Show More
@@ -152,7 +152,10 b' class unbundle20(object):' | |||||
152 | paramssize = self._unpack(_fstreamparamsize)[0] |
|
152 | paramssize = self._unpack(_fstreamparamsize)[0] | |
153 | if paramssize: |
|
153 | if paramssize: | |
154 | for p in self._readexact(paramssize).split(' '): |
|
154 | for p in self._readexact(paramssize).split(' '): | |
155 | params[p] = None |
|
155 | p = p.split('=', 1) | |
|
156 | if len(p) < 2: | |||
|
157 | p.append(None) | |||
|
158 | params[p[0]] = p[1] | |||
156 | return params |
|
159 | return params | |
157 |
|
160 | |||
158 | def __iter__(self): |
|
161 | def __iter__(self): |
@@ -34,6 +34,9 b' Create an extension to test bundle2 API' | |||||
34 | > ui.write('options count: %i\n' % len(unbundler.params)) |
|
34 | > ui.write('options count: %i\n' % len(unbundler.params)) | |
35 | > for key in sorted(unbundler.params): |
|
35 | > for key in sorted(unbundler.params): | |
36 | > ui.write('- %s\n' % key) |
|
36 | > ui.write('- %s\n' % key) | |
|
37 | > value = unbundler.params[key] | |||
|
38 | > if value is not None: | |||
|
39 | > ui.write(' %s\n' % value) | |||
37 | > parts = list(unbundler) |
|
40 | > parts = list(unbundler) | |
38 | > ui.write('parts count: %i\n' % len(parts)) |
|
41 | > ui.write('parts count: %i\n' % len(parts)) | |
39 | > EOF |
|
42 | > EOF | |
@@ -120,3 +123,12 b' Test generation' | |||||
120 | $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants' |
|
123 | $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants' | |
121 | HG20\x00\x1ccaution meal=vegan elephants\x00\x00 (no-eol) (esc) |
|
124 | HG20\x00\x1ccaution meal=vegan elephants\x00\x00 (no-eol) (esc) | |
122 |
|
125 | |||
|
126 | Test unbundling | |||
|
127 | ||||
|
128 | $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants' | hg unbundle2 | |||
|
129 | options count: 3 | |||
|
130 | - caution | |||
|
131 | - elephants | |||
|
132 | - meal | |||
|
133 | vegan | |||
|
134 | parts count: 0 |
General Comments 0
You need to be logged in to leave comments.
Login now