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:  https://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.

ASP.NET 3.5 Extensions Preview – New version of MS MVC is available.