My Subversion (Version/Source Code Control) Experience

I had a chance to look into subversion today and here are some of my notes. It's a version control system (source code control but it's really more than just code) along side Visual SourceSafe, SourceGear Vault among others. Why subversion [more]of all other is worthy of another post but first one, it's free (Vault is also free for single user/personal i think but in that case Subversion is more widely accepted in the community and some issues with JetBrains TeamCity support for Vault made me think that Vault may not be that frictionless when it comes to Continuous Integration – not sure if CruiseControl.NET supports it).

Moving on, there's just not much to say my experience but it just works. Some caveats since I haven't read the documentation and instead jumped right in but I'm happy with my first checkin/checkout after a few minutes.

1. I got the latest (i think) Windows Installer (with the basic win32 binaries) from the following link:
svn-1.4.6-setup.exe
.

Also note that you can get to this from their home page by clicking on Downloads from the treeview on the left of the site. Then go to the windows section. Furthermore you could reach the same page by clicking on Documents and Files from the same treeview on the left. After redirection to the Documents & files page, on the treeview that appears in the main content of the page, traverse subversion > releases > windows (or further to windows apache 2.2.x node for binaries built against the famous apache web server version 2.2).

2. Install (in my case I installed on a Virtual Machine I have with Windows XP)

4. I then created a sample repository by issuing the following command (command line dialog/cmd) "svnadmin create C:svntest_repository" where C:svntest_repository is an existing folder in my system. There are some articles that mentioned issues when the directory doesn't exist and rather than test and verify it, I created the folder before issuing the command (but feel free to try it and tell us how it goes). Looking at the C:svntest_repository directory I found new directories/files created so on the right track here.

6. Then I was wondering now that I have SVN setup, what will be my server URL? I have worked with http/https/svn URLs before but merely as a client who connects to it. I tried to connect to it using SmartSVN (client) which I'm already familiar wit. You can also use TortoiseSVN but coming from Visual Source Safe and Vault background, I prefer not to work with SVN from the windows explorer (as TortoiseSVN does).

So I was trying to connect without knowing my SVN server URL (yeah, using SmartSVN but not so smart there) and just trying random URLs like say my internal IP was 192.168.1.7 so I tried http://192.168.1.7 or svn://192.168.1.7 with or without the test_repository relative path. Obviously no luck there and getting some thing like "connection refused" (sorry should have noted the specific messages).

After some digging it turns out that you have to have a server to access the repositories (duh, so that's why apache has been mentioned all over)

I don't have apache setup so I was wondering if I could live without it. So after some walk around the documentation I found Overview of Server Configuration and there it is svnserve. The documentation is very impressive if only I've read through it first but diving right in without reading much still worked for me. Here's a link to the main page for the Subversion Book multi-page html edition index. Or you can also check out the the Subversion Book for other available editions (eg. PDF)

6. I started svnserve as a standalone daemo using the -d switch and tried to access it using SmartSVN (from my host machine). The command was svnserver -d. Tried to connect using SmartSVN again.

(File > Create Module menu item > "select local directory to import to repository" > setup repository profile). Hmm, should probably have made a post on SmartSVN or tortoise but feel free to drop me questions if ever or chekc out documentation for SmartSVN or Tortoise on "importing local files to repository"

Moving on. Oops, I was getting new errors along the lines of "no repository can be found at URL (svn://192.168.1.7/test_repository)". Hmmm, sounds bad but not so bad coz somehow it is now able to recognize the server, it just can't find a repository in there. Again, checking the documentation, it turns out that you have to use svnserve's -r switch if you have to use that path. That is without the -r switch your repository URL should append the full path of the repository (C:svntest_repository). The samples given are in UNIX so not sure how it should look like in windows (will try when i can), maybe svn://192.168.1.7/"c:svntest_repository"? But bottom line is that i started svnserve with this command instead "svnserve -d -r c:svn" and accessing the repository URL as svn://192.168.1.7/test_repository now works. great.

So guess that's it. Pardon any incoherent thoughts above (if any) but hope this benefits someone other than future me. Back to work.


Posted

in

,

by