Patchwork D7975: copies: move early return in mergecopies() earlier

login
register
mail settings
Submitter phabricator
Date Jan. 24, 2020, 10:02 p.m.
Message ID <46b72216468c609b120aea5dc6801226@localhost.localdomain>
Download mbox | patch
Permalink /patch/44620/
State Not Applicable
Headers show

Comments

phabricator - Jan. 24, 2020, 10:02 p.m.
martinvonz updated this revision to Diff 19560.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7975?vs=19527&id=19560

BRANCH
  default

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

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

AFFECTED FILES
  mercurial/copies.py
  tests/test-issue1802.t
  tests/test-issue522.t
  tests/test-merge-criss-cross.t
  tests/test-up-local-change.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-up-local-change.t b/tests/test-up-local-change.t
--- a/tests/test-up-local-change.t
+++ b/tests/test-up-local-change.t
@@ -40,8 +40,6 @@ 
   summary:     1
   
   $ hg --debug up
-    unmatched files in other:
-     b
   resolving manifests
    branchmerge: False, force: False, partial: False
    ancestor: c19d34741b0a, local: c19d34741b0a+, remote: 1e71731e6fbb
@@ -91,8 +89,6 @@ 
   summary:     1
   
   $ hg --debug up
-    unmatched files in other:
-     b
   resolving manifests
    branchmerge: False, force: False, partial: False
    ancestor: c19d34741b0a, local: c19d34741b0a+, remote: 1e71731e6fbb
diff --git a/tests/test-merge-criss-cross.t b/tests/test-merge-criss-cross.t
--- a/tests/test-merge-criss-cross.t
+++ b/tests/test-merge-criss-cross.t
@@ -410,11 +410,6 @@ 
   note: merging c0ef19750a22+ and 6ca01f7342b9 using bids from ancestors 11b5b303e36c and 154e6000f54e
   
   calculating bids for ancestor 11b5b303e36c
-    unmatched files in local:
-     d1/a
-     d1/b
-    unmatched files in other:
-     d2/b
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: 11b5b303e36c, local: c0ef19750a22+, remote: 6ca01f7342b9
diff --git a/tests/test-issue522.t b/tests/test-issue522.t
--- a/tests/test-issue522.t
+++ b/tests/test-issue522.t
@@ -25,8 +25,6 @@ 
   $ hg ci -qAm 'add bar'
 
   $ hg merge --debug
-    unmatched files in local:
-     bar
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: bbd179dfa0a7, local: 71766447bdbb+, remote: 4d9e78aaceee
diff --git a/tests/test-issue1802.t b/tests/test-issue1802.t
--- a/tests/test-issue1802.t
+++ b/tests/test-issue1802.t
@@ -52,8 +52,6 @@ 
 Simulate a Windows merge:
 
   $ hg --config extensions.n=$TESTTMP/noexec.py merge --debug
-    unmatched files in local:
-     b
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: a03b0deabf2b, local: d6fa54f68ae1+, remote: 2d8bcf2dda39
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -563,6 +563,9 @@ 
     copies1 = pathcopies(base, c1)
     copies2 = pathcopies(base, c2)
 
+    if not (copies1 or copies2):
+        return {}, {}, {}, {}, {}
+
     inversecopies1 = {}
     inversecopies2 = {}
     for dst, src in copies1.items():
@@ -632,8 +635,6 @@ 
 
     fullcopy = copies1.copy()
     fullcopy.update(copies2)
-    if not fullcopy:
-        return copy, {}, diverge, renamedelete, {}
 
     if repo.ui.debugflag:
         repo.ui.debug(