comparison mercurial/crecord.py @ 41843:25420df87903

py3: convert KEY_PRESSED value to bytes in crecord.py This was a str before. Differential Revision: https://phab.mercurial-scm.org/D6071
author Pulkit Goyal <pulkit@yandex-team.ru>
date Tue, 05 Mar 2019 04:11:32 +0530
parents 82d9728ace95
children 7e95ade0f369
comparison
equal deleted inserted replaced
41842:28842adf8ed5 41843:25420df87903
18 from .i18n import _ 18 from .i18n import _
19 from . import ( 19 from . import (
20 encoding, 20 encoding,
21 error, 21 error,
22 patch as patchmod, 22 patch as patchmod,
23 pycompat,
23 scmutil, 24 scmutil,
24 util, 25 util,
25 ) 26 )
26 from .utils import ( 27 from .utils import (
27 stringutil, 28 stringutil,
1665 """ 1666 """
1666 Perform actions based on pressed keys. 1667 Perform actions based on pressed keys.
1667 1668
1668 Return true to exit the main loop. 1669 Return true to exit the main loop.
1669 """ 1670 """
1671 keypressed = pycompat.bytestr(keypressed)
1670 if keypressed in ["k", "KEY_UP"]: 1672 if keypressed in ["k", "KEY_UP"]:
1671 self.uparrowevent() 1673 self.uparrowevent()
1672 if keypressed in ["K", "KEY_PPAGE"]: 1674 if keypressed in ["K", "KEY_PPAGE"]:
1673 self.uparrowshiftevent() 1675 self.uparrowshiftevent()
1674 elif keypressed in ["j", "KEY_DOWN"]: 1676 elif keypressed in ["j", "KEY_DOWN"]: