Disable backing out merges?
Sjujskij Nikolaj
sterkrig at myopera.com
Sat Oct 8 08:55:43 CDT 2011
Backout operation hardly can do rebase and other destructive things. The
whole idea is that you only *add* changesets, while backing out "bad one".
If you cannot safely push result, it's not backout.
> Am Donnerstag, 6. Oktober 2011, 16:03:48 schrieb Matt Mackall:
>> On Thu, 2011-10-06 at 22:45 +0200, Arne Babenhauserheide wrote:
>> > The only way to get rid of them after subsequent pushed commits are
>> > clean
>> > backouts.
>>
>> ..except we know this doesn't actually work for merges and causes lots
>> of pain.
> …
>> > Or fix the backout logic?
>
>> I have no idea how to do that, and I actually suspect that a
>> satisfactory answer doesn't exist. If you know better, I'm ready to be
>> impressed.
>
> Essentially the problem is, that a merge is a special operation which
> affects
> later merges, right? A backout then only undoes the content changes, but
> not
> the graph changes.
>
> a-b-c-x ← broken
> \ /
> d
>
> A backout of c would need to make x a valid changeset, so it would
> actually
> have to
> (a) rebase x on b or d und then close c-x, or cleaner but more complex
> (b) do a new merge of d and b, rebase x on it and then merge x with that,
> discarding the changes from x.
>
> (a)
>
> a-b-c-x † ← closed
> \ /
> d-x' ← OK
>
> (b)
>
> a-b--\
> \ \ c'-x'-y ← OK
> \ X /
> \ / c-x ← broken
> d--/
>
> y = x - c + c'
>
> So essentially y is a rebase of x on c', followed by a dummy merge of x
> on x'
> to replicate the graph change.
>
> If I did not miss something, future merges should then work without
> problems.
>
> So actually a backout of a merge is either
> (a) a rebase + close (there should never have been a merge in the first
> place),
> or
> (b) a remerge + rebase + dummy merge (merging was the right thing to do,
> but
> the exact merge was bad).
>
> (a) and (b) should warn everyone who wants to push ancestors of the bad
> merge,
> because they would introduce a new non-closed head.
>
> Is this correct?
>
> Best wishes,
> Arne
> --
> A man in the streets faces a knife.
> Two policemen are there it once. They raise a sign:
>
> “Illegal Scene! Noone may watch this!”
>
> The man gets robbed and stabbed and bleeds to death.
> The police had to hold the sign.
>
> …Welcome to Europe, citizen. Censorship is beautiful.
>
> ( http://draketo.de/stichwort/censorship )
>
>
--
Använder Operas banbrytande e-postklient: http://www.opera.com/mail/
More information about the Mercurial-devel
mailing list