Re: [PATCH] Atom 1.0 feeds for subversion
From: Bhuvaneswaran Arumugam <bhuvan_at_collab.net>
Date: 2006-07-19 13:42:24 CEST
Max, thanks for your review! Please find attached the revised patch and
> > TODO: Implement a scheme to insert the items to the file if it already
Yep. But, the Atom feed should be updated with recent revisions on
This script is almost inherited from svn2rss.py. So, all the
> 'Python xml.dom module' explains what you mean more clearly.
[[
* contrib/hook-scripts/svn2atom.py
* www/tools_contrib.html
> ATOM or Atom? Find out which is officially correct, and use it exclusively.
In all reference sites (ex: [1], [2]) they use Atom and never use ATOM.
> Explain what happens if the file already exists. It will be overwritten?
Ok. I have addressed it.
> If keeping of old items isn't implemented yet, then the above comment is
Yeah, for now, i have not implemented the method to keep old items.
> > + -u, --item-url=URL Use URL as the basis for generating ATOM item links.
I have added more description.
> > + -P, --svn-path=DIR Look in DIR for the svnlook binary. If not provided,
Yeah, i have corrected it.
>
I have corrected it.
> Please use PEP 8 style <http://www.python.org/dev/peps/pep-0008/>. In
Thanks for the link. Now, each import statement gets a separate line!
> > + stream = errmsg is not None and sys.stderr or sys.stdout
I have incorporated this change.
> No. What if someone wants to put a svn:// URL in there? Or an ftp://
The URL we are talking here is an Atom feed URL. It could be an http://,
> > +class SVN2ATOM:
I have corrected it.
> > + self.init_output()
We use it only here. So, IMO one combined function is unnecessary.
> > + self.feed.appendChild(doc.createTextNode("\n "))
I have corrected it.
> > + self.title.appendChild(doc.createTextNode("%s SVN Commit's Feed" % \
I have corrected it.
> > + self.id.appendChild(doc.createTextNode("%s" % self.feed_url or ""))
It's intended to store "" in case self.feed_url is None. I have
> If you are going to require Python 2.3, then you must state that at the
Now, I have stated it at the top of the script.
> > + self.author.appendChild(self.aname)
These entries are necessary for an Atom feed. If i get you wrong, can
> > + self.item_url + "?rev=%d" % self.revision or ""
As i mentioned earlier, this script is almost inherited from svn2rss.py
> > + doc.createTextNode("%s" % self.format_date(datetime.datetime.now())))
I guess it should be the entry published/updated date instead of
> > + cmd = "%s info -r %s %s" % (self.svnlook_cmd, self.revision, self.repos_path)
Yes, i have incorporated this change.
> > + out, x, y = popen2.popen3(cmd)
Yes, i'm using clear variable names now!
> But don't the lines already have a newline attached?
Yes, they do have a newline attached. So, i have corrected it.
> Weird capitalization. Local variables should be lower-case.
Yes, i have corrected it.
> > + changed_files = changed_files + item
Yes, i have incorporated this change. Thanks to madan for clarifying
> desc_lines.append('')
Yes, i have incorporated this change.
> > + atom_file = os.path.basename(repos_path) + ".atom"
Yes, as per [1] this is the normal file extension convention for atom
> > + if (commit_rev == None):
Yes, i have incorporated this change.
> > + except ValueError, msg:
Earlier, the 'except' was not in correct loop. I have corrected it and
> > + revisions = range(start, end + 1)[-max_items:]
I have incorporated this change.
[1]
-- Regards, Bhuvaneswaran
|
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.