changeset 28837:d54a7410307f

templater: drop deprecated handling of KeyError from changeset_templater It's been superseded by 09cde75e0613 and the previous patch. templater.mapfile is no longer used and removed.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 03 Apr 2016 11:23:31 +0900
parents 3f45488d70df
children a9a8b3f29544
files mercurial/cmdutil.py mercurial/templater.py
diffstat 2 files changed, 19 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Wed Apr 06 20:34:34 2016 +0000
+++ b/mercurial/cmdutil.py	Sun Apr 03 11:23:31 2016 +0900
@@ -1532,29 +1532,25 @@
         props['revcache'] = {'copies': copies}
         props['cache'] = self.cache
 
-        try:
-            # write header
-            if self._parts['header']:
-                h = templater.stringify(self.t(self._parts['header'], **props))
-                if self.buffered:
-                    self.header[ctx.rev()] = h
-                else:
-                    if self.lastheader != h:
-                        self.lastheader = h
-                        self.ui.write(h)
-
-            # write changeset metadata, then patch if requested
-            key = self._parts['changeset']
-            self.ui.write(templater.stringify(self.t(key, **props)))
-            self.showpatch(ctx, matchfn)
-
-            if self._parts['footer']:
-                if not self.footer:
-                    self.footer = templater.stringify(
-                        self.t(self._parts['footer'], **props))
-        except KeyError as inst:
-            msg = _("%s: no key named '%s'")
-            raise error.Abort(msg % (self.t.mapfile, inst.args[0]))
+        # write header
+        if self._parts['header']:
+            h = templater.stringify(self.t(self._parts['header'], **props))
+            if self.buffered:
+                self.header[ctx.rev()] = h
+            else:
+                if self.lastheader != h:
+                    self.lastheader = h
+                    self.ui.write(h)
+
+        # write changeset metadata, then patch if requested
+        key = self._parts['changeset']
+        self.ui.write(templater.stringify(self.t(key, **props)))
+        self.showpatch(ctx, matchfn)
+
+        if self._parts['footer']:
+            if not self.footer:
+                self.footer = templater.stringify(
+                    self.t(self._parts['footer'], **props))
 
 def gettemplate(ui, tmpl, style):
     """
--- a/mercurial/templater.py	Wed Apr 06 20:34:34 2016 +0000
+++ b/mercurial/templater.py	Sun Apr 03 11:23:31 2016 +0900
@@ -956,7 +956,6 @@
             defaults = {}
         if cache is None:
             cache = {}
-        self.mapfile = mapfile or 'template'
         self.cache = cache.copy()
         self.map = {}
         if mapfile: