Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subversion update externals to a date

Tags:

svn

I'm working on a large, established project under SVN control. Many parts of the code base are being checked out as externals, but are being actively worked on by other people.
I wanted to update my entire working copy, externals and all, so that it reflected the various repositories' HEADs at a specific point in time. My initial attempt was:

svn up -r'{20090324}' 

This updates the current directory to the specified date, but updates all externals to the current date. Updating the externals one at a time works as expected.
I understand that due to the nature of externals, a single update couldn't work with a revision number, but why doesn't it work with a date?
What's the best way to achieve the point-in-time effect that I'm looking for, without having to maintain a script that hard-codes the various externals?

I'm running a Linux system.

like image 607
Whatsit Avatar asked Mar 25 '09 22:03

Whatsit


People also ask

How to update externals in svn?

If you need to change an externals definition, you can do so using the regular property modification subcommands. When you commit a change to the svn:externals property, Subversion will synchronize the checked-out items against the changed externals definition when you next run svn update .

What does svn externals do?

The edit dialog for svn:externals properties allows you to select the externals and automatically set them explicitly to the HEAD revision. If the external project is in the same repository, any changes you make there will be included in the commit list when you commit your main project.

Does svn update overwrite local changes?

Subversion is pretty smart about updating and never just overwrites files that have local changes with copies from the repository. The most important thing to take away from this section is: If you collaborate with others on one repository, remember to update your working copy regularly.


1 Answers

This is inefficient, in that it calls svn update more often than (usually) required. Otherwise, it is short an sweet:

Unix:

find . -name .svn -execdir svn update -r {2010-08-30} \; 

Windows:

forfiles /m .svn /s /c "cmd /c svn up -r {2010-08-30}" 
like image 180
Dave Cohen Avatar answered Sep 30 '22 09:09

Dave Cohen