# HG changeset patch # User Martin von Zweigbergk # Date 2019-01-21 06:00:21 # Node ID c9f1fd82a826c7b765581ae57a7ffab94805de1e # Parent 7be231f5a4ad6a92efe221f3e19b20edc9883291 uncommit: mark old node obsolete after updating dirstate The next patch will start doing more things with the context object for the old node and that ran into problems without this change. Regardless of that, I think it seems better to first update to the new node and then mark the old node obsolete. Differential Revision: https://phab.mercurial-scm.org/D5660 diff --git a/hgext/uncommit.py b/hgext/uncommit.py --- a/hgext/uncommit.py +++ b/hgext/uncommit.py @@ -179,13 +179,13 @@ def uncommit(ui, repo, *pats, **opts): # Fully removed the old commit mapping[old.node()] = () - scmutil.cleanupnodes(repo, mapping, 'uncommit', fixphase=True) - with repo.dirstate.parentchange(): repo.dirstate.setparents(newid, node.nullid) s = old.p1().status(old, match=match) _fixdirstate(repo, old, repo[newid], s) + scmutil.cleanupnodes(repo, mapping, 'uncommit', fixphase=True) + def predecessormarkers(ctx): """yields the obsolete markers marking the given changeset as a successor""" for data in ctx.repo().obsstore.predecessors.get(ctx.node(), ()):