# HG changeset patch # User Jun Wu # Date 1490572645 25200 # Node ID 4dbef666c6c972cf9ceb2bf6c50d9935417680df # Parent e960eba3581c9f29a9bc500ff2cb2028ffe5500a bundle2: use ProgrammingError diff -r e960eba3581c -r 4dbef666c6c9 mercurial/bundle2.py --- a/mercurial/bundle2.py Sun Mar 26 16:55:56 2017 -0700 +++ b/mercurial/bundle2.py Sun Mar 26 16:57:25 2017 -0700 @@ -855,7 +855,7 @@ self._seenparams = set() 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: # - None: not started, @@ -913,7 +913,7 @@ # methods used to generates the bundle2 stream 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 if ui.debugflag: @@ -1082,7 +1082,7 @@ @property def repo(self): - raise RuntimeError('no repo access from stream interruption') + raise error.ProgrammingError('no repo access from stream interruption') def gettransaction(self): raise TransactionUnavailable('no repo access from stream interruption')