Patchwork [3,of,5] bundle2: use ProgrammingError

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

Comments

Jun Wu - March 27, 2017, 12:14 a.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1490572645 25200
#      Sun Mar 26 16:57:25 2017 -0700
# Node ID 79b332a45f07401b16e0b8cdb861655057773ff7
# Parent  14659f3ffd6070d6e153f633e18fef9e8df29485
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 79b332a45f07
bundle2: use ProgrammingError

Patch

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -856,5 +856,5 @@  class bundlepart(object):
         for pname, __ in self._mandatoryparams + self._advisoryparams:
             if pname in self._seenparams:
-                raise RuntimeError('duplicated params: %s' % pname)
+                raise error.ProgrammingError('duplicated params: %s' % pname)
             self._seenparams.add(pname)
         # status of the part's generation:
@@ -914,5 +914,5 @@  class bundlepart(object):
     def getchunks(self, ui):
         if self._generated is not None:
-            raise RuntimeError('part can only be consumed once')
+            raise error.ProgrammingError('part can only be consumed once')
         self._generated = False
 
@@ -1083,5 +1083,5 @@  class interruptoperation(object):
     @property
     def repo(self):
-        raise RuntimeError('no repo access from stream interruption')
+        raise error.ProgrammingError('no repo access from stream interruption')
 
     def gettransaction(self):