diff hglib/context.py @ 124:cc7569bffb26

context: add 'hidden' method to check if the changeset is hidden This method should not be a static property obtained at creation as the hidden status may change.
author Paul Tonelli <paul.tonelli@logilab.fr>
date Thu, 15 May 2014 15:12:13 +0200
parents c635e6e7054f
children a7fe976b1931
line wrap: on
line diff
--- a/hglib/context.py	Thu May 22 15:23:12 2014 +0200
+++ b/hglib/context.py	Thu May 15 15:12:13 2014 +0200
@@ -194,6 +194,11 @@
     def bookmarks(self):
         return self._bookmarks
 
+    def hidden(self):
+        """return True if the changeset is hidden, else False"""
+        return bool(self._repo.log(revrange='%s and hidden()' % self._node,
+                                   hidden=True))
+
     def children(self):
         """return contexts for each child changeset"""
         for c in self._repo.log('children(%s)' % self._node):