[PATCH] hgweb: add remoteuser to template variables

FZiegler zarf at klacto.net
Thu Sep 16 22:16:29 CDT 2010


This patch updates my suggestion from

http://selenic.com/pipermail/mercurial-devel/2010-September/024433.html

Following discussion on irc, I changed the {user} keyword to 
{remoteuser} and also added its value in the ETag -- otherwise it gets 
stale if you log out and back in as another user.

The ETag syntax is made up -- for user 'guest' the http headers will 
include 'Etag:1283856267.0/guest' instead of 'Etag:1283856267.0' 
currently. I'm happy to change it if anything else is preferred.

mpm pointed out a side effect: currently, "If multiple different users 
hit the same hgweb page through a proxy using existing user-less 
templates, they'll get cached copies. The above change will mean they'll 
all get uncached copies of the same bytes."

If that is a concern, I guess we could try to make the ETag addition 
conditional on some flag to be set in hgweb.config. As mpm said, "Dunno 
if it's worth the trouble", I'm leaving this up for you to judge.

Francois Z.


More information about the Mercurial-devel mailing list