diff -r c4daf4753ed3 -r 048153ccf040 hgkw/keyword.py --- a/hgkw/keyword.py Mon Jan 08 03:08:24 2007 +0100 +++ b/hgkw/keyword.py Mon Jan 08 05:47:52 2007 +0100 @@ -1,5 +1,5 @@ # keyword.py - keyword expansion for mercurial -# $Id$ +# $Id: keyword.py,v c4daf4753ed3 2007-01-08 03:08:24 +0100 blacktrash $ '''keyword expansion hack against the grain of a DSCM @@ -225,8 +225,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) @@ -253,7 +252,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) @@ -261,7 +259,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)