templater: remove a mutable default argument
Mutable default arguments are know to the state of California to cause bugs.
--- a/mercurial/templater.py Thu Sep 24 01:06:10 2015 -0700
+++ b/mercurial/templater.py Thu Sep 24 01:06:41 2015 -0700
@@ -833,7 +833,7 @@
class templater(object):
- def __init__(self, mapfile, filters=None, defaults={}, cache={},
+ def __init__(self, mapfile, filters=None, defaults=None, cache={},
minchunk=1024, maxchunk=65536):
'''set up template engine.
mapfile is name of file to read map definitions from.
@@ -841,6 +841,8 @@
defaults is dict of default map definitions.'''
if filters is None:
filters = {}
+ if defaults is None:
+ defaults = {}
self.mapfile = mapfile or 'template'
self.cache = cache.copy()
self.map = {}