Commits

Marcin Kuzminski committed 37945c6

don't use db-repo instance on readme file fetching, use regular scm get_repo that doesn't hide exceptions

  • Participants
  • Parent commits 986430c

Comments (0)

Files changed (1)

File rhodecode/controllers/summary.py

         if c.enable_downloads:
             c.download_options = self._get_download_links(c.rhodecode_repo)
 
-        c.readme_data, c.readme_file = self.__get_readme_data(c.rhodecode_db_repo)
+        c.readme_data, c.readme_file = self.__get_readme_data(
+            c.rhodecode_db_repo.repo_name, c.rhodecode_repo
+        )
         return render('summary/summary.html')
 
-    def __get_readme_data(self, repo):
+    def __get_readme_data(self, repo_name, repo):
 
         @cache_region('long_term')
         def _get_readme_from_cache(key):
             readme_file = None
             log.debug('Fetching readme file')
             try:
-                cs = repo.get_changeset() # fetches TIP
+                cs = repo.get_changeset()  # fetches TIP
                 renderer = MarkupRenderer()
                 for f in README_FILES:
+                    print f
                     try:
                         readme = cs.get_node(f)
                         readme_file = f
                     except NodeDoesNotExistError:
                         continue
             except ChangesetError:
+                log.error(traceback.format_exc())
                 pass
             except EmptyRepositoryError:
                 pass
 
             return readme_data, readme_file
 
-        key = repo.repo_name + '_README'
+        key = repo_name + '_README'
         inv = CacheInvalidation.invalidate(key)
         if inv is not None:
             region_invalidate(_get_readme_from_cache, None, key)