[PATCH STABLE] progress: stop excessive clearing (issue4801)

Sean Farley sean at farley.io
Fri May 6 19:07:03 EDT 2016


Matt Mackall <mpm at selenic.com> writes:

> # HG changeset patch
> # User Matt Mackall <mpm at selenic.com>
> # Date 1462575186 18000
> #      Fri May 06 17:53:06 2016 -0500
> # Branch stable
> # Node ID 222b8170d69e74ed6970a51b73e83042a1b87b92
> # Parent  77de985d7c91c67650d9fba0e4b21dfdbd894eeb
> progress: stop excessive clearing (issue4801)
>
> The progress bar was being cleared on every write(), regardless of
> whether it was currently displayed. This could foul up the display of
> any writes that didn't include a linebreak.
>
> In particular, the win32 mode of the color extension was turning
> single prompt string writes into two writes, and the resulting
> clear/write/clear/write pattern was making the prompt invisible.
>
> We fix this by insisting that we have shown a progress bar and haven't
> just cleared it (setting lastprint to 0).
>
> Conveniently, the test suite already had instances of duplicate
> clears.. that are now cleared up.

Looks awesome to me! r+


More information about the Mercurial-devel mailing list