Patchwork [v2] tests: deal with some git versions sending status messages to stderr

login
register
mail settings
Submitter Mads Kiilerich
Date Nov. 17, 2013, 11:11 p.m.
Message ID <e3f96967024a4d3c2cd3.1384729862@localhost.localdomain>
Download mbox | patch
Permalink /patch/3051/
State Superseded
Headers show

Comments

Mads Kiilerich - Nov. 17, 2013, 11:11 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1384711929 18000
#      Sun Nov 17 13:12:09 2013 -0500
# Node ID e3f96967024a4d3c2cd3ec47353e41d2b9729373
# Parent  fea4770ba6d14de9e33951f1d6225dc143b3ca72
tests: deal with some git versions sending status messages to stderr

git-1.8.4.2 on Fedora 20 will send messages like
  Cloning into 'X'...
  done.
to stderr.

The test cases for git subrepos tricks hg into invoking git. Stdout is muted,
stderr isn't. Muting stderr in hg do not sound like a good idea. Instead we do
it in the tests.
Augie Fackler - Nov. 27, 2013, 3 p.m.
On Sun, Nov 17, 2013 at 06:11:02PM -0500, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1384711929 18000
> #      Sun Nov 17 13:12:09 2013 -0500
> # Node ID e3f96967024a4d3c2cd3ec47353e41d2b9729373
> # Parent  fea4770ba6d14de9e33951f1d6225dc143b3ca72
> tests: deal with some git versions sending status messages to stderr

Queued this, thanks

>
> git-1.8.4.2 on Fedora 20 will send messages like
>   Cloning into 'X'...
>   done.
> to stderr.
>
> The test cases for git subrepos tricks hg into invoking git. Stdout is muted,
> stderr isn't. Muting stderr in hg do not sound like a good idea. Instead we do
> it in the tests.
>
> diff --git a/tests/test-subrepo-git.t b/tests/test-subrepo-git.t
> --- a/tests/test-subrepo-git.t
> +++ b/tests/test-subrepo-git.t
> @@ -71,7 +71,7 @@ make $GITROOT pushable, by replacing it
>  clone root
>
>    $ cd t
> -  $ hg clone . ../tc
> +  $ hg clone . ../tc 2> /dev/null
>    updating to branch default
>    cloning subrepo s from $TESTTMP/gitroot
>    3 files updated, 0 files merged, 0 files removed, 0 files unresolved
> @@ -94,7 +94,7 @@ update to previous substate
>  clone root, make local change
>
>    $ cd ../t
> -  $ hg clone . ../ta
> +  $ hg clone . ../ta 2> /dev/null
>    updating to branch default
>    cloning subrepo s from $TESTTMP/gitroot
>    3 files updated, 0 files merged, 0 files removed, 0 files unresolved
> @@ -113,7 +113,7 @@ clone root, make local change
>  clone root separately, make different local change
>
>    $ cd ../t
> -  $ hg clone . ../tb
> +  $ hg clone . ../tb 2> /dev/null
>    updating to branch default
>    cloning subrepo s from $TESTTMP/gitroot
>    3 files updated, 0 files merged, 0 files removed, 0 files unresolved
> @@ -199,7 +199,7 @@ make upstream git changes
>  make and push changes to hg without updating the subrepo
>
>    $ cd ../t
> -  $ hg clone . ../td
> +  $ hg clone . ../td 2>&1 | egrep -v '^Cloning into|^done\.'
>    updating to branch default
>    cloning subrepo s from $TESTTMP/gitroot
>    checking out detached HEAD in subrepo s
> @@ -317,7 +317,7 @@ create nested repo
>    $ hg add b
>    $ hg commit -m b
>
> -  $ hg clone ../t inner
> +  $ hg clone ../t inner 2> /dev/null
>    updating to branch default
>    cloning subrepo s from $TESTTMP/gitroot
>    3 files updated, 0 files merged, 0 files removed, 0 files unresolved
> @@ -345,7 +345,7 @@ relative source expansion
>
>    $ cd ..
>    $ mkdir d
> -  $ hg clone t d/t
> +  $ hg clone t d/t 2> /dev/null
>    updating to branch default
>    cloning subrepo s from $TESTTMP/gitroot
>    3 files updated, 0 files merged, 0 files removed, 0 files unresolved
> @@ -364,7 +364,7 @@ Don't crash if the subrepo is missing
>    $ hg commit --subrepos -qm missing
>    abort: subrepo s is missing (in subrepo s)
>    [255]
> -  $ hg update -C
> +  $ hg update -C 2> /dev/null
>    cloning subrepo s from $TESTTMP/gitroot
>    1 files updated, 0 files merged, 0 files removed, 0 files unresolved
>    $ hg sum | grep commit
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
Augie Fackler - Nov. 27, 2013, 3:03 p.m.
On Sun, Nov 17, 2013 at 06:11:02PM -0500, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1384711929 18000
> #      Sun Nov 17 13:12:09 2013 -0500
> # Node ID e3f96967024a4d3c2cd3ec47353e41d2b9729373
> # Parent  fea4770ba6d14de9e33951f1d6225dc143b3ca72
> tests: deal with some git versions sending status messages to stderr

Patch doesn't apply, rebase and resend?

>
> git-1.8.4.2 on Fedora 20 will send messages like
>   Cloning into 'X'...
>   done.
> to stderr.
>
> The test cases for git subrepos tricks hg into invoking git. Stdout is muted,
> stderr isn't. Muting stderr in hg do not sound like a good idea. Instead we do
> it in the tests.
>
> diff --git a/tests/test-subrepo-git.t b/tests/test-subrepo-git.t
> --- a/tests/test-subrepo-git.t
> +++ b/tests/test-subrepo-git.t
> @@ -71,7 +71,7 @@ make $GITROOT pushable, by replacing it
>  clone root
>
>    $ cd t
> -  $ hg clone . ../tc
> +  $ hg clone . ../tc 2> /dev/null
>    updating to branch default
>    cloning subrepo s from $TESTTMP/gitroot
>    3 files updated, 0 files merged, 0 files removed, 0 files unresolved
> @@ -94,7 +94,7 @@ update to previous substate
>  clone root, make local change
>
>    $ cd ../t
> -  $ hg clone . ../ta
> +  $ hg clone . ../ta 2> /dev/null
>    updating to branch default
>    cloning subrepo s from $TESTTMP/gitroot
>    3 files updated, 0 files merged, 0 files removed, 0 files unresolved
> @@ -113,7 +113,7 @@ clone root, make local change
>  clone root separately, make different local change
>
>    $ cd ../t
> -  $ hg clone . ../tb
> +  $ hg clone . ../tb 2> /dev/null
>    updating to branch default
>    cloning subrepo s from $TESTTMP/gitroot
>    3 files updated, 0 files merged, 0 files removed, 0 files unresolved
> @@ -199,7 +199,7 @@ make upstream git changes
>  make and push changes to hg without updating the subrepo
>
>    $ cd ../t
> -  $ hg clone . ../td
> +  $ hg clone . ../td 2>&1 | egrep -v '^Cloning into|^done\.'
>    updating to branch default
>    cloning subrepo s from $TESTTMP/gitroot
>    checking out detached HEAD in subrepo s
> @@ -317,7 +317,7 @@ create nested repo
>    $ hg add b
>    $ hg commit -m b
>
> -  $ hg clone ../t inner
> +  $ hg clone ../t inner 2> /dev/null
>    updating to branch default
>    cloning subrepo s from $TESTTMP/gitroot
>    3 files updated, 0 files merged, 0 files removed, 0 files unresolved
> @@ -345,7 +345,7 @@ relative source expansion
>
>    $ cd ..
>    $ mkdir d
> -  $ hg clone t d/t
> +  $ hg clone t d/t 2> /dev/null
>    updating to branch default
>    cloning subrepo s from $TESTTMP/gitroot
>    3 files updated, 0 files merged, 0 files removed, 0 files unresolved
> @@ -364,7 +364,7 @@ Don't crash if the subrepo is missing
>    $ hg commit --subrepos -qm missing
>    abort: subrepo s is missing (in subrepo s)
>    [255]
> -  $ hg update -C
> +  $ hg update -C 2> /dev/null
>    cloning subrepo s from $TESTTMP/gitroot
>    1 files updated, 0 files merged, 0 files removed, 0 files unresolved
>    $ hg sum | grep commit
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/tests/test-subrepo-git.t b/tests/test-subrepo-git.t
--- a/tests/test-subrepo-git.t
+++ b/tests/test-subrepo-git.t
@@ -71,7 +71,7 @@  make $GITROOT pushable, by replacing it 
 clone root
 
   $ cd t
-  $ hg clone . ../tc
+  $ hg clone . ../tc 2> /dev/null
   updating to branch default
   cloning subrepo s from $TESTTMP/gitroot
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -94,7 +94,7 @@  update to previous substate
 clone root, make local change
 
   $ cd ../t
-  $ hg clone . ../ta
+  $ hg clone . ../ta 2> /dev/null
   updating to branch default
   cloning subrepo s from $TESTTMP/gitroot
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -113,7 +113,7 @@  clone root, make local change
 clone root separately, make different local change
 
   $ cd ../t
-  $ hg clone . ../tb
+  $ hg clone . ../tb 2> /dev/null
   updating to branch default
   cloning subrepo s from $TESTTMP/gitroot
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -199,7 +199,7 @@  make upstream git changes
 make and push changes to hg without updating the subrepo
 
   $ cd ../t
-  $ hg clone . ../td
+  $ hg clone . ../td 2>&1 | egrep -v '^Cloning into|^done\.'
   updating to branch default
   cloning subrepo s from $TESTTMP/gitroot
   checking out detached HEAD in subrepo s
@@ -317,7 +317,7 @@  create nested repo
   $ hg add b
   $ hg commit -m b
 
-  $ hg clone ../t inner
+  $ hg clone ../t inner 2> /dev/null
   updating to branch default
   cloning subrepo s from $TESTTMP/gitroot
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -345,7 +345,7 @@  relative source expansion
 
   $ cd ..
   $ mkdir d
-  $ hg clone t d/t
+  $ hg clone t d/t 2> /dev/null
   updating to branch default
   cloning subrepo s from $TESTTMP/gitroot
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -364,7 +364,7 @@  Don't crash if the subrepo is missing
   $ hg commit --subrepos -qm missing
   abort: subrepo s is missing (in subrepo s)
   [255]
-  $ hg update -C
+  $ hg update -C 2> /dev/null
   cloning subrepo s from $TESTTMP/gitroot
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg sum | grep commit