hgext3rd/topic/stack.py
changeset 4651 55c347b4874f
parent 4650 7c05b1625921
child 4652 b72cd597a887
--- a/hgext3rd/topic/stack.py	Sun May 05 17:39:46 2019 +0800
+++ b/hgext3rd/topic/stack.py	Wed May 08 15:57:54 2019 +0800
@@ -77,6 +77,11 @@
     def __getitem__(self, index):
         return self.revs[index]
 
+    def __nonzero__(self):
+        return bool(self._revs)
+
+    __bool__ = __nonzero__
+
     def index(self, item):
         return self.revs.index(item)