changeset 27077:ca3fbf9dad8c

mergestate: add a function to return the number of unresolved files Note that unlike the other functions, this is based on the persistent mergestate.
author Siddharth Agarwal <sid0@fb.com>
date Fri, 20 Nov 2015 16:18:51 -0800
parents 09139ccf3085
children a421debae31d
files mercurial/merge.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Fri Nov 20 16:17:54 2015 -0800
+++ b/mercurial/merge.py	Fri Nov 20 16:18:51 2015 -0800
@@ -504,6 +504,11 @@
                     merged += 1
         return updated, merged, removed
 
+    def unresolvedcount(self):
+        """get unresolved count for this merge (persistent)"""
+        return len([True for f, entry in self._state.iteritems()
+                    if entry[0] == 'u'])
+
 def _checkunknownfile(repo, wctx, mctx, f, f2=None):
     if f2 is None:
         f2 = f