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

Re: Urgent help with repository/project rollback.

From: Paul Koning <pkoning_at_equallogic.com>
Date: 2006-01-23 20:59:28 CET

>>>>> "Res" == Res Pons <pons32@hotmail.com> writes:

 Res> Hi A developer inadvertently checked in code into our latest
 Res> release-branch. Good thing, I had tagged that branch upon
 Res> release.

 Res> So I do a diff between the latest (HEAD) of the branch vs. the
 Res> tag and I see about 100 changes that need to roll back. What is
 Res> the most efficient way of handling this in one fell swoop as
 Res> opposed to per file & item by item rollback?

 Res> I thought I could (or could I?) copy the entire tag back onto
 Res> the branch and commit it?

If someone makes a whole lot of changes, but commits them with one
commit, you can very easily rollback that one commit with a merge
command. That's why you should teach your developers that they should
always commit the entire set of files involved in a given task with a
single commit, not a sequence of separate commits.

Actually, if that person did a sequence of commits but there weren't
any others in between that you do want to keep, you can still do the
same sort of thing.

  svn co http://.../branches/releasebranch
  cd releasebranch
  svn merge -r lastbadrev:lastgoodrev http://.../branches/release .
  svn ci -m "repair the damage"

where lastgoodrev is the rev before the first wrongheaded commit, and
lastbadrev is the rev of the last wrongheaded commit. For example, if
it was just one bad commit, rev 1234, then the merge would be
   svn merge -r 1234:1233 ...

Note that the -r arguments have the larger of the two values FIRST
here. That's a reverse merge -- it applies the reverse of a change to
your working directory.

     paul

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Jan 23 21:01:51 2006

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.