Show More
@@ -65,23 +65,23 b' def _commit(orig, ui, repo, *pats, **opt' | |||||
65 | b"unable to parse '%s', should follow " |
|
65 | b"unable to parse '%s', should follow " | |
66 | b"KEY=VALUE format" |
|
66 | b"KEY=VALUE format" | |
67 | ) |
|
67 | ) | |
68 |
raise error. |
|
68 | raise error.InputError(msg % raw) | |
69 | k, v = raw.split(b'=', 1) |
|
69 | k, v = raw.split(b'=', 1) | |
70 | if not k: |
|
70 | if not k: | |
71 | msg = _(b"unable to parse '%s', keys can't be empty") |
|
71 | msg = _(b"unable to parse '%s', keys can't be empty") | |
72 |
raise error. |
|
72 | raise error.InputError(msg % raw) | |
73 | if re.search(br'[^\w-]', k): |
|
73 | if re.search(br'[^\w-]', k): | |
74 | msg = _( |
|
74 | msg = _( | |
75 | b"keys can only contain ascii letters, digits," |
|
75 | b"keys can only contain ascii letters, digits," | |
76 | b" '_' and '-'" |
|
76 | b" '_' and '-'" | |
77 | ) |
|
77 | ) | |
78 |
raise error. |
|
78 | raise error.InputError(msg) | |
79 | if k in usedinternally: |
|
79 | if k in usedinternally: | |
80 | msg = _( |
|
80 | msg = _( | |
81 | b"key '%s' is used internally, can't be set " |
|
81 | b"key '%s' is used internally, can't be set " | |
82 | b"manually" |
|
82 | b"manually" | |
83 | ) |
|
83 | ) | |
84 |
raise error. |
|
84 | raise error.InputError(msg % k) | |
85 | inneropts['extra'][k] = v |
|
85 | inneropts['extra'][k] = v | |
86 | return super(repoextra, self).commit(*innerpats, **inneropts) |
|
86 | return super(repoextra, self).commit(*innerpats, **inneropts) | |
87 |
|
87 |
@@ -134,13 +134,13 b' Using the advanced --extra flag' | |||||
134 | $ hg add quux |
|
134 | $ hg add quux | |
135 | $ hg commit -m "adding internal used extras" --extra amend_source=hash |
|
135 | $ hg commit -m "adding internal used extras" --extra amend_source=hash | |
136 | abort: key 'amend_source' is used internally, can't be set manually |
|
136 | abort: key 'amend_source' is used internally, can't be set manually | |
137 |
[ |
|
137 | [10] | |
138 | $ hg commit -m "special chars in extra" --extra id@phab=214 |
|
138 | $ hg commit -m "special chars in extra" --extra id@phab=214 | |
139 | abort: keys can only contain ascii letters, digits, '_' and '-' |
|
139 | abort: keys can only contain ascii letters, digits, '_' and '-' | |
140 |
[ |
|
140 | [10] | |
141 | $ hg commit -m "empty key" --extra =value |
|
141 | $ hg commit -m "empty key" --extra =value | |
142 | abort: unable to parse '=value', keys can't be empty |
|
142 | abort: unable to parse '=value', keys can't be empty | |
143 |
[ |
|
143 | [10] | |
144 | $ hg commit -m "adding extras" --extra sourcehash=foo --extra oldhash=bar |
|
144 | $ hg commit -m "adding extras" --extra sourcehash=foo --extra oldhash=bar | |
145 | $ hg log -r . -T '{extras % "{extra}\n"}' |
|
145 | $ hg log -r . -T '{extras % "{extra}\n"}' | |
146 | branch=default |
|
146 | branch=default |
General Comments 0
You need to be logged in to leave comments.
Login now