[PATCH 2 of 2] Convert: add tests for glob exclude patterns

Tessa Starkey testarkey at gmail.com
Tue Feb 2 19:07:19 UTC 2010


# HG changeset patch
# User Tessa Starkey <testarkey at gmail.com>
# Date 1265132657 18000
# Node ID f3b48c94b2a6d1e61e3b8225aecfc3d241df147c
# Parent  052ab4a8d877c59c398a7ed2f52644387dc56d9b
Convert: add tests for glob exclude patterns

diff --git a/tests/test-convert-filemap b/tests/test-convert-filemap
--- a/tests/test-convert-filemap
+++ b/tests/test-convert-filemap
@@ -21,6 +21,8 @@
 echo dir/file2 >> dir/file2
 echo dir/subdir/file3 >> dir/subdir/file3
 echo dir/subdir/file4 >> dir/subdir/file4
+echo dir/hi.py >> dir/hi.py
+echo dir/hello.py >> dir/hello.py
 hg ci -d '0 0' -qAm '0: add foo baz dir/'
 
 echo bar > bar
@@ -128,3 +130,16 @@
 hg --cwd source cat copied
 echo 'copied2:'
 hg --cwd renames.repo cat copied2
+
+cat > globs.fmap <<EOF
+exclude dir/file2
+glob_exclude b*
+rename dir dir2
+rename foo foo2
+glob_exclude */h?.py
+EOF
+hg -q convert --filemap globs.fmap --datesort source globs.repo
+hg up -q -R globs.repo
+glog -R globs.repo
+hg -R globs.repo manifest --debug
+
diff --git a/tests/test-convert-filemap.out b/tests/test-convert-filemap.out
--- a/tests/test-convert-filemap.out
+++ b/tests/test-convert-filemap.out
@@ -16,7 +16,7 @@
 |/
 o  1 "1: add bar quux; copy foo to copied" files: bar copied quux
 |
-o  0 "0: add foo baz dir/" files: baz dir/file dir/file2 dir/subdir/file3 dir/subdir/file4 foo
+o  0 "0: add foo baz dir/" files: baz dir/file dir/file2 dir/hello.py dir/hi.py dir/subdir/file3 dir/subdir/file4 foo
 
 % final file versions in this repo:
 9463f52fe115e377cf2878d4fc548117211063f2 644   bar
@@ -24,6 +24,8 @@
 6ca237634e1f6bee1b6db94292fb44f092a25842 644   copied
 3e20847584beff41d7cd16136b7331ab3d754be0 644   dir/file
 75e6d3f8328f5f6ace6bf10b98df793416a09dca 644   dir/file2
+8d41eedffc3e45d44f1de07e6f2bab0dee86877b 644   dir/hello.py
+169259caa693ae5c4e637fe8b57c8237cae76209 644   dir/hi.py
 5fe139720576e18e34bcc9f79174db8897c8afe9 644   dir/subdir/file3
 57a1c1511590f3de52874adfa04effe8a77d64af 644   dir/subdir/file4
 9a7b52012991e4873687192c3e17e61ba3e837a3 644   foo
@@ -146,10 +148,12 @@
 |
 o  1 "1: add bar quux; copy foo to copied" files: copied2
 |
-o  0 "0: add foo baz dir/" files: dir2/file dir2/subdir/file3 foo2
+o  0 "0: add foo baz dir/" files: dir2/file dir2/hello.py dir2/hi.py dir2/subdir/file3 foo2
 
 e5e3d520be9be45937d0b06b004fadcd6c221fa2 644   copied2
 3e20847584beff41d7cd16136b7331ab3d754be0 644   dir2/file
+8d41eedffc3e45d44f1de07e6f2bab0dee86877b 644   dir2/hello.py
+169259caa693ae5c4e637fe8b57c8237cae76209 644   dir2/hi.py
 5fe139720576e18e34bcc9f79174db8897c8afe9 644   dir2/subdir/file3
 9a7b52012991e4873687192c3e17e61ba3e837a3 644   foo2
 copied2 renamed from foo2:2ed2a3912a0b24502043eae84ee4b279c18b90dd
@@ -157,3 +161,28 @@
 foo
 copied2:
 foo
+@  8 "8: change foo" files: foo2
+|
+o    7 "7: second merge; change bar" files:
+|\
+| o  6 "6: change foo baz" files: foo2
+| |
+o |  5 "5: change bar baz quux" files: quux
+|/
+o    4 "4: first merge; change bar baz" files:
+|\
+| o  3 "3: change bar quux" files: quux
+| |
+o |  2 "2: change foo" files: foo2
+|/
+o  1 "1: add bar quux; copy foo to copied" files: copied quux
+|
+o  0 "0: add foo baz dir/" files: dir2/file dir2/hello.py dir2/subdir/file3 dir2/subdir/file4 foo2
+
+e5e3d520be9be45937d0b06b004fadcd6c221fa2 644   copied
+3e20847584beff41d7cd16136b7331ab3d754be0 644   dir2/file
+8d41eedffc3e45d44f1de07e6f2bab0dee86877b 644   dir2/hello.py
+5fe139720576e18e34bcc9f79174db8897c8afe9 644   dir2/subdir/file3
+57a1c1511590f3de52874adfa04effe8a77d64af 644   dir2/subdir/file4
+9a7b52012991e4873687192c3e17e61ba3e837a3 644   foo2
+bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644   quux
diff --git a/tests/test-convert.out b/tests/test-convert.out
--- a/tests/test-convert.out
+++ b/tests/test-convert.out
@@ -64,14 +64,17 @@
 
       exclude path/to/file
 
+      glob_exclude path/to/file
+
       rename from/file to/file
 
-    The 'include' directive causes a file, or all files under a directory, to
-    be included in the destination repository, and the exclusion of all other
-    files and directories not explicitly included. The 'exclude' directive
-    causes files or directories to be omitted. The 'rename' directive renames
-    a file or directory. To rename from a subdirectory into the root of the
-    repository, use '.' as the path to rename to.
+    The 'include' directive causes a file, or all files under a directory, to be
+    included in the destination repository, and the exclusion of all other files 
+    and directories not explicitly included. The 'exclude' directive causes files 
+    or directories to be omitted. The 'glob_exclude' directive also causes files or
+    directories to be omitted and allows the use of glob wildcards '*' and '?'.The
+    'rename' directive renames a file or directory. To rename from a subdirectory
+    into the root of the repository, use '.' as the path to rename to.
 
     The splicemap is a file that allows insertion of synthetic history,
     letting you specify the parents of a revision. This is useful if you want



More information about the Mercurial-devel mailing list