[PATCH] hgweb/localrepo: pass the request object to hooks

Dirkjan Ochtman dirkjan at ochtman.nl
Fri Nov 6 13:39:37 CST 2009


On Fri, Nov 6, 2009 at 20:31, Sune Foldager <cryo at cyanite.org> wrote:
> # HG changeset patch
> # User Sune Foldager <cryo at cyanite.org>
> # Date 1257535374 -3600
> # Node ID 08d5b56a38837bcdcca28fdf783d686891f19c48
> # Parent  732fc0e9d411e0b94e56779d4ac053ceac0349e4
> hgweb/localrepo: pass the request object to hooks
>
> The pretxnchangegroup hook is main place to do authorization based on the
> contents of the commit, such as named branches, committer etc. In order to
> receive authorization headers you need access to the environment. With CGI
> you can always use os.environ, but not so with WSGI.
>
> localrepo gets a property, request, which is normally None, but can be set
> to an object which is then passed on to hooks. hgweb sets it when processing
> requests.

It seems pretty ugly to stick data into the repo object like that.
What are you really trying to do here?

Cheers,

Dirkjan



More information about the Mercurial-devel mailing list