mergestate: implement unresolvedcount() in terms of unresolved()
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 01 Dec 2015 09:26:33 -0800
changeset 33311 f8f716da90fa
parent 33310 b4d517d736a1
child 33312 b5612dbe72a3
mergestate: implement unresolvedcount() in terms of unresolved() This simplifies the method slightly. It does create a full list of paths while doing so, but it's not a lot of data anyway (besides, I would think references to strings are no larger than (references to?) True).
mercurial/merge.py
--- a/mercurial/merge.py	Tue Dec 01 09:26:10 2015 -0800
+++ b/mercurial/merge.py	Tue Dec 01 09:26:33 2015 -0800
@@ -567,8 +567,7 @@
 
     def unresolvedcount(self):
         """get unresolved count for this merge (persistent)"""
-        return len([True for f, entry in self._state.iteritems()
-                    if entry[0] == 'u'])
+        return len(list(self.unresolved()))
 
     def actions(self):
         """return lists of actions to perform on the dirstate"""