##// END OF EJS Templates
copies: avoid calling matcher if matcher.always()...
Martin von Zweigbergk -
r42688:c0b51449 default
parent child Browse files
Show More
@@ -270,6 +270,7 b' def _changesetforwardcopies(a, b, match)'
270 # came from.
270 # came from.
271 work = [(r, 1, {}) for r in roots]
271 work = [(r, 1, {}) for r in roots]
272 heapq.heapify(work)
272 heapq.heapify(work)
273 alwaysmatch = match.always()
273 while work:
274 while work:
274 r, i1, copies1 = heapq.heappop(work)
275 r, i1, copies1 = heapq.heappop(work)
275 if work and work[0][0] == r:
276 if work and work[0][0] == r:
@@ -280,7 +281,7 b' def _changesetforwardcopies(a, b, match)'
280 # TODO: perhaps this filtering should be done as long as ctx
281 # TODO: perhaps this filtering should be done as long as ctx
281 # is merge, whether or not we're tracing from both parent.
282 # is merge, whether or not we're tracing from both parent.
282 for dst in allcopies:
283 for dst in allcopies:
283 if not match(dst):
284 if not alwaysmatch and not match(dst):
284 continue
285 continue
285 # Unlike when copies are stored in the filelog, we consider
286 # Unlike when copies are stored in the filelog, we consider
286 # it a copy even if the destination already existed on the
287 # it a copy even if the destination already existed on the
@@ -306,7 +307,7 b' def _changesetforwardcopies(a, b, match)'
306 assert r == childctx.p2().rev()
307 assert r == childctx.p2().rev()
307 parent = 2
308 parent = 2
308 childcopies = childctx.p2copies()
309 childcopies = childctx.p2copies()
309 if not match.always():
310 if not alwaysmatch:
310 childcopies = {dst: src for dst, src in childcopies.items()
311 childcopies = {dst: src for dst, src in childcopies.items()
311 if match(dst)}
312 if match(dst)}
312 # Copy the dict only if later iterations will also need it
313 # Copy the dict only if later iterations will also need it
General Comments 0
You need to be logged in to leave comments. Login now