Patchwork D6120: scmutil: document matcher argument of movedirstate()

login
register
mail settings
Submitter phabricator
Date March 11, 2019, 9:08 p.m.
Message ID <differential-rev-PHID-DREV-nqyuxc7lqirm4plmzzy3-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/39223/
State Superseded
Headers show

Comments

phabricator - March 11, 2019, 9:08 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - March 11, 2019, 10:32 p.m.
martinvonz added a comment.


  Sorry, I forgot (again) to manually add the parent revision. That's done now.

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1255,7 +1255,12 @@ 
             wctx.copy(origsrc, dst)
 
 def movedirstate(repo, newctx, match=None):
-    """Move the dirstate to newctx and adjust it as necessary."""
+    """Move the dirstate to newctx and adjust it as necessary.
+
+    A matcher can be provided as an optimization. It is probably a bug to pass
+    a matcher that doesn't match all the differences between the parent of the
+    working copy and newctx.
+    """
     oldctx = repo['.']
     ds = repo.dirstate
     ds.setparents(newctx.node(), nullid)