Patchwork D7549: graft: never set both parents equal in the dirstate (issue6098)

login
register
mail settings
Submitter phabricator
Date Dec. 6, 2019, 3:37 p.m.
Message ID <e73e060b28076101358a72f273a42207@localhost.localdomain>
Download mbox | patch
Permalink /patch/43598/
State Not Applicable
Headers show

Comments

phabricator - Dec. 6, 2019, 3:37 p.m.
Closed by commit rHG32d11a23c9cf: graft: never set both parents equal in the dirstate (issue6098) (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7549?vs=18474&id=18488

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7549/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7549

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -2626,6 +2626,9 @@ 
         if keepparent and len(parents) == 2 and base in parents:
             parents.remove(base)
             pother = parents[0].node()
+    # Never set both parents equal to each other
+    if pother == pctx.node():
+        pother = nullid
 
     with repo.dirstate.parentchange():
         repo.setparents(pctx.node(), pother)