changeset 3424:440fab755fa9 beta

switch to branch: handle slashes in branch names In git, having slashes in branch names are not uncommon. We cannot use a branch name with slashes in the url, so in that case, we use the changeset id instead like we already do for tags and bookmarks. Fixes #654
author Dennis Brakhane <brakhane@googlemail.com>
date Sat, 02 Mar 2013 14:17:52 +0100
parents 043d3827cd88
children 46e10b3de4e3
files rhodecode/templates/switch_to_list.html
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/templates/switch_to_list.html	Sat Mar 02 16:27:56 2013 +0100
+++ b/rhodecode/templates/switch_to_list.html	Sat Mar 02 14:17:52 2013 +0100
@@ -4,7 +4,7 @@
     <ul>
     %if c.rhodecode_repo.branches.values():
         %for cnt,branch in enumerate(c.rhodecode_repo.branches.items()):
-            <li><div><pre>${h.link_to('%s - %s' % (branch[0],h.short_id(branch[1])),h.url('files_home',repo_name=c.repo_name,revision=branch[0]))}</pre></div></li>
+            <li><div><pre>${h.link_to('%s - %s' % (branch[0],h.short_id(branch[1])),h.url('files_home',repo_name=c.repo_name,revision=(branch[0] if '/' not in branch[0] else branch[1])))}</pre></div></li>
         %endfor
     %else:
         <li>${h.link_to(_('There are no branches yet'),'#')}</li>