changeset 27079:a88a10a933b2

mergestate: add a method to compute actions to perform on dirstate We're going to use this to extend the action lists in merge.applyupdates. The somewhat funky return value is to make passing this dict directly into recordactions easier. We're going to exploit that in an upcoming patch.
author Siddharth Agarwal <sid0@fb.com>
date Fri, 20 Nov 2015 16:43:25 -0800
parents a421debae31d
children ae2d3782d818
files mercurial/merge.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Fri Nov 20 16:37:39 2015 -0800
+++ b/mercurial/merge.py	Fri Nov 20 16:43:25 2015 -0800
@@ -509,6 +509,14 @@
         return len([True for f, entry in self._state.iteritems()
                     if entry[0] == 'u'])
 
+    def actions(self):
+        """return lists of actions to perform on the dirstate"""
+        actions = {'r': [], 'a': [], 'g': []}
+        for f, (r, action) in self._results.iteritems():
+            if action is not None:
+                actions[action].append((f, None, "merge result"))
+        return actions
+
 def _checkunknownfile(repo, wctx, mctx, f, f2=None):
     if f2 is None:
         f2 = f