Make kwfilelog.add respect filename config solo-extension
authorChristian Ebert <blacktrash@gmx.net>
Thu, 04 Jan 2007 14:18:15 +0100
branchsolo-extension
changeset 66 8a8d30596640
parent 65 188849659487
child 67 7311b30cdb58
Make kwfilelog.add respect filename config
hgkw/keyword.py
--- a/hgkw/keyword.py	Thu Jan 04 13:13:54 2007 +0100
+++ b/hgkw/keyword.py	Thu Jan 04 14:18:15 2007 +0100
@@ -118,10 +118,13 @@
             return data
 
         def add(self, text, meta, tr, link, p1=None, p2=None):
-            if not util.binary(text):
-                ui.debug(_('removing keyword substitutions in %s\n')
-                        % self._path)
-                text = re_kw.sub(r'$\1$', text)
+            if not self._path.startswith('.hg') and not util.binary(text):
+                for mf in kwfmatchers(ui, self._repo):
+                    if mf(self._path):
+                        ui.debug(_('removing keyword substitutions in %s\n')
+                                % self._path)
+                        text = re_kw.sub(r'$\1$', text)
+                        break
             return super(kwfilelog, self).add(text, meta, tr, link, p1, p2)
 
         def size(self, rev):