How to make a dry-run with svn update
Quick Subversion trick:
I asked at the office today if anyone could figure out a method for doing a dry-run to see what files would be updated if you do an “svn update” from repository.
My colleague Mads came up with this:
jesper:test_project jesper$ svn merge --dry-run -r BASE:HEAD .
U app/helpers/application_helper.rb
U app/controllers/reports_controller.rb
A app/views/layouts/formula.html.erb
U app/views/overview/index.html.erb
U app/views/overview/_sidebar.html.erb
U app/views/reports/index.html.erb
A app/views/reports/_sidebar.html.erb
U app/views/reports/new.html.erb
U app/views/reports/start.html.erb
C log/development.log
U public/stylesheets/app.css
Brilliant! Now I can see which files will conflict or update before I pull newest version from repository. Now added as an alias:
alias svnupdry='svn merge --dry-run -r BASE:HEAD .'
I took a brief look at the Git manual. There is apparently no flag on ‘git pull’ that does a dry-run. Anyone knows if the same thing is possible with Git?
Technorati Tags: subversion, dry-run, git
May 1st, 2008 at 19:46 (GMT-1)
Another nice one:
alias svnupall='for DIR in `find . -maxdepth 2 -type d -name ".svn" | cut -d / -f 2`; do echo "$DIR: ";svn update ./$DIR; done''
This one updates all my svn projects in my code projects dir.
From http://codesnippets.joyent.com/posts/show/368
May 28th, 2008 at 15:05 (GMT-1)
Is that works? Anyway, i will copy down and have a try on it
Thank you
June 3rd, 2008 at 02:15 (GMT-1)
svn status -u
will also do a dry update run
July 23rd, 2008 at 18:43 (GMT-1)
“svn status -u” won’t show files that will become conflicted
August 11th, 2008 at 20:36 (GMT-1)
This doesn’t work perfectly for me on very old checkouts. I get false conflicts and “Skipping” messages, similar to symptoms in this forum post:
http://translocator.ws/2005/10/12/svn-update-dry-run
[jesse@sente]~/svn/rex> svn merge –dry-run -r BASE:HEAD .
Skipped missing target: ‘www/html/HP/Traffic_Users_Guide.pdf’
Skipped ‘www/html/js/traffic-class.js’
C www/cgi-bin/queries
[jesse@sente]~/svn/rex/www/cgi-bin>svn status queries
[jesse@sente]~/svn/rex/www/cgi-bin>svn diff queries
[jesse@sente]~/svn/rex/www/cgi-bin>svn status -u queries
* 44231 queries
See also
April 17th, 2009 at 07:07 (GMT-1)
thanks for your great post, Jesper! this is a very handy trick to know…will save me lots of time.
September 16th, 2009 at 21:50 (GMT-1)
[…] From http://justaddwater.dk/2008/04/29/how-to-make-a-dry-run-with-svn-update/ […]
April 23rd, 2010 at 10:09 (GMT-1)
[…] Shared justaddwater.dk | How to make a dry-run with svn update. […]
October 30th, 2010 at 10:13 (GMT-1)
[…] http://justaddwater.dk/2008/04/29/how-to-make-a-dry-run-with-svn-update/ […]
March 9th, 2011 at 10:09 (GMT-1)
That line didn’t work with SVN 1.6.16. Had to change it to:
svn merge –dry-run –revision BASE:HEAD .
March 9th, 2011 at 10:10 (GMT-1)
That should be
svn merge –dry-run –revision BASE:HEAD .
with two “-” before “dry-run” and “revision”.
March 9th, 2011 at 22:17 (GMT-1)
@Markus, yeah unfortunately wordpress tries to clever-change all quotes and double dashes.
It is really really a wrong default and very annoying.
BTW, you can avoid the double dashes by using the single letter equivalents “-n” for dry-run and “-r” for revision. But it then becomes less intuitive and a bit harder to learn:
Then the expression becomes: