# HG changeset patch # User Yuya Nishihara # Date 1459693363 -32400 # Node ID f59e2400267827e89e6736c4f6204c9869b63ee4 # Parent 1bba1b43525ae9476456ae0401b95ac2dfc6c624 templater: demote "base" directory of map file to local variable It isn't referenced from other places. diff -r 1bba1b43525a -r f59e24002678 mercurial/templater.py --- a/mercurial/templater.py Mon Apr 04 22:50:50 2016 +0900 +++ b/mercurial/templater.py Sun Apr 03 23:22:43 2016 +0900 @@ -1003,10 +1003,6 @@ cache = {} self.cache = cache.copy() self.map = {} - if mapfile: - self.base = os.path.dirname(mapfile) - else: - self.base = '' self.filters = templatefilters.filters.copy() self.filters.update(filters) self.defaults = defaults @@ -1019,6 +1015,7 @@ raise error.Abort(_("style '%s' not found") % mapfile, hint=_("available styles: %s") % stylelist()) + base = os.path.dirname(mapfile) conf = config.config(includepaths=templatepaths()) conf.read(mapfile) @@ -1034,7 +1031,7 @@ val = 'default', val if ':' in val[1]: val = val[1].split(':', 1) - self.map[key] = val[0], os.path.join(self.base, val[1]) + self.map[key] = val[0], os.path.join(base, val[1]) def __contains__(self, key): return key in self.cache or key in self.map