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.
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
- 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
- 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
- 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
List of SVN utility commands that I needed to use frequently apart from commit and update. Feel free to add to the list
Related posts
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.
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
- 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
- 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
-
Click on Load button so that we can find out more. Putty looks like following when I clicked Load

visharad session loaded in putty
Looking at this I have more concrete information about server i.e. Host name/IP : 192.168.1.50
-
Let’s move to the SSH->Auth in left tree structure -

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.
-
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
- 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.
- How can I make tortoise SVN remember a new password?
Just refer to this link for the instructions
Related posts
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:
- 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
- Transfer the dump file to new server. This can be accomplished through SSH / FTP connection or a simple scp command as:
scp /path/to/dump/folder/myrepo.dump user@new_server:/path/to/dump/folder/myrepo.dump
- 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
- Load empty reposity with dump file
svnadmin load myrepo < /path/to/dump/folder/myrepo.dump
- Define group ownership and permission
chown -R :all myrepo
chmod -R 770 myrepo
Related posts
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
- log onto server as root
- 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
- Create repository using following command
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
- 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
- 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
Who is this post for?
This post is for anyone who wants a step by step guide to accomplish any of the following
- Make a SVN client like tortoise svn remember password
- Make linux server remember your password when logging through putty
Tools you need:
What you need to do:
- Using putty – login to linux server. change directory to ~/.ssh/ by typing following command
cd ~/.ssh
- 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.
- type command
cat ~/.ssh/id_dsa.pub
Copy the output to the clipboard by selecting the output by mouse.
- 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.
- Using ftp download your key files – both private and public
- 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
- In the tree structure on left, choose conversion -> import key -> choose the private key file downloaded from ftp
- Choose to save private key. Choose path and save the file as anything.ppk
- 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)
- Go back to Session tab and hit “save” button. You will see “MyConnection” in the list of available connections.
- 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.
- 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