changeset 29074:e7c679738503

revset: define _parsealias() in _aliasrules class It's short. It doesn't make sense to define _parsealias() outside of the class.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 17 Apr 2016 13:06:44 +0900
parents 81bac118f9e2
children 3f0177d2b8fb
files mercurial/revset.py
diffstat 1 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- 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):