# HG changeset patch # User Marcin Kuzminski # Date 2017-04-04 18:08:51 # Node ID 31d11ad7261e75f59600d26bb2bbb945cc905c96 # Parent da8c8187ca530f78e93d663e36aeae7a0d2676b8 files: fixed editing of files for branches with `/` in the name. - currently we're not supporting such names, so we need to use the reference commit_id. diff --git a/rhodecode/controllers/files.py b/rhodecode/controllers/files.py --- a/rhodecode/controllers/files.py +++ b/rhodecode/controllers/files.py @@ -241,7 +241,11 @@ class FilesController(BaseRepoController c.on_branch_head = self._is_valid_head( commit_id, c.rhodecode_repo) - c.branch_or_raw_id = c.commit.branch or c.commit.raw_id + + branch = c.commit.branch if ( + c.commit.branch and '/' not in c.commit.branch) else None + c.branch_or_raw_id = branch or c.commit.raw_id + c.branch_name = c.commit.branch or h.short_id(c.commit.raw_id) author = c.file_last_commit.author c.authors = [(h.email(author), diff --git a/rhodecode/templates/files/files_source.mako b/rhodecode/templates/files/files_source.mako --- a/rhodecode/templates/files/files_source.mako +++ b/rhodecode/templates/files/files_source.mako @@ -40,7 +40,7 @@ | %if c.on_branch_head and c.branch_or_raw_id and not c.file.is_binary: - ${_('Edit on Branch:%s') % c.branch_or_raw_id} + ${_('Edit on Branch:%s') % c.branch_name} | ${_('Delete')}