# HG changeset patch # User Martin von Zweigbergk # Date 1580840190 28800 # Node ID 30862e226339217f2a694a04ed32d830f57dff44 # Parent 66dab0d9a78ed38f2fd222e13b46b4e3ff5a9075 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 diff -r 66dab0d9a78e -r 30862e226339 mercurial/copies.py --- a/mercurial/copies.py Tue Feb 04 10:14:44 2020 -0800 +++ b/mercurial/copies.py Tue Feb 04 10:16:30 2020 -0800 @@ -403,13 +403,15 @@ ) if x == y or not x or not y: return {} + if y.rev() is None and x == y.p1(): + if debug: + repo.ui.debug(b'debug.copies: search mode: dirstate\n') + # short-circuit to avoid issues with merge states + return _dirstatecopies(repo, match) a = y.ancestor(x) if a == x: if debug: repo.ui.debug(b'debug.copies: search mode: forward\n') - if y.rev() is None and x == y.p1(): - # short-circuit to avoid issues with merge states - return _dirstatecopies(repo, match) copies = _forwardcopies(x, y, match=match) elif a == y: if debug: diff -r 66dab0d9a78e -r 30862e226339 tests/test-repo-filters-tiptoe.t --- a/tests/test-repo-filters-tiptoe.t Tue Feb 04 10:14:44 2020 -0800 +++ b/tests/test-repo-filters-tiptoe.t Tue Feb 04 10:16:30 2020 -0800 @@ -68,7 +68,6 @@ ! b $ hg status --copies - debug.filters: computing revision filter for "visible" M c A d R a