changeset 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 324ad3e7ef41
children 64de86fd0984
files mercurial/statichttprepo.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/statichttprepo.py	Tue Sep 08 18:46:01 2020 +0530
+++ b/mercurial/statichttprepo.py	Thu Sep 10 13:37:35 2020 +0530
@@ -238,7 +238,12 @@
         )
 
     def lock(self, wait=True):
-        raise error.Abort(_(b'cannot lock static-http repository'))
+        raise error.LockUnavailable(
+            0,
+            _(b'lock not available'),
+            b'lock',
+            _(b'cannot lock static-http repository'),
+        )
 
     def _writecaches(self):
         pass  # statichttprepository are read only