[Updated] D9325: histedit: don't crash if commit message is empty
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Sat Nov 21 08:26:19 UTC 2020
Closed by commit rHGf4065c3f09b8: histedit: don't crash if commit message is empty (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D9325?vs=23557&id=23608
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D9325/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D9325
AFFECTED FILES
hgext/histedit.py
CHANGE DETAILS
diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -533,7 +533,8 @@
summary = cmdutil.rendertemplate(
ctx, ui.config(b'histedit', b'summary-template')
)
- summary = summary.splitlines()[0]
+ # Handle the fact that `''.splitlines() => []`
+ summary = summary.splitlines()[0] if summary else b''
line = b'%s %s %s' % (self.verb, ctx, summary)
# trim to 75 columns by default so it's not stupidly wide in my editor
# (the 5 more are left for verb)
To: martinvonz, durin42, #hg-reviewers, pulkit
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20201121/98adeb51/attachment-0002.html>
More information about the Mercurial-patches
mailing list