mercurial/localrepo.py
changeset 46675 6f4a481f182a
parent 46638 b4c2a2af25e2
parent 46572 d5d9177c0045
child 46705 fd55a9eb1507
--- a/mercurial/localrepo.py	Wed Mar 10 18:24:23 2021 +0100
+++ b/mercurial/localrepo.py	Fri Mar 12 13:13:13 2021 -0500
@@ -543,7 +543,7 @@
         except ValueError as e:
             # Can be raised on Python 3.8 when path is invalid.
             raise error.Abort(
-                _(b'invalid path %s: %s') % (path, pycompat.bytestr(e))
+                _(b'invalid path %s: %s') % (path, stringutil.forcebytestr(e))
             )
 
         raise error.RepoError(_(b'repository %s not found') % path)
@@ -571,7 +571,7 @@
     # repository was shared the old way. We check the share source .hg/requires
     # for SHARESAFE_REQUIREMENT to detect whether the current repository needs
     # to be reshared
-    hint = _("see `hg help config.format.use-share-safe` for more information")
+    hint = _(b"see `hg help config.format.use-share-safe` for more information")
     if requirementsmod.SHARESAFE_REQUIREMENT in requirements:
 
         if (
@@ -1137,7 +1137,7 @@
     """File storage when using revlogs."""
 
     def file(self, path):
-        if path[0] == b'/':
+        if path.startswith(b'/'):
             path = path[1:]
 
         return filelog.filelog(self.svfs, path)
@@ -1148,7 +1148,7 @@
     """File storage when using revlogs and narrow files."""
 
     def file(self, path):
-        if path[0] == b'/':
+        if path.startswith(b'/'):
             path = path[1:]
 
         return filelog.narrowfilelog(self.svfs, path, self._storenarrowmatch)