Patchwork D2611: scmutil: avoid using basestring and add explicit handling of unicodes

login
register
mail settings
Submitter phabricator
Date March 3, 2018, 11 p.m.
Message ID <ef0a6a2621bea2f979e9e61261905645@localhost.localdomain>
Download mbox | patch
Permalink /patch/28862/
State Not Applicable
Headers show

Comments

phabricator - March 3, 2018, 11 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGb76248e51605: scmutil: avoid using basestring and add explicit handling of unicodes (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2611?vs=6489&id=6495

REVISION DETAIL
  https://phab.mercurial-scm.org/D2611

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS




To: durin42, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -186,7 +186,10 @@ 
             ui.warn(_("(%s)\n") % inst.hint)
     except error.ResponseError as inst:
         ui.warn(_("abort: %s") % inst.args[0])
-        if not isinstance(inst.args[1], basestring):
+        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]:
             ui.warn(_(" empty string\n"))