# HG changeset patch # User Martin von Zweigbergk # Date 2020-10-23 06:35:04 # 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 --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -525,11 +525,8 @@ class histeditaction(object): """ 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 @@ class histeditrule(object): @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