remotefilelog: byteify the message for a few StorageErrors
authorMatt Harbison <matt_harbison@yahoo.com>
Fri, 06 Jan 2023 12:20:09 -0500
changeset 49859 8b369bcbadf1
parent 49858 8cb848601bec
child 49860 d5116e4dc744
remotefilelog: byteify the message for a few StorageErrors Flagged by pytype locally.
hgext/remotefilelog/shallowutil.py
tests/test-remotefilelog-corrupt-cache.t
--- a/hgext/remotefilelog/shallowutil.py	Thu Jan 05 17:38:14 2023 -0500
+++ b/hgext/remotefilelog/shallowutil.py	Fri Jan 06 12:20:09 2023 -0500
@@ -247,7 +247,7 @@
         index = raw.index(b'\0')
     except ValueError:
         raise BadRemotefilelogHeader(
-            "unexpected remotefilelog header: illegal format"
+            b"unexpected remotefilelog header: illegal format"
         )
     header = raw[:index]
     if header.startswith(b'v'):
@@ -267,7 +267,7 @@
         size = int(header)
     if size is None:
         raise BadRemotefilelogHeader(
-            "unexpected remotefilelog header: no size found"
+            b"unexpected remotefilelog header: no size found"
         )
     return index + 1, size, flags
 
--- a/tests/test-remotefilelog-corrupt-cache.t	Thu Jan 05 17:38:14 2023 -0500
+++ b/tests/test-remotefilelog-corrupt-cache.t	Fri Jan 06 12:20:09 2023 -0500
@@ -38,7 +38,7 @@
   $ chmod u+w $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
   $ echo x > $CACHEDIR/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
   $ hg up tip 2>&1 | egrep "^[^ ].*unexpected remotefilelog"
-  hgext.remotefilelog.shallowutil.BadRemotefilelogHeader: unexpected remotefilelog header: illegal format (py3 !)
+  abort: unexpected remotefilelog header: illegal format
 
 Verify detection and remediation when remotefilelog.validatecachelog is set