|
|
Home » Community » U++ community news and announcements » Svn changes over RSS feed
Svn changes over RSS feed [message #25044] |
Tue, 09 February 2010 10:02  |
|
Hi!
If there is someone who would like to stay informed about what is new in U++ svn and also uses feedreader, I have some news. Since google code feed about svn changes doesn't work (probably because it publishes only direct commits and ignores syncing) I've had to create my own:http://feed43.com/upp-svn-changes.xml It contains basic information - revision, changelog, author, date and link to diffs. It is probably few hours behind the reality, because of svn syncing interval + polling interval + feedreader polling interval. Still I consider it useful for myself, since I can update my sources whenever I see interesting commit.
Also Sergeynikitin had an interesting proposal about this: Incorporating something similar into the webpages. Little "shoutbox" style area in Status&Roadmap section would give visitors an idea about how active the development is.
Best regards,
Honza
|
|
|
|
|
Re: Svn changes over RSS feed [message #25056 is a reply to message #25053] |
Tue, 09 February 2010 12:24   |
|
luzr wrote on Tue, 09 February 2010 11:42 | Is there a simple way how to do that? Like putting some html somewhere? (I really suck at web development... 
|
Hi Mirek,
There is many ways The simplest and least error prone IMO is what you suggested. Parsing svn log, producing static html that could be directly incorporated in to the web. Also when doing this, it would be simple to generate our own feed at the same time. The free service from feed43.com I used is pretty limited
About the timing: For most of the pages, once per day is quite enough. For things like this more often would be better. The ultimate ( ) solution in this case would be to keep this part of web content generation independent from the rest and run it from post commit hook. This approach gives you instant response for "news-like" content, while keeping the rest of the infrastructure intact.
I'll supply some code in few weeks time, I'm unfortunately quite busy now...
Regards,
Honza
PS: I already have the most difficult part - a python script to parse svn logs. Original can be downloaded here. For my use in ubuntu packaging scripts I just added few more options and modified the output to conform to Debian policy manual.
|
|
|
|
Re: Svn changes over RSS feed [message #25079 is a reply to message #25053] |
Tue, 09 February 2010 18:47   |
|
If there is available log is quite simple. It's just a text file processibg in PHP.
But even for the http-RSS has many handler code and output without regeneration page (such as dynamic PHP).
Need only support PHP, I understand this may be the problem.
And if we have PHP support, we declare the server APACHE to parse html-files as PHP-scripts (configures in .htaccess). And then many dynamic insertion, such as instant processing of RSS is to be available, it would be quite easy.
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
Re: Svn changes over RSS feed [message #25084 is a reply to message #25079] |
Tue, 09 February 2010 19:45   |
|
sergeynikitin wrote on Tue, 09 February 2010 18:47 | If there is available log is quite simple. It's just a text file processibg in PHP.
But even for the http-RSS has many handler code and output without regeneration page (such as dynamic PHP).
Need only support PHP, I understand this may be the problem.
And if we have PHP support, we declare the server APACHE to parse html-files as PHP-scripts (configures in .htaccess). And then many dynamic insertion, such as instant processing of RSS is to be available, it would be quite easy.
|
Hi Sergey!
Actually none of this will be needed. PHP is supported, this forum runs in it, so no problem with that. But: Running the "svn log" and parsing the output every time someone asks for feed is unnecessary load for the server. You could cache it, but then we are back to static solution. IMHO having it generated from post-commit is the most elegant solution possible.
BTW: For parsing, I use XML output ("svn -v --xml"), not textual.
Regards,
Honza
|
|
|
Re: Svn changes over RSS feed [message #25152 is a reply to message #25044] |
Fri, 12 February 2010 19:57   |
|
Hello all!
I had some free time today, so I decided make a little exercise in sed:#!/bin/bash
SVNPATH="/path/to/svn"
COUNT="25"
OUTPUT="/tmp/svnchanges.html"
header='1 c<html><head><script>\
function toggleFiles(id){\
var f=document.getElementById("f"+id);var a=document.getElementById("a"+id);\
if(f.style.display=="none"){f.style.display="block";a.innerHTML="Hide affected files";}\
else{f.style.display="none";a.innerHTML="Show affected files"}}\
</script></head><body>
# replace first line with header'
footer='$ a</body></html>
# append footer after last line'
svn --limit $COUNT --verbose log $SVNPATH |\
sed -n \
-e "$header" \
-e '/-----*/ !{ # when the line IS NOT separator
s/^ *A \(.*$\)/\1 (Added)<br>/
s/^ *M \(.*$\)/\1 (Modified)<br>/ # formating of affected files
s/^ *D \(.*$\)/\1 (Removed)<br>/
H #append everything between separators into hold space
}' \
-e '/-----*/ { # when the line IS separator
x # get string from hold space
s/r\([0-9]*\)[ |]*\([^|]*\)[ |]*\([0-9 :+\-]*\).*\nChanged paths:\n\(.*\)\n\n\(.*\)$/\
<table style="font-size:small;">\
<tr><td>Revision:<\/td><td><b>\1<\/b><\/td><\/tr>\
<tr><td>Description:<\/td><td><code>\5<\/code><\/td><\/tr>\
<tr><td>Submitted:<\/td><td><i>\3<\/i> by <i>\2<\/i><\/td><\/tr>\
<tr><td colspan="2">\
<a href="" id="a\1" onclick="toggleFiles(\1);return false;">Show affected files<\/a>\
<div id="f\1" style="display:none;margin-left:20px;">\4<\/div>\
<\/td><\/tr>\
<\/table><br>\
/p # this ugly substitution makes all the formating
s/.*// # clear pattern space
x # clear hold space
}' \
-e "$footer" > $OUTPUT
This script parses svn log into static html, which I hope will be simple to include somewhere in the pages (<iframe>?). It's just a "first iteration", so please don't look at the style too much It will need few touches to get it in look fitting on the web, but that is the easier part.
I hope that thee three variables on top of the script are self-explaining, so anyone can try this at home Looking forward to your comments.
Best regards,
Honza
|
|
|
Re: Svn changes over RSS feed [message #25161 is a reply to message #25044] |
Sat, 13 February 2010 03:05   |
|
I think I'm almost finished with the script. It is a bit bigger, so it's in attachment. Major change: It outputs two files now, HTML page and RSS feed, both perfectly valid. Also files are now linked to their page on code.google.com and to the corresponding diff. That is about all the functionality I can think of. If you have some other suggestions, just tell me.
Now, is there someone who can prepare the color&style part? I'm actually bad at this, so help is more then welcome And aslo: any ideas or hints how to get it into the web structure?
Regards,
Honza
-
Attachment: svnchanges
(Size: 3.84KB, Downloaded 249 times)
|
|
|
|
Re: Svn changes over RSS feed [message #25186 is a reply to message #25181] |
Sat, 13 February 2010 15:44   |
|
Hi Mirek
luzr wrote on Sat, 13 February 2010 13:41 | I am afraid this will be more easily done in U++ and uppweb and at the point, more easily included to the front page too.
|
Sure, it could be written in U++. But I don't see any strong reason. I hoped that this could be run after each commit from post-commit hook, too keep the informations always actual (Do you agree with that?). The hook can of course run binary or even be a binary itself. The only problem is that it is out of version control. So either way, script or binary, you have to put it in there manually. Using binary just adds one more step, compilation.
The script is ready to use, just put it in svnhooks directory and add code to upload the output to the server. With feed there is no problem, just add a link somewhere, e.g. bellow google search field. The html part for direct inclusion is trickier. I thought it is possible to include html from within uppweb. But now as I look closer I see that it is only in special cases (ads,forum). So that is probably not the way to go.
Would it help if the script would generate QTF instead of html? Then you could just copy the output into uppweb and wait till it is converted and uploaded with the rest of the pages. This way you loose the always-up-to-date part, but for www it doesn't really matter (at least for me, as I prefer feed:) ).
luzr wrote on Sat, 13 February 2010 13:41 |
I am now only thinking whether we should introduce some convention about "minor changes". Like putting '.' before commit message?
".fixed small type"
vs
"Refactored theide search"
Mirek
|
Good idea. I'm not sure if you can force everybody to follow it , but if you do, then there could be regular-user-feed with only major changes (suitable for www too) and dev-feed with complete info.
Honza
EDIT: Just found you can include html code into tpp quite easily. At least if I understand this line correctly:escape.Add("PAYPAL", LoadFile(GetRcFile("donations.txt"))); Here PAYPAL is index entry in tpp. Not sure how it works, but it does and it is easier than I thought. This way adding the html inside some page is easy. Additionaly, if you don't include the file directly during uppweb compilation, but only a file that will include it on the server (through frame,iframe or some magic), you get even the always-up-to-date feature.
[Updated on: Sat, 13 February 2010 16:09] Report message to a moderator
|
|
|
Re: Svn changes over RSS feed [message #25205 is a reply to message #25044] |
Sat, 13 February 2010 23:34   |
|
Hello all,
Time for another update I've integrated part of this process into uppweb package to reduce the code generated independently to minimum. I've compiled the package and copied Status&Roadmap page to a free hosting I use for testing. You can view it here:
http://koncept.nazory.cz/upptest/www$uppweb$Roadmap$en-us.ht ml
There is only this single page, so links won't work. Also disregard the ads on top, that is the price for free hosting 
The principle is simple: RSS feed is just a link in the page and link tag in head, to a file that is to be generated with post--commit hook. All the changes to the page were done in uppweb. The changes box on the right side is inserted into the page by uppweb, using index entry in www.tpp/Roadmap$en-us. The list of changes is loaded using javascript feed.js, which was generated by the script.
This is just a proof of concept. There is just a basic styling and some things can be nicer/better written.
Best regards,
Honza
|
|
|
|
Goto Forum:
Current Time: Tue Apr 29 18:28:11 CEST 2025
Total time taken to generate the page: 0.04188 seconds
|
|
|