Avoid calling kwfmatcher twice (kwtemplater.overwrite, kwrepo.file) when overwriting
authorChristian Ebert <blacktrash@gmx.net>
Tue, 18 Sep 2007 00:03:17 +0100
changeset 242 71056c5042de
parent 241 e0a846f9f095
child 243 bbd5af3ec247
Avoid calling kwfmatcher twice (kwtemplater.overwrite, kwrepo.file) when overwriting _weedcandidates already checks if file is configured for keyword substitution.
hgkw/keyword.py
--- a/hgkw/keyword.py	Fri Sep 14 23:00:26 2007 +0100
+++ b/hgkw/keyword.py	Tue Sep 18 00:03:17 2007 +0100
@@ -255,7 +255,7 @@
         notify = (self.ui.note, self.ui.debug)[commit]
         overwritten = []
         for f in candidates:
-            fp = self.repo.file(f, kwexp=expand, kwcnt=True)
+            fp = self.repo.file(f, kwexp=expand, kwcnt=True, kwmatch=True)
             data, kwfound = fp.read(man[f])
             if kwfound:
                 notify(_('overwriting %s %s keywords\n') % (f, action))
@@ -463,10 +463,10 @@
         return
 
     class kwrepo(repo.__class__):
-        def file(self, f, kwexp=True, kwcnt=False):
+        def file(self, f, kwexp=True, kwcnt=False, kwmatch=False):
             if f[0] == '/':
                 f = f[1:]
-            if kwfmatcher(f):
+            if kwmatch or kwfmatcher(f):
                 kwt = kwtemplater(ui, self, kwexp, path=f)
                 return kwfilelog(self.sopener, f, kwt, kwcnt)
             return filelog.filelog(self.sopener, f)