##// END OF EJS Templates
revset: store full detail into revsetalias.error for error source distinction...
FUJIWARA Katsunori -
r23844:ddf2172e default
parent child Browse files
Show More
@@ -2154,7 +2154,8 b' class revsetalias(object):'
2154 # Check for placeholder injection
2154 # Check for placeholder injection
2155 _checkaliasarg(self.replacement, self.args)
2155 _checkaliasarg(self.replacement, self.args)
2156 except error.ParseError, inst:
2156 except error.ParseError, inst:
2157 self.error = parseerrordetail(inst)
2157 self.error = _('failed to parse the definition of revset alias'
2158 ' "%s": %s') % (self.name, parseerrordetail(inst))
2158
2159
2159 def _getalias(aliases, tree):
2160 def _getalias(aliases, tree):
2160 """If tree looks like an unexpanded alias, return it. Return None
2161 """If tree looks like an unexpanded alias, return it. Return None
@@ -2197,8 +2198,7 b' def _expandaliases(aliases, tree, expand'
2197 alias = _getalias(aliases, tree)
2198 alias = _getalias(aliases, tree)
2198 if alias is not None:
2199 if alias is not None:
2199 if alias.error:
2200 if alias.error:
2200 raise util.Abort(_('failed to parse revset alias "%s": %s') %
2201 raise util.Abort(alias.error)
2201 (alias.name, alias.error))
2202 if alias in expanding:
2202 if alias in expanding:
2203 raise error.ParseError(_('infinite expansion of revset alias "%s" '
2203 raise error.ParseError(_('infinite expansion of revset alias "%s" '
2204 'detected') % alias.name)
2204 'detected') % alias.name)
@@ -2231,9 +2231,7 b' def findaliases(ui, tree, showwarning=No'
2231 # warn about problematic (but not referred) aliases
2231 # warn about problematic (but not referred) aliases
2232 for name, alias in sorted(aliases.iteritems()):
2232 for name, alias in sorted(aliases.iteritems()):
2233 if alias.error and not alias.warned:
2233 if alias.error and not alias.warned:
2234 msg = _('failed to parse revset alias "%s": %s'
2234 showwarning(_('warning: %s\n') % (alias.error))
2235 ) % (name, alias.error)
2236 showwarning(_('warning: %s\n') % (msg))
2237 alias.warned = True
2235 alias.warned = True
2238 return tree
2236 return tree
2239
2237
@@ -985,12 +985,12 b' far away.'
985 (range
985 (range
986 ('symbol', '2')
986 ('symbol', '2')
987 ('symbol', '5')))
987 ('symbol', '5')))
988 abort: failed to parse revset alias "injectparamasstring2": not a function: _aliasarg
988 abort: failed to parse the definition of revset alias "injectparamasstring2": not a function: _aliasarg
989 [255]
989 [255]
990 $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip"
990 $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip"
991 ('symbol', 'tip')
991 ('symbol', 'tip')
992 warning: failed to parse revset alias "anotherbadone": at 7: not a prefix: end
992 warning: failed to parse the definition of revset alias "anotherbadone": at 7: not a prefix: end
993 warning: failed to parse revset alias "injectparamasstring2": not a function: _aliasarg
993 warning: failed to parse the definition of revset alias "injectparamasstring2": not a function: _aliasarg
994 9
994 9
995 >>> data = file('.hg/hgrc', 'rb').read()
995 >>> data = file('.hg/hgrc', 'rb').read()
996 >>> file('.hg/hgrc', 'wb').write(data.replace('_aliasarg', ''))
996 >>> file('.hg/hgrc', 'wb').write(data.replace('_aliasarg', ''))
General Comments 0
You need to be logged in to leave comments. Login now