changeset 520:a426301ab306 stable

Conditionnaly add the `hidden` revset symbol Mercurial Core#default now have it (but 2.3 don't)
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Sun, 26 Aug 2012 12:04:16 +0200
parents 9825c7da5b54
children 46f1597bcfe6
files hgext/evolve.py
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/evolve.py	Sat Aug 25 14:43:34 2012 +0200
+++ b/hgext/evolve.py	Sun Aug 26 12:04:16 2012 +0200
@@ -787,15 +787,16 @@
 # this section add several useful revset symbol not yet in core.
 # they are subject to changes
 
-### hidden revset is not in core yet
 
-@eh.revset('hidden')
-def revsethidden(repo, subset, x):
-    """``hidden()``
-    Changeset is hidden.
-    """
-    args = revset.getargs(x, 0, 0, 'hidden takes no argument')
-    return [r for r in subset if r in repo.hiddenrevs]
+if 'hidden' not in revset.symbols:
+    # in 2.3+
+    @eh.revset('hidden')
+    def revsethidden(repo, subset, x):
+        """``hidden()``
+        Changeset is hidden.
+        """
+        args = revset.getargs(x, 0, 0, 'hidden takes no argument')
+        return [r for r in subset if r in repo.hiddenrevs]
 
 ### XXX I'm not sure this revset is useful
 @eh.revset('suspended')