You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Bruce Elrick <br...@elrick.ca> on 2004/02/10 02:37:24 UTC
Undo changes to a tag
I created a tag with:
svn copy http://localhost/svn/trunk/projectX \
http://localhost/svn/tags/projectX-0.9 -m "Tag ProjectX Release 0.9"
which commited at revision 20.
For a new working copy in which I was originally not going to modify any
files, I checked out my files from a tag dir something like:
cd ~
mkdir mywc
cd mywc
svn checkout http://localhost/svn/tags/projectX-0.9 .
Subsequently I decided to make changes in that WC but forgot that it was
checked out from the tag and not the trunk, thus
http://localhost/svn/tags/projectX-0.9/ had changes commited to it.
I was able to merge those changes into the trunk (which didn't have
changes) with something like this:
cd ~
mkdir fixtrunk
cd fixtrunk
svn checkout http://localhost/svn/trunk/projectX .
svn merge -r 20:31 http://localhost/svn/tags/projectX-0.9 .
svn commit -m \
"Merge /tags/projectX-0.9 between rev 20 & 31 into /trunk/projectX"
Where HEAD was at revision 31 at the time.
I could then go to my main wc and switch without changes:
cd ~/mywc
svn switch http://localhost/svn/trunk/projectX
And it switched without problem and without changes. Perfect.
The last step to fix things is to get http://localhost/svn/tags/projectX-0.9
back to its state at revision 20. I know I could probably delete and
re-tag:
svn rm http://localhost/svn/tags/projectX-0.9 -m \
"Remove accidentally modified tag"
svn copy -r 20 http://localhost/svn/trunk/projectX \
http://localhost/svn/tags/projectX-0.9 -m "Tag ProjectX Release 0.9
(try #2)"
But is that the canonical way of dealing with this type of screw-up?
Thanks for any help you can give!
Cheers...
Bruce
(previous lurker in dev@sunversion.tigris.org,
new "productive" user of SubVersion)
P.S. I saw the thread last year on putting the pre-commit hook that
blocks modifications to /tags...anyone have a "canned" script with
instructions on how to install? I'll probably research it and find it
myself, but if someone can point me in the right direction, I would
appreciate it!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Undo changes to a tag
Posted by Bruce Elrick <br...@elrick.ca>.
FYI, I did confirm that the "reversing" merge should use the range when
the changes to the tag were made (rev 31:20) not the range in which the
tag itself was created (20:19).
Thanks for your help, Francois.
Cheers...
Bruce
Bruce Elrick wrote:
> Thanks!
>
> Though...hmmm. In revision 19 http://localhost/svn/tags/projectX-0.9
> didn't exist. It was the copy to create it that bumped the repos rev to
> 20. Then changes to http://localhost/svn/tags/projectX-0.9 happened in
> some revisions in the range 21 to 31.
>
> I had thought along the line you suggest, but thought it would be:
> cd ~
> mkdir fixtag
> cd fixtag
> svn checkout http://localhost/svn/tags/projectX-0.9 .
> svn merge -r 31:20 http://localhost/svn/tags/projectX-0.9 .
> svn commit -m "Revert tag back to revision 20 state"
>
> I've done the above up to the merge (i.e. haven't commited) and find
> that svn diff shows:
> $ svn diff -r 20
> Index: file1
> ===================================================================
> Index: file2
> ===================================================================
> Index: file3
> ===================================================================
> Index: file4
> ===================================================================
> Index: file5
> ===================================================================
> Index: file6
> ===================================================================
> Index: file7
> ===================================================================
>
> Where those are the seven files that changed in revisions 21-31, but I
> see it sees no differences between the "reverted" wc and repos rev 20.
> So it seems that is correct, but I am unsure enough not to commit until
> someone confirms.
>
> You recipe below gives:
> svn: REPORT request failed on '/svn/!svn/vcc/default'
> svn:
> svn_repos_dir_delta: invalid editor anchoring; at least one of the input
> paths is not a directory and there was no source entry
>
> I assume that is because http://localhost/svn/tags/projectX-0.9 did not
> exist at revision 19.
>
> Thanks for such a quick response, by the way.
>
> Cheers...
> Bruce
>
> Francois Beausoleil wrote:
>
>> On Mon, 09 Feb 2004 19:37:24 -0700, "Bruce Elrick" <br...@elrick.ca>
>> said:
>> [snip]
>>
>>> cd ~
>>> mkdir fixtrunk
>>> cd fixtrunk
>>> svn checkout http://localhost/svn/trunk/projectX .
>>> svn merge -r 20:31 http://localhost/svn/tags/projectX-0.9 .
>>> svn commit -m \
>>> "Merge /tags/projectX-0.9 between rev 20 & 31 into /trunk/projectX"
>>>
>>
>> [snip]
>>
>> Just do a reverse merge:
>> cd ~
>> mkdir fixtag
>> cd fixtag
>> svn checkout http://localhost/svn/tags/projectX-0.9 .
>> svn merge -r 20:19 http://localhost/svn/tags/projectX-0.9 .
>>
>> Notice the order of the revisions. We're applying the changes in
>> reverse, in effect reverting the change. The subsequent commit will
>> bring back the tag to it's previous state.
>>
>> Hope that helps !
>> François
>> Developer of Java Gui Builder
>> http://jgb.sourceforge.net/
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Undo changes to a tag
Posted by Bruce Elrick <br...@elrick.ca>.
Thanks!
Though...hmmm. In revision 19 http://localhost/svn/tags/projectX-0.9
didn't exist. It was the copy to create it that bumped the repos rev to
20. Then changes to http://localhost/svn/tags/projectX-0.9 happened in
some revisions in the range 21 to 31.
I had thought along the line you suggest, but thought it would be:
cd ~
mkdir fixtag
cd fixtag
svn checkout http://localhost/svn/tags/projectX-0.9 .
svn merge -r 31:20 http://localhost/svn/tags/projectX-0.9 .
svn commit -m "Revert tag back to revision 20 state"
I've done the above up to the merge (i.e. haven't commited) and find
that svn diff shows:
$ svn diff -r 20
Index: file1
===================================================================
Index: file2
===================================================================
Index: file3
===================================================================
Index: file4
===================================================================
Index: file5
===================================================================
Index: file6
===================================================================
Index: file7
===================================================================
Where those are the seven files that changed in revisions 21-31, but I
see it sees no differences between the "reverted" wc and repos rev 20.
So it seems that is correct, but I am unsure enough not to commit until
someone confirms.
You recipe below gives:
svn: REPORT request failed on '/svn/!svn/vcc/default'
svn:
svn_repos_dir_delta: invalid editor anchoring; at least one of the input
paths is not a directory and there was no source entry
I assume that is because http://localhost/svn/tags/projectX-0.9 did not
exist at revision 19.
Thanks for such a quick response, by the way.
Cheers...
Bruce
Francois Beausoleil wrote:
> On Mon, 09 Feb 2004 19:37:24 -0700, "Bruce Elrick" <br...@elrick.ca>
> said:
> [snip]
>
>>cd ~
>>mkdir fixtrunk
>>cd fixtrunk
>>svn checkout http://localhost/svn/trunk/projectX .
>>svn merge -r 20:31 http://localhost/svn/tags/projectX-0.9 .
>>svn commit -m \
>> "Merge /tags/projectX-0.9 between rev 20 & 31 into /trunk/projectX"
>>
>
> [snip]
>
> Just do a reverse merge:
> cd ~
> mkdir fixtag
> cd fixtag
> svn checkout http://localhost/svn/tags/projectX-0.9 .
> svn merge -r 20:19 http://localhost/svn/tags/projectX-0.9 .
>
> Notice the order of the revisions. We're applying the changes in
> reverse, in effect reverting the change. The subsequent commit will
> bring back the tag to it's previous state.
>
> Hope that helps !
> François
> Developer of Java Gui Builder
> http://jgb.sourceforge.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Undo changes to a tag
Posted by Francois Beausoleil <fb...@users.sourceforge.net>.
On Mon, 09 Feb 2004 19:37:24 -0700, "Bruce Elrick" <br...@elrick.ca>
said:
[snip]
> cd ~
> mkdir fixtrunk
> cd fixtrunk
> svn checkout http://localhost/svn/trunk/projectX .
> svn merge -r 20:31 http://localhost/svn/tags/projectX-0.9 .
> svn commit -m \
> "Merge /tags/projectX-0.9 between rev 20 & 31 into /trunk/projectX"
>
[snip]
Just do a reverse merge:
cd ~
mkdir fixtag
cd fixtag
svn checkout http://localhost/svn/tags/projectX-0.9 .
svn merge -r 20:19 http://localhost/svn/tags/projectX-0.9 .
Notice the order of the revisions. We're applying the changes in
reverse, in effect reverting the change. The subsequent commit will
bring back the tag to it's previous state.
Hope that helps !
François
Developer of Java Gui Builder
http://jgb.sourceforge.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org