D1967: wireprotoserver: don't import symbol from hgweb.common
indygreg (Gregory Szorc)
phabricator at mercurial-scm.org
Thu Feb 1 20:19:24 UTC 2018
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
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.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D1967
AFFECTED FILES
mercurial/wireprotoserver.py
CHANGE DETAILS
diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py
--- a/mercurial/wireprotoserver.py
+++ b/mercurial/wireprotoserver.py
@@ -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'
To: indygreg, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list