[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Commit a mixed revision working copy as new HEAD?

From: Daniel Patterson <danpat_at_danpat.net>
Date: 2005-02-24 07:17:06 CET

Matthew S. Moore wrote:
>> This need came about because I was trying to figure out how to back
>> out of some problems I had. Specifically, I needed to un-delete one
>> file and roll back another file to the exact state it was several
>> revisions earlier.
>>
>> It was easy to do the following:
>> svn update -r100 file1 # roll back to the the good revision of file1
>> svn update -r120 file2 # get the last version of file2 before it
>> was deleted
>>
> Zachary,
>
> I am new to subversion (less than two weeks, but three years with
> ClearCase) but I think the solution to simplify this process of rolling
> back some files is to use svn cat:
>
> svn cat -r100 file1 > file1 # copy the old version over your working copy.
> svn cat -r120 file2 > file2
>

   Or, you can take advantage of Subversions smarts and do this:

     svn copy -r100 http://server/repos/path/to/file.c ./file.c

   which will make sure that the history of your item is (mostly)
   preserved
   (if you use the cat example above, it'll show up as a new item)

   Or, you can do the "merge in reverse" approach, by doing something
   like:

     svn merge -r 100:99 http://server/repos/path/to/file.c

   which merge in your "delete of file.c" *backwards* (i.e. undelete
   it). Again, I believe, preserving history. (maybe not in this case,
   one of the developers could answer that).

   Both of these use cases is documented in the Subversion book at:

   http://svnbook.red-bean.com/en/1.1/ch04s04.html#svn-ch-4-sect-4.2

daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Feb 24 07:20:59 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.