##// 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 parameters.
43 parameters.
44
44
45 The blob contains a space separated list of parameters. parameter with value
45 The blob contains a space separated list of parameters. parameter with value
46 are stored in the form `<name>=<value>`.
46 are stored in the form `<name>=<value>`. Both name and value are urlquoted.
47
48 Special character in param name are not supported yet.
49
47
50 Stream parameters use a simple textual format for two main reasons:
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 import util
71 import util
74 import struct
72 import struct
73 import urllib
75
74
76 import changegroup
75 import changegroup
77 from i18n import _
76 from i18n import _
@@ -116,8 +115,9 b' class bundle20(object):'
116 """return a encoded version of all stream parameters"""
115 """return a encoded version of all stream parameters"""
117 blocks = []
116 blocks = []
118 for par, value in self._params:
117 for par, value in self._params:
119 # XXX no escaping yet
118 par = urllib.quote(par)
120 if value is not None:
119 if value is not None:
120 value = urllib.quote(value)
121 par = '%s=%s' % (par, value)
121 par = '%s=%s' % (par, value)
122 blocks.append(par)
122 blocks.append(par)
123 return ' '.join(blocks)
123 return ' '.join(blocks)
@@ -132,3 +132,11 b' Test unbundling'
132 - meal
132 - meal
133 vegan
133 vegan
134 parts count: 0
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