[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn2rss.py patch

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: 2006-06-09 07:41:50 CEST

Bhuvaneswaran wrote:
>> Hrm. Seems like all the feed types would have the same basic input
>> needs.
>> Why not just rename the script to svnsyndicate.py or somesuch?
>
>
> The current script uses PyRSS2Gen and it only supports RSS 2.0. To
> include ATOM 1.0 feature, we may use different library. If we
> implement it in same script, it may increase the complexity of the
> script. Thus we wish to add new script "svn2atom.py".

Okay, having now taken a look at the script, I have to agree -- a second
script is the way to go.

If I might offer some constructive criticism about the script as it sits
today, though:

   * The script should call sys.exit(1) at the end of "except
     ImportError" block

   * Add a --max-items option.

   * --revision could take a range, like the 'svn' client does.

   * Lose --url, and add --url-template, which is a URL with replaceable
     fields, such as:

        http://svn.collab.net/viewvc/{repository}/?rev={revision}

     Dan Rall probably thought he was being helpful when he removed the
     mentioned of "viewcvs" from the --url description, but the new
     text implies a generality of the URL format which frankly isn't there.

   * Come up with decent default values for options for which
     it makes sense to do so:

        --svn-path could default to nothing, meaning "look in $PATH"
        --rss-file could default to os.path.basename(self.repos_path) \
                   + ".rss"
        --revision could default to the youngest revision in the repos

     Alternatively, the script should validate input before trying to act
     on it. Today you get cryptic errors as the script tries to use
     uninitialized variables and the likes.

   * Lose --repos-path, and make it a command-line argument, not an option.
     In conjunction with the other changes mentioned here, that would mean
     that running this script could be as simple as:

        svn2rss.py \
          --url http://svn.collab.net/viewvc/{repository}/?rev={revision} \
          /path/to/repository

-- 
C. Michael Pilato <cmpilato@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on Fri Jun 9 07:44:00 2006

This is an archived mail posted to the Subversion Dev mailing list.