Patchwork [11,of,14,evolve-ext] revset: add `predecessor` aliases for `precursors` and `allprecursors`

login
register
mail settings
Submitter Matt Harbison
Date April 28, 2019, 4:28 a.m.
Message ID <eed04da5b1e569516d8b.1556425738@Envy>
Download mbox | patch
Permalink /patch/39863/
State New
Headers show

Comments

Matt Harbison - April 28, 2019, 4:28 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1556418796 14400
#      Sat Apr 27 22:33:16 2019 -0400
# Node ID eed04da5b1e569516d8b7d315404f0787ef545f1
# Parent  206d66bf7e91472aa229379d7e1d53c3de7b0c64
revset: add `predecessor` aliases for `precursors` and `allprecursors`

Per https://www.mercurial-scm.org/wiki/CEDVocabulary

Patch

diff --git a/hgext3rd/evolve/__init__.py b/hgext3rd/evolve/__init__.py
--- a/hgext3rd/evolve/__init__.py
+++ b/hgext3rd/evolve/__init__.py
@@ -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.