diff mercurial/hgweb/protocol.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 d534ba1c4eb4
children 5be210afe1b8
line wrap: on
line diff
--- a/mercurial/hgweb/protocol.py	Mon Jan 21 13:37:27 2008 -0200
+++ b/mercurial/hgweb/protocol.py	Sun Jan 20 14:39:25 2008 +0100
@@ -28,7 +28,7 @@
 
 def branches(web, req):
     nodes = []
-    if req.form.has_key('nodes'):
+    if 'nodes' in req.form:
         nodes = map(bin, req.form['nodes'][0].split(" "))
     resp = cStringIO.StringIO()
     for b in web.repo.branches(nodes):
@@ -38,7 +38,7 @@
     req.write(resp)
 
 def between(web, req):
-    if req.form.has_key('pairs'):
+    if 'pairs' in req.form:
         pairs = [map(bin, p.split("-"))
                  for p in req.form['pairs'][0].split(" ")]
     resp = cStringIO.StringIO()
@@ -54,7 +54,7 @@
     if not web.allowpull:
         return
 
-    if req.form.has_key('roots'):
+    if 'roots' in req.form:
         nodes = map(bin, req.form['roots'][0].split(" "))
 
     z = zlib.compressobj()
@@ -74,9 +74,9 @@
     if not web.allowpull:
         return
 
-    if req.form.has_key('bases'):
+    if 'bases' in req.form:
         bases = [bin(x) for x in req.form['bases'][0].split(' ')]
-    if req.form.has_key('heads'):
+    if 'heads' in req.form:
         heads = [bin(x) for x in req.form['heads'][0].split(' ')]
 
     z = zlib.compressobj()