Import say a file is not tracked after patching : test case
author"Mathieu Clabaut <mathieu.clabaut@gmail.com>"
Wed, 02 Aug 2006 09:29:17 +0200
changeset 2773 871ca5b9d348
parent 2772 4720e79486d3
child 2774 8cd3e19bf4a5
child 2779 663094f5595b
Import say a file is not tracked after patching : test case
tests/test-import
tests/test-import.out
--- a/tests/test-import	Wed Aug 02 20:33:57 2006 -0700
+++ b/tests/test-import	Wed Aug 02 09:29:17 2006 +0200
@@ -1,7 +1,10 @@
 #!/bin/sh
 
 hg init a
+mkdir a/d1
+mkdir a/d1/d2
 echo line 1 > a/a
+echo line 1 > a/d1/d2/a
 hg --cwd a ci -d '0 0' -Ama
 
 echo line 2 >> a/a
@@ -79,3 +82,19 @@
 hg --cwd b tip | grep second
 rm -rf b
 
+# bug non regression test
+# importing a patch in a subdirectory failed at the commit stage
+echo line 2 >> a/d1/d2/a
+hg --cwd a ci -u someoneelse -d '1 0' -m'subdir change'
+echo % hg import in a subdirectory
+hg clone -r0 a b
+hg --cwd a export tip | sed -e 's/d1\/d2\///' > tip.patch
+pushd b/d1/d2 2>&1 > /dev/null
+hg import  ../../../tip.patch
+popd  2>&1 > /dev/null
+echo "% message should be 'subdir change'"
+hg --cwd b tip | grep 'subdir change'
+echo "% committer should be 'someoneelse'"
+hg --cwd b tip | grep someoneelse
+echo "% should be empty"
+hg --cwd b status
--- a/tests/test-import.out	Wed Aug 02 20:33:57 2006 -0700
+++ b/tests/test-import.out	Wed Aug 02 09:29:17 2006 +0200
@@ -1,11 +1,12 @@
 adding a
+adding d1/d2/a
 % import exported patch
 requesting all changes
 adding changesets
 adding manifests
 adding file changes
-added 1 changesets with 1 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+added 1 changesets with 2 changes to 2 files
+2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 applying ../tip.patch
 patching file a
 % message should be same
@@ -17,8 +18,8 @@
 adding changesets
 adding manifests
 adding file changes
-added 1 changesets with 1 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+added 1 changesets with 2 changes to 2 files
+2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 applying ../tip.patch
 patching file a
 transaction abort!
@@ -28,8 +29,8 @@
 adding changesets
 adding manifests
 adding file changes
-added 1 changesets with 1 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+added 1 changesets with 2 changes to 2 files
+2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 applying ../tip.patch
 patching file a
 % import from stdin
@@ -37,8 +38,8 @@
 adding changesets
 adding manifests
 adding file changes
-added 1 changesets with 1 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+added 1 changesets with 2 changes to 2 files
+2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 applying patch from stdin
 patching file a
 % override commit message
@@ -46,8 +47,8 @@
 adding changesets
 adding manifests
 adding file changes
-added 1 changesets with 1 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+added 1 changesets with 2 changes to 2 files
+2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 applying patch from stdin
 patching file a
 summary:     override
@@ -56,8 +57,8 @@
 adding changesets
 adding manifests
 adding file changes
-added 1 changesets with 1 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+added 1 changesets with 2 changes to 2 files
+2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 applying ../msg.patch
 patching file a
 user:        email patcher
@@ -67,8 +68,8 @@
 adding changesets
 adding manifests
 adding file changes
-added 1 changesets with 1 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+added 1 changesets with 2 changes to 2 files
+2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 applying patch from stdin
 patching file a
 % plain diff in email, subject, no message body
@@ -76,8 +77,8 @@
 adding changesets
 adding manifests
 adding file changes
-added 1 changesets with 1 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+added 1 changesets with 2 changes to 2 files
+2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 applying patch from stdin
 patching file a
 % plain diff in email, no subject, no message body, should fail
@@ -85,8 +86,8 @@
 adding changesets
 adding manifests
 adding file changes
-added 1 changesets with 1 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+added 1 changesets with 2 changes to 2 files
+2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 applying patch from stdin
 patching file a
 transaction abort!
@@ -96,8 +97,22 @@
 adding changesets
 adding manifests
 adding file changes
-added 1 changesets with 1 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+added 1 changesets with 2 changes to 2 files
+2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 applying patch from stdin
 patching file a
 summary:     second change
+% hg import in a subdirectory
+requesting all changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 2 changes to 2 files
+2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+applying ../../../tip.patch
+patching file a
+% message should be 'subdir change'
+summary:     subdir change
+% committer should be 'someoneelse'
+user:        someoneelse
+% should be empty