##// END OF EJS Templates
copies: improve logic of deciding copytracing on based of config options...
Pulkit Goyal -
r39402:a41497b5 default
parent child Browse files
Show More
@@ -20,6 +20,9 b' from . import ('
20 scmutil,
20 scmutil,
21 util,
21 util,
22 )
22 )
23 from .utils import (
24 stringutil,
25 )
23
26
24 def _findlimit(repo, a, b):
27 def _findlimit(repo, a, b):
25 """
28 """
@@ -366,19 +369,22 b' def mergecopies(repo, c1, c2, base):'
366 return repo.dirstate.copies(), {}, {}, {}, {}
369 return repo.dirstate.copies(), {}, {}, {}, {}
367
370
368 copytracing = repo.ui.config('experimental', 'copytrace')
371 copytracing = repo.ui.config('experimental', 'copytrace')
372 boolctrace = stringutil.parsebool(copytracing)
369
373
370 # Copy trace disabling is explicitly below the node == p1 logic above
374 # Copy trace disabling is explicitly below the node == p1 logic above
371 # because the logic above is required for a simple copy to be kept across a
375 # because the logic above is required for a simple copy to be kept across a
372 # rebase.
376 # rebase.
373 if copytracing == 'off':
377 if copytracing == 'heuristics':
374 return {}, {}, {}, {}, {}
375 elif copytracing == 'heuristics':
376 # Do full copytracing if only non-public revisions are involved as
378 # Do full copytracing if only non-public revisions are involved as
377 # that will be fast enough and will also cover the copies which could
379 # that will be fast enough and will also cover the copies which could
378 # be missed by heuristics
380 # be missed by heuristics
379 if _isfullcopytraceable(repo, c1, base):
381 if _isfullcopytraceable(repo, c1, base):
380 return _fullcopytracing(repo, c1, c2, base)
382 return _fullcopytracing(repo, c1, c2, base)
381 return _heuristicscopytracing(repo, c1, c2, base)
383 return _heuristicscopytracing(repo, c1, c2, base)
384 elif boolctrace is False:
385 # stringutil.parsebool() returns None when it is unable to parse the
386 # value, so we should rely on making sure copytracing is on such cases
387 return {}, {}, {}, {}, {}
382 else:
388 else:
383 return _fullcopytracing(repo, c1, c2, base)
389 return _fullcopytracing(repo, c1, c2, base)
384
390
@@ -870,8 +876,10 b' def duplicatecopies(repo, wctx, rev, fro'
870 copies between fromrev and rev.
876 copies between fromrev and rev.
871 """
877 """
872 exclude = {}
878 exclude = {}
879 ctraceconfig = repo.ui.config('experimental', 'copytrace')
880 bctrace = stringutil.parsebool(ctraceconfig)
873 if (skiprev is not None and
881 if (skiprev is not None and
874 repo.ui.config('experimental', 'copytrace') != 'off'):
882 (ctraceconfig == 'heuristics' or bctrace or bctrace is None)):
875 # copytrace='off' skips this line, but not the entire function because
883 # copytrace='off' skips this line, but not the entire function because
876 # the line below is O(size of the repo) during a rebase, while the rest
884 # the line below is O(size of the repo) during a rebase, while the rest
877 # of the function is much faster (and is required for carrying copy
885 # of the function is much faster (and is required for carrying copy
General Comments 0
You need to be logged in to leave comments. Login now