##// END OF EJS Templates
wireprotoserver: rename hgweb.protocol to wireprotoserver (API)...
Gregory Szorc -
r35874:ef3a24a0 default
parent child Browse files
Show More
@@ -36,10 +36,10 b' from .. import ('
36 templater,
36 templater,
37 ui as uimod,
37 ui as uimod,
38 util,
38 util,
39 wireprotoserver,
39 )
40 )
40
41
41 from . import (
42 from . import (
42 protocol,
43 webcommands,
43 webcommands,
44 webutil,
44 webutil,
45 wsgicgi,
45 wsgicgi,
@@ -362,13 +362,13 b' class hgweb(object):'
362 # and the clients always use the old URL structure
362 # and the clients always use the old URL structure
363
363
364 cmd = pycompat.sysbytes(req.form.get(r'cmd', [r''])[0])
364 cmd = pycompat.sysbytes(req.form.get(r'cmd', [r''])[0])
365 if protocol.iscmd(cmd):
365 if wireprotoserver.iscmd(cmd):
366 try:
366 try:
367 if query:
367 if query:
368 raise ErrorResponse(HTTP_NOT_FOUND)
368 raise ErrorResponse(HTTP_NOT_FOUND)
369 if cmd in perms:
369 if cmd in perms:
370 self.check_perm(rctx, req, perms[cmd])
370 self.check_perm(rctx, req, perms[cmd])
371 return protocol.call(rctx.repo, req, cmd)
371 return wireprotoserver.call(rctx.repo, req, cmd)
372 except ErrorResponse as inst:
372 except ErrorResponse as inst:
373 # A client that sends unbundle without 100-continue will
373 # A client that sends unbundle without 100-continue will
374 # break if we respond early.
374 # break if we respond early.
@@ -379,7 +379,7 b' class hgweb(object):'
379 req.drain()
379 req.drain()
380 else:
380 else:
381 req.headers.append((r'Connection', r'Close'))
381 req.headers.append((r'Connection', r'Close'))
382 req.respond(inst, protocol.HGTYPE,
382 req.respond(inst, wireprotoserver.HGTYPE,
383 body='0\n%s\n' % inst)
383 body='0\n%s\n' % inst)
384 return ''
384 return ''
385
385
@@ -1,4 +1,3 b''
1 #
2 # Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net>
1 # Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net>
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
2 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
4 #
3 #
@@ -10,16 +9,16 b' from __future__ import absolute_import'
10 import cgi
9 import cgi
11 import struct
10 import struct
12
11
13 from .common import (
12 from .hgweb.common import (
14 HTTP_OK,
13 HTTP_OK,
15 )
14 )
16
15 from . import (
17 from .. import (
18 error,
16 error,
19 pycompat,
17 pycompat,
20 util,
18 util,
21 wireproto,
19 wireproto,
22 )
20 )
21
23 stringio = util.stringio
22 stringio = util.stringio
24
23
25 urlerr = util.urlerr
24 urlerr = util.urlerr
General Comments 0
You need to be logged in to leave comments. Login now