Sylvain Viart [mailto:firstname.lastname@example.org] wrote:
> Is it possible to update (not to switch or merge) to the same revision
> that were been copied into a tag?
> trunk_wc/file1 rev 123
> trunk_wc/file2 rev 129
> Mixed version wc...
> now I tag the wc using a copy.
> cd ..
> svn copy http://url//repos/tags/mytag trunk_wc
> Now, I would like to have in the trunk, the same that I've taged in
> ideally something like the :
> cd trunk_wc/
> svn up -r http://url//repos/tags/mytag
> Any idea?
Yes, it is possible, however SVN's design forces you to jump
a mess of pain to get there. Thankfully you can script it to
degree, with effort.
A tag is really a copy and results in a new revision with shared
history. But you don't want that one, you want what it
particular path@rev on a particular branch or trunk).
First checkout the latest of whatever branch you're talking
(assuming you haven't deleted it...at which point this becomes
more complex because of how badly SVN handles deleted objects).
Now that you have HEAD on the branch the tag was made, you need
run svn diff --summarize between your copy and the tag you're
to get to. This will give you a manifest of the files that need
Walk this manifest and one by one retrieve the history of that
file on the tag path and walk the history backwards until the
no longer on the /tag/. This is probably the 2nd entry from the
top of the log, but might not be if you've changed anything on
tag after it was created or if the tag was created by copying
tag (i.e., copying a build # tag to a final release # tag).
Now you have the original path and rev. Use that rev to update
particular file. Do this separately for each file in the diff
manifest...one by one.
If you need to REMOVE a file because it exists at HEAD but not
the tag you're trying to reproduce, you can't update to a
number. -If you try, such as update -r 0, it will remove the
your wc...but it'll screw up that file's parent directory meta
such that SVN won't let you copy your WC (you can't tag again).
Instead you need to kluge around this SVN brain damage by running
svn switch on the file to a URL that doesn't exist:
svn switch http://my/repo/NON_EXISTANT_PATH
This will remove the file from your wc w/o screwing up the
meta data allowing you to copy your wc again if you'd like the
as it originally existed. -In this case you're leveraging SVN's
poor deleted file handling in your favor instead of against you.
I have scripts I use to do this, but the code is part of
larger utilities and I haven't had time to split it out cleanly
It is a major feature hole/design flaw in SVN. SVN needs *real*
tags, not kluged copy. It also needs the Last Modified Revision
to be correct...which it frequently is not (found out the hard
To unsubscribe, e-mail: email@example.com
For additional commands, e-mail: firstname.lastname@example.org
Received on Wed Sep 26 02:15:17 2007