merge with stable
authorMatt Mackall <mpm@selenic.com>
Sat, 27 Sep 2014 14:47:52 -0500
changeset 22560 4109cc16279e
parent 22559 4e0b696a1cb3 (current diff)
parent 22506 6e1fbcb18a75 (diff)
child 22561 1120b1e2f975
merge with stable
mercurial/hgweb/hgweb_mod.py
tests/test-hgweb.t
--- a/mercurial/hgweb/hgweb_mod.py	Fri Sep 26 16:44:11 2014 -0500
+++ b/mercurial/hgweb/hgweb_mod.py	Sat Sep 27 14:47:52 2014 -0500
@@ -200,8 +200,6 @@
             # avoid accepting e.g. style parameter as command
             if util.safehasattr(webcommands, cmd):
                 req.form['cmd'] = [cmd]
-            else:
-                cmd = ''
 
             if cmd == 'static':
                 req.form['file'] = ['/'.join(args)]
--- a/mercurial/keepalive.py	Fri Sep 26 16:44:11 2014 -0500
+++ b/mercurial/keepalive.py	Sat Sep 27 14:47:52 2014 -0500
@@ -635,7 +635,7 @@
     fo = urllib2.urlopen(url)
     foo = fo.read()
     fo.close()
-    m = md5.new(foo)
+    m = md5(foo)
     print format % ('normal urllib', m.hexdigest())
 
     # now install the keepalive handler and try again
@@ -645,7 +645,7 @@
     fo = urllib2.urlopen(url)
     foo = fo.read()
     fo.close()
-    m = md5.new(foo)
+    m = md5(foo)
     print format % ('keepalive read', m.hexdigest())
 
     fo = urllib2.urlopen(url)
@@ -656,7 +656,7 @@
             foo = foo + f
         else: break
     fo.close()
-    m = md5.new(foo)
+    m = md5(foo)
     print format % ('keepalive readline', m.hexdigest())
 
 def comp(N, url):
--- a/tests/test-hgweb.t	Fri Sep 26 16:44:11 2014 -0500
+++ b/tests/test-hgweb.t	Sat Sep 27 14:47:52 2014 -0500
@@ -122,6 +122,24 @@
   error: no such method: spam
   [1]
 
+  $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT '?cmd=spam'
+  400 no such method: spam
+  [1]
+
+should give a 400 - bad command as a part of url path (issue4071)
+
+  $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'spam'
+  400 no such method: spam
+  [1]
+
+  $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'raw-spam'
+  400 no such method: spam
+  [1]
+
+  $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'spam/tip/foo'
+  400 no such method: spam
+  [1]
+
 should give a 404 - file does not exist
 
   $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/bork?style=raw'
@@ -308,7 +326,7 @@
 Test the access/error files are opened in append mode
 
   $ python -c "print len(file('access.log').readlines()), 'log lines written'"
-  10 log lines written
+  14 log lines written
 
 static file