Commits

Pierre-Yves David  committed a426301

Conditionnaly add the `hidden` revset symbol

Mercurial Core#default now have it (but 2.3 don't)

  • Participants
  • Parent commits 9825c7d
  • Branches stable

Comments (0)

Files changed (1)

File hgext/evolve.py

 # 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')