diff rhodecode/lib/hooks.py @ 3278:c2bf0fa7b3cb beta

git hook handler shouldn't ever use cache instances - moved cache invalidation into finally block so we invalidate at latest possible stage - added scm_instance_no_cache property to get non cached scm instances always
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 31 Jan 2013 01:51:42 +0100
parents db1b7125cdaf
children 796738bb697c
line wrap: on
line diff
--- a/rhodecode/lib/hooks.py	Thu Jan 31 01:37:38 2013 +0100
+++ b/rhodecode/lib/hooks.py	Thu Jan 31 01:51:42 2013 +0100
@@ -382,7 +382,12 @@
 
     for k, v in extras.items():
         baseui.setconfig('rhodecode_extras', k, v)
-    repo = repo.scm_instance
+    if hook_type == 'pre':
+        repo = repo.scm_instance
+    else:
+        #post push shouldn't use the cached instance never
+        repo = repo.scm_instance_no_cache
+
     repo.ui = baseui
 
     if hook_type == 'pre':