changeset 5986:b99e00fb6dd4

lock: simplify debug logging - use the actual response code
author Mads Kiilerich <madski@unity3d.com>
date Sat, 25 Jun 2016 02:57:44 +0200
parents 05c67c3ef222
children ada7b0495b9f
files kallithea/lib/hooks.py kallithea/lib/middleware/simplegit.py kallithea/lib/middleware/simplehg.py
diffstat 3 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/hooks.py	Fri Jun 17 20:23:09 2016 +0200
+++ b/kallithea/lib/hooks.py	Sat Jun 25 02:57:44 2016 +0200
@@ -105,8 +105,7 @@
 
 
 def pre_pull(ui, repo, **kwargs):
-    # pre push function, currently used to ban pushing when
-    # repository is locked
+    # pre pull function ...
     ex = _extract_extras()
     if ex.locked_by[0]:
         locked_by = User.get(ex.locked_by[0]).username
--- a/kallithea/lib/middleware/simplegit.py	Fri Jun 17 20:23:09 2016 +0200
+++ b/kallithea/lib/middleware/simplegit.py	Sat Jun 25 02:57:44 2016 +0200
@@ -210,8 +210,7 @@
                     lambda: self._invalidate_cache(repo_name))
             return result
         except HTTPLockedRC as e:
-            _code = CONFIG.get('lock_ret_code')
-            log.debug('Repository LOCKED ret code %s!', _code)
+            log.debug('Locked, response %s: %s', e.code, e.title)
             return e(environ, start_response)
         except Exception:
             log.error(traceback.format_exc())
--- a/kallithea/lib/middleware/simplehg.py	Fri Jun 17 20:23:09 2016 +0200
+++ b/kallithea/lib/middleware/simplehg.py	Sat Jun 25 02:57:44 2016 +0200
@@ -217,8 +217,7 @@
             if str(e).find('not found') != -1:
                 return HTTPNotFound()(environ, start_response)
         except HTTPLockedRC as e:
-            _code = CONFIG.get('lock_ret_code')
-            log.debug('Repository LOCKED ret code %s!', _code)
+            log.debug('Locked, response %s: %s', e.code, e.title)
             return e(environ, start_response)
         except Exception:
             log.error(traceback.format_exc())