# HG changeset patch # User Pierre-Yves David # Date 1443081970 25200 # Node ID 66221730d372b4681836caa8cb4a72c1831858e4 # Parent 2c6a741bf05ea01daaec02663f80170001f62841 templater: remove a mutable default argument Mutable default arguments are know to the state of California to cause bugs. diff -r 2c6a741bf05e -r 66221730d372 mercurial/templater.py --- a/mercurial/templater.py Thu Sep 24 01:05:21 2015 -0700 +++ b/mercurial/templater.py Thu Sep 24 01:06:10 2015 -0700 @@ -833,12 +833,14 @@ class templater(object): - def __init__(self, mapfile, filters={}, defaults={}, cache={}, + def __init__(self, mapfile, filters=None, defaults={}, cache={}, minchunk=1024, maxchunk=65536): '''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.''' + if filters is None: + filters = {} self.mapfile = mapfile or 'template' self.cache = cache.copy() self.map = {}