merge.mergestate: add a way to get the other side of the merge
It's surprising there was no API at all for this until now. In any case this
will be needed from custom merge drivers.
--- a/mercurial/merge.py Thu Oct 15 00:45:20 2015 -0700
+++ b/mercurial/merge.py Thu Oct 15 00:49:07 2015 -0700
@@ -84,6 +84,8 @@
self._state = {}
self._local = None
self._other = None
+ if 'otherctx' in vars(self):
+ del self.otherctx
if node:
self._local = node
self._other = other
@@ -101,6 +103,8 @@
self._local = None
self._other = None
self._mdstate = 'u'
+ if 'otherctx' in vars(self):
+ del self.otherctx
records = self._readrecords()
for rtype, record in records:
if rtype == 'L':
@@ -233,6 +237,9 @@
@util.propertycache
def mergedriver(self):
return self._repo.ui.config('experimental', 'mergedriver')
+ @util.propertycache
+ def otherctx(self):
+ return self._repo[self._other]
def active(self):
"""Whether mergestate is active.