Patchwork [1,of,4] tests: Solaris cp doesn't support the -T option

login
register
mail settings
Submitter Danek Duvall
Date March 2, 2016, 11:22 p.m.
Message ID <47d43135bf430d7172c8.1456960940@smelly.us.oracle.com>
Download mbox | patch
Permalink /patch/13576/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Danek Duvall - March 2, 2016, 11:22 p.m.
# HG changeset patch
# User Danek Duvall <danek.duvall@oracle.com>
# Date 1456959037 28800
#      Wed Mar 02 14:50:37 2016 -0800
# Node ID 47d43135bf430d7172c8fb8fe35fb17b6f8f029c
# Parent  c7f89ad87baef87f00c507545dfd4cc824bc3131
tests: Solaris cp doesn't support the -T option

The treemanifest tests use the -T option to cp in order to ensure that the
two directories named on the commandline are treated as peers, rather than
the usual behavior when the final argument is a directory.  GNU cp has this
option, but other implementations may not.  Thankfully, there's no pressing
reason to use it.  We can simply copy the contents of the first directory
into the target directory, since we know that the target directory already
exists.
Katsunori FUJIWARA - March 3, 2016, 8:52 a.m.
At Wed, 02 Mar 2016 15:22:20 -0800,
danek.duvall@oracle.com wrote:
> 
> # HG changeset patch
> # User Danek Duvall <danek.duvall@oracle.com>
> # Date 1456959037 28800
> #      Wed Mar 02 14:50:37 2016 -0800
> # Node ID 47d43135bf430d7172c8fb8fe35fb17b6f8f029c
> # Parent  c7f89ad87baef87f00c507545dfd4cc824bc3131
> tests: Solaris cp doesn't support the -T option
> 
> The treemanifest tests use the -T option to cp in order to ensure that the
> two directories named on the commandline are treated as peers, rather than
> the usual behavior when the final argument is a directory.  GNU cp has this
> option, but other implementations may not.  Thankfully, there's no pressing
> reason to use it.  We can simply copy the contents of the first directory
> into the target directory, since we know that the target directory already
> exists.

I confirmed that #1, #2 and #4 fix test portability problem on
Solaris.

To avoid re-raising "cp -T" problem in the future, it would be
desirable to add new detection rule for usage of "cp -T" to
contrib/check-code.py.

> diff --git a/tests/test-treemanifest.t b/tests/test-treemanifest.t
> --- a/tests/test-treemanifest.t
> +++ b/tests/test-treemanifest.t
> @@ -541,7 +541,7 @@ Verify reports missing dirlog
>    8 integrity errors encountered!
>    (first damaged changeset appears to be 0)
>    [1]
> -  $ cp -rT .hg/store-newcopy .hg/store
> +  $ cp -r .hg/store-newcopy/* .hg/store
>  
>  Verify reports missing dirlog entry
>    $ mv -f .hg/store-copy/meta/b/00manifest.* .hg/store/meta/b/
> @@ -566,7 +566,7 @@ Verify reports missing dirlog entry
>    8 integrity errors encountered!
>    (first damaged changeset appears to be 1)
>    [1]
> -  $ cp -rT .hg/store-newcopy .hg/store
> +  $ cp -r .hg/store-newcopy/* .hg/store
>  
>  Test cloning a treemanifest repo over http.
>    $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

----------------------------------------------------------------------
[FUJIWARA Katsunori]                             foozy@lares.dti.ne.jp
timeless - March 3, 2016, 1:56 p.m.
I have a patch for that. I'm waiting for this to be queued before I send it.
On Mar 3, 2016 3:53 AM, "FUJIWARA Katsunori" <foozy@lares.dti.ne.jp> wrote:

> At Wed, 02 Mar 2016 15:22:20 -0800,
> danek.duvall@oracle.com wrote:
> >
> > # HG changeset patch
> > # User Danek Duvall <danek.duvall@oracle.com>
> > # Date 1456959037 28800
> > #      Wed Mar 02 14:50:37 2016 -0800
> > # Node ID 47d43135bf430d7172c8fb8fe35fb17b6f8f029c
> > # Parent  c7f89ad87baef87f00c507545dfd4cc824bc3131
> > tests: Solaris cp doesn't support the -T option
> >
> > The treemanifest tests use the -T option to cp in order to ensure that
> the
> > two directories named on the commandline are treated as peers, rather
> than
> > the usual behavior when the final argument is a directory.  GNU cp has
> this
> > option, but other implementations may not.  Thankfully, there's no
> pressing
> > reason to use it.  We can simply copy the contents of the first directory
> > into the target directory, since we know that the target directory
> already
> > exists.
>
> I confirmed that #1, #2 and #4 fix test portability problem on
> Solaris.
>
> To avoid re-raising "cp -T" problem in the future, it would be
> desirable to add new detection rule for usage of "cp -T" to
> contrib/check-code.py.
>
> > diff --git a/tests/test-treemanifest.t b/tests/test-treemanifest.t
> > --- a/tests/test-treemanifest.t
> > +++ b/tests/test-treemanifest.t
> > @@ -541,7 +541,7 @@ Verify reports missing dirlog
> >    8 integrity errors encountered!
> >    (first damaged changeset appears to be 0)
> >    [1]
> > -  $ cp -rT .hg/store-newcopy .hg/store
> > +  $ cp -r .hg/store-newcopy/* .hg/store
> >
> >  Verify reports missing dirlog entry
> >    $ mv -f .hg/store-copy/meta/b/00manifest.* .hg/store/meta/b/
> > @@ -566,7 +566,7 @@ Verify reports missing dirlog entry
> >    8 integrity errors encountered!
> >    (first damaged changeset appears to be 1)
> >    [1]
> > -  $ cp -rT .hg/store-newcopy .hg/store
> > +  $ cp -r .hg/store-newcopy/* .hg/store
> >
> >  Test cloning a treemanifest repo over http.
> >    $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log
> > _______________________________________________
> > Mercurial-devel mailing list
> > Mercurial-devel@mercurial-scm.org
> > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
> ----------------------------------------------------------------------
> [FUJIWARA Katsunori]                             foozy@lares.dti.ne.jp
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
Yuya Nishihara - March 4, 2016, 2:32 p.m.
On Wed, 02 Mar 2016 15:22:20 -0800, danek.duvall@oracle.com wrote:
> # HG changeset patch
> # User Danek Duvall <danek.duvall@oracle.com>
> # Date 1456959037 28800
> #      Wed Mar 02 14:50:37 2016 -0800
> # Node ID 47d43135bf430d7172c8fb8fe35fb17b6f8f029c
> # Parent  c7f89ad87baef87f00c507545dfd4cc824bc3131
> tests: Solaris cp doesn't support the -T option

Queued the series per foozy's review, thank you. I've ignored
test-check-commit.t failure since "Solaris" should be capitalized.
Martin von Zweigbergk - March 4, 2016, 3:12 p.m.
Someone (I though it was timeless) sent a patch not long ago to change "/*"
to "/.". Could you do that in flight for this patch, Yuya? Thanks

On Fri, Mar 4, 2016, 06:36 Yuya Nishihara <yuya@tcha.org> wrote:

> On Wed, 02 Mar 2016 15:22:20 -0800, danek.duvall@oracle.com wrote:
> > # HG changeset patch
> > # User Danek Duvall <danek.duvall@oracle.com>
> > # Date 1456959037 28800
> > #      Wed Mar 02 14:50:37 2016 -0800
> > # Node ID 47d43135bf430d7172c8fb8fe35fb17b6f8f029c
> > # Parent  c7f89ad87baef87f00c507545dfd4cc824bc3131
> > tests: Solaris cp doesn't support the -T option
>
> Queued the series per foozy's review, thank you. I've ignored
> test-check-commit.t failure since "Solaris" should be capitalized.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
Yuya Nishihara - March 4, 2016, 3:26 p.m.
On Fri, 04 Mar 2016 15:12:11 +0000, Martin von Zweigbergk wrote:
> Someone (I though it was timeless) sent a patch not long ago to change "/*"
> to "/.". Could you do that in flight for this patch, Yuya? Thanks

Oh, fixed in flight. Thanks for pointing it out.

https://selenic.com/repo/hg/rev/408446e4b10c

Patch

diff --git a/tests/test-treemanifest.t b/tests/test-treemanifest.t
--- a/tests/test-treemanifest.t
+++ b/tests/test-treemanifest.t
@@ -541,7 +541,7 @@  Verify reports missing dirlog
   8 integrity errors encountered!
   (first damaged changeset appears to be 0)
   [1]
-  $ cp -rT .hg/store-newcopy .hg/store
+  $ cp -r .hg/store-newcopy/* .hg/store
 
 Verify reports missing dirlog entry
   $ mv -f .hg/store-copy/meta/b/00manifest.* .hg/store/meta/b/
@@ -566,7 +566,7 @@  Verify reports missing dirlog entry
   8 integrity errors encountered!
   (first damaged changeset appears to be 1)
   [1]
-  $ cp -rT .hg/store-newcopy .hg/store
+  $ cp -r .hg/store-newcopy/* .hg/store
 
 Test cloning a treemanifest repo over http.
   $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log