D1084: hgweb: detect Python 3-era libraries and use modern attribute names
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Sun Oct 15 09:27:17 EDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG6e1b05692b2c: hgweb: detect Python 3-era libraries and use modern attribute names (authored by durin42, committed by ).
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D1084?vs=2764&id=2774
REVISION DETAIL
https://phab.mercurial-scm.org/D1084
AFFECTED FILES
mercurial/hgweb/server.py
CHANGE DETAILS
diff --git a/mercurial/hgweb/server.py b/mercurial/hgweb/server.py
--- a/mercurial/hgweb/server.py
+++ b/mercurial/hgweb/server.py
@@ -130,7 +130,13 @@
if query:
env[r'QUERY_STRING'] = query
- if True:
+ if pycompat.ispy3:
+ if self.headers.get_content_type() is None:
+ env[r'CONTENT_TYPE'] = self.headers.get_default_type()
+ else:
+ env[r'CONTENT_TYPE'] = self.headers.get_content_type()
+ length = self.headers.get('content-length')
+ else:
if self.headers.typeheader is None:
env[r'CONTENT_TYPE'] = self.headers.type
else:
To: durin42, #hg-reviewers, yuja
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list