Patchwork [10,of,14,evolve-ext] revset: add `unstable` alias for `troubled`

login
register
mail settings
Submitter Matt Harbison
Date April 28, 2019, 4:28 a.m.
Message ID <206d66bf7e91472aa229.1556425737@Envy>
Download mbox | patch
Permalink /patch/39862/
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 1556418270 14400
#      Sat Apr 27 22:24:30 2019 -0400
# Node ID 206d66bf7e91472aa229379d7e1d53c3de7b0c64
# Parent  65670dda8ace58b000da738d3e053197c436bf7a
revset: add `unstable` alias for `troubled`

Per https://www.mercurial-scm.org/wiki/CEDVocabulary.  The old name is still
available (but undocumented) for compatibility.  `Orphan` was renamed from
`unstable` in core in 4.4, so this seems safe to do now.

Patch

diff --git a/hgext3rd/evolve/__init__.py b/hgext3rd/evolve/__init__.py
--- a/hgext3rd/evolve/__init__.py
+++ b/hgext3rd/evolve/__init__.py
@@ -500,13 +500,13 @@ 
                      "diff --hidden --rev 'limit(precursors(.),1)' --rev .",
                      'evolve')
 
-### Troubled revset symbol
+### Unstable revset symbol
 
-@eh.revsetpredicate('troubled()')
-def revsettroubled(repo, subset, x):
-    """Changesets with troubles.
+@eh.revsetpredicate('unstable()')
+def revsetunstable(repo, subset, x):
+    """Changesets with instabilities.
     """
-    revset.getargs(x, 0, 0, 'troubled takes no arguments')
+    revset.getargs(x, 0, 0, 'unstable takes no arguments')
     troubled = set()
     troubled.update(getrevs(repo, 'orphan'))
     troubled.update(getrevs(repo, 'phasedivergent'))
@@ -515,6 +515,10 @@ 
     troubled.sort() # set is non-ordered, enforce order
     return subset & troubled
 
+@eh.revsetpredicate('troubled()')    # legacy name
+def revsettroubled(repo, subset, x):
+    return revsetunstable(repo, subset, x)
+
 ### Obsolescence graph
 
 # XXX SOME MAJOR CLEAN UP TO DO HERE XXX
diff --git a/hgext3rd/evolve/evolvecmd.py b/hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/evolvecmd.py
+++ b/hgext3rd/evolve/evolvecmd.py
@@ -1197,7 +1197,7 @@ 
         "orphan": repo.revs("orphan()"),
         "contentdivergent": repo.revs("contentdivergent()"),
         "phasedivergent": repo.revs("phasedivergent()"),
-        "all": repo.revs("troubled()"),
+        "all": repo.revs("unstable()"),
     }
 
     hintmap = {