Re: [PATCH STABLE v2] hghave: don't claim we have `tic` if it's NetBSD's binary (issue5698)
On Thu, Jun 28, 2018, 06:30 Thomas Klausner wrote: > On Wed, Jun 27, 2018 at 11:50:18AM -0400, Augie Fackler wrote: > > # HG changeset patch > > # User Augie Fackler > > # 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. > > This looks like it should work, but it doesn't. > Nuts. > > --- > /scratch/devel/py-mercurial/work/mercurial-4.6.1/tests/test-status-color.t > +++ > /scratch/devel/py-mercurial/work/mercurial-4.6.1/tests/test-status-color.t.err > @@ -243,15 +243,18 @@ >$ mkdir "$TESTTMP/terminfo" >$ TERMINFO="$TESTTMP/terminfo" tic "$TESTDIR/hgterm.ti" >$ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config > color.mode=terminfo -A > - \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1madded\x1b[30m > (esc) > - \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1mcopied\x1b[30m > (esc) > - \x1b[30m\x1b[30m modified\x1b[30m (esc) > - \x1b[30m\x1b[31m\x1b[1mR \x1b[30m\x1b[30m\x1b[31m\x1b[1mremoved\x1b[30m > (esc) > - \x1b[30m\x1b[36m\x1b[1m\x1b[4m! > \x1b[30m\x1b[30m\x1b[36m\x1b[1m\x1b[4mdeleted\x1b[30m (esc) > - \x1b[30m\x1b[35m\x1b[1m\x1b[4m? > \x1b[30m\x1b[30m\x1b[35m\x1b[1m\x1b[4munknown\x1b[30m (esc) > - \x1b[30m\x1b[30m\x1b[1mI \x1b[30m\x1b[30m\x1b[30m\x1b[1mignored\x1b[30m > (esc) > - \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30m.hgignore\x1b[30m (esc) > - \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30mmodified\x1b[30m (esc) > + warning: failed to set color mode to terminfo > + warning: failed to set color mode to terminfo > + warning: failed to set color mode to terminfo > + \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc) > + \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc) > + \x1b[0;0m modified\x1b[0m (esc) > + \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc) > + \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc) > + \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc) > + \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignored\x1b[0m (esc) > + \x1b[0;0mC \x1b[0m\x1b[0;0m.hgignore\x1b[0m (esc) > + \x1b[0;0mC \x1b[0m\x1b[0;0mmodified\x1b[0m (esc) > > The user can define effects with raw terminfo codes: > > @@ -262,15 +265,18 @@ >> terminfo.bold = \E[2m >> EOF >$ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config > color.mode=terminfo --config color.status.clean=dim -A > - \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2madded\x1b[30m > (esc) > - \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2mcopied\x1b[30m > (esc) > - \x1b[30m\x1b[30m modified\x1b[30m (esc) > - \x1b[30m\x1b[31m\x1b[2mR \x1b[30m\x1b[30m\x1b[31m\x1b[2mremoved\x1b[30m > (esc) > - \x1b[30m\x1b[36m\x1b[2m\x1b[4m! > \x1b[30m\x1b[30m\x1b[36m\x1b[2m\x1b[4mdeleted\x1b[30m (esc) > - \x1b[30m\x1b[35m\x1b[2m\x1b[4m? > \x1b[30m\x1b[30m\x1b[35m\x1b[2m\x1b[4munknown\x1b[30m (esc) > - \x1b[30m\x1b[30m\x1b[2mI \x1b[30m\x1b[30m\x1b[30m\x1b[2mignored\x1b[30m > (esc) > - \x1b[30m\x1b[88mC \x1b[30m\x1b[30m\x1b[88m.hgignore\x1b[30m (esc) > - \x1b[30m\x1b[88mC \x1b[30m\x1b[30m\x1b[88mmodified\x1b[30m (esc) > + warning: failed to set color mode to terminfo > + warning: failed to set color mode to terminfo > + warning: failed to set color mode to terminfo > + \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc) > + \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc) > + \x1b[0;0m modified\x1b[0m (esc) > + \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc) > + \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc) > + \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc) > + \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignored\x1b[0m (esc) > + \x1b[0;2mC \x1b[0m\x1b[0;2m.hgignore\x1b[0m (esc) > + \x1b[0;2mC \x1b[0m\x1b[0;2mmodified\x1b[0m (esc) > > #endif > > > ERROR: test-status-color.t output changed > > > How do I run the single test with the same settings as when it's run > in the context of the full test suite? > `make local` (just once, will speed up the process if you need multiple runs) `(cd tests && python run-tests.py --local test-status-color.t)` Thomas > ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH STABLE v2] hghave: don't claim we have `tic` if it's NetBSD's binary (issue5698)
On Wed, Jun 27, 2018 at 11:50:18AM -0400, Augie Fackler wrote: > # HG changeset patch > # User Augie Fackler > # 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. This looks like it should work, but it doesn't. --- /scratch/devel/py-mercurial/work/mercurial-4.6.1/tests/test-status-color.t +++ /scratch/devel/py-mercurial/work/mercurial-4.6.1/tests/test-status-color.t.err @@ -243,15 +243,18 @@ $ mkdir "$TESTTMP/terminfo" $ TERMINFO="$TESTTMP/terminfo" tic "$TESTDIR/hgterm.ti" $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo -A - \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1madded\x1b[30m (esc) - \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1mcopied\x1b[30m (esc) - \x1b[30m\x1b[30m modified\x1b[30m (esc) - \x1b[30m\x1b[31m\x1b[1mR \x1b[30m\x1b[30m\x1b[31m\x1b[1mremoved\x1b[30m (esc) - \x1b[30m\x1b[36m\x1b[1m\x1b[4m! \x1b[30m\x1b[30m\x1b[36m\x1b[1m\x1b[4mdeleted\x1b[30m (esc) - \x1b[30m\x1b[35m\x1b[1m\x1b[4m? \x1b[30m\x1b[30m\x1b[35m\x1b[1m\x1b[4munknown\x1b[30m (esc) - \x1b[30m\x1b[30m\x1b[1mI \x1b[30m\x1b[30m\x1b[30m\x1b[1mignored\x1b[30m (esc) - \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30m.hgignore\x1b[30m (esc) - \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30mmodified\x1b[30m (esc) + warning: failed to set color mode to terminfo + warning: failed to set color mode to terminfo + warning: failed to set color mode to terminfo + \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc) + \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc) + \x1b[0;0m modified\x1b[0m (esc) + \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc) + \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc) + \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc) + \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignored\x1b[0m (esc) + \x1b[0;0mC \x1b[0m\x1b[0;0m.hgignore\x1b[0m (esc) + \x1b[0;0mC \x1b[0m\x1b[0;0mmodified\x1b[0m (esc) The user can define effects with raw terminfo codes: @@ -262,15 +265,18 @@ > terminfo.bold = \E[2m > EOF $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo --config color.status.clean=dim -A - \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2madded\x1b[30m (esc) - \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2mcopied\x1b[30m (esc) - \x1b[30m\x1b[30m modified\x1b[30m (esc) - \x1b[30m\x1b[31m\x1b[2mR \x1b[30m\x1b[30m\x1b[31m\x1b[2mremoved\x1b[30m (esc) - \x1b[30m\x1b[36m\x1b[2m\x1b[4m! \x1b[30m\x1b[30m\x1b[36m\x1b[2m\x1b[4mdeleted\x1b[30m (esc) - \x1b[30m\x1b[35m\x1b[2m\x1b[4m? \x1b[30m\x1b[30m\x1b[35m\x1b[2m\x1b[4munknown\x1b[30m (esc) - \x1b[30m\x1b[30m\x1b[2mI \x1b[30m\x1b[30m\x1b[30m\x1b[2mignored\x1b[30m (esc) - \x1b[30m\x1b[88mC \x1b[30m\x1b[30m\x1b[88m.hgignore\x1b[30m (esc) - \x1b[30m\x1b[88mC \x1b[30m\x1b[30m\x1b[88mmodified\x1b[30m (esc) + warning: failed to set color mode to terminfo + warning: failed to set color mode to terminfo + warning: failed to set color mode to terminfo + \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc) + \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc) + \x1b[0;0m modified\x1b[0m (esc) + \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc) + \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc) + \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc) + \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignored\x1b[0m (esc) + \x1b[0;2mC \x1b[0m\x1b[0;2m.hgignore\x1b[0m (esc) + \x1b[0;2mC \x1b[0m\x1b[0;2mmodified\x1b[0m (esc) #endif ERROR: test-status-color.t output changed How do I run the single test with the same settings as when it's run in the context of the full test suite? Thomas ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH STABLE v2] hghave: don't claim we have `tic` if it's NetBSD's binary (issue5698)
also looks good On Wed, Jun 27, 2018 at 8:50 AM, Augie Fackler wrote: > # HG changeset patch > # User Augie Fackler > # 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 > ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH STABLE v2] hghave: don't claim we have `tic` if it's NetBSD's binary (issue5698)
# HG changeset patch # User Augie Fackler # 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