Patchwork D2437: subrepo: use util.forcebytestr() instead of str() on exception

login
register
mail settings
Submitter phabricator
Date Feb. 26, 2018, 5:39 a.m.
Message ID <b338171321e4ddd1c68483cc31ed1443@localhost.localdomain>
Download mbox | patch
Permalink /patch/28373/
State Not Applicable
Headers show

Comments

phabricator - Feb. 26, 2018, 5:39 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG1df7e7b8558e: subrepo: use util.forcebytestr() instead of str() on exception (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2437?vs=6082&id=6095

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

AFFECTED FILES
  mercurial/subrepo.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -73,7 +73,8 @@ 
             raise ex
         except error.Abort as ex:
             subrepo = subrelpath(self)
-            errormsg = str(ex) + ' ' + _('(in subrepository "%s")') % subrepo
+            errormsg = (util.forcebytestr(ex) + ' '
+                        + _('(in subrepository "%s")') % subrepo)
             # avoid handling this exception by raising a SubrepoAbort exception
             raise SubrepoAbort(errormsg, hint=ex.hint, subrepo=subrepo,
                                cause=sys.exc_info())