Fixed issue 180, can't select branches containing / character in git projects.
This commit is contained in:
parent
7d6cb22291
commit
c0dfd6b5dc
@ -75,7 +75,12 @@ class IDF_Scm_Git extends IDF_Scm
|
||||
}
|
||||
$res = array();
|
||||
foreach ($out as $b) {
|
||||
$res[substr($b, 2)] = '';
|
||||
$b = substr($b, 2);
|
||||
if (false !== strpos($b, '/')) {
|
||||
$res[$this->getCommit($b)->commit] = $b;
|
||||
} else {
|
||||
$res[$b] = '';
|
||||
}
|
||||
}
|
||||
$this->cache['branches'] = $res;
|
||||
return $res;
|
||||
|
@ -94,7 +94,7 @@ class IDF_Views_Source
|
||||
$rchanges = new Pluf_Template_ContextVars($rchanges);
|
||||
$scmConf = $request->conf->getVal('scm', 'git');
|
||||
$in_branches = $scm->inBranches($commit, '');
|
||||
return Pluf_Shortcuts_RenderToResponse('idf/source/changelog.html',
|
||||
return Pluf_Shortcuts_RenderToResponse('idf/source/'.$scmConf.'/changelog.html',
|
||||
array(
|
||||
'page_title' => $title,
|
||||
'title' => $title,
|
||||
|
@ -27,23 +27,3 @@
|
||||
</tbody>
|
||||
</table>
|
||||
{/block}
|
||||
|
||||
{block context}
|
||||
{if $scm != 'svn'}
|
||||
<p><strong>{trans 'Branches:'}</strong><br />
|
||||
{foreach $branches as $branch => $path}
|
||||
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $branch)}
|
||||
<span class="label{if in_array($branch, $tree_in)} active{/if}"><a href="{$url}" class="label">{$branch}</a></span><br />
|
||||
{/foreach}
|
||||
</p>
|
||||
{else}
|
||||
<form class="star" action="{url 'IDF_Views_Source_Svn::changelogRev', array($project.shortname)}" method="get">
|
||||
<p><strong>{trans 'Revision:'}</strong> {$commit}</p>
|
||||
<p>
|
||||
<input accesskey="4" type="text" value="{$commit}" name="rev" size="5" />
|
||||
<input type="submit" name="s" value="{trans 'Go to revision'}" />
|
||||
</p>
|
||||
</form>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
|
10
src/IDF/templates/idf/source/git/changelog.html
Normal file
10
src/IDF/templates/idf/source/git/changelog.html
Normal file
@ -0,0 +1,10 @@
|
||||
{extends "idf/source/changelog.html"}
|
||||
{block context}
|
||||
<p><strong>{trans 'Branches:'}</strong><br />
|
||||
{foreach $branches as $branch => $path}
|
||||
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $branch)}
|
||||
<span class="label{if in_array($branch, $tree_in)} active{/if}"><a href="{$url}" class="label">{if $path}{$path}{else}{$branch}{/if}</a></span><br />
|
||||
{/foreach}
|
||||
</p>
|
||||
{/block}
|
||||
|
@ -25,7 +25,7 @@
|
||||
<p><strong>{trans 'Branches:'}</strong><br />
|
||||
{foreach $branches as $branch => $path}
|
||||
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $branch)}
|
||||
<span class="label{if in_array($branch, $tree_in)} active{/if}"><a href="{$url}" class="label">{$branch}</a></span><br />
|
||||
<span class="label{if in_array($branch, $tree_in)} active{/if}"><a href="{$url}" class="label">{if $path}{$path}{else}{$branch}{/if}</a></span><br />
|
||||
{/foreach}
|
||||
</p>
|
||||
{/block}
|
||||
|
@ -55,7 +55,7 @@
|
||||
<p><strong>{trans 'Branches:'}</strong><br />
|
||||
{foreach $branches as $branch => $path}
|
||||
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $branch)}
|
||||
<span class="label{if in_array($branch, $tree_in)} active{/if}"><a href="{$url}" class="label">{$branch}</a></span><br />
|
||||
<span class="label{if in_array($branch, $tree_in)} active{/if}"><a href="{$url}" class="label">{if $path}{$path}{else}{$branch}{/if}</a></span><br />
|
||||
{/foreach}
|
||||
</p>
|
||||
{/block}
|
||||
|
10
src/IDF/templates/idf/source/mercurial/changelog.html
Normal file
10
src/IDF/templates/idf/source/mercurial/changelog.html
Normal file
@ -0,0 +1,10 @@
|
||||
{extends "idf/source/changelog.html"}
|
||||
{block context}
|
||||
<p><strong>{trans 'Branches:'}</strong><br />
|
||||
{foreach $branches as $branch => $path}
|
||||
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $branch)}
|
||||
<span class="label{if in_array($branch, $tree_in)} active{/if}"><a href="{$url}" class="label">{$branch}</a></span><br />
|
||||
{/foreach}
|
||||
</p>
|
||||
{/block}
|
||||
|
11
src/IDF/templates/idf/source/svn/changelog.html
Normal file
11
src/IDF/templates/idf/source/svn/changelog.html
Normal file
@ -0,0 +1,11 @@
|
||||
{extends "idf/source/changelog.html"}
|
||||
{block context}
|
||||
<form class="star" action="{url 'IDF_Views_Source_Svn::changelogRev', array($project.shortname)}" method="get">
|
||||
<p><strong>{trans 'Revision:'}</strong> {$commit}</p>
|
||||
<p>
|
||||
<input accesskey="4" type="text" value="{$commit}" name="rev" size="5" />
|
||||
<input type="submit" name="s" value="{trans 'Go to revision'}" />
|
||||
</p>
|
||||
</form>
|
||||
{/block}
|
||||
|
Loading…
Reference in New Issue
Block a user