aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Kuzminski <marcin@python-works.com>2013-04-26 14:14:46 +0200
committerMarcin Kuzminski <marcin@python-works.com>2013-04-26 14:14:46 +0200
commit44ee258f00ab80ccaa988ac2f26c006c48c720c4 (patch)
tree3129d887cd295f6576c3261ebb5fed1d5a22a4fc
parenta485694cc313d657c5b926f2bf365367a909265b (diff)
downloadrhodecode-44ee258f00ab80ccaa988ac2f26c006c48c720c4.tar.gz
fixed some unicode problems with git file path
--HG-- extra : source : 63adb3d5233a3d56d5b918ed7a118f1115cba5cb
-rw-r--r--rhodecode/lib/vcs/backends/git/changeset.py11
-rw-r--r--rhodecode/templates/files/files.html2
2 files changed, 8 insertions, 5 deletions
diff --git a/rhodecode/lib/vcs/backends/git/changeset.py b/rhodecode/lib/vcs/backends/git/changeset.py
index 24fa2356..cc9d3d04 100644
--- a/rhodecode/lib/vcs/backends/git/changeset.py
+++ b/rhodecode/lib/vcs/backends/git/changeset.py
@@ -17,7 +17,7 @@ from rhodecode.lib.vcs.nodes import FileNode, DirNode, NodeKind, RootNode, \
from rhodecode.lib.vcs.utils import safe_unicode
from rhodecode.lib.vcs.utils import date_fromtimestamp
from rhodecode.lib.vcs.utils.lazy import LazyProperty
-from rhodecode.lib.utils2 import safe_int
+from rhodecode.lib.utils2 import safe_int, safe_str
class GitChangeset(BaseChangeset):
@@ -289,15 +289,18 @@ class GitChangeset(BaseChangeset):
which is generally not good. Should be replaced with algorithm
iterating commits.
"""
-
self._get_filectx(path)
+ cs_id = safe_str(self.id)
+ f_path = safe_str(path)
+
if limit:
cmd = 'log -n %s --pretty="format: %%H" -s -p %s -- "%s"' % (
- safe_int(limit, 0), self.id, path
+ safe_int(limit, 0), cs_id, f_path
)
+
else:
cmd = 'log --pretty="format: %%H" -s -p %s -- "%s"' % (
- self.id, path
+ cs_id, f_path
)
so, se = self.repository.run_git_command(cmd)
ids = re.findall(r'[0-9a-fA-F]{40}', so)
diff --git a/rhodecode/templates/files/files.html b/rhodecode/templates/files/files.html
index 16ae191c..409af8e2 100644
--- a/rhodecode/templates/files/files.html
+++ b/rhodecode/templates/files/files.html
@@ -3,7 +3,7 @@
<%def name="title(*args)">
${_('%s Files') % c.repo_name}
%if hasattr(c,'file'):
- &middot; ${c.file.path or '\\'}
+ &middot; ${h.safe_unicode(c.file.path) or '\\'}
%endif
&middot; ${c.rhodecode_name}
</%def>