comparison mercurial/copies.py @ 42241:c74226916c8c

copies: make "limit" argument to _tracefile() mandatory 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. Differential Revision: https://phab.mercurial-scm.org/D6335
author Martin von Zweigbergk <martinvonz@google.com>
date Sat, 27 Apr 2019 22:08:45 -0700
parents fdbeacb9d456
children 00e065fb1469
comparison
equal deleted inserted replaced
42240:39b63f9d7464 42241:c74226916c8c
150 elif k not in dst: 150 elif k not in dst:
151 del t[k] 151 del t[k]
152 152
153 return t 153 return t
154 154
155 def _tracefile(fctx, am, limit=node.nullrev): 155 def _tracefile(fctx, am, limit):
156 """return file context that is the ancestor of fctx present in ancestor 156 """return file context that is the ancestor of fctx present in ancestor
157 manifest am, stopping after the first ancestor lower than limit""" 157 manifest am, stopping after the first ancestor lower than limit"""
158 158
159 for f in fctx.ancestors(): 159 for f in fctx.ancestors():
160 if am.get(f.path(), None) == f.filenode(): 160 if am.get(f.path(), None) == f.filenode():
161 return f 161 return f
162 if limit >= 0 and not f.isintroducedafter(limit): 162 if not f.isintroducedafter(limit):
163 return None 163 return None
164 164
165 def _dirstatecopies(repo, match=None): 165 def _dirstatecopies(repo, match=None):
166 ds = repo.dirstate 166 ds = repo.dirstate
167 c = ds.copies().copy() 167 c = ds.copies().copy()