Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hgweb/hgwebdir_mod.py @ 5915:d0576d065993
Prefer i in d over d.has_key(i)
author | Christian Ebert <blacktrash@gmx.net> |
---|---|
date | Sun, 20 Jan 2008 14:39:25 +0100 |
parents | e9f68860d5ed |
children | 3340aa5a64f7 |
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py Mon Jan 21 13:37:27 2008 -0200 +++ b/mercurial/hgweb/hgwebdir_mod.py Sun Jan 20 14:39:25 2008 +0100 @@ -143,7 +143,7 @@ def entries(sortcolumn="", descending=False, subdir="", **map): def sessionvars(**map): fields = [] - if req.form.has_key('style'): + if 'style' in req.form: style = req.form['style'][0] if style != get('web', 'style', ''): fields.append(('style', style)) @@ -214,7 +214,7 @@ sortable = ["name", "description", "contact", "lastchange"] sortcolumn, descending = self.repos_sorted - if req.form.has_key('sort'): + if 'sort' in req.form: sortcolumn = req.form['sort'][0] descending = sortcolumn.startswith('-') if descending: @@ -262,7 +262,7 @@ style = self.style if style is None: style = config('web', 'style', '') - if req.form.has_key('style'): + if 'style' in req.form: style = req.form['style'][0] if self.stripecount is None: self.stripecount = int(config('web', 'stripes', 1))