[PATCH STABLE] tests: account for different newline behavior between Solaris and GNU grep

2017-01-29 Thread danek . duvall
# HG changeset patch
# User Danek Duvall 
# Date 1485722456 28800
#  Sun Jan 29 12:40:56 2017 -0800
# Branch stable
# Node ID 24d82f28412d67323d13ac2b9f8c7c489c171ee0
# Parent  7bfe02b57695900ef996989286c1fdc2a13aec82
tests: account for different newline behavior between Solaris and GNU grep

GNU grep, when emitting a matching line that doesn't have a terminating
newline, will add an extra newline.  Solaris grep passes the original line
through without the newline.  This causes differences in test output when
looking at the last line of the output of get-with-headers.py, which
doesn't usually emit (and certainly doesn't guarantee) a terminating
newline.

Both grep implementations succeed in matching the requested pattern,
though, so rely on specifying the full pattern on grep's commandline
instead of expecting it in the output, and send the output to /dev/null.

diff --git a/tests/test-http-protocol.t b/tests/test-http-protocol.t
--- a/tests/test-http-protocol.t
+++ b/tests/test-http-protocol.t
@@ -16,11 +16,9 @@
 compression formats are advertised in compression capability
 
 #if zstd
-  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | 
grep compression
-  compression=zstd,zlib
+  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | 
grep '^compression=zstd,zlib$' > /dev/null
 #else
-  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | 
grep compression
-  compression=zlib
+  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | 
grep '^compression=zlib$' > /dev/null
 #endif
 
   $ killdaemons.py
@@ -29,8 +27,7 @@ server.compressionengines can replace en
 
   $ hg --config server.compressionengines=none -R server serve -p $HGPORT -d 
--pid-file hg.pid
   $ cat hg.pid > $DAEMON_PIDS
-  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | 
grep compression
-  compression=none
+  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | 
grep '^compression=none$' > /dev/null
 
   $ killdaemons.py
 
@@ -38,8 +35,7 @@ Order of engines can also change
 
   $ hg --config server.compressionengines=none,zlib -R server serve -p $HGPORT 
-d --pid-file hg.pid
   $ cat hg.pid > $DAEMON_PIDS
-  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | 
grep compression
-  compression=none,zlib
+  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | 
grep '^compression=none,zlib$' > /dev/null
 
   $ killdaemons.py
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] match: adding non-recursive directory matching

2017-01-29 Thread FUJIWARA Katsunori

At Fri, 27 Jan 2017 15:14:38 -0800,
Rodrigo Damazio wrote:
> 
> [1  ]
> [1.1  ]
> On Fri, Jan 27, 2017 at 1:03 AM, FUJIWARA Katsunori 
> wrote:
> 
> >
> > At Thu, 26 Jan 2017 17:27:17 -0800,
> > Rodrigo Damazio wrote:
> > >
> > > [1  ]
> > > [1.1  ]
> > > All sounds very reasonable, and "filesin:" or "rootfilesin:" LGTM.
> >
> > Is it OK for your solution that "rootfilesin:FOO" doesn't match
> > against "file FOO", even though your patch posted in this thread made
> > "files:FOO" do so ? or, is combining "rootfile:" and "rootfilesin"
> > acceptable for your solution ?
> >
> 
> Yes, not matching files is fine, and actually the easiest to implement (the
> regex is simpler and our custom server doesn't support files anyway).
> For that, rootfilesin:foo/bar can produce regex ^foo/bar/[^/]+$ or similar
> which would not match a file called bar. visitdir would have to be updated
> accordingly, of course, but that shouldn't be too hard (and i can take the
> opportunity to add some comments to the code).
> 
> If that looks good to you, let me know and I'll send an updated patch.

Sure, LGTM

-- 
--
[FUJIWARA Katsunori] fo...@lares.dti.ne.jp
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel