[PATCH] test-import: test git patch import with strip
Mads Kiilerich
mads at kiilerich.com
Wed Jun 16 10:45:47 CDT 2010
# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1276703015 -7200
# Node ID 136ac1e87031eff1cd61d3f1e2256bdd55104acf
# Parent ee50e43a946a2c397bc5dec8cdcdf34b92ebca45
test-import: test git patch import with strip
Tests revision 0429d0d49f92
diff --git a/tests/test-import b/tests/test-import
--- a/tests/test-import
+++ b/tests/test-import
@@ -296,31 +296,31 @@
EOF
cd ..
-echo '% test import with similarity (issue295)'
+echo '% test import with similarity and git and strip (issue295 et al.)'
hg init sim
cd sim
echo 'this is a test' > a
hg ci -Ama
cat > ../rename.diff <<EOF
-diff --git a/a b/a
+diff --git a/foo/a b/foo/a
deleted file mode 100644
---- a/a
+--- a/foo/a
+++ /dev/null
@@ -1,1 +0,0 @@
-this is a test
-diff --git a/b b/b
+diff --git a/foo/b b/foo/b
new file mode 100644
--- /dev/null
-+++ b/b
++++ b/foo/b
@@ -0,0 +1,2 @@
+this is a test
+foo
EOF
-hg import --no-commit -v -s 1 ../rename.diff
+hg import --no-commit -v -s 1 ../rename.diff -p2
hg st -C
hg revert -a
rm b
-hg import --no-commit -v -s 100 ../rename.diff
+hg import --no-commit -v -s 100 ../rename.diff -p2
hg st -C
cd ..
diff --git a/tests/test-import.out b/tests/test-import.out
--- a/tests/test-import.out
+++ b/tests/test-import.out
@@ -279,7 +279,7 @@
% test paths outside repo root
applying patch from stdin
abort: ../outside/foo not under root
-% test import with similarity (issue295)
+% test import with similarity and git and strip (issue295 et al.)
adding a
applying ../rename.diff
patching file a
More information about the Mercurial-devel
mailing list