# HG changeset patch # User Matt Harbison # Date 1721357196 14400 # Node ID 7558cee89655c0bde9467c3d42257cbb52ef6da2 # Parent 45828bc3c3d63afa83249f667b0093dbd9a2b1c8 dirstate: stringify a few exception messages Built in exceptions want str, and ProgrammingError converts bytes to str internally (because it subclasses RuntimeError). diff -r 45828bc3c3d6 -r 7558cee89655 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: