# HG changeset patch # User Marcin Kuzminski # Date 1301186077 -3600 # Node ID f128465845c0caebe8df619d40bd4b372b01ae6c # Parent b3f48216e55eca598ad026b1fbd4f0dafcfb3568# Parent 014c9a58a0d9e28c830542c0570584cbf48e870e merge with unicode fixes diff -r b3f48216e55e -r f128465845c0 rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py Sun Mar 27 01:34:14 2011 +0100 +++ b/rhodecode/lib/helpers.py Sun Mar 27 01:34:37 2011 +0100 @@ -36,7 +36,7 @@ from vcs.utils.annotate import annotate_highlight from rhodecode.lib.utils import repo_name_slug -from rhodecode.lib import str2bool +from rhodecode.lib import str2bool, safe_unicode def _reset(name, value=None, id=NotGiven, type="reset", **attrs): """ @@ -192,7 +192,7 @@ def __call__(self, repo_name, rev, paths): if isinstance(paths, str): - paths = paths.decode('utf-8', 'replace') + paths = safe_unicode(paths) url_l = [link_to(repo_name, url('files_home', repo_name=repo_name, revision=rev, f_path=''))] @@ -680,7 +680,7 @@ suf = '' if len(nodes) > 30: suf = '
' + _(' and %s more') % (len(nodes) - 30) - return literal(pref + '
'.join([x.path.decode('utf-8', 'replace') for x in nodes[:30]]) + suf) + return literal(pref + '
'.join([safe_unicode(x.path) for x in nodes[:30]]) + suf) else: return ': ' + _('No Files') diff -r b3f48216e55e -r f128465845c0 rhodecode/templates/changeset/changeset.html --- a/rhodecode/templates/changeset/changeset.html Sun Mar 27 01:34:14 2011 +0100 +++ b/rhodecode/templates/changeset/changeset.html Sun Mar 27 01:34:37 2011 +0100 @@ -89,7 +89,7 @@ ${_('Files affected (%s)' % len(c.changeset.affected_files))}
%for change,filenode,diff,cs1,cs2 in c.changes: -
${h.link_to(filenode.path.decode('utf-8','replace'),h.url.current(anchor=h.repo_name_slug('C%s' % filenode.path.decode('utf-8','replace'))))}
+
${h.link_to(h.safe_unicode(filenode.path),h.url.current(anchor=h.repo_name_slug('C%s' % h.safe_unicode(filenode.path))))}
%endfor % if c.cut_off: ${_('Changeset was to big and was cut off...')} @@ -103,19 +103,19 @@ %if change !='removed':
-
+
- ${h.link_to_if(change!='removed',filenode.path.decode('utf-8','replace'),h.url('files_home',repo_name=c.repo_name, - revision=filenode.changeset.raw_id,f_path=filenode.path.decode('utf-8','replace')))} + ${h.link_to_if(change!='removed',h.safe_unicode(filenode.path),h.url('files_home',repo_name=c.repo_name, + revision=filenode.changeset.raw_id,f_path=h.safe_unicode(filenode.path)))} %if 1: » ${h.link_to(_('diff'), - h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path.decode('utf-8','replace'),diff2=cs2,diff1=cs1,diff='diff'))} + h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='diff'))} » ${h.link_to(_('raw diff'), - h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path.decode('utf-8','replace'),diff2=cs2,diff1=cs1,diff='raw'))} + h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='raw'))} » ${h.link_to(_('download diff'), - h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path.decode('utf-8','replace'),diff2=cs2,diff1=cs1,diff='download'))} + h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='download'))} %endif
diff -r b3f48216e55e -r f128465845c0 rhodecode/templates/changeset/changeset_range.html --- a/rhodecode/templates/changeset/changeset_range.html Sun Mar 27 01:34:14 2011 +0100 +++ b/rhodecode/templates/changeset/changeset_range.html Sun Mar 27 01:34:37 2011 +0100 @@ -54,7 +54,7 @@ %for cs in c.cs_ranges:
r${cs}
%for change,filenode,diff,cs1,cs2 in c.changes[cs.raw_id]: -
${h.link_to(filenode.path.decode('utf-8','replace'),h.url.current(anchor=h.repo_name_slug('C%s-%s' % (cs.short_id,filenode.path.decode('utf-8','replace')))))}
+
${h.link_to(h.safe_unicode(filenode.path),h.url.current(anchor=h.repo_name_slug('C%s-%s' % (cs.short_id,h.safe_unicode(filenode.path)))))}
%endfor %endfor
@@ -66,19 +66,19 @@ %if change !='removed':
-
+
- ${h.link_to_if(change!='removed',filenode.path.decode('utf-8','replace'),h.url('files_home',repo_name=c.repo_name, - revision=filenode.changeset.raw_id,f_path=filenode.path.decode('utf-8','replace')))} + ${h.link_to_if(change!='removed',h.safe_unicode(filenode.path,h.url('files_home',repo_name=c.repo_name, + revision=filenode.changeset.raw_id,f_path=h.safe_unicode(filenode.path)))} %if 1: » ${h.link_to(_('diff'), - h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path.decode('utf-8','replace'),diff2=cs2,diff1=cs1,diff='diff'))} + h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='diff'))} » ${h.link_to(_('raw diff'), - h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path.decode('utf-8','replace'),diff2=cs2,diff1=cs1,diff='raw'))} + h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='raw'))} » ${h.link_to(_('download diff'), - h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path.decode('utf-8','replace'),diff2=cs2,diff1=cs1,diff='download'))} + h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='download'))} %endif
diff -r b3f48216e55e -r f128465845c0 rhodecode/templates/files/files_browser.html --- a/rhodecode/templates/files/files_browser.html Sun Mar 27 01:34:14 2011 +0100 +++ b/rhodecode/templates/files/files_browser.html Sun Mar 27 01:34:37 2011 +0100 @@ -66,7 +66,7 @@ %for cnt,node in enumerate(c.files_list): - ${h.link_to(node.name,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=node.path.decode('utf-8','replace')),class_=file_class(node))} + ${h.link_to(node.name,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=h.safe_unicode(node.path)),class_=file_class(node))} %if node.is_file():