treemanifest: use "cp xyz/." instead of "cp xyz/*"
authorTony Tung <tonytung@merly.org>
Tue, 23 Feb 2016 17:22:51 -0800
changeset 30326 408446e4b10c4af11c39c97caa61565c3f86754e
parent 30325 93b5c540db69b9130b5549a7eca336d6158d0ee9
child 30327 f7c5c7847b5343baee7bc619064df11d44da75e1
push id187
push usergszorc@mozilla.com
push dateSun, 28 Feb 2016 01:45:48 +0000
treemanifest: use "cp xyz/." instead of "cp xyz/*" This is more similar to cp -T because it covers hidden files.
tests/test-treemanifest.t
tests/test-verify.t
--- a/tests/test-treemanifest.t
+++ b/tests/test-treemanifest.t
@@ -415,56 +415,56 @@ Excludes with a glob should not exclude 
 Test files for a subdirectory.
 
   $ rm -r .hg/store/meta/~2e_a
   $ hg files -r . b
   b/bar/fruits.txt (glob)
   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.
 
   $ rm -r .hg/store/meta/~2e_a
   $ rm -r .hg/store/meta/b/bar/orange/fly
   $ 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.
 
   $ rm -r .hg/store/meta/~2e_a
   $ rm -r .hg/store/meta/b/foo
   $ hg files -r . -X path:b/foo b
   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.
 
   $ rm -r .hg/store/meta/~2e_a
   $ rm -r .hg/store/meta/b/foo
   $ 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.
 
   $ rm -r .hg/store/meta/~2e_a
   $ rm -r .hg/store/meta/b/foo
   $ 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
   $ hg ci -m narf
   $ echo troz >> b/bar/orange/fly/gnat.py
   $ hg ci -m troz
 
 Verify works
--- a/tests/test-verify.t
+++ b/tests/test-verify.t
@@ -79,51 +79,51 @@ Entire changelog missing
   $ rm .hg/store/00changelog.*
   $ hg verify -q
    0: empty or missing changelog
    manifest@0: d0b6632564d4 not in changesets
    manifest@1: 941fc4534185 not in changesets
   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
 
   $ rm .hg/store/00manifest.*
   $ hg verify -q
    0: empty or missing manifest
   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
 
   $ rm .hg/store/data/file.*
   $ hg verify -q
    warning: revlog 'data/file.i' not in fncache!
    0: empty or missing file
    file@0: manifest refers to unknown revision 362fef284ce2
    file@1: manifest refers to unknown revision c10f2164107d
   1 warnings encountered!
   hint: run "hg debugrebuildfncache" to recover from corrupt fncache
   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
 
   $ rm .hg/store/00changelog.*
   $ rm .hg/store/00manifest.*
   $ 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
 
   $ rm .hg/store/00changelog.*
   $ rm .hg/store/data/file.*
   $ hg verify -q
    0: empty or missing changelog
    manifest@0: d0b6632564d4 not in changesets
@@ -132,141 +132,141 @@ Entire changelog and filelog missing
    ?: empty or missing file
    file@0: manifest refers to unknown revision 362fef284ce2
    file@1: manifest refers to unknown revision c10f2164107d
   1 warnings encountered!
   hint: run "hg debugrebuildfncache" to recover from corrupt fncache
   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
 
   $ rm .hg/store/00manifest.*
   $ rm .hg/store/data/file.*
   $ hg verify -q
    0: empty or missing manifest
    warning: revlog 'data/file.i' not in fncache!
    0: empty or missing file
   1 warnings encountered!
   hint: run "hg debugrebuildfncache" to recover from corrupt fncache
   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
 
   $ cp -f .hg/store-partial/00changelog.* .hg/store
   $ hg verify -q
    manifest@?: rev 1 points to nonexistent changeset 1
    manifest@?: 941fc4534185 not in changesets
    file@?: rev 1 points to nonexistent changeset 1
    (expected 0)
   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
 
   $ cp -f .hg/store-partial/00manifest.* .hg/store
   $ hg verify -q
    manifest@1: changeset refers to unknown revision 941fc4534185
    file@1: c10f2164107d not in manifests
   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
 
   $ cp -f .hg/store-partial/data/file.* .hg/store/data
   $ hg verify -q
    file@1: manifest refers to unknown revision c10f2164107d
   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
 
   $ cp -f .hg/store-partial/00changelog.* .hg/store
   $ cp -f .hg/store-partial/00manifest.* .hg/store
   $ hg verify -q
    file@?: rev 1 points to nonexistent changeset 1
    (expected 0)
    file@?: c10f2164107d not in manifests
   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
 
   $ cp -f .hg/store-partial/00changelog.* .hg/store
   $ cp -f .hg/store-partial/data/file.* .hg/store/data
   $ hg verify -q
    manifest@?: rev 1 points to nonexistent changeset 1
    manifest@?: 941fc4534185 not in changesets
    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
 
   $ cp -f .hg/store-partial/00manifest.* .hg/store
   $ cp -f .hg/store-partial/data/file.* .hg/store/data
   $ hg verify -q
    manifest@1: changeset refers to unknown revision 941fc4534185
   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
 
   $ printf abcd | dd conv=notrunc of=.hg/store/00changelog.i bs=1 seek=16 \
   >   2> /dev/null
   $ hg verify -q
    0: unpacking changeset 08b1860757c2: * (glob)
    manifest@?: rev 0 points to unexpected changeset 0
    manifest@?: d0b6632564d4 not in changesets
    file@?: rev 0 points to unexpected changeset 0
    (expected 1)
   1 warnings encountered!
   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
 
   $ printf abcd | dd conv=notrunc of=.hg/store/00manifest.i bs=1 seek=16 \
   >   2> /dev/null
   $ hg verify -q
    manifest@0: reading delta d0b6632564d4: * (glob)
    file@0: 362fef284ce2 not in manifests
   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
 
   $ printf abcd | dd conv=notrunc of=.hg/store/data/file.i bs=1 seek=16 \
   >   2> /dev/null
   $ hg verify -q
    file@0: unpacking 362fef284ce2: * (glob)
   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 ..
 
 test changelog without a manifest
 
   $ hg init b
   $ cd b
   $ hg branch foo