Patchwork [1,of,7,mergedriver] mergestate._resolve: store return code and action for each file

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 21, 2015, 1:03 a.m.
Message ID <f8f5e2ddd13d49db6dfb.1448067836@dev666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11561/
State Accepted
Commit 78b0c88ab0dbaad6d3cbbaf5a6548c3d03ae1db3
Delegated to: Martin von Zweigbergk
Headers show

Comments

Siddharth Agarwal - Nov. 21, 2015, 1:03 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1448064502 28800
#      Fri Nov 20 16:08:22 2015 -0800
# Node ID f8f5e2ddd13d49db6dfbcc34a38f872189f04b89
# Parent  8b9c04fb4c7e6d6cb872c63f7289ea679296dd3e
# Available At http://42.netv6.net/sid0-wip/hg/
#              hg pull http://42.netv6.net/sid0-wip/hg/ -r f8f5e2ddd13d
mergestate._resolve: store return code and action for each file

We're going to need this to compute (a) updated/merged/unresolved counts, and
(b) actions to perform on the dirstate.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -114,6 +114,7 @@  class mergestate(object):
         else:
             self._mdstate = 'u'
         shutil.rmtree(self._repo.join('merge'), True)
+        self._results = {}
         self._dirty = False
 
     def _read(self):
@@ -150,6 +151,7 @@  class mergestate(object):
                 self._state[bits[0]] = bits[1:]
             elif not rtype.islower():
                 unsupported.add(rtype)
+        self._results = {}
         self._dirty = False
 
         if unsupported:
@@ -466,6 +468,7 @@  class mergestate(object):
                 elif fco.isabsent(): # cd: local picked
                     action = 'a'
                 # else: regular merges (no action necessary)
+            self._results[dfile] = r, action
 
         return complete, r, action