hgkw/keyword.py
branchsolo-extension
changeset 76 d9c80746d727
parent 74 85c345cd495b
--- a/hgkw/keyword.py	Mon Jan 08 03:05:22 2007 +0100
+++ b/hgkw/keyword.py	Mon Jan 08 05:40:34 2007 +0100
@@ -1,5 +1,5 @@
 # keyword.py - keyword expansion for mercurial
-# $Id$
+# $Id: keyword.py,v 85c345cd495b 2007-01-08 03:05:22 +0100 blacktrash $
 
 '''keyword expansion hack against the grain of a DSCM
 
@@ -229,8 +229,7 @@
                 data = self.wfile(f).read()
                 if not util.binary(data):
                     data, kwct = re_kw.subn(lambda m:
-                            kwexpand(m, self, f, changeid=hex(n)),
-                            data)
+                            kwexpand(m, self, f, changeid=hex(n)), data)
                     if kwct:
                         ui.debug(_('overwriting %s expanding keywords\n' % f))
                         self.wfile(f, 'w').write(data)
@@ -257,7 +256,6 @@
             data = super(kwfilelog, self).read(node)
             if not util.binary(data) and \
                     kwfmatches(ui, self._repo, [self._path]):
-                ui.debug(_('expanding keywords in %s\n' % self._path))
                 return re_kw.sub(lambda m:
                         kwexpand(m, self._repo, self._path,
                             fileid=node, filelog=self), data)
@@ -265,7 +263,8 @@
 
         def cmp(self, node, text):
             '''Removes keyword substitution for comparison.'''
-            if not util.binary(text):
+            if not util.binary(text) and \
+                    kwfmatches(ui, self._repo, [self._path]):
                 text = re_kw.sub(r'$\1$', text)
             return super(kwfilelog, self).cmp(node, text)