Mercurial > hg
comparison mercurial/crecord.py @ 43458:117b41b1859d stable
py3: compare response of crecord's confirmationwindow with str
confirmationwindow() returns a native string, as a result of calling
chr() on getch(). On Python 3, response.lower().startswith(b"y") leads
to a TypeError.
This fixes a crash when typing "r" in the curses interface of
interactive commit.
author | Denis Laxalde <denis.laxalde@logilab.fr> |
---|---|
date | Wed, 06 Nov 2019 17:12:13 +0100 |
parents | dd64e229c46b |
children | 7cc913396f8c |
comparison
equal
deleted
inserted
replaced
43457:92e24a139ecc | 43458:117b41b1859d |
---|---|
1739 """ | 1739 """ |
1740 ) | 1740 ) |
1741 with self.ui.timeblockedsection(b'crecord'): | 1741 with self.ui.timeblockedsection(b'crecord'): |
1742 response = self.confirmationwindow(confirmtext) | 1742 response = self.confirmationwindow(confirmtext) |
1743 if response is None: | 1743 if response is None: |
1744 response = b"n" | 1744 response = "n" |
1745 if response.lower().startswith(b"y"): | 1745 if response.lower().startswith("y"): |
1746 return True | 1746 return True |
1747 else: | 1747 else: |
1748 return False | 1748 return False |
1749 | 1749 |
1750 def toggleamend(self, opts, test): | 1750 def toggleamend(self, opts, test): |