[PATCH 5 of 5] revset: remove unused lookup argument from _tokenizealias()

Yuya Nishihara yuya at tcha.org
Tue Mar 29 11:27:50 EDT 2016


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1456728392 -32400
#      Mon Feb 29 15:46:32 2016 +0900
# Node ID cf9abced341da9a63ad5daf49a908d39795aafb5
# Parent  092c90f4dad4e4e5870499819d4c0a2f4646e8fd
revset: remove unused lookup argument from _tokenizealias()

Since aliases are defined in configuration file, they should never have tokens
that require a repository-dependent lookup function.

This is purely a clean-up patch. Future patches won't have logical dependency
on this change.

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2266,15 +2266,14 @@ def optimize(x, small):
 _aliassyminitletters = set(c for c in [chr(i) for i in xrange(256)]
                            if c.isalnum() or c in '._@$' or ord(c) > 127)
 
-def _tokenizealias(program, lookup=None):
+def _tokenizealias(program):
     """Parse alias declaration/definition into a stream of tokens
 
     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 tokenize(program, lookup=lookup,
-                    syminitletters=_aliassyminitletters)
+    return tokenize(program, syminitletters=_aliassyminitletters)
 
 def _parsealiasdecl(decl):
     """Parse alias declaration ``decl``


More information about the Mercurial-devel mailing list