Patchwork D118: run-tests: remove unnecessary 'with_color' variable

login
register
mail settings
Submitter phabricator
Date July 18, 2017, 12:06 a.m.
Message ID <differential-rev-PHID-DREV-xk767dlr5rnhxmazrndz-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/22465/
State Superseded, archived
Headers show

Comments

phabricator - July 18, 2017, 12:06 a.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Its value is always the same as that of 'pygmentspresent'.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D118

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS




EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - July 18, 2017, 12:45 a.m.
quark added inline comments.

INLINE COMMENTS

> run-tests.py:424
>              sys.stderr.write('warning: --color=always ignored because'
> -                             'pygments is not installed\n')
> +                             'pygment is not installed\n')
>  

Seems like a wrong spellchecker?

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D118

EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

To: martinvonz, #hg-reviewers
Cc: quark, mercurial-devel
phabricator - July 18, 2017, 4:36 a.m.
martinvonz added inline comments.

INLINE COMMENTS

> quark wrote in run-tests.py:424
> Seems like a wrong spellchecker?

Oops, thanks for spotting that. It was a rebase artifact.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D118

EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

To: martinvonz, #hg-reviewers
Cc: quark, mercurial-devel
phabricator - July 18, 2017, 7:19 p.m.
krbullock accepted this revision.
krbullock added a comment.
This revision is now accepted and ready to land.


  Queued, thanks.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D118

EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

To: martinvonz, #hg-reviewers, krbullock
Cc: krbullock, quark, mercurial-devel

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -88,15 +88,13 @@ 
 osenvironb = getattr(os, 'environb', os.environ)
 processlock = threading.Lock()
 
-with_color = False
 pygmentspresent = False
 # ANSI color is unsupported prior to Windows 10
 if os.name != 'nt':
     try: # is pygments installed
         import pygments
         import pygments.lexers as lexers
         import pygments.formatters as formatters
-        with_color = True
         pygmentspresent = True
     except ImportError:
         pass
@@ -414,16 +412,16 @@ 
                      '(use --with-chg instead)')
 
     if options.color == 'auto':
-        options.color = with_color
+        options.color = pygmentspresent
         if not sys.stderr.isatty(): # check if the terminal is capable
             options.color = False
     elif options.color == 'never':
         options.color = False
     else: # 'always', for testing purposes
         options.color = pygmentspresent
         if not pygmentspresent:
             sys.stderr.write('warning: --color=always ignored because'
-                             'pygments is not installed\n')
+                             'pygment is not installed\n')
 
     global useipv6
     if options.ipv6: