[PATCH 0 of 1] hgweb: add environ to template variables

Mads Kiilerich mads at kiilerich.com
Sat Sep 25 13:15:25 CDT 2010


  Dirkjan Ochtman wrote, On 09/21/2010 02:58 PM:
> On Tue, Sep 21, 2010 at 14:41, FZiegler<zarf at klacto.net>  wrote:
>> Rather than making the piecemeal addition of req.env['REMOTE_USER'] as a
>> template variable ('remoteuser'), it uses danchr's mechanism to expose the
>> entire wsgi environment (req.env) as template variable 'environ'.
> I think this is a bad idea, because it exposes too much stuff to the templates.

Can you say more about why you think it is a bad idea?

Yes, it exposes much stuff to the templates, but it is stuff that 
already has been exposed as environment variables.

Now the user wants to use one of these values in the template. The value 
do not mean anything to hgweb here, so why should we add specific code 
for just passing this single variable on? Exposing the whole environment 
would make it a more powerful building block that might be usable in 
ways we haven't predicted.

Sure, we shouldn't make everything too generic, but we also should make 
sure we don't make "easy" solutions that we will have to support forever.

/Mads


More information about the Mercurial-devel mailing list