Patchwork D6620: crecord: make KEY_ENTER usable in tests (by not updating UI)

login
register
mail settings
Submitter phabricator
Date July 8, 2019, 10:04 p.m.
Message ID <8ae30df7561ad0cdf47f3150f7495772@localhost.localdomain>
Download mbox | patch
Permalink /patch/40839/
State Not Applicable
Headers show

Comments

phabricator - July 8, 2019, 10:04 p.m.
Closed by commit rHGcd4f1b7c3192: crecord: make KEY_ENTER usable in tests (by not updating UI) (authored by spectral).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6620?vs=15812&id=15821

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6620/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6620

AFFECTED FILES
  mercurial/crecord.py

CHANGE DETAILS




To: spectral, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -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']: