changeset 34367:d00910b286cd

copytrace: use ctx.mutable() instead of adhoc constant of non-public phases
author Yuya Nishihara <yuya@tcha.org>
date Fri, 22 Sep 2017 22:45:02 +0900
parents cd3f39716fd3
children f61f5af5ed31
files mercurial/copies.py
diffstat 1 files changed, 7 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/copies.py	Sat Sep 30 10:09:29 2017 +0100
+++ b/mercurial/copies.py	Fri Sep 22 22:45:02 2017 +0900
@@ -15,7 +15,6 @@
     match as matchmod,
     node,
     pathutil,
-    phases,
     scmutil,
     util,
 )
@@ -368,9 +367,9 @@
     if copytracing == 'off':
         return {}, {}, {}, {}, {}
     elif copytracing == 'heuristics':
-        # Do full copytracing if only drafts are involved as that will be fast
-        # enough and will also cover the copies which can be missed by
-        # heuristics
+        # Do full copytracing if only non-public revisions are involved as
+        # that will be fast enough and will also cover the copies which could
+        # be missed by heuristics
         if _isfullcopytraceable(repo, c1, base):
             return _fullcopytracing(repo, c1, c2, base)
         return _heuristicscopytracing(repo, c1, c2, base)
@@ -378,16 +377,13 @@
         return _fullcopytracing(repo, c1, c2, base)
 
 def _isfullcopytraceable(repo, c1, base):
-    """ Checks that if base, source and destination are all draft branches, if
-    yes let's use the full copytrace algorithm for increased capabilities since
-    it will be fast enough.
+    """ Checks that if base, source and destination are all no-public branches,
+    if yes let's use the full copytrace algorithm for increased capabilities
+    since it will be fast enough.
     """
     if c1.rev() is None:
         c1 = c1.p1()
-
-    nonpublicphases = set([phases.draft, phases.secret])
-
-    if (c1.phase() in nonpublicphases) and (base.phase() in nonpublicphases):
+    if c1.mutable() and base.mutable():
         sourcecommitlimit = repo.ui.configint('experimental',
                                               'copytrace.sourcecommitlimit')
         commits = len(repo.revs('%d::%d', base.rev(), c1.rev()))