D2780: hgweb: set variables in qsparams

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Mon Mar 12 17:32:56 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG4e06e8336634: hgweb: set variables in qsparams (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2780?vs=6841&id=6916

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

AFFECTED FILES
  mercurial/hgweb/hgweb_mod.py

CHANGE DETAILS

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
@@ -342,15 +342,22 @@
             # 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:
+                        req.qsparams.add('file', a)
 
             ua = req.headers.get('User-Agent', '')
             if cmd == 'rev' and 'mercurial' in ua:
@@ -362,7 +369,9 @@
                     ext = spec[2]
                     if fn.endswith(ext):
                         wsgireq.form['node'] = [fn[:-len(ext)]]
+                        req.qsparams['node'] = fn[:-len(next)]
                         wsgireq.form['type'] = [type_]
+                        req.qsparams['type'] = type_
         else:
             cmd = wsgireq.form.get('cmd', [''])[0]
 
@@ -379,6 +388,7 @@
 
             if cmd == '':
                 wsgireq.form['cmd'] = [tmpl.cache['default']]
+                req.qsparams['cmd'] = tmpl.cache['default']
                 cmd = wsgireq.form['cmd'][0]
 
             # Don't enable caching if using a CSP nonce because then it wouldn't



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


More information about the Mercurial-devel mailing list