Subject: | Add changed paths info to the rss feed |
Please consider integrating following functionality SVN::Web:
I hacked SVN::Web::RSS to add additional informations about the added,
deleted or changed paths to the log message in a rev entry. We found it
very helpfull to have such messages in our RSS readers like. The output
is cut after 40 entries:
Done some very complicated changes to the projekt
D: /trunk/file1
M: /trunk/file2
M: /trunk/file3
M: /trunk/file4
M: /trunk/file5
M: /trunk/file6
A: /trunk/file7
I've attached a patch against RSS.pm 0.46 which contains the change.
I've seen your last changes to svn trunk which uses a template to create
the rss feed. Maybe there is a possibility to implement this without
invasion of rss.pm?
PS.: I've also noticed the date/time localization efforts which are very
welcome! One note to this: you seem to use localized date/time with
custom patterns like %d.%m.%Y for generating the <dc:date> elements in
the rss which leads to unreadable timestamps in the rss readers.
Thank you for your greate work!
Subject: | RSS.pm.diff |
*** RSS.pm.orig Thu Mar 9 10:47:46 2006
--- RSS.pm Thu Mar 9 11:02:37 2006
***************
*** 64,77 ****
$_ && $rss->add_item
( title => "$_->{rev} - ".substr ((split("\n",$_->{msg}, 1))[0],
! 0, 40),
link => "$url/revision/?rev=$_->{rev}",
dc => { date => $_->{date},
creator => $_->{author},
},
! description => $_->{msg},
) for @{$self->{REVS}}[0..10];
return { mimetype => 'text/xml', body => $rss->as_string };
}
1;
--- 64,104 ----
$_ && $rss->add_item
( title => "$_->{rev} - ".substr ((split("\n",$_->{msg}, 1))[0],
! 0, 80),
link => "$url/revision/?rev=$_->{rev}",
dc => { date => $_->{date},
creator => $_->{author},
},
! # description => $_->{msg},
! description => create_description($_) . create_paths($_),
) for @{$self->{REVS}}[0..10];
return { mimetype => 'text/xml', body => $rss->as_string };
}
+ sub create_description {
+ my $data = shift;
+ my $desc = $data->{msg};
+
+ $desc =~ s#\n#<br/>#g;
+ $desc =~ s#<#<#g;
+ $desc =~ s#>#>#g;
+
+ return $desc;
+ }
+
+ sub create_paths {
+ my $data = shift;
+
+ my $output = '<br/><br/><br/>';
+ my $i = 0;
+ for ( keys %{$data->{paths}} ) {
+ $output .= $data->{paths}{$_}{action} . ': ' . $_ . '<br/>';
+ $i += 1;
+ if ( $i > 40 ) {
+ return $output . '<br/>...';
+ }
+ }
+ return $output;
+ }
+
1;