[PATCH 4 of 5 STABLE] crecord: ensure we reinstall the SIGSTOP handler

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed Apr 12 16:48:04 EDT 2017



On 04/12/2017 10:46 PM, Augie Fackler wrote:
> On Wed, Apr 12, 2017 at 10:41:19AM +0200, Pierre-Yves David wrote:
>> # HG changeset patch
>> # User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
>> # Date 1491470713 -7200
>> #      Thu Apr 06 11:25:13 2017 +0200
>> # Branch stable
>> # Node ID f83025d451fa293849f819cc997bc3f8c9ce42e0
>> # Parent  7c33ce6b8a6991d4189c7d379a78a2c2fa802c35
>> # EXP-Topic crecord-windows
>> # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
>> #              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r f83025d451fa
>> crecord: ensure we reinstall the SIGSTOP handler
>
> Up here you said "SIGSTOP"...

Should be SIGTSTP

>
>>
>> Previous, exceptions would prevent the reinstallation of the
>> signal.
>>
>> diff --git a/mercurial/crecord.py b/mercurial/crecord.py
>> --- a/mercurial/crecord.py
>> +++ b/mercurial/crecord.py
>> @@ -474,11 +474,13 @@ def chunkselector(ui, headerlist, operat
>>      ui.write(_('starting interactive selection\n'))
>>      chunkselector = curseschunkselector(headerlist, ui, operation)
>>      f = signal.getsignal(signal.SIGTSTP)
>> -    curses.wrapper(chunkselector.main)
>> -    if chunkselector.initerr is not None:
>> -        raise error.Abort(chunkselector.initerr)
>> -    # ncurses does not restore signal handler for SIGTSTP
>> -    signal.signal(signal.SIGTSTP, f)
>
> But down here it says SIGTSTP. Typo in the log message above?

yeah, my bad.

>
>> +    try:
>> +        curses.wrapper(chunkselector.main)
>> +        if chunkselector.initerr is not None:
>> +            raise error.Abort(chunkselector.initerr)
>> +        # ncurses does not restore signal handler for SIGTSTP
>> +    finally:
>> +        signal.signal(signal.SIGTSTP, f)
>>      return chunkselector.opts
>>
>>  def testdecorator(testfn, f):
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel at mercurial-scm.org
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list