merge.mergestate: set merge driver state to 's' if there's none present
authorSiddharth Agarwal <sid0@fb.com>
Thu, 15 Oct 2015 01:06:29 -0700
changeset 26769 5b00ec4c05cb
parent 26768 ac68769a5985
child 26770 3d1978cc949e
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.
mercurial/merge.py
--- a/mercurial/merge.py	Thu Oct 15 01:04:46 2015 -0700
+++ b/mercurial/merge.py	Thu Oct 15 01:06:29 2015 -0700
@@ -89,8 +89,11 @@
         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 @@
         self._state = {}
         self._local = None
         self._other = None
-        self._mdstate = 'u'
         if 'otherctx' in vars(self):
             del self.otherctx
         self._readmergedriver = None
+        self._mdstate = 's'
         records = self._readrecords()
         for rtype, record in records:
             if rtype == 'L':