scmutil: fix oversight in b76248e51605c6 where I forgot to use msg
authorAugie Fackler <augie@google.com>
Sun, 04 Mar 2018 10:20:41 -0500
changeset 36695 c442c4a92ae8
parent 36694 1d06407d0ee9
child 36696 0c431d3129c4
scmutil: fix oversight in b76248e51605c6 where I forgot to use msg Thanks to Yuya for spotting my mistake. Differential Revision: https://phab.mercurial-scm.org/D2636
mercurial/scmutil.py
--- 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: