[PATCH 3 of 3] Leave urlbase empty in templates if url is already absolute

Patrick Mézard pmezard at gmail.com
Wed May 28 06:09:57 CDT 2008


Emanuele Aina a écrit :
> Patrick Mézard ipotizzò:
> 
>> The two other patches are good for me (except I will switch the test
>> and the fix order), but I am less sure about this one. I am really
>> tempted to make "url" always a relative URL instead. Is this issue
>> related to the RSS template only or am I missing something ?
> 
> The RSS/Atom templates use {urlbase}{url} to always get absolute urls
> while other web templates use only {url}.
> 
> Problems arise when you use a full url for 'baseurl' in hgweb.config
> (e.g. 'http://techn.ocracy.org'), as it will make {url} already complete
> but it will nevertheless appended to {urlbase}.
> 
> I didn't make {url} always relative as it will break the web templates
> when using 'baseurl'

Wouldn't it be the opposite ? Will break when not used with 'baseurl' ?
But the compatibility problem still holds.

What about adding an 'uri' parameter which would be the url part without the scheme and domain part, and fix only the RSS template for now ?

--
Patrick Mézard



More information about the Mercurial-devel mailing list