sub base : Chained('/repository/find') PathPart('') CaptureArgs(0) {}
-sub blob_plain : Chained('find_blob') Does('FilenameArgs') Args() {
+sub raw : Chained('find') Does('FilenameArgs') Args() {
my ($self, $c) = @_;
+ $c->forward('find_blob');
$c->response->content_type('text/plain; charset=utf-8');
$c->response->body(delete $c->stash->{blob});
sub tree : Chained('find') Does('FilenameArgs') Args() {}
-sub find_blob : Chained('find') PathPart('') CaptureArgs(0) {
+sub find_blob : Action {
my ($self, $c) = @_;
# FIXME - Eugh!
my $h = $c->stash->{Repository}->hash_by_path($c->stash->{Commit}->sha1, $c->stash->{filename})
$c->stash(blob => $c->stash->{Repository}->get_object($h)->content);
}
-sub blob : Chained('find_blob') Does('FilenameArgs') Args() {}
+sub blob : Chained('find') Does('FilenameArgs') Args() {
+ my ($self, $c) = @_;
+ $c->forward('find_blob');
+}
sub blame : Chained('find') Does('FilenameArgs') Args() {}
sub history : Chained('find') Does('FilenameArgs') Args() {}
-sub raw : Chained('find') Does('FilenameArgs') Args() {}
-
sub shortlog : Chained('find') Does('FilenameArgs') Args() {}
1;
[% FOREACH item IN diff %]
<div class='diff-head'>
diff --git
- <a href='[% c.uri_for("blob", {h=item.src, f=item.file}) %]'>[% item.a %]</a>
- <a href='[% c.uri_for("blob", {h=item.dst, f=item.file}) %]'>[% item.b %]</a>
+ <a href='[% c.uri_for_action("/commit/blob", [Repository.name, item.src], item.file) %]'>[% item.a %]</a>
+ <a href='[% c.uri_for_action("/commit/blob", [Repository.name, item.dst], item.file) %]'>[% item.b %]</a>
</div>
<div class='diff-index'>
[% item.index %]
%]
</td>
<td class='action-list'>
- [% IF !line.is_new %]<a href="[% c.uri_for("blobdiff", {hp=commit.parent_sha1, h=commit.sha1, f=line.file}) %]">diff</a>[% END %]
- <a href="[% c.uri_for("blob", {h=line.sha1, hb=commit.sha1, f=line.file}) %]">blob</a>
- [% IF !line.is_new %]<a href="[% c.uri_for("shortlog", {hb=commit.sha1, f=line.file}) %]">history</a>[% END %]
+ [% IF !line.is_new %]<a href="[% c.uri_for_action("/commit/diff", [Repository.name, Commit.sha1], line.file.to_path) %]">diff</a>[% END %]
+ <a href="[% c.uri_for_action("/commit/blob", [Repository.name, Commit.sha1], line.file.to_path) %]">blob</a>
+ [% IF !line.is_new %]<a href="[% c.uri_for("/commit/shortlog", [Repository.name, Commit.sha1], line.file.to_path) %]">history</a>[% END %]
</td>
</tr>
[% END %]
</div>
- [% subinclude('/fragment/commit/diff_fancy', c.req.captures) %]
+ [% subinclude('/fragment/commit/diff_fancy', c.req.captures c.req.args.to_path) %]
</div>
-[%
+MOO[%
# In the case of merge commits there will be no diff tree.
IF diff_tree.size > 0;
INCLUDE '_diff_tree.tt2';
<td class='file-mode'>[% item.modestr %]</td>
[%-
action_type = item.type == 'tree' ? 'tree' : 'blob';
- action_for_link = item.type == 'tree' ? c.action : c.controller.action_for('blob');
- blob_or_tree_link = c.uri_for(action_for_link, c.req.captures, c.req.args.to_path(item.file))
+ action_for_link = item.type == 'tree' ? '/commit/tree' : '/commit/blob';
+ blob_or_tree_link = c.uri_for_action(action_for_link, c.req.captures, c.req.args.to_path(item.file))
-%]
<td class='file-name'>
<a href="[% blob_or_tree_link %]">[% item.file %]</a>
<td class='action-list'>
<a href="[% blob_or_tree_link %]">[% theact %]</a>
[% IF item.type == 'blob' %]
+ <a href="[% c.uri_for_action('/commit/blob', c.req.captures, c.req.args.to_path(item.file)) %]">blob</a>
<a href="[% c.uri_for_action('/commit/blame', c.req.captures, c.req.args.to_path(item.file)) %]">blame</a>
[% END %]
<a href="[% c.uri_for_action('/commit/history', c.req.captures, c.req.args.to_path(item.file)) %]">history</a>
</td>
<td class='action-list'>
<a href="[% c.uri_for_action("/commit/commit", [Repository.name, line.sha1]) %]">commit</a>
- <a href="[% c.uri_for_action("/commit/diff", [Repository.name, line.sha1]) %]">commitdiff</a>
+ <a href="[% c.uri_for_action("/commit/diff_fancy", [Repository.name, line.sha1]) %]">commitdiff</a>
<a href="[% c.uri_for_action("/commit/tree", [Repository.name, line.sha1]) %]">tree</a>
</td>
</tr>
[% IF filename %]
§
<a href="[% c.uri_for_action('/commit/blob', [c.req.captures.0, Commit.sha1], filename) %]">blob</a> •
- <a href="[% c.uri_for_action('/commit/blob_plain', [c.req.captures.0, Commit.sha1], filename) %]">raw</a> •
+ <a href="[% c.uri_for_action('/commit/raw', [c.req.captures.0, Commit.sha1], filename) %]">raw</a> •
<a href="[% c.uri_for_action('/commit/blame', [c.req.captures.0, Commit.sha1], filename) %]">blame</a> •
<a href="[% c.uri_for_action('/commit/shortlog', [c.req.captures.0, Commit.sha1], filename) %]">history</a> •
<a href="[% c.uri_for(c.controller.action_for('commit'), [c.req.captures.0, Repository.head_hash]) %]">HEAD</a>
test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/patch');
test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/patches/1');
test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/patches/2');
-
+ test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/history/dir1');
+ test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/blame/file1');
+ test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/raw/file1');
+ test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/blob/file1');
+
TODO: {
local $TODO = "FIXME";
test('search', 'type=commit&text=added');
-
- test('blob', 'f=dir1/file2;hb=36c6c6708b8360d7023e8a1649c45bcf9b3bd818');
-
# FIXME - What's the difference here?
#test('patch', 'h=3f7567c7bdf7e7ebf410926493b92d398333116e');
#test('patch', 'h=3f7567c7bdf7e7ebf410926493b92d398333116e;hp=3bc0634310b9c62222bb0e724c11ffdfb297b4ac');