comparison tests/test-import @ 2773:871ca5b9d348

Import say a file is not tracked after patching : test case
author "Mathieu Clabaut <mathieu.clabaut@gmail.com>"
date Wed, 02 Aug 2006 09:29:17 +0200
parents f22e3e8fd457
children 0b9ac7dfcf56
comparison
equal deleted inserted replaced
2772:4720e79486d3 2773:871ca5b9d348
1 #!/bin/sh 1 #!/bin/sh
2 2
3 hg init a 3 hg init a
4 mkdir a/d1
5 mkdir a/d1/d2
4 echo line 1 > a/a 6 echo line 1 > a/a
7 echo line 1 > a/d1/d2/a
5 hg --cwd a ci -d '0 0' -Ama 8 hg --cwd a ci -d '0 0' -Ama
6 9
7 echo line 2 >> a/a 10 echo line 2 >> a/a
8 hg --cwd a ci -u someone -d '1 0' -m'second change' 11 hg --cwd a ci -u someone -d '1 0' -m'second change'
9 12
77 hg --cwd a export tip > tip.patch 80 hg --cwd a export tip > tip.patch
78 python mkmsg.py | hg --cwd b import - 81 python mkmsg.py | hg --cwd b import -
79 hg --cwd b tip | grep second 82 hg --cwd b tip | grep second
80 rm -rf b 83 rm -rf b
81 84
85 # bug non regression test
86 # importing a patch in a subdirectory failed at the commit stage
87 echo line 2 >> a/d1/d2/a
88 hg --cwd a ci -u someoneelse -d '1 0' -m'subdir change'
89 echo % hg import in a subdirectory
90 hg clone -r0 a b
91 hg --cwd a export tip | sed -e 's/d1\/d2\///' > tip.patch
92 pushd b/d1/d2 2>&1 > /dev/null
93 hg import ../../../tip.patch
94 popd 2>&1 > /dev/null
95 echo "% message should be 'subdir change'"
96 hg --cwd b tip | grep 'subdir change'
97 echo "% committer should be 'someoneelse'"
98 hg --cwd b tip | grep someoneelse
99 echo "% should be empty"
100 hg --cwd b status