##// END OF EJS Templates
copytrace: use ctx.mutable() instead of adhoc constant of non-public phases
Yuya Nishihara -
r34365:d00910b2 default
parent child Browse files
Show More
@@ -15,7 +15,6 b' from . import ('
15 match as matchmod,
15 match as matchmod,
16 node,
16 node,
17 pathutil,
17 pathutil,
18 phases,
19 scmutil,
18 scmutil,
20 util,
19 util,
21 )
20 )
@@ -368,9 +367,9 b' def mergecopies(repo, c1, c2, base):'
368 if copytracing == 'off':
367 if copytracing == 'off':
369 return {}, {}, {}, {}, {}
368 return {}, {}, {}, {}, {}
370 elif copytracing == 'heuristics':
369 elif copytracing == 'heuristics':
371 # Do full copytracing if only drafts are involved as that will be fast
370 # Do full copytracing if only non-public revisions are involved as
372 # enough and will also cover the copies which can be missed by
371 # that will be fast enough and will also cover the copies which could
373 # heuristics
372 # be missed by heuristics
374 if _isfullcopytraceable(repo, c1, base):
373 if _isfullcopytraceable(repo, c1, base):
375 return _fullcopytracing(repo, c1, c2, base)
374 return _fullcopytracing(repo, c1, c2, base)
376 return _heuristicscopytracing(repo, c1, c2, base)
375 return _heuristicscopytracing(repo, c1, c2, base)
@@ -378,16 +377,13 b' def mergecopies(repo, c1, c2, base):'
378 return _fullcopytracing(repo, c1, c2, base)
377 return _fullcopytracing(repo, c1, c2, base)
379
378
380 def _isfullcopytraceable(repo, c1, base):
379 def _isfullcopytraceable(repo, c1, base):
381 """ Checks that if base, source and destination are all draft branches, if
380 """ Checks that if base, source and destination are all no-public branches,
382 yes let's use the full copytrace algorithm for increased capabilities since
381 if yes let's use the full copytrace algorithm for increased capabilities
383 it will be fast enough.
382 since it will be fast enough.
384 """
383 """
385 if c1.rev() is None:
384 if c1.rev() is None:
386 c1 = c1.p1()
385 c1 = c1.p1()
387
386 if c1.mutable() and base.mutable():
388 nonpublicphases = set([phases.draft, phases.secret])
389
390 if (c1.phase() in nonpublicphases) and (base.phase() in nonpublicphases):
391 sourcecommitlimit = repo.ui.configint('experimental',
387 sourcecommitlimit = repo.ui.configint('experimental',
392 'copytrace.sourcecommitlimit')
388 'copytrace.sourcecommitlimit')
393 commits = len(repo.revs('%d::%d', base.rev(), c1.rev()))
389 commits = len(repo.revs('%d::%d', base.rev(), c1.rev()))
General Comments 0
You need to be logged in to leave comments. Login now