[PATCH 5 of 5 hgweb-thread-isolation] hgweb: add reponame to requestcontext

Augie Fackler raf at durin42.com
Tue Sep 8 11:55:31 CDT 2015


On Thu, Sep 03, 2015 at 04:16:20PM -0700, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1440288264 25200
> #      Sat Aug 22 17:04:24 2015 -0700
> # Node ID 05037adfc610d49c843f45c3f78cebb64cb5adb9
> # Parent  7d9878e5f7ad2d36bf5099a73955a46e5ead694b
> hgweb: add reponame to requestcontext

This batch looks good, queued, thanks.

>
> We have to use object.__setattr__ until the app proxy is gone.
>
> diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py
> --- a/mercurial/hgweb/hgweb_mod.py
> +++ b/mercurial/hgweb/hgweb_mod.py
> @@ -69,8 +69,9 @@ class requestcontext(object):
>      """
>      def __init__(self, app):
>          object.__setattr__(self, 'app', app)
>          object.__setattr__(self, 'repo', app.repo)
> +        object.__setattr__(self, 'reponame', app.reponame)
>
>          object.__setattr__(self, 'archives', ('zip', 'gz', 'bz2'))
>
>          object.__setattr__(self, 'maxchanges',
> @@ -176,11 +177,12 @@ class requestcontext(object):
>          start = req.url[-1] == '?' and '&' or '?'
>          sessionvars = webutil.sessionvars(vars, start)
>
>          if not self.reponame:
> -            self.reponame = (self.config('web', 'name')
> -                             or req.env.get('REPO_NAME')
> -                             or req.url.strip('/') or self.repo.root)
> +            object.__setattr__(self, 'reponame',
> +                               (self.config('web', 'name')
> +                                or req.env.get('REPO_NAME')
> +                                or req.url.strip('/') or self.repo.root))
>
>          def websubfilter(text):
>              return websub(text, self.websubtable)
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list