diff --git a/hgext/uncommit.py b/hgext/uncommit.py --- a/hgext/uncommit.py +++ b/hgext/uncommit.py @@ -166,7 +166,7 @@ @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, @@ -175,12 +175,13 @@ 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)