Patchwork [6,of,7] py3: do not try to byte-stringify None in cmdutil.tryimportone()

login
register
mail settings
Submitter Yuya Nishihara
Date April 8, 2018, 9:09 a.m.
Message ID <7ed301f165390dfd2a9f.1523178589@mimosa>
Download mbox | patch
Permalink /patch/30562/
State Accepted
Headers show

Comments

Yuya Nishihara - April 8, 2018, 9:09 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1523169129 -32400
#      Sun Apr 08 15:32:09 2018 +0900
# Node ID 7ed301f165390dfd2a9f4e8c6f6bc49ecba04c79
# Parent  d08cb276664c86807fc497b0c7b3980d3752b613
py3: do not try to byte-stringify None in cmdutil.tryimportone()

It's a debug message, so just use '' instead.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1398,7 +1398,7 @@  def tryimportone(ui, repo, hunk, parents
         else:
             # launch the editor
             message = None
-        ui.debug('message:\n%s\n' % message)
+        ui.debug('message:\n%s\n' % (message or ''))
 
         if len(parents) == 1:
             parents.append(repo[nullid])