hgkw/keyword.py
branchextension
changeset 41 e1c539e1282b
parent 36 b3ace8cc5a33
child 42 ba000e29ecf3
equal deleted inserted replaced
40:38ee735886d2 41:e1c539e1282b
    43             return data
    43             return data
    44 
    44 
    45         def add(self, text, meta, tr, link, p1=None, p2=None):
    45         def add(self, text, meta, tr, link, p1=None, p2=None):
    46             if (not util.binary(text) and
    46             if (not util.binary(text) and
    47                    self._repo.ui.config('keyword', 'remove', True)):
    47                    self._repo.ui.config('keyword', 'remove', True)):
    48                 text = re.sub(r'\$Hg[^$]*?\$', '$Hg$', text)
    48                 re_kw = re.compile(r'\$Hg: [^$]+?,v [a-z0-9]{12} [^$]+? \$')
       
    49                 text = re_kw.sub('$Hg$', text)
    49             return super(kwfilelog, self).add(text, meta, tr, link, p1, p2)
    50             return super(kwfilelog, self).add(text, meta, tr, link, p1, p2)
    50 
    51 
    51     filelog.filelog = kwfilelog
    52     filelog.filelog = kwfilelog
    52     repo.__class__ = kwrepo
    53     repo.__class__ = kwrepo