comparison mercurial/copies.py @ 44276:30862e226339

copies: avoid filtering by short-circuit dirstate-only copies earlier The call to `y.ancestor(x)` triggered repo filtering, which we'd like to avoid in the simple `hg status --copies` case. Differential Revision: https://phab.mercurial-scm.org/D8071
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 04 Feb 2020 10:16:30 -0800
parents b4057d001760
children 45f3f35cefe7 d452acc8cce8
comparison
equal deleted inserted replaced
44275:66dab0d9a78e 44276:30862e226339
401 repo.ui.debug( 401 repo.ui.debug(
402 b'debug.copies: searching copies from %s to %s\n' % (x, y) 402 b'debug.copies: searching copies from %s to %s\n' % (x, y)
403 ) 403 )
404 if x == y or not x or not y: 404 if x == y or not x or not y:
405 return {} 405 return {}
406 if y.rev() is None and x == y.p1():
407 if debug:
408 repo.ui.debug(b'debug.copies: search mode: dirstate\n')
409 # short-circuit to avoid issues with merge states
410 return _dirstatecopies(repo, match)
406 a = y.ancestor(x) 411 a = y.ancestor(x)
407 if a == x: 412 if a == x:
408 if debug: 413 if debug:
409 repo.ui.debug(b'debug.copies: search mode: forward\n') 414 repo.ui.debug(b'debug.copies: search mode: forward\n')
410 if y.rev() is None and x == y.p1():
411 # short-circuit to avoid issues with merge states
412 return _dirstatecopies(repo, match)
413 copies = _forwardcopies(x, y, match=match) 415 copies = _forwardcopies(x, y, match=match)
414 elif a == y: 416 elif a == y:
415 if debug: 417 if debug:
416 repo.ui.debug(b'debug.copies: search mode: backward\n') 418 repo.ui.debug(b'debug.copies: search mode: backward\n')
417 copies = _backwardrenames(x, y, match=match) 419 copies = _backwardrenames(x, y, match=match)