SVN::Web falling foul of uri filter (was: Re: [Templates] New Subversion repository to replace CVS)

Nik Clayton nik@ngo.org.uk
Thu, 15 Mar 2007 11:36:26 +0000


Andy Wardley wrote:
> Josh Rosenbaum wrote:
>> Andy, is there a web interface for this like the viewcvs web interface?
> 
> Yes, there is now.
> 
>   http://template-toolkit.org/svnweb/
> 
> It's using SVN::Web, which in turn uses TT, which is nice in an
> eating-your-own-dog-food kinda way.

Excellent, that saves me setting one up.

As an aside, what's the preferred way to deal with the new strictness of 
the uri filter?

Based on problem reports, I think the problem is that SVN::Web does this 
in the templates:

   <a href="/path/to/action[% path | uri | html %]">action</a>

The intent being that "/path/to/action" is mapped in the Apache config 
to SVN::Web.  SVN::Web runs SVN::Web::<action>, which then expects to 
get the rest of the path from the URL, and do something with it.

In newer TT's, if path is something like "/Template2/trunk" that becomes:

   <a href="/path/to/action%2fTemplate2%2ftrunk">action</a>

and things rapidly go pear shaped, because Apache can no longer map 
"/path/to/action%2f..." to any handlers in the config file.

I guess I need to change that to something like:

    [% path.split('/').map(uri).join('/') | html %]

except that there's no map() vmethod (hey, there's an idea).

N