Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 24219:282c0d8c1880
revset: use UnknownIdentifier where appropriate
author | Augie Fackler <augie@google.com> |
---|---|
date | Mon, 26 Jan 2015 14:32:30 -0500 |
parents | d2de20e1451f |
children | 6ddc86eedc3b |
comparison
equal
deleted
inserted
replaced
24218:cecaec0e8719 | 24219:282c0d8c1880 |
---|---|
366 raise error.ParseError(_("can't use a list in this context")) | 366 raise error.ParseError(_("can't use a list in this context")) |
367 | 367 |
368 def func(repo, subset, a, b): | 368 def func(repo, subset, a, b): |
369 if a[0] == 'symbol' and a[1] in symbols: | 369 if a[0] == 'symbol' and a[1] in symbols: |
370 return symbols[a[1]](repo, subset, b) | 370 return symbols[a[1]](repo, subset, b) |
371 raise error.ParseError(_("not a function: %s") % a[1]) | 371 raise error.UnknownIdentifier(a[1], symbols.keys()) |
372 | 372 |
373 # functions | 373 # functions |
374 | 374 |
375 def adds(repo, subset, x): | 375 def adds(repo, subset, x): |
376 """``adds(pattern)`` | 376 """``adds(pattern)`` |
2149 value is in known. Used to avoid alias placeholders injection. | 2149 value is in known. Used to avoid alias placeholders injection. |
2150 """ | 2150 """ |
2151 if isinstance(tree, tuple): | 2151 if isinstance(tree, tuple): |
2152 arg = _getaliasarg(tree) | 2152 arg = _getaliasarg(tree) |
2153 if arg is not None and (not known or arg not in known): | 2153 if arg is not None and (not known or arg not in known): |
2154 raise error.ParseError(_("not a function: %s") % '_aliasarg') | 2154 raise error.UnknownIdentifier('_aliasarg', []) |
2155 for t in tree: | 2155 for t in tree: |
2156 _checkaliasarg(t, known) | 2156 _checkaliasarg(t, known) |
2157 | 2157 |
2158 # the set of valid characters for the initial letter of symbols in | 2158 # the set of valid characters for the initial letter of symbols in |
2159 # alias declarations and definitions | 2159 # alias declarations and definitions |