hgkw/keyword.py
branchkwmap-templates
changeset 140 cade80b9d83d
parent 139 0ea07bb56ff6
child 141 edf9299112d1
equal deleted inserted replaced
139:0ea07bb56ff6 140:cade80b9d83d
   212     class kwfilelog(filelog.filelog):
   212     class kwfilelog(filelog.filelog):
   213         '''
   213         '''
   214         Superclass over filelog to customize it's read, add, cmp methods.
   214         Superclass over filelog to customize it's read, add, cmp methods.
   215         Keywords are "stored" unexpanded, and expanded on reading.
   215         Keywords are "stored" unexpanded, and expanded on reading.
   216         '''
   216         '''
   217         def __init__(self, opener, path, repo,
   217         def __init__(self, opener, path, repo=None,
   218                      defversion=revlog.REVLOG_DEFAULT_VERSION):
   218                      defversion=revlog.REVLOG_DEFAULT_VERSION):
   219             super(kwfilelog, self).__init__(opener, path, defversion)
   219             super(kwfilelog, self).__init__(opener, path, defversion)
   220             self._repo = repo
   220             self._repo = repo
   221             self._path = path
   221             self._path = path
   222             # only init kwtemplater if needed
   222             # only init kwtemplater if needed
   223             if hasattr(repo, 'kwfmatcher') and repo.kwfmatcher(path):
   223             if repo and hasattr(repo, 'kwfmatcher') and repo.kwfmatcher(path):
   224                 self.kwt = kwtemplater(repo.ui, repo)
   224                 self.kwt = kwtemplater(repo.ui, repo)
   225             else:
   225             else:
   226                 self.kwt = None
   226                 self.kwt = None
   227 
   227 
   228         def read(self, node):
   228         def read(self, node):