[Updated] D10176: hg: convert an exception to bytes in the repo creation exception handler

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Wed Mar 17 10:11:43 UTC 2021


Closed by commit rHG1099541b6462: hg: convert an exception to bytes in the repo creation exception handler (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D10176?vs=26273&id=26466

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D10176/new/

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

AFFECTED FILES
  mercurial/hg.py

CHANGE DETAILS

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -41,7 +41,6 @@
     mergestate as mergestatemod,
     narrowspec,
     phases,
-    pycompat,
     requirements,
     scmutil,
     sshpeer,
@@ -53,7 +52,11 @@
     verify as verifymod,
     vfs as vfsmod,
 )
-from .utils import hashutil
+from .utils import (
+    hashutil,
+    stringutil,
+)
+
 
 release = lock.release
 
@@ -74,7 +77,7 @@
     # Python 2 raises TypeError, Python 3 ValueError.
     except (TypeError, ValueError) as e:
         raise error.Abort(
-            _(b'invalid path %s: %s') % (path, pycompat.bytestr(e))
+            _(b'invalid path %s: %s') % (path, stringutil.forcebytestr(e))
         )
     except OSError:
         isfile = False



To: mharbison72, #hg-reviewers, pulkit
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210317/81ee172d/attachment-0002.html>


More information about the Mercurial-patches mailing list