If only I were

October 1, 2008

World’s simplest source code updater

Filed under: Technology, Thoughts — Tags: , , , , — Chris Sutton @ 7:53 am

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:

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

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

pause

6 Comments »

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

    Comment by Tim Barcz — October 8, 2008 @ 8:08 am | Reply

  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) [...]

    Pingback by Frictionless Subversion Updates - Tim Barcz — October 8, 2008 @ 9:20 pm | Reply

  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
    )

    Comment by Chris — October 8, 2008 @ 10:43 pm | Reply

  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* …”

    Comment by Chris — October 8, 2008 @ 10:45 pm | Reply

  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.

    Comment by Jason — October 9, 2008 @ 10:44 am | Reply

  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

    Comment by Chris Sutton — October 9, 2008 @ 6:15 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.