##// 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 15 match as matchmod,
16 16 node,
17 17 pathutil,
18 phases,
19 18 scmutil,
20 19 util,
21 20 )
@@ -368,9 +367,9 b' def mergecopies(repo, c1, c2, base):'
368 367 if copytracing == 'off':
369 368 return {}, {}, {}, {}, {}
370 369 elif copytracing == 'heuristics':
371 # Do full copytracing if only drafts are involved as that will be fast
372 # enough and will also cover the copies which can be missed by
373 # heuristics
370 # Do full copytracing if only non-public revisions are involved as
371 # that will be fast enough and will also cover the copies which could
372 # be missed by heuristics
374 373 if _isfullcopytraceable(repo, c1, base):
375 374 return _fullcopytracing(repo, c1, c2, base)
376 375 return _heuristicscopytracing(repo, c1, c2, base)
@@ -378,16 +377,13 b' def mergecopies(repo, c1, c2, base):'
378 377 return _fullcopytracing(repo, c1, c2, base)
379 378
380 379 def _isfullcopytraceable(repo, c1, base):
381 """ Checks that if base, source and destination are all draft branches, if
382 yes let's use the full copytrace algorithm for increased capabilities since
383 it will be fast enough.
380 """ Checks that if base, source and destination are all no-public branches,
381 if yes let's use the full copytrace algorithm for increased capabilities
382 since it will be fast enough.
384 383 """
385 384 if c1.rev() is None:
386 385 c1 = c1.p1()
387
388 nonpublicphases = set([phases.draft, phases.secret])
389
390 if (c1.phase() in nonpublicphases) and (base.phase() in nonpublicphases):
386 if c1.mutable() and base.mutable():
391 387 sourcecommitlimit = repo.ui.configint('experimental',
392 388 'copytrace.sourcecommitlimit')
393 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