You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Steve Constable <st...@hotmail.com> on 2009/10/14 18:37:42 UTC

SVN revert.

I want to revert -rHEAD to -rOLD (where OLD represents some valid previous
revision).
I have not made any local changes but simply recognize that the OLD version
is where I want to be and continue from there.
I've 'Googled' my question and some have suggested using 'merge' and then
commit.
Here is what I tried:

svn merge -rHEAD:50 Folder_name
svn commit Folder_name -m "try to revert back to -r50 as an experiment"
But neither command generated any output from SVN. I was expecting to
see the command output similar to when I check in a bunch of files.
When I did a svn stat, I see that I'm still at the HEAD. What I was really
expecting to see was that I'm now at HEAD+1 and the contents of HEAD+1 is
really the exact same as -rOLD.
Maybe SVN is not meant to be able to move the HEAD back to some old version?
Is there some way that others have achieved this?
It seems like a core functionality-so it must be do-able....no?

Thanks for any help.
-Steve

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2407687

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

RE: SVN revert.

Posted by "Srilakshmanan, Lakshman" <la...@police.vic.gov.au>.
Hi Steve,

Just as clarification, 

Cd Folder_name
svn merge -rHEAD:50 <http://zxc/weqwe/asdas/....>

The URL above must be the same URL you checked out into <Folder_name>

Thanks
Lakshman
-----Original Message-----
From: Andy Levy [mailto:andy.levy@gmail.com] 
Sent: Thursday, 15 October 2009 6:09 AM
To: Steve Constable
Cc: users@subversion.tigris.org
Subject: Re: SVN revert.

On Wed, Oct 14, 2009 at 14:37, Steve Constable <st...@hotmail.com> wrote:
> I want to revert -rHEAD to -rOLD (where OLD represents some valid 
> previous revision).
> I have not made any local changes but simply recognize that the OLD 
> version is where I want to be and continue from there.
> I've 'Googled' my question and some have suggested using 'merge' and 
> then commit.
> Here is what I tried:
>
> svn merge -rHEAD:50 Folder_name
> svn commit Folder_name -m "try to revert back to -r50 as an experiment"
> But neither command generated any output from SVN. I was expecting to 
> see the command output similar to when I check in a bunch of files.
> When I did a svn stat, I see that I'm still at the HEAD. What I was 
> really expecting to see was that I'm now at HEAD+1 and the contents of 
> HEAD+1 is really the exact same as -rOLD.
> Maybe SVN is not meant to be able to move the HEAD back to some old version?
> Is there some way that others have achieved this?
> It seems like a core functionality-so it must be do-able....no?

You're misunderstanding the purpose of revert. Revert is only to undo changes in your working copy since the last update/commit. It does not touch the repository.

To roll back to a previous version, you need to do a "reverse merge".
See http://svnbook.red-bean.com/en/1.5/svn.branchmerge.basicmerging.html#svn.branchmerge.basicmerging.undo

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2407699

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

================================================================================================
EMAIL DISCLAIMER

This email and any attachments are confidential. They may also be subject to copyright.

If you are not an intended recipient of this email please immediately contact us by replying
to this email and then delete this email. 

You must not read, use, copy, retain, forward or disclose this email or any attachment.

We do not accept any liability arising from or in connection with unauthorised use or disclosure 
of the information contained in this email or any attachment.

We make reasonable efforts to protect against computer viruses but we do not accept liability
for any liability, loss or damage caused by any computer virus contained in this email.
================================================================================================

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2407744

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: SVN revert.

Posted by Andy Levy <an...@gmail.com>.
On Wed, Oct 14, 2009 at 14:37, Steve Constable
<st...@hotmail.com> wrote:
> I want to revert -rHEAD to -rOLD (where OLD represents some valid previous
> revision).
> I have not made any local changes but simply recognize that the OLD version
> is where I want to be and continue from there.
> I've 'Googled' my question and some have suggested using 'merge' and then
> commit.
> Here is what I tried:
>
> svn merge -rHEAD:50 Folder_name
> svn commit Folder_name -m "try to revert back to -r50 as an experiment"
> But neither command generated any output from SVN. I was expecting to
> see the command output similar to when I check in a bunch of files.
> When I did a svn stat, I see that I'm still at the HEAD. What I was really
> expecting to see was that I'm now at HEAD+1 and the contents of HEAD+1 is
> really the exact same as -rOLD.
> Maybe SVN is not meant to be able to move the HEAD back to some old version?
> Is there some way that others have achieved this?
> It seems like a core functionality-so it must be do-able....no?

You're misunderstanding the purpose of revert. Revert is only to undo
changes in your working copy since the last update/commit. It does not
touch the repository.

To roll back to a previous version, you need to do a "reverse merge".
See http://svnbook.red-bean.com/en/1.5/svn.branchmerge.basicmerging.html#svn.branchmerge.basicmerging.undo

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2407699

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].