--- a/hgkw/keyword.py Fri Jun 15 08:56:26 2007 +0200
+++ b/hgkw/keyword.py Mon Jun 18 17:49:27 2007 +0200
@@ -106,6 +106,9 @@
'Header': '{root}/{file},v {node|short} {date|utcdate} {author|user}',
}
+kwcommands = ('status', 'commit', 'update', 'revert', 'backout', 'diff', 'cat',
+ 'archive', 'pull', 'unbundle', 'import')
+
def utcdate(date):
'''Returns hgdate in cvs-like UTC format.'''
return time.strftime('%Y/%m/%d %H:%M:%S', time.gmtime(date[0]))
@@ -224,21 +227,15 @@
This is done for local repos only, and only if there are
files configured at all for keyword substitution.'''
- if not repo.local():
+ if not repo.local() or getcmd(ui) not in kwcommands:
return
- inc, exc, archive, noarchive = [], ['.hg*'], [], ['.hg*']
- for pat, opt in repo.ui.configitems('keyword'):
- if opt == 'archive':
- archive.append(pat)
- elif opt == 'noarchive':
- noarchive.append(pat)
- elif opt == 'ignore':
+ inc, exc = [], ['.hg*']
+ for pat, opt in ui.configitems('keyword'):
+ if opt != 'ignore':
+ inc.append(pat)
+ else:
exc.append(pat)
- else:
- inc.append(pat)
- if getcmd(repo.ui) == 'archive':
- inc, exc = archive, noarchive
if not inc:
return