hovercards: handle empty repository
marcink -
r4132:ca85e1b2 default
Not Reviewed
Show More
Add another comment
TODOs: 0 unresolved 0 Resolved
COMMENTS: 0 General 0 Inline
@@ -34,7 +34,7
34 from rhodecode.lib.index import searcher_from_config
34 from rhodecode.lib.index import searcher_from_config
35 from rhodecode.lib.utils2 import safe_unicode, str2bool, safe_int
35 from rhodecode.lib.utils2 import safe_unicode, str2bool, safe_int
36 from rhodecode.lib.ext_json import json
36 from rhodecode.lib.ext_json import json
37 from rhodecode.lib.vcs.exceptions import CommitDoesNotExistError
37 from rhodecode.lib.vcs.exceptions import CommitDoesNotExistError, EmptyRepositoryError
38 from rhodecode.lib.vcs.nodes import FileNode
38 from rhodecode.lib.vcs.nodes import FileNode
39 from rhodecode.model.db import (
39 from rhodecode.model.db import (
40 func, true, or_, case, in_filter_generator, Repository, RepoGroup, User, UserGroup, PullRequest)
40 func, true, or_, case, in_filter_generator, Repository, RepoGroup, User, UserGroup, PullRequest)
@@ -102,8 +102,9
102 commit_id = self.request.matchdict['commit_id']
102 commit_id = self.request.matchdict['commit_id']
103 pre_load = ['author', 'branch', 'date', 'message']
103 pre_load = ['author', 'branch', 'date', 'message']
104 try:
104 try:
105 c.commit = self.rhodecode_vcs_repo.get_commit(commit_id=commit_id, pre_load=pre_load)
105 c.commit = self.rhodecode_vcs_repo.get_commit(
106 except CommitDoesNotExistError:
106 commit_id=commit_id, pre_load=pre_load)
107 except (CommitDoesNotExistError, EmptyRepositoryError):
107 raise HTTPNotFound()
108 raise HTTPNotFound()
108
109
109 return self._get_template_context(c)
110 return self._get_template_context(c)
Comments 0
You need to be logged in to leave comments. Login now