changeset 3360:85f69bf84d95 beta

non-lightweight dashboard mode is now more error proof when it stumbles across bad or damaged repositories
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 10 Feb 2013 21:05:53 +0100
parents c394a564ab71
children 14556b463177
files rhodecode/model/scm.py
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/model/scm.py	Sun Feb 10 20:35:35 2013 +0100
+++ b/rhodecode/model/scm.py	Sun Feb 10 21:05:53 2013 +0100
@@ -106,16 +106,17 @@
             )(dbr.repo_name, 'get repo check'):
                 continue
 
-            if scmr is None:
+            try:
+                last_change = scmr.last_change
+                tip = h.get_changeset_safe(scmr, 'tip')
+            except Exception:
                 log.error(
                     '%s this repository is present in database but it '
-                    'cannot be created as an scm instance' % dbr.repo_name
+                    'cannot be created as an scm instance, org_exc:%s'
+                    % (dbr.repo_name, traceback.format_exc())
                 )
                 continue
 
-            last_change = scmr.last_change
-            tip = h.get_changeset_safe(scmr, 'tip')
-
             tmp_d = {}
             tmp_d['name'] = dbr.repo_name
             tmp_d['name_sort'] = tmp_d['name'].lower()