# HG changeset patch # User Yuya Nishihara # Date 1460866004 -32400 # Node ID e7c679738503a400032fa67293d3c9f977ddc63e # Parent 81bac118f9e24fab0e2721b817f843806add857a revset: define _parsealias() in _aliasrules class It's short. It doesn't make sense to define _parsealias() outside of the class. diff -r 81bac118f9e2 -r e7c679738503 mercurial/revset.py --- a/mercurial/revset.py Sun Apr 17 13:03:23 2016 +0900 +++ b/mercurial/revset.py Sun Apr 17 13:06:44 2016 +0900 @@ -2238,19 +2238,19 @@ raise error.ParseError(_('invalid token'), pos) return parser.simplifyinfixops(tree, ('list', 'or')) -def _parsealias(spec): - """Parse alias declaration/definition ``spec`` - - This allows symbol names to use also ``$`` as an initial letter - (for backward compatibility), and callers of this function should - examine whether ``$`` is used also for unexpected symbols or not. - """ - return _parsewith(spec, syminitletters=_aliassyminitletters) - class _aliasrules(parser.basealiasrules): """Parsing and expansion rule set of revset aliases""" _section = _('revset alias') - _parse = staticmethod(_parsealias) + + @staticmethod + def _parse(spec): + """Parse alias declaration/definition ``spec`` + + This allows symbol names to use also ``$`` as an initial letter + (for backward compatibility), and callers of this function should + examine whether ``$`` is used also for unexpected symbols or not. + """ + return _parsewith(spec, syminitletters=_aliassyminitletters) @staticmethod def _trygetfunc(tree):