mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
wireproto: use proper UTF-8 handling for key lookup
Lookups happen in the local encoding space, but the wire protocol should be using UTF-8 for interoperability.
This commit is contained in:
parent
3d79b5ac97
commit
0d5b6162e5
@ -25,7 +25,7 @@ def encodelist(l, sep=' '):
|
||||
class wirerepository(repo.repository):
|
||||
def lookup(self, key):
|
||||
self.requirecap('lookup', _('look up remote revision'))
|
||||
d = self._call("lookup", key=key)
|
||||
d = self._call("lookup", key=encoding.fromlocal(key))
|
||||
success, data = d[:-1].split(" ", 1)
|
||||
if int(success):
|
||||
return bin(data)
|
||||
@ -213,7 +213,7 @@ def listkeys(repo, proto, namespace):
|
||||
|
||||
def lookup(repo, proto, key):
|
||||
try:
|
||||
r = hex(repo.lookup(key))
|
||||
r = hex(repo.lookup(encoding.tolocal(key)))
|
||||
success = 1
|
||||
except Exception, inst:
|
||||
r = str(inst)
|
||||
|
Loading…
Reference in New Issue
Block a user