reverse logic for detection of excluding commands kwmap-templates
authorChristian Ebert <blacktrash@gmx.net>
Wed, 27 Jun 2007 13:33:57 +0200
branchkwmap-templates
changeset 167 b0a5c3535727
parent 166 849e28e03fb4
child 168 368fbd5b054c
reverse logic for detection of excluding commands Exclude all "outgoing" commands. rollback does not change working dir. incoming -p does not expand anyway. Revert ui -> repo.ui for backwards compatibiliy in reposetup.
hgkw/keyword.py
--- a/hgkw/keyword.py	Wed Jun 20 13:22:11 2007 +0200
+++ b/hgkw/keyword.py	Wed Jun 27 13:33:57 2007 +0200
@@ -98,8 +98,7 @@
         'Header': '{root}/{file},v {node|short} {date|utcdate} {author|user}',
         }
 
-kwcommands = ('status', 'commit', 'update', 'revert', 'backout', 'diff', 'cat',
-              'archive', 'pull', 'unbundle', 'import')
+nokwcommands = ('rollback', 'incoming', 'outgoing', 'export', 'bundle', 'push')
 
 def utcdate(date):
     '''Returns hgdate in cvs-like UTC format.'''
@@ -217,11 +216,11 @@
     This is done for local repos only, and only if there are
     files configured at all for keyword substitution.'''
 
-    if not repo.local() or getcmd(ui) not in kwcommands:
+    if not repo.local() or getcmd(repo.ui) in nokwcommands:
         return
 
     inc, exc = [], ['.hg*']
-    for pat, opt in ui.configitems('keyword'):
+    for pat, opt in repo.ui.configitems('keyword'):
         if opt != 'ignore':
             inc.append(pat)
         else: