Patchwork treemanifest: use "cp xyz/." instead of "cp xyz/*"

login
register
mail settings
Submitter Tony Tung
Date Feb. 23, 2016, 7:15 a.m.
Message ID <9a30df378101e038bf74.1456211700@dev8692.prn1.facebook.com>
Download mbox | patch
Permalink /patch/13303/
State Superseded
Commit 408446e4b10c4af11c39c97caa61565c3f86754e
Delegated to: Martin von Zweigbergk
Headers show

Comments

Tony Tung - Feb. 23, 2016, 7:15 a.m.
# HG changeset patch
# User Tony Tung <tonytung@merly.org>
# Date 1456211598 28800
#      Mon Feb 22 23:13:18 2016 -0800
# Node ID 9a30df378101e038bf7493fc27cf9c421de16d61
# Parent  91a827e760df9d9b3d86692c5aa195a3d6ba2208
treemanifest: use "cp xyz/." instead of "cp xyz/*"

This is more similar to cp -T because it covers hidden files.
Martin von Zweigbergk - Feb. 23, 2016, 1:52 p.m.
Did the difference cause you any problems? Either way, could you name the
same change to the other file (I forgot which) that does a similar backup
of .hg/store/?

On Mon, Feb 22, 2016, 23:15 Tony Tung <ttung@fb.com> wrote:

> # HG changeset patch
> # User Tony Tung <tonytung@merly.org>
> # Date 1456211598 28800
> #      Mon Feb 22 23:13:18 2016 -0800
> # Node ID 9a30df378101e038bf7493fc27cf9c421de16d61
> # Parent  91a827e760df9d9b3d86692c5aa195a3d6ba2208
> treemanifest: use "cp xyz/." instead of "cp xyz/*"
>
> This is more similar to cp -T because it covers hidden files.
>
> 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 -r .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 -r .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 -r .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 -r .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 -r .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@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

Patch

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 -r .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 -r .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 -r .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 -r .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 -r .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