comparison mercurial/statichttprepo.py @ 45434:5523e3e1bc71

statichttprepo: use LockUnavailable() instead of Abort() for lock (API) If we try to get a lock on statichttprepo, we get `error.Abort()` instead of subclass of `error.LockError()`. The callers which catches `error.LockError` fails to catch this case as the correct error is not raised. Raising `error.LockUnavaible()` is same as what is done for wlock also.
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 10 Sep 2020 13:37:35 +0530
parents 9f70512ae2cf
children 5135b393884b
comparison
equal deleted inserted replaced
45433:324ad3e7ef41 45434:5523e3e1bc71
236 b'lock', 236 b'lock',
237 _(b'cannot lock static-http repository'), 237 _(b'cannot lock static-http repository'),
238 ) 238 )
239 239
240 def lock(self, wait=True): 240 def lock(self, wait=True):
241 raise error.Abort(_(b'cannot lock static-http repository')) 241 raise error.LockUnavailable(
242 0,
243 _(b'lock not available'),
244 b'lock',
245 _(b'cannot lock static-http repository'),
246 )
242 247
243 def _writecaches(self): 248 def _writecaches(self):
244 pass # statichttprepository are read only 249 pass # statichttprepository are read only
245 250
246 251