# HG changeset patch # User Siddharth Agarwal # Date 2015-11-21 00:18:51 # Node ID ca3fbf9dad8c4bcbd1838501efa5cf5e8ac6174a # Parent 09139ccf3085e5a5acf9bb2cd70f66668fe93703 mergestate: add a function to return the number of unresolved files Note that unlike the other functions, this is based on the persistent mergestate. diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -504,6 +504,11 @@ class mergestate(object): 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