# HG changeset patch # User Martin von Zweigbergk # Date 1603434904 25200 # Node ID 1f9736eb0e656f059c42a996c867a1223c14fa2c # Parent 5d65e04b6a80bc7d132f0757796c1157af34f206 histedit: drop fallback to empty string from rendertemplate() AFAICT, `cmdutil.rendertemplate()` always returns bytes (never e.g. `None`), so we don't need to fall back to empty (byte-)string. The fallback has been there since the code was added in 11c076786d56 (histedit: add templating support to histedit's rule file generation, 2019-01-29). Differential Revision: https://phab.mercurial-scm.org/D9244 diff -r 5d65e04b6a80 -r 1f9736eb0e65 hgext/histedit.py --- a/hgext/histedit.py Tue Oct 20 17:32:45 2020 +0200 +++ b/hgext/histedit.py Thu Oct 22 23:35:04 2020 -0700 @@ -525,11 +525,8 @@ """ ctx = self.repo[self.node] ui = self.repo.ui - summary = ( - cmdutil.rendertemplate( - ctx, ui.config(b'histedit', b'summary-template') - ) - or b'' + summary = cmdutil.rendertemplate( + ctx, ui.config(b'histedit', b'summary-template') ) summary = summary.splitlines()[0] line = b'%s %s %s' % (self.verb, ctx, summary) @@ -1152,11 +1149,8 @@ @util.propertycache def desc(self): - summary = ( - cmdutil.rendertemplate( - self.ctx, self.ui.config(b'histedit', b'summary-template') - ) - or b'' + summary = cmdutil.rendertemplate( + self.ctx, self.ui.config(b'histedit', b'summary-template') ) if summary: return summary