Patchwork D884: dirstate: implement __len__ on dirstatemap (issue5695)

login
register
mail settings
Submitter phabricator
Date Oct. 1, 2017, 4:15 p.m.
Message ID <7736bbe084f366a87d3bd80317e9528c@localhost.localdomain>
Download mbox | patch
Permalink /patch/24357/
State Not Applicable
Headers show

Comments

phabricator - Oct. 1, 2017, 4:15 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG7d2f71b7bc31: dirstate: implement __len__ on dirstatemap (issue5695) (authored by swhitaker, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D884?vs=2295&id=2296

REVISION DETAIL
  https://phab.mercurial-scm.org/D884

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS




To: swhitaker, #hg-reviewers, durham, indygreg
Cc: mercurial-devel

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -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)