##// END OF EJS Templates
bundle2: urlquote stream parameter name and value...
Pierre-Yves David -
r20811:9785c3f8 default
parent child Browse files
Show More
@@ -43,9 +43,7 b' Binary format is as follow'
43 43 parameters.
44 44
45 45 The blob contains a space separated list of parameters. parameter with value
46 are stored in the form `<name>=<value>`.
47
48 Special character in param name are not supported yet.
46 are stored in the form `<name>=<value>`. Both name and value are urlquoted.
49 47
50 48 Stream parameters use a simple textual format for two main reasons:
51 49
@@ -72,6 +70,7 b' Binary format is as follow'
72 70
73 71 import util
74 72 import struct
73 import urllib
75 74
76 75 import changegroup
77 76 from i18n import _
@@ -116,8 +115,9 b' class bundle20(object):'
116 115 """return a encoded version of all stream parameters"""
117 116 blocks = []
118 117 for par, value in self._params:
119 # XXX no escaping yet
118 par = urllib.quote(par)
120 119 if value is not None:
120 value = urllib.quote(value)
121 121 par = '%s=%s' % (par, value)
122 122 blocks.append(par)
123 123 return ' '.join(blocks)
@@ -132,3 +132,11 b' Test unbundling'
132 132 - meal
133 133 vegan
134 134 parts count: 0
135
136 parameter with special char in value
137 ---------------------------------------------------
138
139 Test generation
140
141 $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple
142 HG20\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00 (no-eol) (esc)
General Comments 0
You need to be logged in to leave comments. Login now