revset: add `predecessor` aliases for `precursors` and `allprecursors`
authorMatt Harbison <matt_harbison@yahoo.com>
Sat, 27 Apr 2019 22:33:16 -0400
changeset 4623 0adb59b55add
parent 4622 86f396d2b352
child 4624 c9798965b1f4
revset: add `predecessor` aliases for `precursors` and `allprecursors` Per https://www.mercurial-scm.org/wiki/CEDVocabulary
hgext3rd/evolve/__init__.py
--- a/hgext3rd/evolve/__init__.py	Sat Apr 27 22:24:30 2019 -0400
+++ b/hgext3rd/evolve/__init__.py	Sat Apr 27 22:33:16 2019 -0400
@@ -624,9 +624,9 @@
     return subset & suspended
 
 
-@eh.revsetpredicate('precursors(set)')
-def revsetprecursors(repo, subset, x):
-    """Immediate precursors of changesets in set.
+@eh.revsetpredicate('predecessors(set)')
+def revsetpredecessors(repo, subset, x):
+    """Immediate predecessors of changesets in set.
     """
     s = revset.getset(repo, revset.fullreposet(repo), x)
     s = revset.baseset(_precursors(repo, s))
@@ -634,9 +634,14 @@
     return subset & s
 
 
-@eh.revsetpredicate('allprecursors(set)')
-def revsetallprecursors(repo, subset, x):
-    """Transitive precursors of changesets in set.
+@eh.revsetpredicate('precursors(set)')   # legacy name for predecessors
+def revsetprecursors(repo, subset, x):
+    return revsetpredecessors(repo, subset, x)
+
+
+@eh.revsetpredicate('allpredecessors(set)')
+def revsetallpredecessors(repo, subset, x):
+    """Transitive predecessors of changesets in set.
     """
     s = revset.getset(repo, revset.fullreposet(repo), x)
     s = revset.baseset(_allprecursors(repo, s))
@@ -644,6 +649,11 @@
     return subset & s
 
 
+@eh.revsetpredicate('allprecursors(set)')   # legacy name for allpredecessors
+def revsetallprecursors(repo, subset, x):
+    return revsetallpredecessors(repo, subset, x)
+
+
 @eh.revsetpredicate('successors(set)')
 def revsetsuccessors(repo, subset, x):
     """Immediate successors of changesets in set.