templater: demote "base" directory of map file to local variable
It isn't referenced from other places.
--- 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