hgkw/keyword.py
changeset 308 2a20fa267041
parent 307 32061d23db14
child 309 a5f5bbf4a668
equal deleted inserted replaced
307:32061d23db14 308:2a20fa267041
   175     Keywords are "stored" unexpanded, and processed on reading.
   175     Keywords are "stored" unexpanded, and processed on reading.
   176     '''
   176     '''
   177     def __init__(self, opener, path, kwtemplater):
   177     def __init__(self, opener, path, kwtemplater):
   178         super(kwfilelog, self).__init__(opener, path)
   178         super(kwfilelog, self).__init__(opener, path)
   179         self.kwtemplater = kwtemplater
   179         self.kwtemplater = kwtemplater
       
   180         self.kwtemplater.path = path
   180 
   181 
   181     def kwctread(self, node, expand):
   182     def kwctread(self, node, expand):
   182         '''Reads expanding and counting keywords
   183         '''Reads expanding and counting keywords
   183         (only called from kwtemplater.overwrite).'''
   184         (only called from kwtemplater.overwrite).'''
   184         data = super(kwfilelog, self).read(node)
   185         data = super(kwfilelog, self).read(node)
   424     class kwrepo(repo.__class__):
   425     class kwrepo(repo.__class__):
   425         def file(self, f, kwmatch=False):
   426         def file(self, f, kwmatch=False):
   426             if f[0] == '/':
   427             if f[0] == '/':
   427                 f = f[1:]
   428                 f = f[1:]
   428             if kwmatch or _kwtemplater.match(f):
   429             if kwmatch or _kwtemplater.match(f):
   429                 _kwtemplater.path = f
       
   430                 return kwfilelog(self.sopener, f, _kwtemplater)
   430                 return kwfilelog(self.sopener, f, _kwtemplater)
   431             return filelog.filelog(self.sopener, f)
   431             return filelog.filelog(self.sopener, f)
   432 
   432 
   433         def commit(self, files=None, text='', user=None, date=None,
   433         def commit(self, files=None, text='', user=None, date=None,
   434                    match=util.always, force=False, force_editor=False,
   434                    match=util.always, force=False, force_editor=False,