##// END OF EJS Templates
keyword: disable expansion in kwfilelog.read() if file renamed in node...
Christian Ebert -
r12628:799cec3b default
parent child Browse files
Show More
@@ -82,8 +82,8 b" like CVS' $Log$, are not supported. A ke"
82 {desc}" expands to the first line of the changeset description.
82 {desc}" expands to the first line of the changeset description.
83 '''
83 '''
84
84
85 from mercurial import commands, cmdutil, dispatch, filelog, revlog, extensions
85 from mercurial import commands, cmdutil, dispatch, filelog, extensions
86 from mercurial import patch, localrepo, templater, templatefilters, util, match
86 from mercurial import localrepo, match, patch, templatefilters, templater, util
87 from mercurial.hgweb import webcommands
87 from mercurial.hgweb import webcommands
88 from mercurial.i18n import _
88 from mercurial.i18n import _
89 import re, shutil, tempfile
89 import re, shutil, tempfile
@@ -263,6 +263,8 b' class kwfilelog(filelog.filelog):'
263 def read(self, node):
263 def read(self, node):
264 '''Expands keywords when reading filelog.'''
264 '''Expands keywords when reading filelog.'''
265 data = super(kwfilelog, self).read(node)
265 data = super(kwfilelog, self).read(node)
266 if self.renamed(node):
267 return data
266 return self.kwt.expand(self.path, node, data)
268 return self.kwt.expand(self.path, node, data)
267
269
268 def add(self, text, meta, tr, link, p1=None, p2=None):
270 def add(self, text, meta, tr, link, p1=None, p2=None):
@@ -273,10 +275,7 b' class kwfilelog(filelog.filelog):'
273 def cmp(self, node, text):
275 def cmp(self, node, text):
274 '''Removes keyword substitutions for comparison.'''
276 '''Removes keyword substitutions for comparison.'''
275 text = self.kwt.shrink(self.path, text)
277 text = self.kwt.shrink(self.path, text)
276 if self.renamed(node):
278 return super(kwfilelog, self).cmp(node, text)
277 t2 = super(kwfilelog, self).read(node)
278 return t2 != text
279 return revlog.revlog.cmp(self, node, text)
280
279
281 def _status(ui, repo, kwt, *pats, **opts):
280 def _status(ui, repo, kwt, *pats, **opts):
282 '''Bails out if [keyword] configuration is not active.
281 '''Bails out if [keyword] configuration is not active.
General Comments 0
You need to be logged in to leave comments. Login now