changeset 26769:5b00ec4c05cb

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.
author Siddharth Agarwal <sid0@fb.com>
date Thu, 15 Oct 2015 01:06:29 -0700
parents ac68769a5985
children 3d1978cc949e
files mercurial/merge.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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':