[PATCH 04 of 11] copies: mark checkcopies as internal with the _ prefix (issue4028)
# HG changeset patch # User Gábor Stefanik # 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 ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 04 of 11] copies: mark checkcopies as internal with the _ prefix (issue4028)
# HG changeset patch # User Gábor Stefanik # 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 ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 04 of 11] copies: mark checkcopies as internal with the _ prefix (issue4028)
On 10/04/2016 04:39 PM, Gábor Stefanik wrote: # HG changeset patch # User Gábor Stefanik # 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) I've pushed patch 1-4 as they are simple. I've some question on patch 5 and 6 (but di dnot looked at them in details. I've not got the time to look at the rest of the series yet. Thanks a lot for slicing this out. -- Pierre-Yves David ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 04 of 11] copies: mark checkcopies as internal with the _ prefix (issue4028)
# HG changeset patch # User Gábor Stefanik # 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 ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel