Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P968
hg_wire_proto.py
Active
Public
Actions
Authored by
epriestley
on Nov 5 2013, 3:43 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F78490: hg_wire_proto.py
Nov 5 2013, 3:43 AM
2013-11-05 03:43:01 (UTC+0)
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
edited the content of this paste.
(Show Details)
Nov 5 2013, 3:43 AM
2013-11-05 03:43:01 (UTC+0)
epriestley
changed the title of this paste from untitled to
hg_wire_proto.py
.
epriestley
updated the paste's language from
autodetect
to
autodetect
.
Log In to Comment