FIX: make repo keyword arg to kwfilelog kwmap-templates
authorChristian Ebert <blacktrash@gmx.net>
Mon, 12 Feb 2007 00:40:49 +0100
branchkwmap-templates
changeset 140 cade80b9d83d
parent 139 0ea07bb56ff6
child 141 edf9299112d1
FIX: make repo keyword arg to kwfilelog hg incoming breaks otherwise as only 3 arguments are passed to init.
hgkw/keyword.py
--- a/hgkw/keyword.py	Mon Feb 12 00:38:47 2007 +0100
+++ b/hgkw/keyword.py	Mon Feb 12 00:40:49 2007 +0100
@@ -214,13 +214,13 @@
         Superclass over filelog to customize it's read, add, cmp methods.
         Keywords are "stored" unexpanded, and expanded on reading.
         '''
-        def __init__(self, opener, path, repo,
+        def __init__(self, opener, path, repo=None,
                      defversion=revlog.REVLOG_DEFAULT_VERSION):
             super(kwfilelog, self).__init__(opener, path, defversion)
             self._repo = repo
             self._path = path
             # only init kwtemplater if needed
-            if hasattr(repo, 'kwfmatcher') and repo.kwfmatcher(path):
+            if repo and hasattr(repo, 'kwfmatcher') and repo.kwfmatcher(path):
                 self.kwt = kwtemplater(repo.ui, repo)
             else:
                 self.kwt = None