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

taapas1128 (Taapas Agrawal) phabricator at mercurial-scm.org
Tue Mar 12 15:03:41 EDT 2019


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

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)



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


More information about the Mercurial-devel mailing list