dirstate: stringify a few exception messages
authorMatt Harbison <matt_harbison@yahoo.com>
Thu, 18 Jul 2024 22:46:36 -0400
changeset 51719 7558cee89655
parent 51718 45828bc3c3d6
child 51720 e618a1756b08
dirstate: stringify a few exception messages Built in exceptions want str, and ProgrammingError converts bytes to str internally (because it subclasses RuntimeError).
mercurial/dirstate.py
--- 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: