hgext/commitextras.py
changeset 48418 45a073af50a2
parent 43554 9f70512ae2cf
child 48966 6000f5b25c9b
equal deleted inserted replaced
48417:35f1ecd84bd0 48418:45a073af50a2
    63                 if b'=' not in raw:
    63                 if b'=' not in raw:
    64                     msg = _(
    64                     msg = _(
    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.Abort(msg % raw)
    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.Abort(msg % raw)
    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.Abort(msg)
    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.Abort(msg % k)
    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 
    88     repo.__class__ = repoextra
    88     repo.__class__ = repoextra
    89     return orig(ui, repo, *pats, **opts)
    89     return orig(ui, repo, *pats, **opts)