diff mercurial/templater.py @ 1964:778281d46bb2

fix template bug that made hgweb break. problem found by Shun-ichi Goto <shunichi.goto@gmail.com>. this fix tested with command template and hgweb templates.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Wed, 15 Mar 2006 11:28:00 -0800
parents 2f500a4b6e99
children 6e1a8ea5d717
line wrap: on
line diff
--- a/mercurial/templater.py	Wed Mar 15 11:26:57 2006 +0100
+++ b/mercurial/templater.py	Wed Mar 15 11:28:00 2006 -0800
@@ -59,18 +59,17 @@
     filter uses function to transform value. syntax is
     {key|filter1|filter2|...}.'''
 
-    def __init__(self, mapfile, filters={}, cache={}):
+    def __init__(self, mapfile, filters={}, defaults={}, cache={}):
         '''set up template engine.
         mapfile is name of file to read map definitions from.
         filters is dict of functions. each transforms a value into another.
         defaults is dict of default map definitions.'''
         self.mapfile = mapfile or 'template'
-        self.cache = {}
+        self.cache = cache
         self.map = {}
         self.base = (mapfile and os.path.dirname(mapfile)) or ''
         self.filters = filters
-        self.defaults = {}
-        self.cache = cache
+        self.defaults = defaults
 
         if not mapfile:
             return