Patchwork [3,of,7] mergecopies: introduce new dicts to handle more complex copy cases

login
register
mail settings
Submitter Gábor Stefanik
Date Oct. 7, 2016, 12:31 p.m.
Message ID <887cbdaad15d5cc1b86c.1475843496@waste.org>
Download mbox | patch
Permalink /patch/16878/
State Changes Requested
Delegated to: Matt Mackall
Headers show

Comments

Gábor Stefanik - Oct. 7, 2016, 12:31 p.m.
# HG changeset patch
# User Gábor Stefanik <gabor.stefanik@nng.com>
# Date 1475494736 -7200
#      Mon Oct 03 13:38:56 2016 +0200
# Node ID 887cbdaad15d5cc1b86c7dc419a83640d467ec5a
# Parent  08f3260e3764bcfbe13945aa62bf079807df02fc
mergecopies: introduce new dicts to handle more complex copy cases

Patch

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -333,9 +333,10 @@ 
 
     # see _checkcopies documentation below for these dicts
     copy1, copy2 = {}, {}
+    incomplete1, incomplete2 = {}, {}
     movewithdir1, movewithdir2 = {}, {}
     fullcopy1, fullcopy2 = {}, {}
-    diverge = {}
+    diverge, incompletediverge = {}, {}
 
     # find interesting file sets from manifests
     addedinm1 = m1.filesnotin(ma)
@@ -373,7 +374,10 @@ 
     if bothnew:
         repo.ui.debug("  unmatched files new in both:\n   %s\n"
                       % "\n   ".join(bothnew))
-    bothdiverge, _copy, _fullcopy = {}, {}, {}
+    bothdiverge = {}
+    _copy, _fullcopy = {}, {} # dummy dicts
+    # reset incomplete dicts for bothdiverge generation
+    incomplete1, incomplete2, incompletediverge = {}, {}, {}
     for f in bothnew:
         _checkcopies(c1, f, m1, m2, ca, ca, False, limit, bothdiverge, _copy,
                      _fullcopy)