D1077: hgweb: rewrite two X or Y and Z ad-hoc ternaries with Y if X else Z
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Sat Oct 14 20:16:31 UTC 2017
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
Just easier to muddle through for my brain now that I don't see the
old pattern much anymore.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D1077
AFFECTED FILES
mercurial/hgweb/hgweb_mod.py
mercurial/hgweb/hgwebdir_mod.py
CHANGE DETAILS
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 @@
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')
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 @@
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:
To: durin42, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list