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

login
register
mail settings
Submitter Tony Tung
Date Feb. 24, 2016, 1:24 a.m.
Message ID <82cf7b62af4caf184854.1456277064@andromeda.local>
Download mbox | patch
Permalink /patch/13335/
State Superseded
Commit 408446e4b10c4af11c39c97caa61565c3f86754e
Headers show

Comments

Tony Tung - Feb. 24, 2016, 1:24 a.m.
# HG changeset patch
# User Tony Tung <tonytung@merly.org>
# Date 1456276971 28800
#      Tue Feb 23 17:22:51 2016 -0800
# Node ID 82cf7b62af4caf184854e2d327e8ed66864d5b6a
# 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. 24, 2016, 1:27 a.m.
Thanks! I'll queue this in a while. The other file is test-verify.t (search
for "store-" in it). Could you update that one too?

On Tue, Feb 23, 2016 at 5:24 PM Tony Tung <tonytung@fb.com> wrote:

> # HG changeset patch
> # User Tony Tung <tonytung@merly.org>
> # Date 1456276971 28800
> #      Tue Feb 23 17:22:51 2016 -0800
> # Node ID 82cf7b62af4caf184854e2d327e8ed66864d5b6a
> # 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
> diff --git a/tests/test-verify.t b/tests/test-verify.t
> --- a/tests/test-verify.t
> +++ b/tests/test-verify.t
> @@ -84,7 +84,7 @@
>    3 integrity errors encountered!
>    (first damaged changeset appears to be 0)
>    [1]
> -  $ cp -r .hg/store-full/* .hg/store
> +  $ cp -r .hg/store-full/. .hg/store
>
>  Entire manifest log missing
>
> @@ -94,7 +94,7 @@
>    1 integrity errors encountered!
>    (first damaged changeset appears to be 0)
>    [1]
> -  $ cp -r .hg/store-full/* .hg/store
> +  $ cp -r .hg/store-full/. .hg/store
>
>  Entire filelog missing
>
> @@ -109,7 +109,7 @@
>    3 integrity errors encountered!
>    (first damaged changeset appears to be 0)
>    [1]
> -  $ cp -r .hg/store-full/* .hg/store
> +  $ cp -r .hg/store-full/. .hg/store
>
>  Entire changelog and manifest log missing
>
> @@ -118,7 +118,7 @@
>    $ hg verify -q
>    warning: orphan revlog 'data/file.i'
>    1 warnings encountered!
> -  $ cp -r .hg/store-full/* .hg/store
> +  $ cp -r .hg/store-full/. .hg/store
>
>  Entire changelog and filelog missing
>
> @@ -137,7 +137,7 @@
>    6 integrity errors encountered!
>    (first damaged changeset appears to be 0)
>    [1]
> -  $ cp -r .hg/store-full/* .hg/store
> +  $ cp -r .hg/store-full/. .hg/store
>
>  Entire manifest log and filelog missing
>
> @@ -152,7 +152,7 @@
>    2 integrity errors encountered!
>    (first damaged changeset appears to be 0)
>    [1]
> -  $ cp -r .hg/store-full/* .hg/store
> +  $ cp -r .hg/store-full/. .hg/store
>
>  Changelog missing entry
>
> @@ -165,7 +165,7 @@
>    1 warnings encountered!
>    3 integrity errors encountered!
>    [1]
> -  $ cp -r .hg/store-full/* .hg/store
> +  $ cp -r .hg/store-full/. .hg/store
>
>  Manifest log missing entry
>
> @@ -176,7 +176,7 @@
>    2 integrity errors encountered!
>    (first damaged changeset appears to be 1)
>    [1]
> -  $ cp -r .hg/store-full/* .hg/store
> +  $ cp -r .hg/store-full/. .hg/store
>
>  Filelog missing entry
>
> @@ -186,7 +186,7 @@
>    1 integrity errors encountered!
>    (first damaged changeset appears to be 1)
>    [1]
> -  $ cp -r .hg/store-full/* .hg/store
> +  $ cp -r .hg/store-full/. .hg/store
>
>  Changelog and manifest log missing entry
>
> @@ -199,7 +199,7 @@
>    1 warnings encountered!
>    2 integrity errors encountered!
>    [1]
> -  $ cp -r .hg/store-full/* .hg/store
> +  $ cp -r .hg/store-full/. .hg/store
>
>  Changelog and filelog missing entry
>
> @@ -211,7 +211,7 @@
>     file@?: manifest refers to unknown revision c10f2164107d
>    3 integrity errors encountered!
>    [1]
> -  $ cp -r .hg/store-full/* .hg/store
> +  $ cp -r .hg/store-full/. .hg/store
>
>  Manifest and filelog missing entry
>
> @@ -222,7 +222,7 @@
>    1 integrity errors encountered!
>    (first damaged changeset appears to be 1)
>    [1]
> -  $ cp -r .hg/store-full/* .hg/store
> +  $ cp -r .hg/store-full/. .hg/store
>
>  Corrupt changelog base node to cause failure to read revision
>
> @@ -238,7 +238,7 @@
>    4 integrity errors encountered!
>    (first damaged changeset appears to be 0)
>    [1]
> -  $ cp -r .hg/store-full/* .hg/store
> +  $ cp -r .hg/store-full/. .hg/store
>
>  Corrupt manifest log base node to cause failure to read revision
>
> @@ -250,7 +250,7 @@
>    2 integrity errors encountered!
>    (first damaged changeset appears to be 0)
>    [1]
> -  $ cp -r .hg/store-full/* .hg/store
> +  $ cp -r .hg/store-full/. .hg/store
>
>  Corrupt filelog base node to cause failure to read revision
>
> @@ -261,7 +261,7 @@
>    1 integrity errors encountered!
>    (first damaged changeset appears to be 0)
>    [1]
> -  $ cp -r .hg/store-full/* .hg/store
> +  $ cp -r .hg/store-full/. .hg/store
>
>    $ cd ..
>
> _______________________________________________
> 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
diff --git a/tests/test-verify.t b/tests/test-verify.t
--- a/tests/test-verify.t
+++ b/tests/test-verify.t
@@ -84,7 +84,7 @@ 
   3 integrity errors encountered!
   (first damaged changeset appears to be 0)
   [1]
-  $ cp -r .hg/store-full/* .hg/store
+  $ cp -r .hg/store-full/. .hg/store
 
 Entire manifest log missing
 
@@ -94,7 +94,7 @@ 
   1 integrity errors encountered!
   (first damaged changeset appears to be 0)
   [1]
-  $ cp -r .hg/store-full/* .hg/store
+  $ cp -r .hg/store-full/. .hg/store
 
 Entire filelog missing
 
@@ -109,7 +109,7 @@ 
   3 integrity errors encountered!
   (first damaged changeset appears to be 0)
   [1]
-  $ cp -r .hg/store-full/* .hg/store
+  $ cp -r .hg/store-full/. .hg/store
 
 Entire changelog and manifest log missing
 
@@ -118,7 +118,7 @@ 
   $ hg verify -q
   warning: orphan revlog 'data/file.i'
   1 warnings encountered!
-  $ cp -r .hg/store-full/* .hg/store
+  $ cp -r .hg/store-full/. .hg/store
 
 Entire changelog and filelog missing
 
@@ -137,7 +137,7 @@ 
   6 integrity errors encountered!
   (first damaged changeset appears to be 0)
   [1]
-  $ cp -r .hg/store-full/* .hg/store
+  $ cp -r .hg/store-full/. .hg/store
 
 Entire manifest log and filelog missing
 
@@ -152,7 +152,7 @@ 
   2 integrity errors encountered!
   (first damaged changeset appears to be 0)
   [1]
-  $ cp -r .hg/store-full/* .hg/store
+  $ cp -r .hg/store-full/. .hg/store
 
 Changelog missing entry
 
@@ -165,7 +165,7 @@ 
   1 warnings encountered!
   3 integrity errors encountered!
   [1]
-  $ cp -r .hg/store-full/* .hg/store
+  $ cp -r .hg/store-full/. .hg/store
 
 Manifest log missing entry
 
@@ -176,7 +176,7 @@ 
   2 integrity errors encountered!
   (first damaged changeset appears to be 1)
   [1]
-  $ cp -r .hg/store-full/* .hg/store
+  $ cp -r .hg/store-full/. .hg/store
 
 Filelog missing entry
 
@@ -186,7 +186,7 @@ 
   1 integrity errors encountered!
   (first damaged changeset appears to be 1)
   [1]
-  $ cp -r .hg/store-full/* .hg/store
+  $ cp -r .hg/store-full/. .hg/store
 
 Changelog and manifest log missing entry
 
@@ -199,7 +199,7 @@ 
   1 warnings encountered!
   2 integrity errors encountered!
   [1]
-  $ cp -r .hg/store-full/* .hg/store
+  $ cp -r .hg/store-full/. .hg/store
 
 Changelog and filelog missing entry
 
@@ -211,7 +211,7 @@ 
    file@?: manifest refers to unknown revision c10f2164107d
   3 integrity errors encountered!
   [1]
-  $ cp -r .hg/store-full/* .hg/store
+  $ cp -r .hg/store-full/. .hg/store
 
 Manifest and filelog missing entry
 
@@ -222,7 +222,7 @@ 
   1 integrity errors encountered!
   (first damaged changeset appears to be 1)
   [1]
-  $ cp -r .hg/store-full/* .hg/store
+  $ cp -r .hg/store-full/. .hg/store
 
 Corrupt changelog base node to cause failure to read revision
 
@@ -238,7 +238,7 @@ 
   4 integrity errors encountered!
   (first damaged changeset appears to be 0)
   [1]
-  $ cp -r .hg/store-full/* .hg/store
+  $ cp -r .hg/store-full/. .hg/store
 
 Corrupt manifest log base node to cause failure to read revision
 
@@ -250,7 +250,7 @@ 
   2 integrity errors encountered!
   (first damaged changeset appears to be 0)
   [1]
-  $ cp -r .hg/store-full/* .hg/store
+  $ cp -r .hg/store-full/. .hg/store
 
 Corrupt filelog base node to cause failure to read revision
 
@@ -261,7 +261,7 @@ 
   1 integrity errors encountered!
   (first damaged changeset appears to be 0)
   [1]
-  $ cp -r .hg/store-full/* .hg/store
+  $ cp -r .hg/store-full/. .hg/store
 
   $ cd ..