Batch file to Checkout all root level project trunks in a Subversion repository

Our source control tree is setup with the projects at the root of our server and each has a separate trunk, tags, and branches.  While this makes it very easy to have a location agnostic build and include all the dependencies in one place for a particular project, this aspect can be painful when you want to checkout the trunk of each project to a new developer machine.  I wrote a little batch file to ease the pain.

Sample Source Control Repository

Project1
   trunk
   tags
   branches

Project2
   trunk
   tags
   branches

ect …

 

Batch file to pull checkout all of the trunks.

   1: set svnbin="d:Program FilesCollabNet Subversion Serverbinsvn.exe"
   2: set svnroot=http://sourceserver:8080/svn/cgi/
   3: %svnbin% list %svnroot%>projects.txt
   4: FOR /F "tokens=1" %%i IN (projects.txt) DO %svnbin% checkout %svnroot%%%itrunk %%i

 

Subscribe to this feed:  http://feeds.feedburner.com/EricHexter

This is pretty easy to modify, simple replace your bin location for subversion executable and update the svnroot to the path to your subversion repository and you are good to go.  The one important gotcha here is that subversion is case sensitive.  I ran into a problem where our repository has some of the trunks starting with a lowercase t and other starting with a uppercase t.  In that case, I just added an additional line 4 with the uppercase Trunk.  That batch file roles on without stopping if there is a mismatch in the case of trunk.

Related Articles:

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

About Eric Hexter

I am the CTO for QuarterSpot. I (co)Founded MvcContrib, Should, Solution Factory, and Pstrami open source projects. I have co-authored MVC 2 in Action, MVC3 in Action, and MVC 4 in Action. I co-founded online events like mvcConf, aspConf, and Community for MVC. I am also a Microsoft MVP in ASP.Net.
This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post.