changeset 27129:1bf1a7c3df43

mergestate: raise exception if otherctx is accessed but _other isn't set We don't want to inadvertently return the workingctx (self._repo[None]).
author Siddharth Agarwal <sid0@fb.com>
date Mon, 30 Nov 2015 10:05:09 -0800
parents efceacd6a0c6
children 6f045b563fa5
files mercurial/merge.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Mon Nov 30 18:47:33 2015 +0000
+++ b/mercurial/merge.py	Mon Nov 30 10:05:09 2015 -0800
@@ -288,6 +288,8 @@
 
     @util.propertycache
     def otherctx(self):
+        if self._other is None:
+            raise RuntimeError("localctx accessed but self._local isn't set")
         return self._repo[self._other]
 
     def active(self):