comparison tests/test-import @ 4772:a7915f79d4cc

Added import test for [PATCH] subject and message body with subject
author Thomas Arendsen Hein <thomas@intevation.de>
date Mon, 02 Jul 2007 22:45:58 +0200
parents c93562fb12cc
children 9b469bdb1ce1
comparison
equal deleted inserted replaced
4771:e321f16f4eac 4772:a7915f79d4cc
91 hg --cwd a export tip > tip.patch 91 hg --cwd a export tip > tip.patch
92 python mkmsg.py | hg --cwd b import - 92 python mkmsg.py | hg --cwd b import -
93 hg --cwd b tip | grep second 93 hg --cwd b tip | grep second
94 rm -r b 94 rm -r b
95 95
96 # subject: duplicate detection, removal of [PATCH]
97 cat > mkmsg2.py <<EOF
98 import email.Message, sys
99 msg = email.Message.Message()
100 msg.set_payload('email patch\n\nnext line\n' + open('tip.patch').read())
101 msg['Subject'] = '[PATCH] email patch'
102 msg['From'] = 'email patcher'
103 sys.stdout.write(msg.as_string())
104 EOF
105
106 echo '% plain diff in email, [PATCH] subject, message body with subject'
107 hg clone -r0 a b
108 hg --cwd a diff -r0:1 > tip.patch
109 python mkmsg2.py | hg --cwd b import -
110 hg --cwd b tip --template '{desc}\n'
111 rm -r b
112
113
96 # bug non regression test 114 # bug non regression test
97 # importing a patch in a subdirectory failed at the commit stage 115 # importing a patch in a subdirectory failed at the commit stage
98 echo line 2 >> a/d1/d2/a 116 echo line 2 >> a/d1/d2/a
99 hg --cwd a ci -u someoneelse -d '1 0' -m'subdir change' 117 hg --cwd a ci -u someoneelse -d '1 0' -m'subdir change'
100 echo % hg import in a subdirectory 118 echo % hg import in a subdirectory