# HG changeset patch # User Christian Ebert # Date 1168231234 -3600 # Node ID d9c80746d727cd6635b24e70500ec65759ffcff5 # Parent 85c345cd495b3b3335e3b7be43fb6db6934a8637 Check against keyword config in kwfilelog.cmp too; be silent in kwfilelog diff -r 85c345cd495b -r d9c80746d727 hgkw/keyword.py --- 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)