Comments
Patch
@@ -166,21 +166,22 @@
@command('unamend', [], helpcategory=command.CATEGORY_CHANGE_MANAGEMENT,
helpbasic=True)
-def unamend(ui, repo, **opts):
+def unamend(ui, repo, *pats, **opts):
"""undo the most recent amend operation on a current changeset
This command will roll back to the previous version of a changeset,
leaving working directory in state in which it was before running
`hg amend` (e.g. files modified as part of an amend will be
marked as modified `hg status`)
"""
+ opts = pycompat.byteskwargs(opts)
unfi = repo.unfiltered()
with repo.wlock(), repo.lock(), repo.transaction('unamend'):
# identify the commit from which to unamend
curctx = repo['.']
-
+ match = scmutil.match(curctx, pats, opts)
rewriteutil.precheck(repo, [curctx.rev()], 'unamend')
# identify the commit to which to unamend
@@ -217,7 +218,7 @@
dirstate = repo.dirstate
with dirstate.parentchange():
- scmutil.movedirstate(repo, newpredctx)
+ scmutil.movedirstate(repo, newpredctx, match)
mapping = {curctx.node(): (newprednode,)}
scmutil.cleanupnodes(repo, mapping, 'unamend', fixphase=True)