Patchwork D1077: hgweb: rewrite two X or Y and Z ad-hoc ternaries with Y if X else Z

login
register
mail settings
Submitter phabricator
Date Oct. 14, 2017, 9:03 p.m.
Message ID <05e1b4cbd165730b356cb9d0ac68cbbd@localhost.localdomain>
Download mbox | patch
Permalink /patch/24922/
State Not Applicable
Headers show

Comments

phabricator - Oct. 14, 2017, 9:03 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGb2316265a32e: hgweb: rewrite two X or Y and Z ad-hoc ternaries with Y if X else Z (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1077?vs=2741&id=2753

REVISION DETAIL
  https://phab.mercurial-scm.org/D1077

AFFECTED FILES
  mercurial/hgweb/hgweb_mod.py
  mercurial/hgweb/hgwebdir_mod.py

CHANGE DETAILS




To: durin42, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

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: