diff mercurial/merge.py @ 42918:f059d6ffcdf0

merge with stable
author Augie Fackler <augie@google.com>
date Mon, 09 Sep 2019 17:26:17 -0400
parents 7b80ad5af239 a4ca0610c754
children 2c14bf83b58b
line wrap: on
line diff
--- a/mercurial/merge.py	Mon Sep 09 12:56:17 2019 -0700
+++ b/mercurial/merge.py	Mon Sep 09 17:26:17 2019 -0400
@@ -2250,17 +2250,23 @@
                    mergeancestor=mergeancestor, labels=labels)
 
 
+    potherp1 = False
     if keepconflictparent and stats.unresolvedcount:
         pother = ctx.node()
     else:
         pother = nullid
         parents = ctx.parents()
         if keepparent and len(parents) == 2 and pctx in parents:
+            if pctx == parents[0]:
+                potherp1 = True
             parents.remove(pctx)
             pother = parents[0].node()
 
     with repo.dirstate.parentchange():
-        repo.setparents(repo['.'].node(), pother)
+        if potherp1:
+            repo.setparents(pother, repo['.'].node())
+        else:
+            repo.setparents(repo['.'].node(), pother)
         repo.dirstate.write(repo.currenttransaction())
         # fix up dirstate for copies and renames
         copies.duplicatecopies(repo, repo[None], ctx.rev(), pctx.rev())