comparison mercurial/bundle2.py @ 33809:1bf5c5507614

bundle2: raise ProgrammingError for invalid call of addhookargs() It should be hard error. Also fixed the error message as s/hooks/hookargs/.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 13 Aug 2017 11:05:56 +0900
parents 119e1c6be1ce
children b3a41f4d837b
comparison
equal deleted inserted replaced
33808:055fee3547df 33809:1bf5c5507614
316 316
317 return transaction 317 return transaction
318 318
319 def addhookargs(self, hookargs): 319 def addhookargs(self, hookargs):
320 if self.hookargs is None: 320 if self.hookargs is None:
321 raise error.Abort( 321 raise error.ProgrammingError('attempted to add hookargs to '
322 _('attempted to add hooks to operation after transaction ' 322 'operation after transaction started')
323 'started'))
324 self.hookargs.update(hookargs) 323 self.hookargs.update(hookargs)
325 324
326 class TransactionUnavailable(RuntimeError): 325 class TransactionUnavailable(RuntimeError):
327 pass 326 pass
328 327