[PATCH] crecord: restore SIGWINCH handler before return
Augie Fackler
raf at durin42.com
Wed Aug 24 09:58:44 EDT 2016
On Wed, Aug 24, 2016 at 11:30:15AM +0100, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1472034247 -3600
> # Wed Aug 24 11:24:07 2016 +0100
> # Node ID b43b1fd0de59f5bb0ee9e04e9fee00f9bf00f32f
> # Parent 4ddfb730789d56b6c597dce2c0556b63fbb0d48a
> # Available At https://bitbucket.org/quark-zju/hg-draft
> # hg pull https://bitbucket.org/quark-zju/hg-draft -r b43b1fd0de59
> crecord: restore SIGWINCH handler before return
queued, thanks
>
> Previously, the SIGWINCH handler does not get cleared and if the commit
> message editor also needs SIGWINCH handling (like vim), the two SIGWINCH
> handlers (the editor's, ours) will have a race. And we may erase the
> editor's screen content.
>
> This patch restores SIGWINCH handler to address the above issue.
>
> diff --git a/mercurial/crecord.py b/mercurial/crecord.py
> --- a/mercurial/crecord.py
> +++ b/mercurial/crecord.py
> @@ -1265,3 +1265,2 @@ class curseschunkselector(object):
> self.chunkpad = curses.newpad(self.numpadlines, self.xscreensize)
> - # todo: try to resize commit message window if possible
> except curses.error:
> @@ -1591,3 +1590,4 @@ are you sure you want to review/edit and
>
> - signal.signal(signal.SIGWINCH, self.sigwinchhandler)
> + origsigwinchhandler = signal.signal(signal.SIGWINCH,
> + self.sigwinchhandler)
> self.stdscr = stdscr
> @@ -1642,1 +1642,2 @@ are you sure you want to review/edit and
> break
> + signal.signal(signal.SIGWINCH, origsigwinchhandler)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
More information about the Mercurial-devel
mailing list