Patchwork D6115: unamend: added match as argument for scmutil.movedirstate

login
register
mail settings
Submitter phabricator
Date March 12, 2019, 7:03 p.m.
Message ID <0a814eece23f4a3fbe2bceb4ebc90988@localhost.localdomain>
Download mbox | patch
Permalink /patch/39232/
State Not Applicable
Headers show

Comments

phabricator - March 12, 2019, 7:03 p.m.
taapas1128 updated this revision to Diff 14478.
taapas1128 edited the summary of this revision.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6115?vs=14476&id=14478

REVISION DETAIL
  https://phab.mercurial-scm.org/D6115

AFFECTED FILES
  hgext/uncommit.py

CHANGE DETAILS




To: taapas1128, #hg-reviewers
Cc: martinvonz, mercurial-devel

Patch

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