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
PAUSEI 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 upcd ..\ironruby
svn upcd ..\subsonicproject
svn upcd ..\masstransit
svn upcd ..\spark
svn upcd ..\crineta
svn upcd ..\programmingmvc
svn upcd ..\codecampserver
svn upcd ..\coregallery
svn upcd ..\csla
svn uppause
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 |
[...] 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 |
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 |
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 |
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 |
@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 |