If only I were

Building Great Software

World’s simplest source code updater

with 6 comments

Update: So, I’ll fess up and admit this wasn’t the simplest. Tim Barcz did this 1 (or 2 or 3) better and simplified the script with:

FOR /D %%a IN (“*”) DO IF EXIST %%~dpa%%a\.svn svn update %%~dpa%%a

I feel like I was trying to start a fire by hitting two rocks together and Tim walked in and pulled out a box of matches.

Many of the projects I watch are hosted on Subversion repositories. I’m tired of right clicking in each directory with TortoiseSVN and clicking “SVN Update.”

So I went the simplest route possible to automate updating source. I have this set of commands in a file called update.cmd. In the morning I double click it and I can see any updates from the previous day.

Of course, you need to adjust the directories and project names for the projects you watch.

rem this script expects svn to be in the path

cd witty
svn up

cd ..\ironruby
svn up

cd ..\subsonicproject
svn up

cd ..\masstransit
svn up

cd ..\spark
svn up

cd ..\crineta
svn up

cd ..\programmingmvc
svn up

cd ..\codecampserver
svn up

cd ..\coregallery
svn up

cd ..\csla
svn up


Written by Chris Sutton

October 1, 2008 at 7:53 am

6 Responses

Subscribe to comments with RSS.

  1. After manually updating different projects manually I am finding that the above is great….and easy.

    Tim Barcz

    October 8, 2008 at 8:08 am

  2. […] and fellow blogger Chris Sutton wrote a post the other day about updating source code with batch file.  I found it quite helpful given the number of open source projects I follow (or attempt to) […]

  3. If you use a FOR-loop it looks a little nicer (replace the “…” with the rest of your directories; I’ve been lazy ;-)

    for %%i in (witty ironruby …) do (
    svn up %%i


    October 8, 2008 at 10:43 pm

  4. Whoops sorry. Noticed just now that (a) Tim Barcz already suggests something similar (although far more elaborate) and (b) you said “world’s *simplest* …”


    October 8, 2008 at 10:45 pm

  5. Since you’re unaware of it, you can select multiple directories and do a Tortoise update on all of them at the same time. If you don’t want to resort to a script.


    October 9, 2008 at 10:44 am

  6. @Jason, I wasn’t aware that you could do multiple selects and updates. I think the latest version of the script would be faster on all counts for my purposes though.


    Chris Sutton

    October 9, 2008 at 6:15 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: