mirror of
https://github.com/facebook/sapling.git
synced 2025-01-07 14:10:42 +03:00
py3: fix test-wireproto.py
Summary: Makes it pass Reviewed By: xavierd Differential Revision: D20933051 fbshipit-source-id: e32ff04597a86fb9674b5a734acc856456f48033
This commit is contained in:
parent
b2c2642e82
commit
cf4a93bfa0
@ -520,7 +520,7 @@ class wirepeer(repository.legacypeer):
|
||||
while b";" not in chunk and chunk:
|
||||
chunk = rsp.read(1024)
|
||||
work.append(chunk)
|
||||
merged = "".join(work)
|
||||
merged = b"".join(work)
|
||||
while b";" in merged:
|
||||
one, merged = merged.split(b";", 1)
|
||||
yield unescapebytearg(one)
|
||||
|
@ -1,12 +1,9 @@
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
from edenscm.mercurial import ui, util, wireproto
|
||||
from edenscm.mercurial import pycompat, ui, util, wireproto
|
||||
from hghave import require
|
||||
|
||||
|
||||
require(["py2"])
|
||||
|
||||
|
||||
stringio = util.stringio
|
||||
|
||||
|
||||
@ -48,7 +45,9 @@ class clientpeer(wireproto.wirepeer):
|
||||
return ["batch"]
|
||||
|
||||
def _call(self, cmd, **args):
|
||||
return wireproto.dispatch(self.serverrepo, proto(args), cmd)
|
||||
return pycompat.encodeutf8(
|
||||
wireproto.dispatch(self.serverrepo, proto(args), cmd)
|
||||
)
|
||||
|
||||
def _callstream(self, cmd, **args):
|
||||
return stringio(self._call(cmd, **args))
|
||||
@ -57,7 +56,7 @@ class clientpeer(wireproto.wirepeer):
|
||||
def greet(self, name):
|
||||
f = wireproto.future()
|
||||
yield {"name": mangle(name)}, f
|
||||
yield unmangle(f.value)
|
||||
yield unmangle(pycompat.decodeutf8(f.value))
|
||||
|
||||
|
||||
class serverrepo(object):
|
||||
|
Loading…
Reference in New Issue
Block a user