Patchwork [6,of,7,mergedriver] merge.mergestate: set merge driver state to 's' if there's none present

login
register
mail settings
Submitter Siddharth Agarwal
Date Oct. 17, 2015, 2:35 a.m.
Message ID <ab0392a6462acbd3084b.1445049319@dev6666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11157/
State Accepted
Headers show

Comments

Siddharth Agarwal - Oct. 17, 2015, 2:35 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1444896389 25200
#      Thu Oct 15 01:06:29 2015 -0700
# Node ID ab0392a6462acbd3084b9493e12b0701b02fe0ce
# Parent  65947f1e70b2940ea58dd37915fb30fb6d3aa138
merge.mergestate: set merge driver state to 's' if there's none present

This allows mergestate.mdstate() to return 's' if there's nothing to be done on
the merge driver end.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -89,8 +89,11 @@  class mergestate(object):
         if node:
             self._local = node
             self._other = other
-        self._mdstate = 'u'
         self._readmergedriver = None
+        if self.mergedriver:
+            self._mdstate = 's'
+        else:
+            self._mdstate = 'u'
         shutil.rmtree(self._repo.join('merge'), True)
         self._dirty = False
 
@@ -103,10 +106,10 @@  class mergestate(object):
         self._state = {}
         self._local = None
         self._other = None
-        self._mdstate = 'u'
         if 'otherctx' in vars(self):
             del self.__dict__['otherctx']
         self._readmergedriver = None
+        self._mdstate = 's'
         records = self._readrecords()
         for rtype, record in records:
             if rtype == 'L':