D6335: copies: make "limit" argument to _tracefile() mandatory

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Fri May 3 01:55:27 EDT 2019


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We always pass a limit. I think the fact that it was optional was also
  the reason we checked ">=limit" before we used it. So now we can
  remove that condition too.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -152,14 +152,14 @@
 
     return t
 
-def _tracefile(fctx, am, limit=node.nullrev):
+def _tracefile(fctx, am, limit):
     """return file context that is the ancestor of fctx present in ancestor
     manifest am, stopping after the first ancestor lower than limit"""
 
     for f in fctx.ancestors():
         if am.get(f.path(), None) == f.filenode():
             return f
-        if limit >= 0 and not f.isintroducedafter(limit):
+        if not f.isintroducedafter(limit):
             return None
 
 def _dirstatecopies(repo, match=None):



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


More information about the Mercurial-devel mailing list