[PATCH 1 of 5 STABLE] crecord: extra most on 'main' in a sub function
Augie Fackler
raf at durin42.com
Wed Apr 12 16:47:04 EDT 2017
On Wed, Apr 12, 2017 at 10:41:16AM +0200, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
> # Date 1490533512 -7200
> # Sun Mar 26 15:05:12 2017 +0200
> # Branch stable
> # Node ID a8c09dc71f99e929d2545ee4366231aa98d73d9d
> # Parent 8110d49e0558d3b50f8e82b5aa95c8f0e53e47e4
> # 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 a8c09dc71f99
> crecord: extra most on 'main' in a sub function
Did you mean "extract most of 'main' into a sub function"?
>
> There are some setup and cleanup necessary around the main code, that
> setup/cleanup code needs multiple adjustments so we extract the core code into
> its own function first for clarity.
>
> diff --git a/mercurial/crecord.py b/mercurial/crecord.py
> --- a/mercurial/crecord.py
> +++ b/mercurial/crecord.py
> @@ -1613,6 +1613,10 @@ are you sure you want to review/edit and
>
> origsigwinchhandler = signal.signal(signal.SIGWINCH,
> self.sigwinchhandler)
> + return self._main(stdscr)
> + signal.signal(signal.SIGWINCH, origsigwinchhandler)
> +
> + def _main(self, stdscr):
> self.stdscr = stdscr
> # error during initialization, cannot be printed in the curses
> # interface, it should be printed by the calling code
> @@ -1663,4 +1667,3 @@ are you sure you want to review/edit and
> keypressed = "foobar"
> if self.handlekeypressed(keypressed):
> 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