Safeguard anything under .hg, and the .hg_archival.txt file
authorChristian Ebert <blacktrash@gmx.net>
Wed, 06 Feb 2008 22:26:50 +0100
changeset 382 e8d4a289f8e4
parent 381 17e94f77de6a
child 383 af4c062c4b41
Safeguard anything under .hg, and the .hg_archival.txt file
hgkw/keyword.py
--- a/hgkw/keyword.py	Wed Feb 06 18:46:49 2008 +0100
+++ b/hgkw/keyword.py	Wed Feb 06 22:26:50 2008 +0100
@@ -412,7 +412,7 @@
     This is done for local repos only, and only if there are
     files configured at all for keyword substitution.'''
 
-    if not repo.local() or repo.root.endswith('/.hg/patches'):
+    if not repo.local() or '.hg' in repo.root.split('/'):
         return
 
     hgcmd, func, args, opts, cmdopts = dispatch._parse(ui, sys.argv[1:])
@@ -428,7 +428,7 @@
         if node1 is not None and node1 != repo.changectx().node():
             hgcmd = 'diff1'
 
-    inc, exc = [], ['.hgtags']
+    inc, exc = [], ['.hgtags', '.hg_archival.txt']
     for pat, opt in ui.configitems('keyword'):
         if opt != 'ignore':
             inc.append(pat)