Page MenuHomePhabricator
Paste P968

hg_wire_proto.py
ActivePublic

Authored by epriestley on Nov 5 2013, 3:43 AM.
Tags
None
Referenced Files
F78490: hg_wire_proto.py
Nov 5 2013, 3:43 AM
Subscribers
None
# list of nodes encoding / decoding
def decodelist(l, sep=' '):
if l:
return map(bin, l.split(sep))
return []
def encodelist(l, sep=' '):
return sep.join(map(hex, l))
# batched call argument encoding
def escapearg(plain):
return (plain
.replace(':', '::')
.replace(',', ':,')
.replace(';', ':;')
.replace('=', ':='))
def unescapearg(escaped):
return (escaped
.replace(':=', '=')
.replace(':;', ';')
.replace(':,', ',')
.replace('::', ':'))
# client side
def todict(**args):
return args

Event Timeline

epriestley changed the title of this paste from untitled to hg_wire_proto.py.
epriestley updated the paste's language from autodetect to autodetect.