dirstate: stringify a few exception messages
Built in exceptions want str, and ProgrammingError converts bytes to str
internally (because it subclasses RuntimeError).
--- a/mercurial/dirstate.py Thu Jul 18 20:34:35 2024 -0400
+++ b/mercurial/dirstate.py Thu Jul 18 22:46:36 2024 -0400
@@ -643,8 +643,8 @@
p2 = self._nodeconstants.nullid
if self._changing_level == 0:
raise ValueError(
- b"cannot set dirstate parent outside of "
- b"dirstate.changing_parents context manager"
+ "cannot set dirstate parent outside of "
+ "dirstate.changing_parents context manager"
)
self._dirty = True
@@ -788,7 +788,7 @@
a `with dirstate.changing_parents(repo):` context.
"""
if self.in_merge:
- msg = b'update_file_reference should not be called when merging'
+ msg = 'update_file_reference should not be called when merging'
raise error.ProgrammingError(msg)
entry = self._map.get(filename)
if entry is None: