##// END OF EJS Templates
bundle2: support for bundling parameter value...
Pierre-Yves David -
r20809:b93bb639 default
parent child Browse files
Show More
@@ -42,9 +42,8 b' Binary format is as follow'
42 A blob of `params size` containing the serialized version of all stream level
42 A blob of `params size` containing the serialized version of all stream level
43 parameters.
43 parameters.
44
44
45 The blob contains a space separated list of parameters.
45 The blob contains a space separated list of parameters. parameter with value
46
46 are stored in the form `<name>=<value>`.
47 Parameter value are not supported yet.
48
47
49 Special character in param name are not supported yet.
48 Special character in param name are not supported yet.
50
49
@@ -116,11 +115,11 b' class bundle20(object):'
116 def _paramchunk(self):
115 def _paramchunk(self):
117 """return a encoded version of all stream parameters"""
116 """return a encoded version of all stream parameters"""
118 blocks = []
117 blocks = []
119 for key, value in self._params:
118 for par, value in self._params:
120 # XXX no support for value yet
121 assert value is None
122 # XXX no escaping yet
119 # XXX no escaping yet
123 blocks.append(key)
120 if value is not None:
121 par = '%s=%s' % (par, value)
122 blocks.append(par)
124 return ' '.join(blocks)
123 return ' '.join(blocks)
125
124
126 class unbundle20(object):
125 class unbundle20(object):
@@ -21,7 +21,9 b' Create an extension to test bundle2 API'
21 > """write a bundle2 container on standard ouput"""
21 > """write a bundle2 container on standard ouput"""
22 > bundler = bundle2.bundle20()
22 > bundler = bundle2.bundle20()
23 > for p in opts['param']:
23 > for p in opts['param']:
24 > bundler.addparam(p)
24 > p = p.split('=', 1)
25 > bundler.addparam(*p)
26 >
25 > for chunk in bundler.getchunks():
27 > for chunk in bundler.getchunks():
26 > ui.write(chunk)
28 > ui.write(chunk)
27 >
29 >
@@ -110,3 +112,11 b' Test unbundling'
110 - meal
112 - meal
111 parts count: 0
113 parts count: 0
112
114
115 advisory parameters, with value
116 -------------------------------
117
118 Test generation
119
120 $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants'
121 HG20\x00\x1ccaution meal=vegan elephants\x00\x00 (no-eol) (esc)
122
General Comments 0
You need to be logged in to leave comments. Login now