crecord: make KEY_ENTER usable in tests (by not updating UI)
Differential Revision: https://phab.mercurial-scm.org/D6620
--- a/mercurial/crecord.py Mon Jul 08 12:38:37 2019 -0700
+++ b/mercurial/crecord.py Mon Jul 08 13:06:46 2019 -0700
@@ -723,7 +723,7 @@
self.currentselecteditem = nextitem
self.recenterdisplayedarea()
- def nextsametype(self):
+ def nextsametype(self, test=False):
currentitem = self.currentselecteditem
sametype = lambda item: isinstance(item, type(currentitem))
nextitem = currentitem.nextitem()
@@ -739,7 +739,8 @@
self.togglefolded(parent)
self.currentselecteditem = nextitem
- self.recenterdisplayedarea()
+ if not test:
+ self.recenterdisplayedarea()
def rightarrowevent(self):
"""
@@ -1753,7 +1754,7 @@
self.toggleapply()
elif keypressed in ['\n', 'KEY_ENTER']:
self.toggleapply()
- self.nextsametype()
+ self.nextsametype(test=test)
elif keypressed in ['A']:
self.toggleall()
elif keypressed in ['e']: