changeset 33311:f8f716da90fa

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).
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 01 Dec 2015 09:26:33 -0800
parents b4d517d736a1
children b5612dbe72a3
files mercurial/merge.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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"""