##// END OF EJS Templates
git: fix for unicode branches
milka -
r4659:8a9c9ffb default
parent child Browse files
Show More
@@ -34,7 +34,7 b' from rhodecode.lib.auth import ('
34 34 from rhodecode.lib.ext_json import json
35 35 from rhodecode.lib.graphmod import _colored, _dagwalker
36 36 from rhodecode.lib.helpers import RepoPage
37 from rhodecode.lib.utils2 import safe_int, safe_str, str2bool
37 from rhodecode.lib.utils2 import safe_int, safe_str, str2bool, safe_unicode
38 38 from rhodecode.lib.vcs.exceptions import (
39 39 RepositoryError, CommitDoesNotExistError,
40 40 CommitError, NodeDoesNotExistError, EmptyRepositoryError)
@@ -110,7 +110,7 b' class RepoChangelogView(RepoAppView):'
110 110
111 111 def _check_if_valid_branch(self, branch_name, repo_name, f_path):
112 112 if branch_name not in self.rhodecode_vcs_repo.branches_all:
113 h.flash('Branch {} is not found.'.format(h.escape(branch_name)),
113 h.flash(u'Branch {} is not found.'.format(h.escape(safe_unicode(branch_name))),
114 114 category='warning')
115 115 redirect_url = h.route_path(
116 116 'repo_commits_file', repo_name=repo_name,
@@ -98,7 +98,7 b' class GitCommit(base.BaseCommit):'
98 98 elif attr == "parents":
99 99 value = self._make_commits(value)
100 100 elif attr == "branch":
101 value = value[0] if value else None
101 value = self._set_branch(value)
102 102 self.__dict__[attr] = value
103 103
104 104 @LazyProperty
@@ -156,13 +156,15 b' class GitCommit(base.BaseCommit):'
156 156 branches.append(name)
157 157 return branches
158 158
159 def _set_branch(self, branches):
160 if branches:
161 # actually commit can have multiple branches in git
162 return safe_unicode(branches[0])
163
159 164 @LazyProperty
160 165 def branch(self):
161 166 branches = self._remote.branch(self.raw_id)
162
163 if branches:
164 # actually commit can have multiple branches in git
165 return safe_unicode(branches[0])
167 return self._set_branch(branches)
166 168
167 169 def _get_tree_id_for_path(self, path):
168 170 path = safe_str(path)
General Comments 0
You need to be logged in to leave comments. Login now