Log";
}
-$table_header_tag = &url_encode3($table_header_tag);
print "$table_tag$table_header_tag";
# Print each line of the revision, preceded by its annotation.
@@ -306,25 +328,7 @@ foreach $revision (@revisions)
}
$output .= "
";
&print_bottom;
+}
-## END of main script
+sub display_rss {
+ my @revisions = ($start_rev, ancestor_revisions($start_rev));
+ @revisions = sort by_author @revisions if $opt_sort eq 'author';
+
+ # The escaped path+name of the file; included in the channel title.
+ my $html_filename = html_quote($filename);
+
+ # The canonical URL of the file; we use a link to its revision history,
+ # but arguably this should be a link to the LXR page or, for web pages,
+ # a link to the actual web page.
+ my $link = Param("urlbase") . "cvslog.cgi?file=$url_filename";
+ $link .= "&root=$root" if $::FORM{'root'} ne "";
+ $link .= $revstr;
+ $link .= $sortstr;
+ $link .= "&author=$url_author_arg" if $author_arg ne "";
+ $link = value_quote($link);
+
+ print <<"END";
+
+
+
+
+ Revision History for $html_filename
+ $link
+ Revision History for $html_filename
+
+
+END
+
+ # We loop over revisions twice. The first time, here, it's just to populate
+ # the "items" list of revisions inside the channel tag. All we need to know
+ # is whether to skip this author and the link to the revision.
+ foreach my $revision (@revisions) {
+ next unless $author_arg eq '' || $use_author{$::revision_author{$revision}};
+ my $link = value_quote(revision_link($revision));
+ print <<"END";
+
+END
+ }
+
+ print <<"END";
+
+
+
+END
+
+ # The second time we loop over revisions, it's to generate "item" resources
+ # for each one.
+ foreach my $revision (@revisions) {
+ my $author = $::revision_author{$revision};
+ next unless $author_arg eq '' || $use_author{$author};
+ $author = html_quote($author);
+
+ my $link = value_quote(revision_link($revision));
+
+ my $log = $::revision_log{$revision};
+ $log = html_quote($log);
+ $log = MarkUpText($log);
+ $log =~ s/\n|\r|\r\n/ /g;
+
+ my $date = date_to_w3cdtf($::revision_ctime{$revision});
+
+ print <<"END";
+
+ Version $revision
+ $link
+
+ $author
+ $date
+
+END
+ }
+
+ print <<"END";
+
+END
+
+}
+
+sub revision_link {
+ my $revision = shift;
+
+ my $link = Param('urlbase') . "cvsview2.cgi";
+ if (defined($::prev_revision{$revision})) {
+ $link .= "?diff_mode=context&whitespace_mode=show&file=$url_file_tail"
+ . "&branch=$::opt_rev&root=$root&subdir=$url_rcs_path"
+ . "&command=DIFF_FRAMESET&rev1=$::prev_revision{$revision}"
+ . "&rev2=$revision";
+ } else {
+ $link .= "?files=$url_file_tail&root=$root&subdir=$url_rcs_path"
+ . "\&command=DIRECTORY\&rev2=$revision&branch=$::opt_rev";
+ $link .= "&branch=$browse_revtag" unless $browse_revtag eq 'HEAD';
+ }
+
+ return $link;
+}
+
+# Format a date/time in W3CDTF per http://www.w3.org/TR/NOTE-datetime
+sub date_to_w3cdtf {
+ my ($date) = @_;
+
+ $date = str2time($date);
+
+ # Date::Format returns timezone offsets without a colon, while W3CDTF
+ # requires a colon between the hour and minute offsets, so we have to
+ # convert the timezone specially.
+ my $timezone = time2str("%z", $date);
+ $timezone =~ s/([+-])(\d\d)(\d\d)/$1$2:$3/;
+
+ $date = time2str("%Y-%m-%dT%R", $date) . $timezone;
+
+ return $date;
+}
sub by_revision {
my (@a_parts) = split(/\./,$a);
@@ -386,11 +506,6 @@ sub by_author {
return by_revision;
}
-sub revision_pad {
- my ($revision) = @_;
- return ' ' x ($max_rev_length - length($revision));
-}
-
sub sprint_author {
my ($revision) = @_;
my ($author) = $::revision_author{$revision};