Patchwork D5662: uncommit: set dirstateparents from within _fixdirstate()

login
register
mail settings
Submitter phabricator
Date Jan. 24, 2019, 5:11 p.m.
Message ID <e8bec8b33087a3423a994d86a43dd290@localhost.localdomain>
Download mbox | patch
Permalink /patch/37980/
State Not Applicable
Headers show

Comments

phabricator - Jan. 24, 2019, 5:11 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGfe83040400b7: uncommit: set dirstateparents from within _fixdirstate() (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5662?vs=13374&id=13410

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

AFFECTED FILES
  hgext/uncommit.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/uncommit.py b/hgext/uncommit.py
--- a/hgext/uncommit.py
+++ b/hgext/uncommit.py
@@ -98,6 +98,7 @@ 
     newctx which can be result of either unamend or uncommit.
     """
     ds = repo.dirstate
+    ds.setparents(newctx.node(), node.nullid)
     copies = dict(ds.copies())
     s = newctx.status(oldctx, match=match)
     for f in s.modified:
@@ -176,7 +177,6 @@ 
                 mapping[old.node()] = ()
 
             with repo.dirstate.parentchange():
-                repo.dirstate.setparents(newid, node.nullid)
                 _fixdirstate(repo, old, repo[newid], match)
 
             scmutil.cleanupnodes(repo, mapping, 'uncommit', fixphase=True)
@@ -239,7 +239,6 @@ 
         dirstate = repo.dirstate
 
         with dirstate.parentchange():
-            dirstate.setparents(newprednode, node.nullid)
             _fixdirstate(repo, curctx, newpredctx)
 
         mapping = {curctx.node(): (newprednode,)}