wireprotoserver: don't import symbol from hgweb.common
authorGregory Szorc <gregory.szorc@gmail.com>
Wed, 31 Jan 2018 11:13:11 -0800
changeset 35858 1b76a9e0a9de
parent 35857 a42455b3dbf8
child 35859 1bf5263fe5cc
wireprotoserver: don't import symbol from hgweb.common Importing hgweb.common requires importing hgweb. hgweb/__init__.py contains a bit of code and does imports of large parts of the hgweb.* module tree. All we need is a constant defining the integer status code for HTTP OK. So just redefine HTTP_OK in wireprotoserver.py and avoid the excessive imports. Differential Revision: https://phab.mercurial-scm.org/D1967
mercurial/wireprotoserver.py
--- a/mercurial/wireprotoserver.py	Wed Jan 31 10:41:27 2018 -0800
+++ b/mercurial/wireprotoserver.py	Wed Jan 31 11:13:11 2018 -0800
@@ -9,9 +9,6 @@
 import cgi
 import struct
 
-from .hgweb.common import (
-    HTTP_OK,
-)
 from . import (
     error,
     pycompat,
@@ -24,6 +21,8 @@
 urlerr = util.urlerr
 urlreq = util.urlreq
 
+HTTP_OK = 200
+
 HGTYPE = 'application/mercurial-0.1'
 HGTYPE2 = 'application/mercurial-0.2'
 HGERRTYPE = 'application/hg-error'