changeset 51719:7558cee89655

dirstate: stringify a few exception messages Built in exceptions want str, and ProgrammingError converts bytes to str internally (because it subclasses RuntimeError).
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 18 Jul 2024 22:46:36 -0400
parents 45828bc3c3d6
children e618a1756b08
files mercurial/dirstate.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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: