Patchwork D1965: wireprotoserver: rename hgweb.protocol to wireprotoserver (API)

login
register
mail settings
Submitter phabricator
Date Feb. 1, 2018, 10:56 p.m.
Message ID <c018e2aeb2223d23927ffd46d98e122d@localhost.localdomain>
Download mbox | patch
Permalink /patch/27159/
State Not Applicable
Headers show

Comments

phabricator - Feb. 1, 2018, 10:56 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG1aa42928bb47: wireprotoserver: rename hgweb.protocol to wireprotoserver (API) (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1965?vs=5045&id=5090

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

AFFECTED FILES
  mercurial/hgweb/hgweb_mod.py
  mercurial/hgweb/protocol.py
  mercurial/wireprotoserver.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/hgweb/protocol.py b/mercurial/wireprotoserver.py
rename from mercurial/hgweb/protocol.py
rename to mercurial/wireprotoserver.py
--- a/mercurial/hgweb/protocol.py
+++ b/mercurial/wireprotoserver.py
@@ -1,4 +1,3 @@ 
-#
 # Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net>
 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
 #
@@ -10,16 +9,16 @@ 
 import cgi
 import struct
 
-from .common import (
+from .hgweb.common import (
     HTTP_OK,
 )
-
-from .. import (
+from . import (
     error,
     pycompat,
     util,
     wireproto,
 )
+
 stringio = util.stringio
 
 urlerr = util.urlerr
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
@@ -36,10 +36,10 @@ 
     templater,
     ui as uimod,
     util,
+    wireprotoserver,
 )
 
 from . import (
-    protocol,
     webcommands,
     webutil,
     wsgicgi,
@@ -362,13 +362,13 @@ 
         # and the clients always use the old URL structure
 
         cmd = pycompat.sysbytes(req.form.get(r'cmd', [r''])[0])
-        if protocol.iscmd(cmd):
+        if wireprotoserver.iscmd(cmd):
             try:
                 if query:
                     raise ErrorResponse(HTTP_NOT_FOUND)
                 if cmd in perms:
                     self.check_perm(rctx, req, perms[cmd])
-                return protocol.call(rctx.repo, req, cmd)
+                return wireprotoserver.call(rctx.repo, req, cmd)
             except ErrorResponse as inst:
                 # A client that sends unbundle without 100-continue will
                 # break if we respond early.
@@ -379,7 +379,7 @@ 
                     req.drain()
                 else:
                     req.headers.append((r'Connection', r'Close'))
-                req.respond(inst, protocol.HGTYPE,
+                req.respond(inst, wireprotoserver.HGTYPE,
                             body='0\n%s\n' % inst)
                 return ''