# HG changeset patch # User Martin von Zweigbergk # Date 2019-01-21 05:49:58 # Node ID fe83040400b7a819a18ab56ff716a420f8282959 # Parent 19c590ce86613239de1b1a370c08f6b4cda644e4 uncommit: set dirstateparents from within _fixdirstate() It's now done in the same way for uncommit and unamend, so we can share the code. Differential Revision: https://phab.mercurial-scm.org/D5662 diff --git a/hgext/uncommit.py b/hgext/uncommit.py --- a/hgext/uncommit.py +++ b/hgext/uncommit.py @@ -98,6 +98,7 @@ def _fixdirstate(repo, oldctx, newctx, m 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 @@ def uncommit(ui, repo, *pats, **opts): 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 @@ def unamend(ui, repo, **opts): dirstate = repo.dirstate with dirstate.parentchange(): - dirstate.setparents(newprednode, node.nullid) _fixdirstate(repo, curctx, newpredctx) mapping = {curctx.node(): (newprednode,)}