Patchwork [2,of,5] merge: use ProgrammingError

login
register
mail settings
Submitter Jun Wu
Date March 27, 2017, 12:14 a.m.
Message ID <14659f3ffd6070d6e153.1490573691@localhost.localdomain>
Download mbox | patch
Permalink /patch/19715/
State Accepted
Headers show

Comments

Jun Wu - March 27, 2017, 12:14 a.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1490572556 25200
#      Sun Mar 26 16:55:56 2017 -0700
# Node ID 14659f3ffd6070d6e153f633e18fef9e8df29485
# Parent  92d7eff3f4c7e44e8aab62b486bda78a37b73b83
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 14659f3ffd60
merge: use ProgrammingError

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -316,5 +316,6 @@  class mergestate(object):
     def localctx(self):
         if self._local is None:
-            raise RuntimeError("localctx accessed but self._local isn't set")
+            msg = "localctx accessed but self._local isn't set"
+            raise error.ProgrammingError(msg)
         return self._repo[self._local]
 
@@ -322,5 +323,6 @@  class mergestate(object):
     def otherctx(self):
         if self._other is None:
-            raise RuntimeError("otherctx accessed but self._other isn't set")
+            msg = "otherctx accessed but self._other isn't set"
+            raise error.ProgrammingError(msg)
         return self._repo[self._other]