[PATCH 1 of 3 py3] error: convert the error into strings to pass into ui.warn()

Pulkit Goyal 7895pulkit at gmail.com
Thu Mar 16 07:53:23 UTC 2017


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1489638672 -19800
#      Thu Mar 16 10:01:12 2017 +0530
# Node ID 47dae3bbf8560824743293870aab601da2d1ed6c
# Parent  63aeb39b5802644ae99eaa5cf0666f3bf5cc4e90
error: convert the error into strings to pass into ui.warn()

diff -r 63aeb39b5802 -r 47dae3bbf856 mercurial/scmutil.py
--- a/mercurial/scmutil.py	Thu Mar 16 09:13:13 2017 +0530
+++ b/mercurial/scmutil.py	Thu Mar 16 10:01:12 2017 +0530
@@ -168,7 +168,8 @@
         if inst.hint:
             ui.warn('(%s)\n' % inst.hint)
     except error.RepoError as inst:
-        ui.warn(_("abort: %s!\n") % inst)
+        if inst.args:
+            ui.warn(_("abort: %s!\n") % ''.join(inst.args))
         if inst.hint:
             ui.warn(_("(%s)\n") % inst.hint)
     except error.ResponseError as inst:


More information about the Mercurial-devel mailing list