dirstate: implement __len__ on dirstatemap (issue5695)
authorSimon Whitaker <swhitaker@fb.com>
Sun, 01 Oct 2017 16:46:02 +0100
changeset 34408 7d2f71b7bc31
parent 34407 b6692ba7d5b0
child 34409 7de145167ae7
dirstate: implement __len__ on dirstatemap (issue5695) Differential Revision: https://phab.mercurial-scm.org/D884
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Sun Oct 01 12:54:35 2017 +0100
+++ b/mercurial/dirstate.py	Sun Oct 01 16:46:02 2017 +0100
@@ -1300,6 +1300,9 @@
     def iteritems(self):
         return self._map.iteritems()
 
+    def __len__(self):
+        return len(self._map)
+
     def __iter__(self):
         return iter(self._map)