# HG changeset patch # User Christian Ebert # Date 1199211373 -3600 # Node ID 12d26936a3151bfa4518d92087f2f8952cf29200 # Parent b18631f0dbdc0f6e8bd1a4d3fd96a845c2178427 Make command line check even more private diff -r b18631f0dbdc -r 12d26936a315 hgkw/keyword.py --- a/hgkw/keyword.py Sat Dec 29 18:45:47 2007 +0100 +++ b/hgkw/keyword.py Tue Jan 01 19:16:13 2008 +0100 @@ -404,18 +404,19 @@ This is done for local repos only, and only if there are files configured at all for keyword substitution.''' - nokwcommands = ('add', 'addremove', 'bundle', 'clone', 'copy', 'export', - 'grep', 'identify', 'incoming', 'init', 'outgoing', 'push', - 'remove', 'rename', 'rollback', 'convert') - - def _getcmd(): - '''Simplified argument parsing as we are only interested in command.''' + def kwbailout(): + '''Obtains command via simplified cmdline parsing, + returns True if keyword expansion not needed.''' + nokwcommands = ('add', 'addremove', 'bundle', 'clone', 'copy', + 'export', 'grep', 'identify', 'incoming', 'init', + 'outgoing', 'push', 'remove', 'rename', 'rollback', + 'convert') args = fancyopts.fancyopts(sys.argv[1:], commands.globalopts, {}) if args: aliases, i = cmdutil.findcmd(ui, args[0], commands.table) - return aliases[0] + return aliases[0] in nokwcommands - if not repo.local() or _getcmd() in nokwcommands: + if not repo.local() or kwbailout(): return inc, exc = [], ['.hgtags']