# HG changeset patch # User Siddharth Agarwal # Date 2015-11-30 18:05:09 # Node ID 1bf1a7c3df430227f6aec068d28fb6f59abdf1c6 # Parent efceacd6a0c6558f35c68bfc90361669e583f8db mergestate: raise exception if otherctx is accessed but _other isn't set We don't want to inadvertently return the workingctx (self._repo[None]). diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -288,6 +288,8 @@ class mergestate(object): @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):