.editorconfig
author Gregory Szorc <gregory.szorc@gmail.com>
Sat, 10 Mar 2018 10:20:51 -0800
changeset 36814 69b2d0900cd7
parent 28793 d30fdd6d1bf7
child 38293 1d6066336d7b
permissions -rw-r--r--
hgweb: parse WSGI request into a data structure Currently, our WSGI applications (hgweb_mod and hgwebdir_mod) process the raw WSGI request instance themselves. This means they have to talk in terms of system strings. And they need to know details about what's in the WSGI request. And in the case of hgweb_mod, it is doing some very funky things with URL parsing to impact dispatching. The code is difficult to read and maintain. This commit introduces parsing of the WSGI request into a higher-level and easier-to-reason-about data structure. To prove it works, we hook it up to hgweb_mod and use it for populating the relative URL on the request instance. We hold off on using it in more places because the logic in hgweb_mod is crazy and I don't want to involve those changes with review of the parsing code. The URL construction code has variations that use the HTTP: Host header (the canonical WSGI way of reconstructing the URL) and with the use of SERVER_NAME. We need to differentiate because hgweb is currently using SERVER_NAME for URL construction. Differential Revision: https://phab.mercurial-scm.org/D2734
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28793
d30fdd6d1bf7 mercurial: add editorconfig
Jun Wu <quark@fb.com>
parents:
diff changeset
     1
# See http://EditorConfig.org for the specification
d30fdd6d1bf7 mercurial: add editorconfig
Jun Wu <quark@fb.com>
parents:
diff changeset
     2
d30fdd6d1bf7 mercurial: add editorconfig
Jun Wu <quark@fb.com>
parents:
diff changeset
     3
root = true
d30fdd6d1bf7 mercurial: add editorconfig
Jun Wu <quark@fb.com>
parents:
diff changeset
     4
d30fdd6d1bf7 mercurial: add editorconfig
Jun Wu <quark@fb.com>
parents:
diff changeset
     5
[*.py]
d30fdd6d1bf7 mercurial: add editorconfig
Jun Wu <quark@fb.com>
parents:
diff changeset
     6
indent_size = 4
d30fdd6d1bf7 mercurial: add editorconfig
Jun Wu <quark@fb.com>
parents:
diff changeset
     7
indent_style = space
d30fdd6d1bf7 mercurial: add editorconfig
Jun Wu <quark@fb.com>
parents:
diff changeset
     8
trim_trailing_whitespace = true
d30fdd6d1bf7 mercurial: add editorconfig
Jun Wu <quark@fb.com>
parents:
diff changeset
     9
d30fdd6d1bf7 mercurial: add editorconfig
Jun Wu <quark@fb.com>
parents:
diff changeset
    10
[*.{c,h}]
d30fdd6d1bf7 mercurial: add editorconfig
Jun Wu <quark@fb.com>
parents:
diff changeset
    11
indent_size = 8
d30fdd6d1bf7 mercurial: add editorconfig
Jun Wu <quark@fb.com>
parents:
diff changeset
    12
indent_style = tab
d30fdd6d1bf7 mercurial: add editorconfig
Jun Wu <quark@fb.com>
parents:
diff changeset
    13
trim_trailing_whitespace = true