Patchwork D6600: copies: move short-circuiting of dirstate copies out of _forwardcopies()

login
register
mail settings
Submitter phabricator
Date July 10, 2019, 7:39 p.m.
Message ID <2c2c3ce4bc1496923e0e27146a8b2b84@localhost.localdomain>
Download mbox | patch
Permalink /patch/40889/
State Not Applicable
Headers show

Comments

phabricator - July 10, 2019, 7:39 p.m.
Closed by commit rHGbcb4b5c5964b: copies: move short-circuiting of dirstate copies out of _forwardcopies() (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/D6600?vs=15744&id=15872

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

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

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -324,10 +324,6 @@ 
     match = a.repo().narrowmatch(match)
     # check for working copy
     if b.rev() is None:
-        if a == b.p1():
-            # short-circuit to avoid issues with merge states
-            return _dirstatecopies(b._repo, match)
-
         cm = _committedforwardcopies(a, b.p1(), match)
         # combine copies from dirstate if necessary
         return _chainandfilter(a, b, cm, _dirstatecopies(b._repo, match))
@@ -367,6 +363,9 @@ 
     if a == x:
         if debug:
             repo.ui.debug('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)
         return _forwardcopies(x, y, match=match)
     if a == y:
         if debug: