[PATCH 04 of 11] copies: mark checkcopies as internal with the _ prefix (issue4028)

Gábor Stefanik gabor.stefanik at nng.com
Wed Oct 5 08:01:36 EDT 2016


# HG changeset patch
# User Gábor Stefanik <gabor.stefanik at nng.com>
# Date 1475493896 -7200
#      Mon Oct 03 13:24:56 2016 +0200
# Node ID a2b50d0c5dc69a4ce15b6a54d030e478c0f4cc41
# Parent  15adeba2cc0fdea04c81404fcb4092cae816de17
copies: mark checkcopies as internal with the _ prefix (issue4028)

diff -r 15adeba2cc0f -r a2b50d0c5dc6 mercurial/copies.py
--- a/mercurial/copies.py	Mon Oct 03 13:23:19 2016 +0200
+++ b/mercurial/copies.py	Mon Oct 03 13:24:56 2016 +0200
@@ -251,10 +251,10 @@
     return u1, u2
 
 def _makegetfctx(ctx):
-    """return a 'getfctx' function suitable for checkcopies usage
+    """return a 'getfctx' function suitable for _checkcopies usage
 
     We have to re-setup the function building 'filectx' for each
-    'checkcopies' to ensure the linkrev adjustment is properly setup for
+    '_checkcopies' to ensure the linkrev adjustment is properly setup for
     each. Linkrev adjustment is important to avoid bug in rename
     detection. Moreover, having a proper '_ancestrycontext' setup ensures
     the performance impact of this adjustment is kept limited. Without it,
@@ -331,7 +331,7 @@
     m2 = c2.manifest()
     ma = ca.manifest()
 
-    # see checkcopies documentation below for these dicts
+    # see _checkcopies documentation below for these dicts
     copy1, copy2 = {}, {}
     movewithdir1, movewithdir2 = {}, {}
     fullcopy1, fullcopy2 = {}, {}
@@ -345,10 +345,10 @@
     bothnew = sorted(addedinm1 & addedinm2)
 
     for f in u1u:
-        checkcopies(c1, f, m1, m2, ca, limit, diverge, copy1, fullcopy1)
+        _checkcopies(c1, f, m1, m2, ca, limit, diverge, copy1, fullcopy1)
 
     for f in u2u:
-        checkcopies(c2, f, m2, m1, ca, limit, diverge, copy2, fullcopy2)
+        _checkcopies(c2, f, m2, m1, ca, limit, diverge, copy2, fullcopy2)
 
     copy = dict(copy1.items() + copy2.items())
     movewithdir = dict(movewithdir1.items() + movewithdir2.items())
@@ -373,8 +373,8 @@
                       % "\n   ".join(bothnew))
     bothdiverge, _copy, _fullcopy = {}, {}, {}
     for f in bothnew:
-        checkcopies(c1, f, m1, m2, ca, limit, bothdiverge, _copy, _fullcopy)
-        checkcopies(c2, f, m2, m1, ca, limit, bothdiverge, _copy, _fullcopy)
+        _checkcopies(c1, f, m1, m2, ca, limit, bothdiverge, _copy, _fullcopy)
+        _checkcopies(c2, f, m2, m1, ca, limit, bothdiverge, _copy, _fullcopy)
     for of, fl in bothdiverge.items():
         if len(fl) == 2 and fl[0] == fl[1]:
             copy[fl[0]] = of # not actually divergent, just matching renames
@@ -454,7 +454,7 @@
 
     return copy, movewithdir, diverge, renamedelete
 
-def checkcopies(ctx, f, m1, m2, ca, limit, diverge, copy, fullcopy):
+def _checkcopies(ctx, f, m1, m2, ca, limit, diverge, copy, fullcopy):
     """
     check possible copies of f from m1 to m2
 


More information about the Mercurial-devel mailing list