--- a/hgext/uncommit.py Fri Dec 01 22:40:55 2017 -0500
+++ b/hgext/uncommit.py Sun Dec 03 00:29:51 2017 +0530
@@ -212,11 +212,11 @@
"""
unfi = repo.unfiltered()
+ with repo.wlock(), repo.lock(), repo.transaction('unamend'):
- # identify the commit from which to unamend
- curctx = repo['.']
+ # identify the commit from which to unamend
+ curctx = repo['.']
- with repo.wlock(), repo.lock(), repo.transaction('unamend'):
if not curctx.mutable():
raise error.Abort(_('cannot unamend public changesets'))
@@ -235,7 +235,7 @@
# add an extra so that we get a new hash
# note: allowing unamend to undo an unamend is an intentional feature
extras = predctx.extra()
- extras['unamend_source'] = curctx.node()
+ extras['unamend_source'] = curctx.hex()
def filectxfn(repo, ctx_, path):
try:
@@ -259,14 +259,7 @@
newprednode = repo.commitctx(newctx)
newpredctx = repo[newprednode]
-
- changedfiles = []
- wctx = repo[None]
- wm = wctx.manifest()
- cm = newpredctx.manifest()
dirstate = repo.dirstate
- diff = cm.diff(wm)
- changedfiles.extend(diff.iterkeys())
with dirstate.parentchange():
dirstate.setparents(newprednode, node.nullid)