rollback/backout a wrong merge between named branches?

Marijn Vriens marijn at metronomo.cl
Thu Oct 8 15:26:40 UTC 2009


On Thu, Oct 8, 2009 at 4:57 PM, Ringo De Smet <ringo.desmet at gmail.com>wrote:

> Colin,
>
> 2009/10/8 Colin Caughie <c.caughie at indigovision.com>:
> >
> > Didn't this happen recently on the hg development repository itself? How
> was it handled there?
> >
>
> I don't understand your questions!
>
> Let me rephrase: the commits on the 'default' branch where not faulty.
> These were valid commits for the ongoing development of our product
> release 1.6. Now, someone performed a merge from a revision on branch
> 'default' to branch '1.5' which pulled a lot of changes to the 1.5
> branch that is being stabilised. Then this merge changeset was pushed
> to the central repository. We now have to undo this merge.
>
> In all the documentation I checked so far, it seems that the Mercurial
> command set doesn't give me a quick way of creating a *new* revision
> with all the changes of this merge undone. Any suggestions here?
>

Here's an idea: Update (hg up) to the revision of the 1.5 just before the
merge occurred. This is the latest revision in the branch that doesn't have
problems and just continue work from there. The next commit will create a
new head inside the 1.5 branch.

If after the bad merge in 1.5branch there were valid commits done, you can
transplant those. (http://mercurial.selenic.com/wiki/TransplantExtension)

The workaround (and I really call it a workaround, not a solution) is
> to strip the faulty revision from the central repository and all its
> clones. But with a growing developer base, this is a situation that I
> can't repeat over and over when such errors would re-occur.
>

Yes, there will be a dangling head with a bad merge in the history, but
that's of no concern. If it really bothers, stripping those revisions out
might be an option, though, if someone doens't do it, and you pull from
them, you will again receive the head with the bad merge.


Regards,
      Marijn Vriens.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20091008/5d635e2c/attachment-0001.html>


More information about the Mercurial mailing list