# HG changeset patch # User Augie Fackler # Date 2017-10-05 18:48:31 # Node ID b2316265a32eaffc2c9b598f691e51d1431b5d3a # Parent 6db536bed7ecac3a892a7165e51212a21647719b hgweb: rewrite two X or Y and Z ad-hoc ternaries with Y if X else Z Just easier to muddle through for my brain now that I don't see the old pattern much anymore. Differential Revision: https://phab.mercurial-scm.org/D1077 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 @@ -187,7 +187,7 @@ class requestcontext(object): if style == styles[0]: vars['style'] = style - start = req.url[-1] == '?' and '&' or '?' + start = '&' if req.url[-1] == '?' else '?' sessionvars = webutil.sessionvars(vars, start) if not self.reponame: diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py +++ b/mercurial/hgweb/hgwebdir_mod.py @@ -508,7 +508,7 @@ class hgwebdir(object): if style == styles[0]: vars['style'] = style - start = url[-1] == '?' and '&' or '?' + start = '&' if url[-1] == '?' else '?' sessionvars = webutil.sessionvars(vars, start) logourl = config('web', 'logourl') logoimg = config('web', 'logoimg')