Show More
@@ -49,25 +49,24 b' def _commit(orig, ui, repo, *pats, **opt' | |||||
49 | class repoextra(repo.__class__): |
|
49 | class repoextra(repo.__class__): | |
50 | def commit(self, *innerpats, **inneropts): |
|
50 | def commit(self, *innerpats, **inneropts): | |
51 | extras = opts.get(r'extra') |
|
51 | extras = opts.get(r'extra') | |
52 |
|
|
52 | for raw in extras: | |
53 |
f |
|
53 | if '=' not in raw: | |
54 | if '=' not in raw: |
|
54 | msg = _("unable to parse '%s', should follow " | |
55 | msg = _("unable to parse '%s', should follow " |
|
55 | "KEY=VALUE format") | |
56 | "KEY=VALUE format") |
|
56 | raise error.Abort(msg % raw) | |
57 | raise error.Abort(msg % raw) |
|
57 | k, v = raw.split('=', 1) | |
58 | k, v = raw.split('=', 1) |
|
58 | if not k: | |
59 | if not k: |
|
59 | msg = _("unable to parse '%s', keys can't be empty") | |
60 | msg = _("unable to parse '%s', keys can't be empty") |
|
60 | raise error.Abort(msg % raw) | |
61 | raise error.Abort(msg % raw) |
|
61 | if re.search('[^\w-]', k): | |
62 | if re.search('[^\w-]', k): |
|
62 | msg = _("keys can only contain ascii letters, digits," | |
63 | msg = _("keys can only contain ascii letters, digits," |
|
63 | " '_' and '-'") | |
64 | " '_' and '-'") |
|
64 | raise error.Abort(msg) | |
65 | raise error.Abort(msg) |
|
65 | if k in usedinternally: | |
66 |
|
|
66 | msg = _("key '%s' is used internally, can't be set " | |
67 | msg = _("key '%s' is used internally, can't be set " |
|
67 | "manually") | |
68 | "manually") |
|
68 | raise error.Abort(msg % k) | |
69 | raise error.Abort(msg % k) |
|
69 | inneropts[r'extra'][k] = v | |
70 | inneropts[r'extra'][k] = v |
|
|||
71 | return super(repoextra, self).commit(*innerpats, **inneropts) |
|
70 | return super(repoextra, self).commit(*innerpats, **inneropts) | |
72 | repo.__class__ = repoextra |
|
71 | repo.__class__ = repoextra | |
73 | return orig(ui, repo, *pats, **opts) |
|
72 | return orig(ui, repo, *pats, **opts) |
General Comments 0
You need to be logged in to leave comments.
Login now