You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Mathias Wagner <wa...@fmi.uni-passau.de> on 2005/06/20 13:11:09 UTC

Set older revision as new HEAD

Hello

I somehow broke my code with svn. So I checked out an older revision. 
But how can I tell svn that I want that older revision to be the new 
HEAD. This is what I tried:
svn merge -r HEAD:130 file:///svnreps/sep_ss05/sep1/sep/
But it does not fix my problem. What else can I do? Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Set older revision as new HEAD

Posted by Mathias Wagner <wa...@fmi.uni-passau.de>.
> Suppose the URL for root directory of your "main" development is
 > file:///svnreps/sep_ss05/sep1/sep, and that you want to get rid of all
 > changes in this subtree after rev 130.  Then:
 >
 > svn delete file:///svnreps/sep_ss05/sep1/sep
 >
 > svn copy -r 130 file:///svnreps/sep_ss05/sep1/sep@130 \
 > file:///svnreps/sep_ss05/sep1/sep


Thank you very much. I'll try this one on the next failure ;) . What I 
did was to delete everything, checkout Revision 130, delete all .svn 
folders, commit, copy all files from 130 and commit again.
This is a very poor solution and probably consumes a lot of discspace. 
But we have a very small project so this should be quite usefully.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: Set older revision as new HEAD

Posted by Dale Worley <dw...@pingtel.com>.
> >>This is what I tried:
> >>svn merge -r HEAD:130 file:///svnreps/sep_ss05/sep1/sep
> >>But it does not fix my problem. What else can I do?

The most common and preferred way to revert changes is through a reverse
merge.  But it seems that if the changes are particularly complicated, that
the merge sometimes fails.  Here is another method for doing a revert.  It
is more brute-force, and as it is uncommon, it might not interact as well
with other tools, but it should work correctly in all circumstances.

Suppose the URL for root directory of your "main" development is
file:///svnreps/sep_ss05/sep1/sep, and that you want to get rid of all
changes in this subtree after rev 130.  Then:

svn delete file:///svnreps/sep_ss05/sep1/sep

svn copy -r 130 file:///svnreps/sep_ss05/sep1/sep@130 \
file:///svnreps/sep_ss05/sep1/sep

I haven't tried this in its brute-force glory, so I don't know if the "@130"
works to locate the version you want to copy.  You may have to do a copy to
a temporary name first, then delete "sip", then rename the temporary name to
"sep".

This will make a new HEAD that is a direct descendant of the rev 130
version, so all of the history between 130 and the old HEAD will (should)
become invisible -- none of those versions have any current descendants.

Dale


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Set older revision as new HEAD

Posted by Mathias Wagner <wa...@fmi.uni-passau.de>.
>>This is what I tried: 
>>svn merge -r HEAD:130 file:///svnreps/sep_ss05/sep1/sep/
>>But it does not fix my problem. What else can I do?
> 
> 
> A reverse merge (i.e. with -r HEAD:130) should do the trick. What does it say? 
> What are the problems? What did you expect? IOW, you need to provide a bit 
> more info.

If I execute the command from above svn first deletes a part of my 
sources and then adds almost all of them again. But not all! Some 
folders are missing although these folders apear if I do a co -r 130.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Set older revision as new HEAD

Posted by Ulrich Eckhardt <ec...@satorlaser.com>.
Mathias Wagner wrote:
> I somehow broke my code with svn. So I checked out an older revision.
> But how can I tell svn that I want that older revision to be the new
> HEAD. 

This is described in the book under undoing/reverting changes.

> This is what I tried: 
> svn merge -r HEAD:130 file:///svnreps/sep_ss05/sep1/sep/
> But it does not fix my problem. What else can I do?

A reverse merge (i.e. with -r HEAD:130) should do the trick. What does it say? 
What are the problems? What did you expect? IOW, you need to provide a bit 
more info.

Uli

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org