[PATCH] run-tests: check if stream is a tty before using color

Martin von Zweigbergk martinvonz at google.com
Tue Jul 18 10:13:00 EDT 2017


Also see my phabricator series D114-D118. Looks like this series was sent
ahead of mine and I missed it :-(

On Jul 18, 2017 6:19 AM, "Yuya Nishihara" <yuya at tcha.org> wrote:

> On Tue, 18 Jul 2017 07:33:13 +0900, mlaneuville at gmail.com wrote:
> > # HG changeset patch
> > # User Matthieu Laneuville <matthieu.laneuville at octobus.net>
> > # Date 1500329966 -32400
> > #      Tue Jul 18 07:19:26 2017 +0900
> > # Node ID 7f5f97697162331b5acf78aef091ae3fd341e308
> > # Parent  9b2647a7a70a270e85457ea55583b6eba0551258
> > run-tests: check if stream is a tty before using color
>
> Queued, thanks.
>
> > @@ -1574,6 +1565,17 @@
> >          self.successes = []
> >          self.faildata = {}
> >
> > +        global with_color
> > +        if not self.stream.isatty(): # check if the terminal is capable
> > +            with_color = False
> > +
> > +        if options.color != 'auto':
> > +            if options.color == 'never':
> > +                with_color = False
> > +            else: # 'always', for testing purposes
> > +                if pygmentspresent:
> > +                    with_color = True
>
> Perhaps this no longer needs to be a global variable.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20170718/b469acfd/attachment.html>


More information about the Mercurial-devel mailing list