mercurial/scmutil.py
changeset 36695 c442c4a92ae8
parent 36661 b76248e51605
child 36836 a00c38b33047
--- a/mercurial/scmutil.py	Sun Mar 04 10:23:07 2018 -0500
+++ b/mercurial/scmutil.py	Sun Mar 04 10:20:41 2018 -0500
@@ -189,12 +189,12 @@
         msg = inst.args[1]
         if isinstance(msg, type(u'')):
             msg = pycompat.sysbytes(msg)
-        elif not isinstance(inst.args[1], bytes):
-            ui.warn(" %r\n" % (inst.args[1],))
-        elif not inst.args[1]:
+        if not isinstance(msg, bytes):
+            ui.warn(" %r\n" % (msg,))
+        elif not msg:
             ui.warn(_(" empty string\n"))
         else:
-            ui.warn("\n%r\n" % util.ellipsis(inst.args[1]))
+            ui.warn("\n%r\n" % util.ellipsis(msg))
     except error.CensoredNodeError as inst:
         ui.warn(_("abort: file censored %s!\n") % inst)
     except error.RevlogError as inst: