comparison mercurial/logcmdutil.py @ 40285:96164fb9b913

logcmdutil: add a helpful assertion to catch mistyped templates early This would have made a defect in test-notify.t much easier to figure out. Differential Revision: https://phab.mercurial-scm.org/D5097
author Augie Fackler <augie@google.com>
date Sun, 14 Oct 2018 04:37:25 -0400
parents 94ca3579e84e
children 6a63ba61e71f
comparison
equal deleted inserted replaced
40284:46b55f279571 40285:96164fb9b913
458 if self._parts['footer']: 458 if self._parts['footer']:
459 if not self.footer: 459 if not self.footer:
460 self.footer = self.t.render(self._parts['footer'], props) 460 self.footer = self.t.render(self._parts['footer'], props)
461 461
462 def templatespec(tmpl, mapfile): 462 def templatespec(tmpl, mapfile):
463 if pycompat.ispy3:
464 assert not isinstance(tmpl, str), 'tmpl must not be a str'
463 if mapfile: 465 if mapfile:
464 return formatter.templatespec('changeset', tmpl, mapfile) 466 return formatter.templatespec('changeset', tmpl, mapfile)
465 else: 467 else:
466 return formatter.templatespec('', tmpl, None) 468 return formatter.templatespec('', tmpl, None)
467 469