diff mercurial/hgweb/hgweb_mod.py @ 36866:cf69df7ea385

hgweb: remove wsgirequest.form (API) Now that everything is ported to consume from parsedrequest.qsparams, we no longer have a need for wsgirequest.form. Let's remove all references to it. .. api:: The WSGI request object no longer exposes a ``form`` attribute containing parsed query string data. Use the ``qsparams`` attribute instead. Differential Revision: https://phab.mercurial-scm.org/D2782
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 10 Mar 2018 12:31:11 -0800
parents 3d60a22e27f5
children 8ddb5c354906
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py	Sat Mar 10 12:36:36 2018 -0800
+++ b/mercurial/hgweb/hgweb_mod.py	Sat Mar 10 12:31:11 2018 -0800
@@ -341,19 +341,15 @@
 
             # avoid accepting e.g. style parameter as command
             if util.safehasattr(webcommands, cmd):
-                wsgireq.form['cmd'] = [cmd]
                 req.qsparams['cmd'] = cmd
 
             if cmd == 'static':
-                wsgireq.form['file'] = ['/'.join(args)]
                 req.qsparams['file'] = '/'.join(args)
             else:
                 if args and args[0]:
                     node = args.pop(0).replace('%2F', '/')
-                    wsgireq.form['node'] = [node]
                     req.qsparams['node'] = node
                 if args:
-                    wsgireq.form['file'] = args
                     if 'file' in req.qsparams:
                         del req.qsparams['file']
                     for a in args:
@@ -368,9 +364,7 @@
                 for type_, spec in rctx.archivespecs.iteritems():
                     ext = spec[2]
                     if fn.endswith(ext):
-                        wsgireq.form['node'] = [fn[:-len(ext)]]
                         req.qsparams['node'] = fn[:-len(ext)]
-                        wsgireq.form['type'] = [type_]
                         req.qsparams['type'] = type_
         else:
             cmd = req.qsparams.get('cmd', '')
@@ -387,7 +381,6 @@
                 self.check_perm(rctx, wsgireq, None)
 
             if cmd == '':
-                wsgireq.form['cmd'] = [tmpl.cache['default']]
                 req.qsparams['cmd'] = tmpl.cache['default']
                 cmd = req.qsparams['cmd']