Patchwork D5595: copies: pass contexts into _findlimit()

login
register
mail settings
Submitter phabricator
Date Jan. 24, 2019, 11:57 p.m.
Message ID <6069392a01bdc3b00cd5db6a6e8f6d80@localhost.localdomain>
Download mbox | patch
Permalink /patch/38009/
State Not Applicable
Headers show

Comments

phabricator - Jan. 24, 2019, 11:57 p.m.
martinvonz updated this revision to Diff 13435.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5595?vs=13233&id=13435

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

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -24,7 +24,7 @@ 
     stringutil,
 )
 
-def _findlimit(repo, a, b):
+def _findlimit(repo, ctxa, ctxb):
     """
     Find the last revision that needs to be checked to ensure that a full
     transitive closure for file copies can be properly calculated.
@@ -45,6 +45,8 @@ 
     #   - quit when interesting revs is zero
 
     cl = repo.changelog
+    a = ctxa.rev()
+    b = ctxb.rev()
     if a is None:
         a = node.wdirrev
     if b is None:
@@ -162,7 +164,7 @@ 
     if debug:
         dbg('debug.copies:    looking into rename from %s to %s\n'
             % (a, b))
-    limit = _findlimit(repo, a.rev(), b.rev())
+    limit = _findlimit(repo, a, b)
     if debug:
         dbg('debug.copies:      search limit: %d\n' % limit)
     am = a.manifest()
@@ -456,7 +458,7 @@ 
     if graft:
         tca = _c1.ancestor(_c2)
 
-    limit = _findlimit(repo, c1.rev(), c2.rev())
+    limit = _findlimit(repo, c1, c2)
     repo.ui.debug("  searching for copies back to rev %d\n" % limit)
 
     m1 = c1.manifest()