Show More
@@ -47,6 +47,10 b' Binary format is as follow' | |||||
47 |
|
47 | |||
48 | Empty name are obviously forbidden. |
|
48 | Empty name are obviously forbidden. | |
49 |
|
49 | |||
|
50 | Name MUST start with a letter. This first character has to be capitalizable. | |||
|
51 | The capitalisation of the first letter will be used to know if an option is | |||
|
52 | advisory or mandatory. This is not implemented yet. | |||
|
53 | ||||
50 | Stream parameters use a simple textual format for two main reasons: |
|
54 | Stream parameters use a simple textual format for two main reasons: | |
51 |
|
55 | |||
52 | - Stream level parameters should remains simple and we want to discourage any |
|
56 | - Stream level parameters should remains simple and we want to discourage any | |
@@ -72,6 +76,7 b' Binary format is as follow' | |||||
72 | import util |
|
76 | import util | |
73 | import struct |
|
77 | import struct | |
74 | import urllib |
|
78 | import urllib | |
|
79 | import string | |||
75 |
|
80 | |||
76 | import changegroup |
|
81 | import changegroup | |
77 | from i18n import _ |
|
82 | from i18n import _ | |
@@ -100,6 +105,8 b' class bundle20(object):' | |||||
100 | """add a stream level parameter""" |
|
105 | """add a stream level parameter""" | |
101 | if not name: |
|
106 | if not name: | |
102 | raise ValueError('empty parameter name') |
|
107 | raise ValueError('empty parameter name') | |
|
108 | if name[0] not in string.letters: | |||
|
109 | raise ValueError('non letter first character: %r' % name) | |||
103 | self._params.append((name, value)) |
|
110 | self._params.append((name, value)) | |
104 |
|
111 | |||
105 | def getchunks(self): |
|
112 | def getchunks(self): |
@@ -162,3 +162,9 b' empty parameter name' | |||||
162 | $ hg bundle2 --param '' --quiet |
|
162 | $ hg bundle2 --param '' --quiet | |
163 | abort: empty parameter name |
|
163 | abort: empty parameter name | |
164 | [255] |
|
164 | [255] | |
|
165 | ||||
|
166 | bad parameter name | |||
|
167 | ||||
|
168 | $ hg bundle2 --param 42babar | |||
|
169 | abort: non letter first character: '42babar' | |||
|
170 | [255] |
General Comments 0
You need to be logged in to leave comments.
Login now