[PATCH STABLE] merge: respect parents order when using `graft` on a merge, this time for real

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH STABLE] merge: respect parents order when using `graft` on a merge, this time for real

Anton Shestakov-3
# HG changeset patch
# User Anton Shestakov <[hidden email]>
# Date 1568803990 -25200
#      Wed Sep 18 17:53:10 2019 +0700
# Branch stable
# Node ID 085295f828459f8ce90f6f5889bac3e0405945a8
# Parent  e26c2440a030b2c5fc43de1a2feedee37d437557
merge: respect parents order when using `graft` on a merge, this time for real

See a4ca0610c754.

potherp1 is a boolean variable that means "pother is ctx.p1", and parents is
naturally [ctx.p1, ctx.p2].

pctx is always removed from parents, so if pctx is parents[0], then we end up
using parents[1] as pother. To be true to its name, potherp1 should then be
True only when pctx is at parents[1].

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -2256,7 +2256,7 @@ def graft(repo, ctx, pctx, labels=None,
         pother = nullid
         parents = ctx.parents()
         if keepparent and len(parents) == 2 and pctx in parents:
-            if pctx == parents[0]:
+            if pctx == parents[1]:
                 potherp1 = True
             parents.remove(pctx)
             pother = parents[0].node()
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH STABLE] merge: respect parents order when using `graft` on a merge, this time for real

Yuya Nishihara
On Wed, 18 Sep 2019 19:01:57 +0700, Anton Shestakov wrote:
> # HG changeset patch
> # User Anton Shestakov <[hidden email]>
> # Date 1568803990 -25200
> #      Wed Sep 18 17:53:10 2019 +0700
> # Branch stable
> # Node ID 085295f828459f8ce90f6f5889bac3e0405945a8
> # Parent  e26c2440a030b2c5fc43de1a2feedee37d437557
> merge: respect parents order when using `graft` on a merge, this time for real

Queued for stable, thanks.
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel