Skip Menu |

This queue is for tickets about the SVN-Web CPAN distribution.

Report information
The Basics
Id: 19931
Status: resolved
Priority: 0/
Queue: SVN-Web

People
Owner: Nobody in particular
Requestors: dietrich.streifert [...] visionet.de
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.46
Fixed in: (no value)



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#<#&lt;#g; + $desc =~ s#>#&gt;#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;
Subject: Re: [rt.cpan.org #19931] Add changed paths info to the rss feed
Date: Wed, 21 Jun 2006 14:04:16 +0100
To: bug-SVN-Web [...] rt.cpan.org
From: Nik Clayton <nik [...] ngo.org.uk>
Guest via RT wrote: Show quoted text
> 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?
Yes -- the changes on trunk/ expose this information to the template. If you look at the documentation for SVN::Web::Log you'll see there's a 'paths' hash, with entries that contain the information you need. For a time the log template contained a commented out section that did exactly what you want. You can see the change where it was removed at http://jc.ngo.org.uk/svnweb/jc/revision/?rev=793. That should give you an idea of what will need to be added to the rss template to give the output you want. Show quoted text
> 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.
Ah, well spotted. I'll fix that before I do the next release. Show quoted text
> Thank you for your greate work!
You're welcome. Thanks for the bug report. N
From: dietrich.streifert [...] visionet.de
So is it possible to only display lets say 40 changed paths with the template syntax? On Mi. 21. Jun. 2006, 09:04:53, nik@ngo.org.uk wrote: Show quoted text
> Guest via RT wrote:
> > 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?
> > Yes -- the changes on trunk/ expose this information to the template. > If > you look at the documentation for SVN::Web::Log you'll see there's a > 'paths' > hash, with entries that contain the information you need. > > For a time the log template contained a commented out section that did > exactly what you want. You can see the change where it was removed at > http://jc.ngo.org.uk/svnweb/jc/revision/?rev=793. That should give > you an > idea of what will need to be added to the rss template to give the > output > you want. >
> > 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.
> > Ah, well spotted. I'll fix that before I do the next release. >
> > Thank you for your greate work!
> > You're welcome. Thanks for the bug report. > > N
Subject: Re: [rt.cpan.org #19931] Add changed paths info to the rss feed
Date: Wed, 21 Jun 2006 18:01:05 +0100
To: bug-SVN-Web [...] rt.cpan.org
From: Nik Clayton <nik [...] ngo.org.uk>
Guest via RT wrote: Show quoted text
> So is it possible to only display lets say 40 changed paths with the > template syntax?
Yes. Inside a loop there's a special 'loop' variable with various methods you can call on it. One of these is 'loop.count', which tells you how many times you've iterated so far. % cat test.tt [%- FOREACH item = ['1' '2' '3' '4' '5' '6' '7' '8' '9' '10' ] %] This is [% item %] [%- LAST IF loop.count >= 5 %] [%- END %] % tpage test.tt This is 1 This is 2 This is 3 This is 4 This is 5 As you can see, even though the list has 10 items the iteration has stopped after 5 of them. N
Dietrich, I've fixed the RSS feed following your suggestion, you can see the commit that fixed it at: http://jc.ngo.org.uk/svnweb/jc/revision?rev=971 Hope the other information was useful. N