Patchwork [STABLE,v2] hghave: don't claim we have `tic` if it's NetBSD's binary (issue5698)

login
register
mail settings
Submitter Augie Fackler
Date June 27, 2018, 3:50 p.m.
Message ID <af7d21e1e44c1bb756af.1530114618@augie-macbookpro2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/32470/
State New
Headers show

Comments

Augie Fackler - June 27, 2018, 3:50 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1529932907 14400
#      Mon Jun 25 09:21:47 2018 -0400
# Branch stable
# Node ID af7d21e1e44c1bb756af28b5978d3f7ee7d50eda
# Parent  0b63a6743010dfdbf8a8154186e119949bdaa1cc
hghave: don't claim we have `tic` if it's NetBSD's binary (issue5698)

test-status-color.t fails with different output because of mismatches
between how `tic` behaves from NetBSD's base system and ncurses'
verison (if I understand the bug right). The bug suggested using -V to
avoid the issue, so we'll do that.
Kyle Lippincott - June 27, 2018, 5:51 p.m.
also looks good

On Wed, Jun 27, 2018 at 8:50 AM, Augie Fackler <raf@durin42.com> wrote:

> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1529932907 14400
> #      Mon Jun 25 09:21:47 2018 -0400
> # Branch stable
> # Node ID af7d21e1e44c1bb756af28b5978d3f7ee7d50eda
> # Parent  0b63a6743010dfdbf8a8154186e119949bdaa1cc
> hghave: don't claim we have `tic` if it's NetBSD's binary (issue5698)
>
> test-status-color.t fails with different output because of mismatches
> between how `tic` behaves from NetBSD's base system and ncurses'
> verison (if I understand the bug right). The bug suggested using -V to
> avoid the issue, so we'll do that.
>
> diff --git a/tests/hghave.py b/tests/hghave.py
> --- a/tests/hghave.py
> +++ b/tests/hghave.py
> @@ -545,7 +545,11 @@ def has_tic():
>      try:
>          import curses
>          curses.COLOR_BLUE
> -        return matchoutput('test -x "`which tic`"', br'')
> +        if not matchoutput('test -x "`which tic`"', br''):
> +            return False
> +        # We have a tic, but make sure it's not the NetBSD system one
> +        # which doesn't pass test-status-color.t.
> +        return not matchoutput('tic -V 2>&1', br'unknown option')
>      except ImportError:
>          return False
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -545,7 +545,11 @@  def has_tic():
     try:
         import curses
         curses.COLOR_BLUE
-        return matchoutput('test -x "`which tic`"', br'')
+        if not matchoutput('test -x "`which tic`"', br''):
+            return False
+        # We have a tic, but make sure it's not the NetBSD system one
+        # which doesn't pass test-status-color.t.
+        return not matchoutput('tic -V 2>&1', br'unknown option')
     except ImportError:
         return False