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.
This commit is contained in:
parent
bbcc92bb81
commit
af0b9fb58b
2 changed files with 6 additions and 2 deletions
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
|
|
||||
%if c.on_branch_head and c.branch_or_raw_id and not c.file.is_binary:
|
||||
<a href="${h.url('files_edit_home',repo_name=c.repo_name,revision=c.branch_or_raw_id,f_path=c.f_path, anchor='edit')}">
|
||||
${_('Edit on Branch:%s') % c.branch_or_raw_id}
|
||||
${_('Edit on Branch:%s') % c.branch_name}
|
||||
</a>
|
||||
| <a class="btn-danger btn-link" href="${h.url('files_delete_home',repo_name=c.repo_name,revision=c.branch_or_raw_id,f_path=c.f_path, anchor='edit')}">${_('Delete')}
|
||||
</a>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue