Patchwork D6129: crecord: completely redraw screen when coming back from editor

login
register
mail settings
Submitter phabricator
Date March 14, 2019, 2:36 a.m.
Message ID <differential-rev-PHID-DREV-tbtxykrnhmgwddzy3q64-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/39242/
State New
Headers show

Comments

phabricator - March 14, 2019, 2:36 a.m.
spectral created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/crecord.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -554,6 +554,14 @@ 
     of the chosen chunks.
     """
     chunkselector = curseschunkselector(headerlist, ui, operation)
+
+    class dummystdscr(object):
+        def clear(self):
+            pass
+        def refresh(self):
+            pass
+
+    chunkselector.stdscr = dummystdscr()
     if testfn and os.path.exists(testfn):
         testf = open(testfn, 'rb')
         testcommands = [x.rstrip('\n') for x in testf.readlines()]
@@ -1605,6 +1613,9 @@ 
             except error.Abort as exc:
                 self.errorstr = str(exc)
                 return None
+            finally:
+                self.stdscr.clear()
+                self.stdscr.refresh()
 
             # remove comment lines
             patch = [line + '\n' for line in patch.splitlines()