[PATCH 1 of 5] ui: track label expansion when creating buffers

Yuya Nishihara yuya at tcha.org
Wed Nov 25 06:48:40 CST 2015


On Tue, 24 Nov 2015 13:11:38 -0800, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1448230248 28800
> #      Sun Nov 22 14:10:48 2015 -0800
> # Node ID d21bc6bcf17a67465835e1b61bcd93dfebdee3be
> # Parent  df9b73d2d444ae82fe8d3fe6cf682a93b2c4a7ef
> ui: track label expansion when creating buffers

> --- a/mercurial/ui.py
> +++ b/mercurial/ui.py

> @@ -592,8 +604,13 @@ class ui(object):
>          is being buffered so it can be captured and parsed or
>          processed, labeled should not be set to True.
>          '''
>          self._bufferstates.pop()
> +        if self._bufferstates:
> +            self._bufferapplylabels = self._bufferstates[-1][2]
> +        else:
> +            self._bufferapplylabels = None
> +
>          return "".join(self._buffers.pop())

colorui would need the same snippet. But anyway, colorui.popbuffer() can
be removed completely as labels are handled by write().


More information about the Mercurial-devel mailing list