[PATCH 1 of 2] tests: use cp -R instead of cp -r

Jun Wu quark at fb.com
Wed Nov 30 14:08:35 EST 2016


Excerpts from Danek Duvall's message of 2016-11-30 10:35:47 -0800:
> Jun Wu wrote:
> 
> > Excerpts from Danek Duvall's message of 2016-11-30 09:51:11 -0800:
> > > Jun Wu wrote:
> > > 
> > > > # HG changeset patch
> > > > # User Jun Wu <quark at fb.com>
> > > > # Date 1480526736 0
> > > > #      Wed Nov 30 17:25:36 2016 +0000
> > > > # Node ID a4f46a03e5f8e33f32c36326c6b14b84d9cb03b4
> > > > # Parent  9e29d4e4e08b5996adda49cdd0b497d89e2b16ee
> > > > # Available At https://bitbucket.org/quark-zju/hg-draft  
> > > > #              hg pull https://bitbucket.org/quark-zju/hg-draft   -r a4f46a03e5f8
> > > > tests: use cp -R instead of cp -r
> > > > 
> > > > This makes OS X happy for some tests after 0d87b1caed92. The default
> > > > behavior of -R (-P, not follow symlinks) is what we want.
> > > 
> > > Where is that documented?  The GNU cp manpage considers -r and -R to be the
> > > same, and the Solaris manpage says that -R is the same as -r, except pipes
> > > are replicated instead of read from.
> > See:
> > 
> > - http://pubs.opengroup.org/onlinepubs/9699919799/utilities/cp.html 
> 
> I'm not sure how you get that.
> 
>    If source_file is a file of type symbolic link:
> 
>    - If the -R option was specified:
> 
>      - If none of the options -H, -L, nor -P were specified, it is
>        unspecified which of -H, -L, or -P will be used as a default.

So it's all about OSX. I'll send a V2 to correct the commit message.
 
> > - https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/cp.1.html 
> 
> I guess MacOS chose -P; Solaris didn't.

I did change them to use -P then I noticed Martijn's patch [1]. With that
applied, -P becomes unnecessary and I reverted them.

Note: even with this patch applied, OS X will still fail on test-hardlinks.t
so Martijn's patch is a better way to fix the OS X tests. And this "cp -R"
thing seems to be nice to have in all cases.

[1]: www.mercurial-scm.org/pipermail/mercurial-devel/2016-November/091170.html
> 
> Seems reasonable to use -R instead of -r, but I think -P will be required,
> too.
> 
> Danek


More information about the Mercurial-devel mailing list