--- 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']