diff mercurial/merge.py @ 21266:19d6fec60b81

resolve: print message when no unresolved files remain (issue4214) When using resolve, users often have to consult with the output of |hg resolve -l| to see if any unresolved files remain. This step is tedious and adds overhead to resolving. This patch will notify a user if there are no unresolved files remaining after executing |hg resolve|:: no unresolved files; you may continue your unfinished operation The patch stops short of telling the user exactly what command should be executed to continue the unfinished operation. That is because this information is not currently captured anywhere. This would make a compelling follow-up feature.
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 18 Apr 2014 22:19:25 -0700
parents 4e932dc5c113
children a0b8a912ec81
line wrap: on
line diff
--- a/mercurial/merge.py	Fri Apr 18 18:56:26 2014 -0700
+++ b/mercurial/merge.py	Fri Apr 18 22:19:25 2014 -0700
@@ -260,6 +260,13 @@
         self._state[dfile][0] = state
         self._dirty = True
 
+    def unresolved(self):
+        """Obtain the paths of unresolved files."""
+
+        for f, entry in self._state.items():
+            if entry[0] == 'u':
+                yield f
+
     def resolve(self, dfile, wctx):
         """rerun merge process for file path `dfile`"""
         if self[dfile] == 'r':