Patchwork D8071: copies: avoid filtering by short-circuit dirstate-only copies earlier

login
register
mail settings
Submitter phabricator
Date Feb. 6, 2020, 10:22 p.m.
Message ID <9b1abbefe43a0db542942172ab8b66a9@localhost.localdomain>
Download mbox | patch
Permalink /patch/45012/
State Not Applicable
Headers show

Comments

phabricator - Feb. 6, 2020, 10:22 p.m.
Closed by commit rHG30862e226339: copies: avoid filtering by short-circuit dirstate-only copies earlier (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8071?vs=19873&id=19976

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8071/new/

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

AFFECTED FILES
  mercurial/copies.py
  tests/test-repo-filters-tiptoe.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-repo-filters-tiptoe.t b/tests/test-repo-filters-tiptoe.t
--- a/tests/test-repo-filters-tiptoe.t
+++ b/tests/test-repo-filters-tiptoe.t
@@ -68,7 +68,6 @@ 
   ! b
 
   $ hg status --copies
-  debug.filters: computing revision filter for "visible"
   M c
   A d
   R a
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -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: