##// END OF EJS Templates
uncommit: convert _fixdirstate() into _movedirstate()...
Martin von Zweigbergk -
r42101:bf72e4c3 default
parent child Browse files
Show More
@@ -99,10 +99,9 b' def _commitfiltered(repo, ctx, match, ke'
99 99 extra=ctx.extra())
100 100 return repo.commitctx(new)
101 101
102 def _fixdirstate(repo, oldctx, newctx, match=None):
103 """ fix the dirstate after switching the working directory from oldctx to
104 newctx which can be result of either unamend or uncommit.
105 """
102 def _movedirstate(repo, newctx, match=None):
103 """Move the dirstate to newctx and adjust it as necessary."""
104 oldctx = repo['.']
106 105 ds = repo.dirstate
107 106 ds.setparents(newctx.node(), node.nullid)
108 107 copies = dict(ds.copies())
@@ -194,7 +193,7 b' def uncommit(ui, repo, *pats, **opts):'
194 193 mapping[old.node()] = ()
195 194
196 195 with repo.dirstate.parentchange():
197 _fixdirstate(repo, old, repo[newid], match)
196 _movedirstate(repo, repo[newid], match)
198 197
199 198 scmutil.cleanupnodes(repo, mapping, 'uncommit', fixphase=True)
200 199
@@ -256,7 +255,7 b' def unamend(ui, repo, **opts):'
256 255 dirstate = repo.dirstate
257 256
258 257 with dirstate.parentchange():
259 _fixdirstate(repo, curctx, newpredctx)
258 _movedirstate(repo, newpredctx)
260 259
261 260 mapping = {curctx.node(): (newprednode,)}
262 261 scmutil.cleanupnodes(repo, mapping, 'unamend', fixphase=True)
General Comments 0
You need to be logged in to leave comments. Login now