changeset 20585:f3c8db3d6d66

obsstore: add a __len__ method We can already use "for mark in store:" it make sense to allow "len(store)" too.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 25 Feb 2014 10:32:54 -0800
parents 224a058f7cd1
children 2d52f37937b0
files mercurial/obsolete.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/obsolete.py	Tue Feb 25 10:21:54 2014 -0800
+++ b/mercurial/obsolete.py	Tue Feb 25 10:32:54 2014 -0800
@@ -247,6 +247,9 @@
     def __iter__(self):
         return iter(self._all)
 
+    def __len__(self):
+        return len(self._all)
+
     def __nonzero__(self):
         return bool(self._all)