comparison mercurial/dirstate.py @ 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 ca7bde5dbafb
children c1d7ac70980b
comparison
equal deleted inserted replaced
51718:45828bc3c3d6 51719:7558cee89655
641 """ 641 """
642 if p2 is None: 642 if p2 is None:
643 p2 = self._nodeconstants.nullid 643 p2 = self._nodeconstants.nullid
644 if self._changing_level == 0: 644 if self._changing_level == 0:
645 raise ValueError( 645 raise ValueError(
646 b"cannot set dirstate parent outside of " 646 "cannot set dirstate parent outside of "
647 b"dirstate.changing_parents context manager" 647 "dirstate.changing_parents context manager"
648 ) 648 )
649 649
650 self._dirty = True 650 self._dirty = True
651 oldp2 = self._pl[1] 651 oldp2 = self._pl[1]
652 if self._origpl is None: 652 if self._origpl is None:
786 786
787 It should not be called during a merge (p2 != nullid) and only within 787 It should not be called during a merge (p2 != nullid) and only within
788 a `with dirstate.changing_parents(repo):` context. 788 a `with dirstate.changing_parents(repo):` context.
789 """ 789 """
790 if self.in_merge: 790 if self.in_merge:
791 msg = b'update_file_reference should not be called when merging' 791 msg = 'update_file_reference should not be called when merging'
792 raise error.ProgrammingError(msg) 792 raise error.ProgrammingError(msg)
793 entry = self._map.get(filename) 793 entry = self._map.get(filename)
794 if entry is None: 794 if entry is None:
795 wc_tracked = False 795 wc_tracked = False
796 else: 796 else: