mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 00:14:35 +03:00
templater: drop deprecated handling of KeyError from changeset_templater
It's been superseded by 50f9d20d4c27 and the previous patch. templater.mapfile is no longer used and removed.
This commit is contained in:
parent
edef054d1b
commit
72e05b7594
@ -1532,29 +1532,25 @@ class changeset_templater(changeset_printer):
|
||||
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 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)
|
||||
# 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]))
|
||||
if self._parts['footer']:
|
||||
if not self.footer:
|
||||
self.footer = templater.stringify(
|
||||
self.t(self._parts['footer'], **props))
|
||||
|
||||
def gettemplate(ui, tmpl, style):
|
||||
"""
|
||||
|
@ -956,7 +956,6 @@ class templater(object):
|
||||
defaults = {}
|
||||
if cache is None:
|
||||
cache = {}
|
||||
self.mapfile = mapfile or 'template'
|
||||
self.cache = cache.copy()
|
||||
self.map = {}
|
||||
if mapfile:
|
||||
|
Loading…
Reference in New Issue
Block a user