Added POD for PODless actions.
);
}
+=head2 tags
+
+The current list of tags in the repo.
+
+=cut
+
+sub tags : Local {
+ my ( $self, $c ) = @_;
+ my $project = $c->stash->{Project};
+ $c->stash(
+ commit => $self->_get_object($c),
+ tags => $project->tags,
+ action => 'tags',
+ );
+}
+
=head2 blob
The blob action i.e the contents of a file.
);
}
+=head2 search
+
+The action for the search form.
+
+=cut
+
sub search : Local {
my($self, $c) = @_;
$c->stash(current_action => 'GitRepos');
);
}
+=head2 search_help
+
+Provides some help for the search form.
+
+=cut
+
sub search_help : Local {
my ($self, $c) = @_;
$c->stash(template => 'search_help.tt2');
}
+=head2 atom
+
+Provides an atom feed for a given project.
+
+=cut
+
sub atom : Local {
my($self, $c) = @_;
$c->response->status(200);
}
+=head2 rss
+
+Provides an RSS feed for a given project.
+
+=cut
+
sub rss : Local {
my ($self, $c) = @_;
$c->response->status(200);
}
+=head2 patch
+
+A raw patch for a given commit.
+
+=cut
+
sub patch : Local {
my ($self, $c) = @_;
$c->detach('patches', [1]);
}
+=head2 patches
+
+The patcheset for a given commit ???
+
+=cut
+
sub patches : Local {
my ($self, $c, $count) = @_;
$count ||= Gitalist->config->{patches}{max};
$c->response->status(200);
}
+=head2 snapshot
+
+Provides a snapshot of a given commit.
+
+=cut
+
sub snapshot : Local {
my ($self, $c) = @_;
my $format = $c->req->param('sf') || 'tgz';
);
}
-sub tags : Local {
- # FIXME - implement snapshot
- Carp::croak "Not implemented.";
-}
sub project_index : Local {
# FIXME - implement snapshot
Carp::croak "Not implemented.";
has heads => ( isa => ArrayRef[HashRef],
is => 'ro',
lazy_build => 1);
+=head2 tags
+
+ArrayRef of hashes containing the name and sha1 of all tags.
+
+=cut
+ has tags => ( isa => ArrayRef[HashRef],
+ is => 'ro',
+ lazy_build => 1);
=head2 references
return \@ret;
}
+ method _build_tags {
+ my @revlines = $self->run_cmd_list('for-each-ref',
+ '--sort=-creatordate',
+ '--format=%(objectname) %(objecttype) %(refname) %(*objectname) %(*objecttype) %(subject)%00%(creator)',
+ 'refs/tags'
+ );
+ my @ret;
+ for my $line (@revlines) {
+ my($refinfo, $creatorinfo) = split /\0/, $line;
+ my($rev, $type, $name, $refid, $reftype, $title) = split(' ', $refinfo, 6);
+ my($creator, $epoch, $tz) = ($creatorinfo =~ /^(.*) ([0-9]+) (.*)$/);
+ $name =~ s!^refs/tags/!!;
+
+ push @ret, { sha1 => $rev, name => $name };
+
+ #FIXME: That isn't the time I'm looking for..
+ if($epoch and $tz) {
+ my $dt = DateTime->from_epoch(epoch => $epoch);
+ $dt->set_time_zone($tz);
+ $ret[-1]->{last_change} = $dt;
+ }
+ }
+
+ return \@ret;
+ }
+
method _build_references {
# 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c refs/tags/v2.6.11
# c39ae07f393806ccf406ef966e9a15afc43cc36a refs/tags/v2.6.11^{}
-<table class='heads listing'>
+<table class='[% action %] listing'>
<thead>
<tr>
<th>HEAD</th>
--- /dev/null
+[% INCLUDE 'nav/actions.tt2' object = commit %]
+
+<div>
+[% Project.name %]
+</div>
+
+[% INCLUDE '_heads.tt2' heads = tags %]