changeset 4623:0adb59b55add

revset: add `predecessor` aliases for `precursors` and `allprecursors` Per https://www.mercurial-scm.org/wiki/CEDVocabulary
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 27 Apr 2019 22:33:16 -0400
parents 86f396d2b352
children c9798965b1f4
files hgext3rd/evolve/__init__.py
diffstat 1 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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.