Archive

Archive for the ‘SVN’ Category

Anticipating TortoiseSVN 1.7 Beginner’s Guide

March 4, 2011 Leave a comment

Yesterday, I got an email from Zaid Siddiqui, Packt Publication asking to review their book Tortoise SVN 1.7 Beginner’s Guide by Lesley Harrison. And I agreed instantly being curious and experimental about SVN related stuff and Tortoise SVN being an important part in the whole scheme of things.

Before I start reading any book, I like to anticipate the experience it may offer me by it’s cover, title, and preface. This time of course it is no different and I thought i might as well write it down to check later what I got and what I did not.

By the sound of it’s title, I am really looking forward to using this book as a recommendation to a fresh out of college hired developer on team. I usually get really hard time explaining them why we do certain things with tortoise SVN the way we do. After some experience, they follow commonly used instructions and panic when they see something like a conflict for a file. Some of them actually did a revert without even giving it a second thought out of panic. Since this book is for beginners, I would really like to introduce a rule – look in this book if you have doubts and before taking any action [and before giving me a hard time ;) ].

Second role I would like this book to play in my life as a process specialist is of a my personal desk copy – helping me get instant answers to problems I face in daily operations especially managing various versions and releases for various sizes of projects.

Security is another aspect I would like to get insights in. But that probably would be better covered as server part than tortoise SVN. Anything on that would certainly be delicious.

That much for now. Let’s see what I get after going through this book.

Categories: SVN

SVN : Preparing for branching/ Merging process

February 3, 2011 5 comments

Preparing your repository for branching and merging can turn into a headache when you do it for the first time. This is a small .. may be obvious .. note to everybody who can get some help

My setup

  • SVN Server hosted on linux
  • Tortoise SVN as client being used from windows

If you perform following checks before getting into the process of branching and merging, you are going to save a lot of time and efforts trying to figure out errors messages and causes

  1. Make sure your SVN Server version is above 1.5. If not, UPGRADE. In my case it was 1.4.2 and I upgraded it to 1.6.* from Collabnet
  2. Make sure your SVN Repository version is upgraded. You can find that out by using following commands
    cd /path/to/repo/reponame
    cd db
    cat format
    

    i.e. changing to repo/directory/db and looking at contents of format file. For 1.4.*, format file showed 2, which should be 4 for it to be a 1.6.* repository. I had to upgrade the repository version by using
    svnadmin upgrade path/to/repo/reponame
    
  3. Make sure your SVN Client is equipped to handle features offered by the upgraded SVN Server. I just downloaded version of tortoise svn made for 1.6 version

After these checks, you can choose the model you want to opt for your process and get started.

In my case, I chose mainline development happening in trunk, creating branches after each phase release. Every-time a bug is fixed in a branch, its committed to its corresponding branch. Then from trunk, using TortoiseSVN’s “reintegrate a branch” option, I choose repository URL of branch and follow through steps to finish the merge. It works wonders !

Related posts

Categories: Linux, SVN

SVN : Utility commands

February 3, 2011 4 comments

List of SVN utility commands that I needed to use frequently apart from commit and update. Feel free to add to the list

  • Know SVN binary path
    which svn
    
  • Know SVN server version installed
    svnadmin --version
    
  • Know SVN Client server version installed
    svn --version
    
  • Create SVN Respository
    svnadmin create path/to/repository/reponame
    

    You can then assign permissions to reponame directory like you do on any other directory
  • Upgrade SVN Respository version
    svnadmin upgrade path/to/repository
    

Related posts

Categories: Linux, SVN

tortoise SVN: Copy a SVN bound directory to another repository

November 30, 2009 1 comment

Task at hand:
Copy a directory from within one SVN repository to another

Assumptions:
- Tortoise SVN as SVN client
- The two SVN repositories – being copied from and being copied to already exist

Steps:
1. Right click SVN bound directory that you with to copy. Choose tortoise SVN -> Export.
2. Specify path to an empty folder e.g. “c:\to_add”. Click on OK.
3. Now you have the SVN bound directory contents in this new directory “to_add”.
4. Right click on “to_add” and choose tortoise svn -> add
5. Specify path to the new repository and location inside it.
6. Right click on “to_add” and choose SVN Commit to make your changes permanent.

Voila !! You are done.

Categories: SVN

What to do : When your SVN client saves a wrong password -> Make it forget it

May 13, 2009 1 comment

Applies to:
Any SVN client using putty to connect to SVN server. For e.g. tortoise SVN

Who is this post for?
This post is for anyone who wants SVN client and server to forget currently configured password

Steps to follow

  1. Know your repository URL
    For this you should be using tortoise SVN repo-browser and check out the URL. In my case, it looks like
    svn+ssh://jyotsnas@visharad/svnRepos/travel_broker

    This tells me following

    • linux username being used is jyotsnas
    • the svn server is named as visharad
    • Probably all SVN repositories are located under /var/svnRepos
  2. Now that we know the servername, in this case ‘visharad’, open putty. Under saved sessions list, you should find your server name. Refer to following screenshot for the same

    visharad in saved sessions of putty

    visharad in saved sessions of putty

  3. Click on Load button so that we can find out more. Putty looks like following when I clicked Load

    visharad session loaded in putty

    visharad session loaded in putty

    Looking at this I have more concrete information about server i.e. Host name/IP : 192.168.1.50

  4. Let’s move to the SSH->Auth in left tree structure -

    visharad ssh auth settings in putty

    visharad ssh auth settings in putty

    This screen tells me a path to a private key file on my machine.

    F:\Jyotsna\SVN sessions\visharad.ppk

    Delete this path from the text box.

  5. Go back to sessions in left tree and click on save.

    When you delete this path, putty is going to forget the password to be used. Since tortoise SVN uses putty in turn to connect to server, it will forget it too. And that is it.

Questions you might have

  1. Why should I not delete the session instead of the private key file path?

    In cases like mine, visharad name was given to a machine with IP 192.168.1.50. If I had deleted the session, I would have have to relocate all the SVN repositories already checked out on my machine so that the new URL contains 192.168.1.50 instead of visharad. Not deleting the session saves this hassel of mine and still make tortoise svn not use the remembered password.

  2. How can I make tortoise SVN remember a new password?

    Just refer to this link for the instructions

Related posts

Categories: SVN

linux how to: replicate svn repository

February 28, 2009 4 comments

Task at hand:

I have a repository on one of the linux server. As a part of upgradation process, we decided to move the SVN server to a newer better linux infrastructure. Task at hand is to replicate the svn repositories on new server.

Solution:

  1. Create dump for existing repository
    svnadmin dump /path/to/repo > /path/to/dump/folder/myrepo.dump

    This command creates a .dump file and shows the revisions being dumped as it progresses

  2. Transfer the dump file to new server. This can be accomplished through SSH / FTP connection or a simple scp command as:
  3. scp /path/to/dump/folder/myrepo.dump user@new_server:/path/to/dump/folder/myrepo.dump
  4. Log into new server and switch to the directory where you want to place your replicated svn repository. Then, create an empty svn repository
    svnadmin create myrepo
  5. Load empty reposity with dump file
    svnadmin load myrepo < /path/to/dump/folder/myrepo.dump
  6. Define group ownership and permission
    chown -R :all myrepo
    chmod -R 770 myrepo
    

Related posts

Categories: SVN

linux: create svn repository

December 26, 2008 17 comments

Assumptions:
You already have SVN installed on your linux server. If you do not know if it is installed, just type command

which svn

If this returns a valid path as output, then it means that svn is installed on your linux box. If not, you need to install it. Installing subversion is very easy (for most distributions) and ample documentation is available on the web. You can start with http://subversion.apache.org/.

Four steps to complete svn repository creation on linux

  1. log onto server as root
  2. I prefer to have all svn repositories in one directory for better organization and easy maintenance. So next step for me would be to change to my svn directory.
    cd /svnRepos

    If you do not already have a directory for svn repositories, I would recommend creating one.

    mkdir svnRepos
  3. Create repository using following command
  4. svnadmin create /path/to/repo/RepoName

    where : RepoName is the name of repository to be created. As an example, I want to create a repository for my testproject. I would write

    svnadmin create testproject
  5. Change group ownership of repository for the intended group. In this case, consider I have a user group created as “all” and I want this group to have ownership to this repository.
    chown -R :all /path/to/repo/RepoName
  6. Grant Read/Write/Execute permissions to “all” on this repository
    chmod -R 770 /path/to/repo/RepoName

After this, all you need to do is

  • Install a client like tortoiseSVN on the user’s machine
  • SVN Checkout the repository. I would use a URL like following to connect to my newly created repository
    svn+ssh://username@servername/path/to/repo/RepoName

    Where

    • username: one of the users from group all
    • servername: my linux server which hosts SVN

    For my testproject, the path looks like

    svn+ssh://jyotsnas@servername/svnRepos/testproject

Related posts

Categories: SVN

How to make SVN remember password

December 6, 2008 11 comments

Who is this post for?

This post is for anyone who wants a step by step guide to accomplish any of the following

  1. Make a SVN client like tortoise svn remember password
  2. Make linux server remember your password when logging through putty

Tools you need:

  • Putty
  • Puttygen

What you need to do:

  1. Using putty – login to linux server. change directory to ~/.ssh/ by typing following command
    cd ~/.ssh
  2. Type command
    ssh-keygen -b 1024 -t dsa 

    and press enter. Do not enter a passphrase. Hit enter when prompted for one. Same for the filename. default filename = id_dsa and id_dsa.pub. id_dsa is the private key file and id_dsa.pub is the public key file.

  3. type command
    cat ~/.ssh/id_dsa.pub

    Copy the output to the clipboard by selecting the output by mouse.

  4. Type command
    vi ~/.ssh/authorized_keys

    Hit i to enter Insert mode and then paste your public key (if there is already a key in this file, move to the bottom before pasting). Hit the ESC key to leave Insert mode and type :wq and hit enter to save and exit vi editor.

  5. Using ftp download your key files – both private and public
  6. In order to use the private key we get from the server, we have to convert it to a putty format. This is because the private key file format is not specified by some standard body. We can accomplish this using puttygen. Open Puttygen
  7. In the tree structure on left, choose conversion -> import key -> choose the private key file downloaded from ftp
  8. Choose to save private key. Choose path and save the file as anything.ppk
  9. Run Putty. Specify parameters
    • Session->HostName: Hostname or IP Adress of your server
    • Session->Protocol: SSH
    • Session->Saved Sessions: MyConnection
    • SSH->Prefered SSH Protocol version: 2
    • SSH->Auth->Private Key file for auth: $PATH$mykey.PKK (replace $PATH$ with real path to the mykey.PKK file)
  10. Go back to Session tab and hit “save” button. You will see “MyConnection” in the list of available connections.
  11. Next click “open” and you should see a telnet login prompt. Use “myuser” as username (without double quotes of course) and if everything is OK, you don’t have to provide a password to your system. If the system still requires a password, something went wrong.
  12. Now that linux server and putty manage to remember your password, you need an application client to use it. In this case it is SVN client e.g. tortoise svn. Go to TortoiseSVN->RepoBrowser and specify a URL like this:
    svn+ssh://myuser@MyConnection/usr/local/repos

    …where MyConnection is the putty session name and /usr/local/repos is my svn repository on linux server

And you are done …

Related posts

Categories: Linux, SVN
Follow

Get every new post delivered to your Inbox.