[PATCH] treemanifest: don't use cp -T, not supported on OS X

Tony Tung tonytung at instagram.com
Thu Feb 18 17:07:30 EST 2016


Can you change this to:

cp -r .hg/store-copy/. .hg/store ?

The reason is that * doesn’t catch hidden files, whereas . does.

%:/tmp> mkdir a
%:/tmp> mkdir b
%:/tmp> echo foo > a/.foo
%:/tmp> cp -r a/. b
%:/tmp> ll b/.foo 
-rw-r--r--  1 tonytung  wheel  4 Feb 18 14:04 b/.foo
%:/tmp> 

Thanks,
Tony

> On Feb 11, 2016, at 5:50 AM, Martijn Pieters <mj at zopatista.com> wrote:
> 
> # HG changeset patch
> # User Martijn Pieters <mjpieters at fb.com>
> # Date 1455198638 0
> #      Thu Feb 11 13:50:38 2016 +0000
> # Node ID 1005b7af928c450646d71b41da02af3b72933367
> # Parent  fb91a65f102ca34d69961142ad84955080ada1fc
> treemanifest: don't use cp -T, not supported on OS X
> 
> The OS X cp implementation has no -T switch. Copy directory contents using a
> glob instead.
> 
> diff --git a/tests/test-treemanifest.t b/tests/test-treemanifest.t
> --- a/tests/test-treemanifest.t
> +++ b/tests/test-treemanifest.t
> @@ -418,7 +418,7 @@
>   b/bar/orange/fly/gnat.py (glob)
>   b/bar/orange/fly/housefly.txt (glob)
>   b/foo/apple/bees/flower.py (glob)
> -  $ cp -rT .hg/store-copy .hg/store
> +  $ cp -r .hg/store-copy/* .hg/store
> 
> Test files with just includes and excludes.
> 
> @@ -427,7 +427,7 @@
>   $ rm -r .hg/store/meta/b/foo/apple/bees
>   $ hg files -r . -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees
>   b/bar/fruits.txt (glob)
> -  $ cp -rT .hg/store-copy .hg/store
> +  $ cp -r .hg/store-copy/* .hg/store
> 
> Test files for a subdirectory, excluding a directory within it.
> 
> @@ -437,7 +437,7 @@
>   b/bar/fruits.txt (glob)
>   b/bar/orange/fly/gnat.py (glob)
>   b/bar/orange/fly/housefly.txt (glob)
> -  $ cp -rT .hg/store-copy .hg/store
> +  $ cp -r .hg/store-copy/* .hg/store
> 
> Test files for a sub directory, including only a directory within it, and
> including an unrelated directory.
> @@ -447,7 +447,7 @@
>   $ hg files -r . -I path:b/bar/orange -I path:a b
>   b/bar/orange/fly/gnat.py (glob)
>   b/bar/orange/fly/housefly.txt (glob)
> -  $ cp -rT .hg/store-copy .hg/store
> +  $ cp -r .hg/store-copy/* .hg/store
> 
> Test files for a pattern, including a directory, and excluding a directory
> within that.
> @@ -457,7 +457,7 @@
>   $ rm -r .hg/store/meta/b/bar/orange
>   $ hg files -r . glob:**.txt -I path:b/bar -X path:b/bar/orange
>   b/bar/fruits.txt (glob)
> -  $ cp -rT .hg/store-copy .hg/store
> +  $ cp -r .hg/store-copy/* .hg/store
> 
> Add some more changes to the deep repo
>   $ echo narf >> b/bar/fruits.txt
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.mercurial-2Dscm.org_mailman_listinfo_mercurial-2Ddevel&d=CwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=nX46-h6uPFfl2aGGFhBQbg&m=kSNkHXpNP4lN6Ev29GK2kr7dFbb7E38RIJHTnQ5Qw3o&s=nUieAeYxtBMAOeoFdpJvaf1dfIC8At28SL17POH-aXw&e= 



More information about the Mercurial-devel mailing list