obsutil: rename allprecursors into allpredecessors
authorBoris Feld <boris.feld@octobus.net>
Wed, 02 Aug 2017 19:49:57 +0200
changeset 33735 e6d8ee3c9ec3
parent 33734 0c3112f17610
child 33736 86aca74a063b
obsutil: rename allprecursors into allpredecessors Use util.nouideprecwarn because obsstore doesn't have easy access to an ui object. The renaming is done according to https://www.mercurial-scm.org/wiki/CEDVocabulary. Differential Revision: https://phab.mercurial-scm.org/D247
contrib/phabricator.py
mercurial/obsolete.py
mercurial/obsutil.py
--- a/contrib/phabricator.py	Wed Aug 02 19:48:06 2017 +0200
+++ b/contrib/phabricator.py	Wed Aug 02 19:49:57 2017 +0200
@@ -41,7 +41,7 @@
     encoding,
     error,
     mdiff,
-    obsolete,
+    obsutil,
     patch,
     registrar,
     scmutil,
@@ -167,7 +167,7 @@
     for node in nodelist:
         ctx = unfi[node]
         # For tags like "D123", put them into "toconfirm" to verify later
-        precnodes = list(obsolete.allprecursors(unfi.obsstore, [node]))
+        precnodes = list(obsutil.allpredecessors(unfi.obsstore, [node]))
         for n in precnodes:
             if n in nodemap:
                 for tag in unfi.nodetags(n):
--- a/mercurial/obsolete.py	Wed Aug 02 19:48:06 2017 +0200
+++ b/mercurial/obsolete.py	Wed Aug 02 19:49:57 2017 +0200
@@ -949,7 +949,7 @@
         # We only evaluate mutable, non-obsolete revision
         node = ctx.node()
         # (future) A cache of predecessors may worth if split is very common
-        for pnode in obsutil.allprecursors(repo.obsstore, [node],
+        for pnode in obsutil.allpredecessors(repo.obsstore, [node],
                                    ignoreflags=bumpedfix):
             prev = torev(pnode) # unfiltered! but so is phasecache
             if (prev is not None) and (phase(repo, prev) <= public):
--- a/mercurial/obsutil.py	Wed Aug 02 19:48:06 2017 +0200
+++ b/mercurial/obsutil.py	Wed Aug 02 19:49:57 2017 +0200
@@ -102,7 +102,16 @@
             else:
                 stack.append(precnodeid)
 
-def allprecursors(obsstore, nodes, ignoreflags=0):
+def allprecursors(*args, **kwargs):
+    """ (DEPRECATED)
+    """
+    msg = ("'obsutil.allprecursors' is deprecated, "
+           "use 'obsutil.allpredecessors'")
+    util.nouideprecwarn(msg, '4.4')
+
+    return allpredecessors(*args, **kwargs)
+
+def allpredecessors(obsstore, nodes, ignoreflags=0):
     """Yield node for every precursors of <nodes>.
 
     Some precursors may be unknown locally.