Show More
@@ -1,932 +1,930 b'' | |||
|
1 | 1 | $ hg init a |
|
2 | 2 | $ mkdir a/d1 |
|
3 | 3 | $ mkdir a/d1/d2 |
|
4 | 4 | $ echo line 1 > a/a |
|
5 | 5 | $ echo line 1 > a/d1/d2/a |
|
6 | 6 | $ hg --cwd a ci -Ama |
|
7 | 7 | adding a |
|
8 | 8 | adding d1/d2/a |
|
9 | 9 | |
|
10 | 10 | $ echo line 2 >> a/a |
|
11 | 11 | $ hg --cwd a ci -u someone -d '1 0' -m'second change' |
|
12 | 12 | |
|
13 | 13 | |
|
14 | generate patches for the test | |
|
15 | ||
|
16 | $ hg --cwd a export tip > exported-tip.patch | |
|
17 | $ hg --cwd a diff -r0:1 > diffed-tip.patch | |
|
18 | ||
|
19 | ||
|
14 | 20 | import exported patch |
|
15 | 21 | |
|
16 | 22 | $ hg clone -r0 a b |
|
17 | 23 | adding changesets |
|
18 | 24 | adding manifests |
|
19 | 25 | adding file changes |
|
20 | 26 | added 1 changesets with 2 changes to 2 files |
|
21 | 27 | updating to branch default |
|
22 | 28 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
23 |
$ hg --cwd |
|
|
24 | $ hg --cwd b import ../tip.patch | |
|
25 | applying ../tip.patch | |
|
29 | $ hg --cwd b import ../exported-tip.patch | |
|
30 | applying ../exported-tip.patch | |
|
26 | 31 | |
|
27 | message should be same | |
|
32 | message and committer should be same | |
|
28 | 33 | |
|
29 |
$ hg --cwd b tip |
|
|
34 | $ hg --cwd b tip | |
|
35 | changeset: 1:1d4bd90af0e4 | |
|
36 | tag: tip | |
|
37 | user: someone | |
|
38 | date: Thu Jan 01 00:00:01 1970 +0000 | |
|
30 | 39 | summary: second change |
|
31 | ||
|
32 | committer should be same | |
|
33 | ||
|
34 | $ hg --cwd b tip | grep someone | |
|
35 | user: someone | |
|
40 | ||
|
36 | 41 | $ rm -r b |
|
37 | 42 | |
|
38 | 43 | |
|
39 | 44 | import exported patch with external patcher |
|
40 | 45 | |
|
41 | 46 | $ cat > dummypatch.py <<EOF |
|
42 | 47 | > print 'patching file a' |
|
43 | 48 | > file('a', 'wb').write('line2\n') |
|
44 | 49 | > EOF |
|
45 | 50 | $ chmod +x dummypatch.py |
|
46 | 51 | $ hg clone -r0 a b |
|
47 | 52 | adding changesets |
|
48 | 53 | adding manifests |
|
49 | 54 | adding file changes |
|
50 | 55 | added 1 changesets with 2 changes to 2 files |
|
51 | 56 | updating to branch default |
|
52 | 57 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
53 | $ hg --cwd a export tip > tip.patch | |
|
54 | $ hg --config ui.patch='python ../dummypatch.py' --cwd b import ../tip.patch | |
|
55 | applying ../tip.patch | |
|
58 | $ hg --config ui.patch='python ../dummypatch.py' --cwd b import ../exported-tip.patch | |
|
59 | applying ../exported-tip.patch | |
|
56 | 60 | $ cat b/a |
|
57 | 61 | line2 |
|
58 | 62 | $ rm -r b |
|
59 | 63 | |
|
60 | 64 | |
|
61 | 65 | import of plain diff should fail without message |
|
62 | 66 | |
|
63 | 67 | $ hg clone -r0 a b |
|
64 | 68 | adding changesets |
|
65 | 69 | adding manifests |
|
66 | 70 | adding file changes |
|
67 | 71 | added 1 changesets with 2 changes to 2 files |
|
68 | 72 | updating to branch default |
|
69 | 73 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
70 |
$ hg --cwd |
|
|
71 | $ hg --cwd b import ../tip.patch | |
|
72 | applying ../tip.patch | |
|
74 | $ hg --cwd b import ../diffed-tip.patch | |
|
75 | applying ../diffed-tip.patch | |
|
73 | 76 | abort: empty commit message |
|
74 | 77 | [255] |
|
75 | 78 | $ rm -r b |
|
76 | 79 | |
|
77 | 80 | |
|
78 | 81 | import of plain diff should be ok with message |
|
79 | 82 | |
|
80 | 83 | $ hg clone -r0 a b |
|
81 | 84 | adding changesets |
|
82 | 85 | adding manifests |
|
83 | 86 | adding file changes |
|
84 | 87 | added 1 changesets with 2 changes to 2 files |
|
85 | 88 | updating to branch default |
|
86 | 89 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
87 |
$ hg --cwd |
|
|
88 | $ hg --cwd b import -mpatch ../tip.patch | |
|
89 | applying ../tip.patch | |
|
90 | $ hg --cwd b import -mpatch ../diffed-tip.patch | |
|
91 | applying ../diffed-tip.patch | |
|
90 | 92 | $ rm -r b |
|
91 | 93 | |
|
92 | 94 | |
|
93 | 95 | import of plain diff with specific date and user |
|
94 | 96 | |
|
95 | 97 | $ hg clone -r0 a b |
|
96 | 98 | adding changesets |
|
97 | 99 | adding manifests |
|
98 | 100 | adding file changes |
|
99 | 101 | added 1 changesets with 2 changes to 2 files |
|
100 | 102 | updating to branch default |
|
101 | 103 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
102 | $ hg --cwd a diff -r0:1 > tip.patch | |
|
103 | $ hg --cwd b import -mpatch -d '1 0' -u 'user@nowhere.net' ../tip.patch | |
|
104 | applying ../tip.patch | |
|
104 | $ hg --cwd b import -mpatch -d '1 0' -u 'user@nowhere.net' ../diffed-tip.patch | |
|
105 | applying ../diffed-tip.patch | |
|
105 | 106 | $ hg -R b tip -pv |
|
106 | 107 | changeset: 1:ca68f19f3a40 |
|
107 | 108 | tag: tip |
|
108 | 109 | user: user@nowhere.net |
|
109 | 110 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
110 | 111 | files: a |
|
111 | 112 | description: |
|
112 | 113 | patch |
|
113 | 114 | |
|
114 | 115 | |
|
115 | 116 | diff -r 80971e65b431 -r ca68f19f3a40 a |
|
116 | 117 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
117 | 118 | +++ b/a Thu Jan 01 00:00:01 1970 +0000 |
|
118 | 119 | @@ -1,1 +1,2 @@ |
|
119 | 120 | line 1 |
|
120 | 121 | +line 2 |
|
121 | 122 | |
|
122 | 123 | $ rm -r b |
|
123 | 124 | |
|
124 | 125 | |
|
125 | 126 | import of plain diff should be ok with --no-commit |
|
126 | 127 | |
|
127 | 128 | $ hg clone -r0 a b |
|
128 | 129 | adding changesets |
|
129 | 130 | adding manifests |
|
130 | 131 | adding file changes |
|
131 | 132 | added 1 changesets with 2 changes to 2 files |
|
132 | 133 | updating to branch default |
|
133 | 134 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
134 |
$ hg --cwd |
|
|
135 | $ hg --cwd b import --no-commit ../tip.patch | |
|
136 | applying ../tip.patch | |
|
135 | $ hg --cwd b import --no-commit ../diffed-tip.patch | |
|
136 | applying ../diffed-tip.patch | |
|
137 | 137 | $ hg --cwd b diff --nodates |
|
138 | 138 | diff -r 80971e65b431 a |
|
139 | 139 | --- a/a |
|
140 | 140 | +++ b/a |
|
141 | 141 | @@ -1,1 +1,2 @@ |
|
142 | 142 | line 1 |
|
143 | 143 | +line 2 |
|
144 | 144 | $ rm -r b |
|
145 | 145 | |
|
146 | 146 | |
|
147 | 147 | import of malformed plain diff should fail |
|
148 | 148 | |
|
149 | 149 | $ hg clone -r0 a b |
|
150 | 150 | adding changesets |
|
151 | 151 | adding manifests |
|
152 | 152 | adding file changes |
|
153 | 153 | added 1 changesets with 2 changes to 2 files |
|
154 | 154 | updating to branch default |
|
155 | 155 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
156 | $ hg --cwd a diff -r0:1 > tip.patch | |
|
157 | $ sed 's/1,1/foo/' < tip.patch > broken.patch | |
|
156 | $ sed 's/1,1/foo/' < diffed-tip.patch > broken.patch | |
|
158 | 157 |
$ |
|
159 | 158 | applying ../broken.patch |
|
160 | 159 | abort: bad hunk #1 |
|
161 | 160 | [255] |
|
162 | 161 | $ rm -r b |
|
163 | 162 | |
|
164 | 163 | |
|
165 | 164 | hg -R repo import |
|
166 | 165 | put the clone in a subdir - having a directory named "a" |
|
167 | 166 | used to hide a bug. |
|
168 | 167 | |
|
169 | 168 | $ mkdir dir |
|
170 | 169 | $ hg clone -r0 a dir/b |
|
171 | 170 | adding changesets |
|
172 | 171 | adding manifests |
|
173 | 172 | adding file changes |
|
174 | 173 | added 1 changesets with 2 changes to 2 files |
|
175 | 174 | updating to branch default |
|
176 | 175 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
177 | $ hg --cwd a export tip > dir/tip.patch | |
|
178 | 176 | $ cd dir |
|
179 | $ hg -R b import tip.patch | |
|
180 | applying tip.patch | |
|
177 | $ hg -R b import ../exported-tip.patch | |
|
178 | applying ../exported-tip.patch | |
|
181 | 179 | $ cd .. |
|
182 | 180 | $ rm -r dir |
|
183 | 181 | |
|
184 | 182 | |
|
185 | 183 | import from stdin |
|
186 | 184 | |
|
187 | 185 | $ hg clone -r0 a b |
|
188 | 186 | adding changesets |
|
189 | 187 | adding manifests |
|
190 | 188 | adding file changes |
|
191 | 189 | added 1 changesets with 2 changes to 2 files |
|
192 | 190 | updating to branch default |
|
193 | 191 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
194 | $ hg --cwd a export tip | hg --cwd b import - | |
|
192 | $ hg --cwd b import - < exported-tip.patch | |
|
195 | 193 | applying patch from stdin |
|
196 | 194 | $ rm -r b |
|
197 | 195 | |
|
198 | 196 | |
|
199 | 197 | import two patches in one stream |
|
200 | 198 | |
|
201 | 199 | $ hg init b |
|
202 | 200 | $ hg --cwd a export 0:tip | hg --cwd b import - |
|
203 | 201 | applying patch from stdin |
|
204 | 202 | applied 80971e65b431 |
|
205 | 203 | $ hg --cwd a id |
|
206 | 204 | 1d4bd90af0e4 tip |
|
207 | 205 | $ hg --cwd b id |
|
208 | 206 | 1d4bd90af0e4 tip |
|
209 | 207 | $ rm -r b |
|
210 | 208 | |
|
211 | 209 | |
|
212 | 210 | override commit message |
|
213 | 211 | |
|
214 | 212 | $ hg clone -r0 a b |
|
215 | 213 | adding changesets |
|
216 | 214 | adding manifests |
|
217 | 215 | adding file changes |
|
218 | 216 | added 1 changesets with 2 changes to 2 files |
|
219 | 217 | updating to branch default |
|
220 | 218 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
221 |
$ |
|
|
219 | $ hg --cwd b import -m 'override' - < exported-tip.patch | |
|
222 | 220 | applying patch from stdin |
|
223 | 221 | $ hg --cwd b tip | grep override |
|
224 | 222 | summary: override |
|
225 | 223 | $ rm -r b |
|
226 | 224 | |
|
227 | 225 | $ cat > mkmsg.py <<EOF |
|
228 | 226 | > import email.Message, sys |
|
229 | 227 | > msg = email.Message.Message() |
|
230 | > msg.set_payload('email commit message\n' + open('tip.patch', 'rb').read()) | |
|
228 | > patch = open(sys.argv[1], 'rb').read() | |
|
229 | > msg.set_payload('email commit message\n' + patch) | |
|
231 | 230 | > msg['Subject'] = 'email patch' |
|
232 | 231 | > msg['From'] = 'email patcher' |
|
233 | 232 | > sys.stdout.write(msg.as_string()) |
|
234 | 233 | > EOF |
|
235 | 234 | |
|
236 | 235 | |
|
237 | 236 | plain diff in email, subject, message body |
|
238 | 237 | |
|
239 | 238 | $ hg clone -r0 a b |
|
240 | 239 | adding changesets |
|
241 | 240 | adding manifests |
|
242 | 241 | adding file changes |
|
243 | 242 | added 1 changesets with 2 changes to 2 files |
|
244 | 243 | updating to branch default |
|
245 | 244 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
246 | $ hg --cwd a diff -r0:1 > tip.patch | |
|
247 | $ python mkmsg.py > msg.patch | |
|
245 | $ python mkmsg.py diffed-tip.patch > msg.patch | |
|
248 | 246 | $ hg --cwd b import ../msg.patch |
|
249 | 247 | applying ../msg.patch |
|
250 | 248 | $ hg --cwd b tip | grep email |
|
251 | 249 | user: email patcher |
|
252 | 250 | summary: email patch |
|
253 | 251 | $ rm -r b |
|
254 | 252 | |
|
255 | 253 | |
|
256 | 254 | plain diff in email, no subject, message body |
|
257 | 255 | |
|
258 | 256 | $ hg clone -r0 a b |
|
259 | 257 | adding changesets |
|
260 | 258 | adding manifests |
|
261 | 259 | adding file changes |
|
262 | 260 | added 1 changesets with 2 changes to 2 files |
|
263 | 261 | updating to branch default |
|
264 | 262 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
265 | 263 | $ grep -v '^Subject:' msg.patch | hg --cwd b import - |
|
266 | 264 | applying patch from stdin |
|
267 | 265 | $ rm -r b |
|
268 | 266 | |
|
269 | 267 | |
|
270 | 268 | plain diff in email, subject, no message body |
|
271 | 269 | |
|
272 | 270 | $ hg clone -r0 a b |
|
273 | 271 | adding changesets |
|
274 | 272 | adding manifests |
|
275 | 273 | adding file changes |
|
276 | 274 | added 1 changesets with 2 changes to 2 files |
|
277 | 275 | updating to branch default |
|
278 | 276 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
279 | 277 | $ grep -v '^email ' msg.patch | hg --cwd b import - |
|
280 | 278 | applying patch from stdin |
|
281 | 279 | $ rm -r b |
|
282 | 280 | |
|
283 | 281 | |
|
284 | 282 | plain diff in email, no subject, no message body, should fail |
|
285 | 283 | |
|
286 | 284 | $ hg clone -r0 a b |
|
287 | 285 | adding changesets |
|
288 | 286 | adding manifests |
|
289 | 287 | adding file changes |
|
290 | 288 | added 1 changesets with 2 changes to 2 files |
|
291 | 289 | updating to branch default |
|
292 | 290 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
293 | 291 | $ egrep -v '^(Subject|email)' msg.patch | hg --cwd b import - |
|
294 | 292 | applying patch from stdin |
|
295 | 293 | abort: empty commit message |
|
296 | 294 | [255] |
|
297 | 295 | $ rm -r b |
|
298 | 296 | |
|
299 | 297 | |
|
300 | 298 | hg export in email, should use patch header |
|
301 | 299 | |
|
302 | 300 | $ hg clone -r0 a b |
|
303 | 301 | adding changesets |
|
304 | 302 | adding manifests |
|
305 | 303 | adding file changes |
|
306 | 304 | added 1 changesets with 2 changes to 2 files |
|
307 | 305 | updating to branch default |
|
308 | 306 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
309 | $ hg --cwd a export tip > tip.patch | |
|
310 | $ python mkmsg.py | hg --cwd b import - | |
|
307 | $ python mkmsg.py exported-tip.patch | hg --cwd b import - | |
|
311 | 308 | applying patch from stdin |
|
312 | 309 | $ hg --cwd b tip | grep second |
|
313 | 310 | summary: second change |
|
314 | 311 | $ rm -r b |
|
315 | 312 | |
|
316 | 313 | |
|
317 | 314 | subject: duplicate detection, removal of [PATCH] |
|
318 | 315 | The '---' tests the gitsendmail handling without proper mail headers |
|
319 | 316 | |
|
320 | 317 | $ cat > mkmsg2.py <<EOF |
|
321 | 318 | > import email.Message, sys |
|
322 | 319 | > msg = email.Message.Message() |
|
323 | > msg.set_payload('email patch\n\nnext line\n---\n' + open('tip.patch').read()) | |
|
320 | > patch = open(sys.argv[1], 'rb').read() | |
|
321 | > msg.set_payload('email patch\n\nnext line\n---\n' + patch) | |
|
324 | 322 | > msg['Subject'] = '[PATCH] email patch' |
|
325 | 323 | > msg['From'] = 'email patcher' |
|
326 | 324 | > sys.stdout.write(msg.as_string()) |
|
327 | 325 | > EOF |
|
328 | 326 | |
|
329 | 327 | |
|
330 | 328 | plain diff in email, [PATCH] subject, message body with subject |
|
331 | 329 | |
|
332 | 330 | $ hg clone -r0 a b |
|
333 | 331 | adding changesets |
|
334 | 332 | adding manifests |
|
335 | 333 | adding file changes |
|
336 | 334 | added 1 changesets with 2 changes to 2 files |
|
337 | 335 | updating to branch default |
|
338 | 336 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
339 | $ hg --cwd a diff -r0:1 > tip.patch | |
|
340 | $ python mkmsg2.py | hg --cwd b import - | |
|
337 | $ python mkmsg2.py diffed-tip.patch | hg --cwd b import - | |
|
341 | 338 | applying patch from stdin |
|
342 | 339 | $ hg --cwd b tip --template '{desc}\n' |
|
343 | 340 | email patch |
|
344 | 341 | |
|
345 | 342 | next line |
|
346 | 343 | --- |
|
347 | 344 | $ rm -r b |
|
348 | 345 | |
|
349 | 346 | |
|
350 | 347 | Issue963: Parent of working dir incorrect after import of multiple |
|
351 | 348 | patches and rollback |
|
352 | 349 | |
|
353 | 350 | We weren't backing up the correct dirstate file when importing many |
|
354 | 351 | patches: import patch1 patch2; rollback |
|
355 | 352 | |
|
356 | 353 | $ echo line 3 >> a/a |
|
357 | 354 | $ hg --cwd a ci -m'third change' |
|
358 | 355 | $ hg --cwd a export -o '../patch%R' 1 2 |
|
359 | 356 | $ hg clone -qr0 a b |
|
360 | 357 | $ hg --cwd b parents --template 'parent: {rev}\n' |
|
361 | 358 | parent: 0 |
|
362 | 359 | $ hg --cwd b import ../patch1 ../patch2 |
|
363 | 360 | applying ../patch1 |
|
364 | 361 | applying ../patch2 |
|
365 | 362 | applied 1d4bd90af0e4 |
|
366 | 363 | $ hg --cwd b rollback |
|
367 | 364 | repository tip rolled back to revision 1 (undo commit) |
|
368 | 365 | working directory now based on revision 1 |
|
369 | 366 | $ hg --cwd b parents --template 'parent: {rev}\n' |
|
370 | 367 | parent: 1 |
|
371 | 368 | $ rm -r b |
|
372 | 369 | |
|
373 | 370 | |
|
374 | 371 | importing a patch in a subdirectory failed at the commit stage |
|
375 | 372 | |
|
376 | 373 | $ echo line 2 >> a/d1/d2/a |
|
377 | 374 | $ hg --cwd a ci -u someoneelse -d '1 0' -m'subdir change' |
|
378 | 375 | |
|
379 | 376 | hg import in a subdirectory |
|
380 | 377 | |
|
381 | 378 | $ hg clone -r0 a b |
|
382 | 379 | adding changesets |
|
383 | 380 | adding manifests |
|
384 | 381 | adding file changes |
|
385 | 382 | added 1 changesets with 2 changes to 2 files |
|
386 | 383 | updating to branch default |
|
387 | 384 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
388 | 385 | $ hg --cwd a export tip > tmp |
|
389 | $ sed -e 's/d1\/d2\///' < tmp > tip.patch | |
|
386 | $ sed -e 's/d1\/d2\///' < tmp > subdir-tip.patch | |
|
390 | 387 | $ dir=`pwd` |
|
391 | 388 | $ cd b/d1/d2 2>&1 > /dev/null |
|
392 | $ hg import ../../../tip.patch | |
|
393 | applying ../../../tip.patch | |
|
389 | $ hg import ../../../subdir-tip.patch | |
|
390 | applying ../../../subdir-tip.patch | |
|
394 | 391 | $ cd "$dir" |
|
395 | 392 | |
|
396 | 393 | message should be 'subdir change' |
|
397 | ||
|
398 | $ hg --cwd b tip | grep 'subdir change' | |
|
399 | summary: subdir change | |
|
400 | ||
|
401 | 394 | committer should be 'someoneelse' |
|
402 | 395 | |
|
403 |
$ hg --cwd b tip |
|
|
396 | $ hg --cwd b tip | |
|
397 | changeset: 1:3577f5aea227 | |
|
398 | tag: tip | |
|
404 | 399 | user: someoneelse |
|
400 | date: Thu Jan 01 00:00:01 1970 +0000 | |
|
401 | summary: subdir change | |
|
402 | ||
|
405 | 403 | |
|
406 | 404 | should be empty |
|
407 | 405 | |
|
408 | 406 | $ hg --cwd b status |
|
409 | 407 | |
|
410 | 408 | |
|
411 | 409 | Test fuzziness (ambiguous patch location, fuzz=2) |
|
412 | 410 | |
|
413 | 411 | $ hg init fuzzy |
|
414 | 412 | $ cd fuzzy |
|
415 | 413 | $ echo line1 > a |
|
416 | 414 | $ echo line0 >> a |
|
417 | 415 | $ echo line3 >> a |
|
418 | 416 | $ hg ci -Am adda |
|
419 | 417 | adding a |
|
420 | 418 | $ echo line1 > a |
|
421 | 419 | $ echo line2 >> a |
|
422 | 420 | $ echo line0 >> a |
|
423 | 421 | $ echo line3 >> a |
|
424 | 422 | $ hg ci -m change a |
|
425 | $ hg export tip > tip.patch | |
|
423 | $ hg export tip > fuzzy-tip.patch | |
|
426 | 424 | $ hg up -C 0 |
|
427 | 425 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
428 | 426 | $ echo line1 > a |
|
429 | 427 | $ echo line0 >> a |
|
430 | 428 | $ echo line1 >> a |
|
431 | 429 | $ echo line0 >> a |
|
432 | 430 | $ hg ci -m brancha |
|
433 | 431 | created new head |
|
434 | $ hg import --no-commit -v tip.patch | |
|
435 | applying tip.patch | |
|
432 | $ hg import --no-commit -v fuzzy-tip.patch | |
|
433 | applying fuzzy-tip.patch | |
|
436 | 434 | patching file a |
|
437 | 435 | Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines). |
|
438 | 436 | $ hg revert -a |
|
439 | 437 | reverting a |
|
440 | 438 | |
|
441 | 439 | |
|
442 | 440 | import with --no-commit should have written .hg/last-message.txt |
|
443 | 441 | |
|
444 | 442 | $ cat .hg/last-message.txt |
|
445 | 443 | change (no-eol) |
|
446 | 444 | |
|
447 | 445 | |
|
448 | 446 | test fuzziness with eol=auto |
|
449 | 447 | |
|
450 | $ hg --config patch.eol=auto import --no-commit -v tip.patch | |
|
451 | applying tip.patch | |
|
448 | $ hg --config patch.eol=auto import --no-commit -v fuzzy-tip.patch | |
|
449 | applying fuzzy-tip.patch | |
|
452 | 450 | patching file a |
|
453 | 451 | Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines). |
|
454 | 452 | $ cd .. |
|
455 | 453 | |
|
456 | 454 | |
|
457 | 455 | Test hunk touching empty files (issue906) |
|
458 | 456 | |
|
459 | 457 | $ hg init empty |
|
460 | 458 | $ cd empty |
|
461 | 459 | $ touch a |
|
462 | 460 | $ touch b1 |
|
463 | 461 | $ touch c1 |
|
464 | 462 | $ echo d > d |
|
465 | 463 | $ hg ci -Am init |
|
466 | 464 | adding a |
|
467 | 465 | adding b1 |
|
468 | 466 | adding c1 |
|
469 | 467 | adding d |
|
470 | 468 | $ echo a > a |
|
471 | 469 | $ echo b > b1 |
|
472 | 470 | $ hg mv b1 b2 |
|
473 | 471 | $ echo c > c1 |
|
474 | 472 | $ hg copy c1 c2 |
|
475 | 473 | $ rm d |
|
476 | 474 | $ touch d |
|
477 | 475 | $ hg diff --git |
|
478 | 476 | diff --git a/a b/a |
|
479 | 477 | --- a/a |
|
480 | 478 | +++ b/a |
|
481 | 479 | @@ -0,0 +1,1 @@ |
|
482 | 480 | +a |
|
483 | 481 | diff --git a/b1 b/b2 |
|
484 | 482 | rename from b1 |
|
485 | 483 | rename to b2 |
|
486 | 484 | --- a/b1 |
|
487 | 485 | +++ b/b2 |
|
488 | 486 | @@ -0,0 +1,1 @@ |
|
489 | 487 | +b |
|
490 | 488 | diff --git a/c1 b/c1 |
|
491 | 489 | --- a/c1 |
|
492 | 490 | +++ b/c1 |
|
493 | 491 | @@ -0,0 +1,1 @@ |
|
494 | 492 | +c |
|
495 | 493 | diff --git a/c1 b/c2 |
|
496 | 494 | copy from c1 |
|
497 | 495 | copy to c2 |
|
498 | 496 | --- a/c1 |
|
499 | 497 | +++ b/c2 |
|
500 | 498 | @@ -0,0 +1,1 @@ |
|
501 | 499 | +c |
|
502 | 500 | diff --git a/d b/d |
|
503 | 501 | --- a/d |
|
504 | 502 | +++ b/d |
|
505 | 503 | @@ -1,1 +0,0 @@ |
|
506 | 504 | -d |
|
507 | 505 | $ hg ci -m empty |
|
508 | 506 | $ hg export --git tip > empty.diff |
|
509 | 507 | $ hg up -C 0 |
|
510 | 508 | 4 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
511 | 509 | $ hg import empty.diff |
|
512 | 510 | applying empty.diff |
|
513 | 511 |
$ for name in a b1 b2 c1 c2 d; |
|
514 | 512 |
> echo % $name |
|
515 | 513 |
> test -f $ |
|
516 | 514 | > done |
|
517 | 515 |
% a |
|
518 | 516 |
|
|
519 | 517 |
% b1 |
|
520 | 518 |
% b2 |
|
521 | 519 |
|
|
522 | 520 |
% c1 |
|
523 | 521 |
|
|
524 | 522 |
% c2 |
|
525 | 523 |
|
|
526 | 524 |
% d |
|
527 | 525 |
$ |
|
528 | 526 | |
|
529 | 527 | |
|
530 | 528 |
Test |
|
531 | 529 | |
|
532 | 530 |
$ |
|
533 | 531 |
$ |
|
534 | 532 |
$ |
|
535 | 533 |
$ |
|
536 | 534 |
$ hg |
|
537 | 535 |
|
|
538 | 536 |
|
|
539 | 537 |
$ |
|
540 | 538 |
$ |
|
541 | 539 |
$ |
|
542 | 540 |
|
|
543 | 541 |
|
|
544 | 542 |
$ |
|
545 | 543 |
$ |
|
546 | 544 |
$ |
|
547 | 545 |
|
|
548 | 546 |
|
|
549 | 547 |
$ |
|
550 | 548 |
|
|
551 | 549 |
$ |
|
552 | 550 |
|
|
553 | 551 |
$ |
|
554 | 552 |
$ |
|
555 | 553 | |
|
556 | 554 | |
|
557 | 555 |
Issue927: |
|
558 | 556 | |
|
559 | 557 |
$ |
|
560 | 558 |
$ |
|
561 | 559 |
$ |
|
562 | 560 |
$ |
|
563 | 561 |
|
|
564 | 562 |
$ |
|
565 | 563 | |
|
566 | 564 |
|
|
567 | 565 | |
|
568 | 566 |
$ |
|
569 | 567 |
$ |
|
570 | 568 |
$ |
|
571 | 569 |
$ |
|
572 | 570 |
|
|
573 | 571 |
$ |
|
574 | 572 |
|
|
575 | 573 | |
|
576 | 574 |
|
|
577 | 575 | |
|
578 | 576 |
$ cat |
|
579 | 577 |
|
|
580 | 578 | |
|
581 | 579 |
|
|
582 | 580 | |
|
583 | 581 |
$ |
|
584 | 582 |
|
|
585 | 583 |
$ |
|
586 | 584 | |
|
587 | 585 | |
|
588 | 586 | test -p0 |
|
589 | 587 | |
|
590 | 588 |
$ |
|
591 | 589 |
$ |
|
592 | 590 |
$ |
|
593 | 591 |
$ |
|
594 | 592 |
|
|
595 | 593 |
$ |
|
596 | 594 | > foobar |
|
597 | 595 |
> --- a |
|
598 | 596 |
> +++ a |
|
599 | 597 | > @@ -1,1 +1,1 @@ |
|
600 | 598 | > -a |
|
601 | 599 | > +bb |
|
602 | 600 | > EOF |
|
603 | 601 |
|
|
604 | 602 |
$ |
|
605 | 603 |
$ |
|
606 | 604 |
|
|
607 | 605 |
$ |
|
608 | 606 | |
|
609 | 607 | |
|
610 | 608 |
test |
|
611 | 609 | |
|
612 | 610 |
$ |
|
613 | 611 |
$ |
|
614 | 612 |
$ |
|
615 | 613 |
$ |
|
616 | 614 |
$ |
|
617 | 615 |
> diff --git |
|
618 | 616 |
> rename |
|
619 | 617 |
> rename |
|
620 | 618 | > EOF |
|
621 | 619 |
|
|
622 | 620 |
abort: ../outside/foo |
|
623 | 621 | [255] |
|
624 | 622 |
$ |
|
625 | 623 | |
|
626 | 624 | |
|
627 | 625 |
test |
|
628 | 626 | |
|
629 | 627 |
|
|
630 | 628 |
$ |
|
631 | 629 |
$ |
|
632 | 630 |
$ |
|
633 | 631 |
|
|
634 | 632 |
$ |
|
635 | 633 |
> diff --git |
|
636 | 634 |
> deleted |
|
637 | 635 | > --- a/foo/a |
|
638 | 636 | > +++ /dev/null |
|
639 | 637 | > @@ -1,1 +0,0 @@ |
|
640 | 638 |
> -this |
|
641 | 639 |
> diff --git |
|
642 | 640 |
> new file |
|
643 | 641 | > --- /dev/null |
|
644 | 642 | > +++ b/foo/b |
|
645 | 643 | > @@ -0,0 +1,2 @@ |
|
646 | 644 |
> +this |
|
647 | 645 | > +foo |
|
648 | 646 | > EOF |
|
649 | 647 |
$ |
|
650 | 648 |
|
|
651 | 649 |
|
|
652 | 650 |
|
|
653 | 651 |
|
|
654 | 652 |
|
|
655 | 653 |
|
|
656 | 654 |
$ |
|
657 | 655 |
|
|
658 | 656 |
|
|
659 | 657 |
|
|
660 | 658 |
$ |
|
661 | 659 |
|
|
662 | 660 |
|
|
663 | 661 |
$ |
|
664 | 662 |
$ |
|
665 | 663 |
|
|
666 | 664 |
|
|
667 | 665 |
|
|
668 | 666 |
|
|
669 | 667 |
|
|
670 | 668 |
$ |
|
671 | 669 |
|
|
672 | 670 |
|
|
673 | 671 |
$ |
|
674 | 672 | |
|
675 | 673 | |
|
676 | 674 |
Issue1495: |
|
677 | 675 | |
|
678 | 676 |
$ |
|
679 | 677 |
$ |
|
680 | 678 |
$ |
|
681 | 679 |
$ |
|
682 | 680 |
|
|
683 | 681 |
$ |
|
684 | 682 | $ cat > a.patch <<EOF |
|
685 | 683 |
> diff --git |
|
686 | 684 | > --- a/a |
|
687 | 685 | > +++ b/a |
|
688 | 686 | > @@ -0,0 +1,1 @@ |
|
689 | 687 | > +a |
|
690 | 688 |
> diff --git |
|
691 | 689 |
> new file |
|
692 | 690 | > EOF |
|
693 | 691 |
$ |
|
694 | 692 |
|
|
695 | 693 |
$ |
|
696 | 694 | |
|
697 | 695 | |
|
698 | 696 |
create |
|
699 | 697 | |
|
700 | 698 |
$ |
|
701 | 699 |
> diff -Naur |
|
702 | 700 |
> --- proj-orig/foo |
|
703 | 701 |
> +++ proj-new/foo |
|
704 | 702 | > @@ -0,0 +1,1 @@ |
|
705 | 703 | > +a |
|
706 | 704 | > EOF |
|
707 | 705 | |
|
708 | 706 |
|
|
709 | 707 | |
|
710 | 708 |
$ |
|
711 | 709 |
> diff -Naur |
|
712 | 710 |
> --- proj-orig/foo.orig |
|
713 | 711 |
> +++ proj-new/foo |
|
714 | 712 | > @@ -0,0 +1,1 @@ |
|
715 | 713 | > +a |
|
716 | 714 | > EOF |
|
717 | 715 |
$ hg |
|
718 | 716 |
$ |
|
719 | 717 |
$ |
|
720 | 718 |
|
|
721 | 719 |
$ |
|
722 | 720 |
|
|
723 | 721 |
$ |
|
724 | 722 |
$ |
|
725 | 723 |
$ |
|
726 | 724 |
|
|
727 | 725 |
$ |
|
728 | 726 |
|
|
729 | 727 | |
|
730 | 728 | |
|
731 | 729 |
Issue1859: |
|
732 | 730 | |
|
733 | 731 |
$ |
|
734 | 732 |
$ |
|
735 | 733 |
$ |
|
736 | 734 |
> module: |
|
737 | 735 | > |
|
738 | 736 | > description |
|
739 | 737 | > |
|
740 | 738 | > |
|
741 | 739 |
> diff -r |
|
742 | 740 | > --- /dev/null |
|
743 | 741 | > +++ b/a |
|
744 | 742 | > @@ -0,0 +1,1 @@ |
|
745 | 743 | > +a |
|
746 | 744 | > EOF |
|
747 | 745 |
$ |
|
748 | 746 |
|
|
749 | 747 |
$ |
|
750 | 748 |
changeset: |
|
751 | 749 |
tag: |
|
752 | 750 |
user: |
|
753 | 751 |
date: |
|
754 | 752 |
files: |
|
755 | 753 | description: |
|
756 | 754 |
module: |
|
757 | 755 | |
|
758 | 756 |
|
|
759 | 757 | |
|
760 | 758 | |
|
761 | 759 |
$ |
|
762 | 760 | |
|
763 | 761 | |
|
764 | 762 |
--- in |
|
765 | 763 | |
|
766 | 764 |
$ |
|
767 | 765 |
$ |
|
768 | 766 |
$ |
|
769 | 767 |
> module: |
|
770 | 768 | > |
|
771 | 769 | > --- description |
|
772 | 770 | > |
|
773 | 771 |
> diff --git |
|
774 | 772 |
> new file |
|
775 | 773 | > --- /dev/null |
|
776 | 774 | > +++ b/a |
|
777 | 775 | > @@ -0,0 +1,1 @@ |
|
778 | 776 | > +a |
|
779 | 777 | > EOF |
|
780 | 778 |
> hg |
|
781 | 779 |
> hg |
|
782 | 780 | > cd .. |
|
783 | 781 | > |
|
784 | 782 |
> echo |
|
785 | 783 | > cat > trickyheaders.patch <<EOF |
|
786 | 784 |
> From: |
|
787 | 785 |
> Subject: |
|
788 | 786 | > |
|
789 | 787 |
> # HG |
|
790 | 788 |
> # |
|
791 | 789 |
> # |
|
792 | 790 |
> # Branch |
|
793 | 791 |
> # |
|
794 | 792 |
> # |
|
795 | 793 |
> from: |
|
796 | 794 | > |
|
797 | 795 |
> That |
|
798 | 796 | > |
|
799 | 797 |
> diff -r |
|
800 | 798 | > --- /dev/null |
|
801 | 799 | > +++ b/foo |
|
802 | 800 | > @@ -0,0 +1,1 @@ |
|
803 | 801 | > +foo |
|
804 | 802 | > EOF |
|
805 | 803 |
|
|
806 | 804 |
changeset: |
|
807 | 805 |
tag: |
|
808 | 806 |
user: |
|
809 | 807 |
date: |
|
810 | 808 |
files: |
|
811 | 809 | description: |
|
812 | 810 |
module: |
|
813 | 811 | |
|
814 | 812 | |
|
815 | 813 |
% tricky |
|
816 | 814 | |
|
817 | 815 |
$ |
|
818 | 816 |
$ |
|
819 | 817 |
$ |
|
820 | 818 |
|
|
821 | 819 |
$ |
|
822 | 820 | # HG changeset patch |
|
823 | 821 | # User User B |
|
824 | 822 | # Date 0 0 |
|
825 | 823 | # Node ID eb56ab91903632294ac504838508cb370c0901d2 |
|
826 | 824 | # Parent 0000000000000000000000000000000000000000 |
|
827 | 825 |
from: |
|
828 | 826 | |
|
829 | 827 |
That |
|
830 | 828 | |
|
831 | 829 |
diff --git |
|
832 | 830 |
|
|
833 | 831 | --- /dev/null |
|
834 | 832 | +++ b/foo |
|
835 | 833 | @@ -0,0 +1,1 @@ |
|
836 | 834 | +foo |
|
837 | 835 |
$ |
|
838 | 836 | |
|
839 | 837 | |
|
840 | 838 |
Issue2102: |
|
841 | 839 | |
|
842 | 840 |
$ |
|
843 | 841 |
$ |
|
844 | 842 |
$ |
|
845 | 843 |
$ |
|
846 | 844 |
$ |
|
847 | 845 |
|
|
848 | 846 |
$ |
|
849 | 847 |
> # |
|
850 | 848 |
> # |
|
851 | 849 |
> # |
|
852 | 850 |
> # Node |
|
853 | 851 |
> # |
|
854 | 852 |
> help |
|
855 | 853 | > |
|
856 | 854 | > R=gri |
|
857 | 855 |
> DELTA=4 (4 |
|
858 | 856 |
|
|
859 | 857 | > CL=13328 |
|
860 | 858 | > |
|
861 | 859 |
> diff --git |
|
862 | 860 |
> new file |
|
863 | 861 | > --- /dev/null |
|
864 | 862 | > +++ b/lib/place-holder |
|
865 | 863 | > @@ -0,0 +1,2 @@ |
|
866 | 864 |
> +perforce |
|
867 | 865 |
> +this |
|
868 | 866 |
> diff --git |
|
869 | 867 |
> new file |
|
870 | 868 | > --- /dev/null |
|
871 | 869 | > +++ b/pkg/place-holder |
|
872 | 870 | > @@ -0,0 +1,2 @@ |
|
873 | 871 |
> +perforce |
|
874 | 872 |
> +this |
|
875 | 873 |
> diff --git |
|
876 | 874 |
> old |
|
877 | 875 |
> new mode |
|
878 | 876 | > EOF |
|
879 | 877 |
|
|
880 | 878 |
$ |
|
881 | 879 |
parent: |
|
882 | 880 |
|
|
883 | 881 | branch: default |
|
884 | 882 |
commit: |
|
885 | 883 |
update: |
|
886 | 884 |
$ hg |
|
887 | 885 |
|
|
888 | 886 |
|
|
889 | 887 | --- /dev/null |
|
890 | 888 | +++ b/lib/place-holder |
|
891 | 889 | @@ -0,0 +1,2 @@ |
|
892 | 890 |
+perforce |
|
893 | 891 |
+this |
|
894 | 892 |
diff --git |
|
895 | 893 |
|
|
896 | 894 | --- /dev/null |
|
897 | 895 | +++ b/pkg/place-holder |
|
898 | 896 | @@ -0,0 +1,2 @@ |
|
899 | 897 |
+perforce |
|
900 | 898 |
+this |
|
901 | 899 |
diff --git |
|
902 | 900 |
|
|
903 | 901 |
|
|
904 | 902 | $ cd .. |
|
905 | 903 | |
|
906 | 904 | |
|
907 | 905 |
diff |
|
908 | 906 | |
|
909 | 907 |
$ |
|
910 | 908 |
$ |
|
911 | 909 |
$ |
|
912 | 910 |
$ |
|
913 | 911 |
$ |
|
914 | 912 |
$ |
|
915 | 913 |
|
|
916 | 914 |
|
|
917 | 915 |
|
|
918 | 916 | |
|
919 | 917 |
$ |
|
920 | 918 |
$ |
|
921 | 919 |
$ |
|
922 | 920 |
$ |
|
923 | 921 | |
|
924 | 922 |
$ |
|
925 | 923 |
|
|
926 | 924 |
$ |
|
927 | 925 |
$ |
|
928 | 926 |
applying |
|
929 | 927 |
$ |
|
930 | 928 |
$ |
|
931 | 929 |
$ |
|
932 | 930 |
General Comments 0
You need to be logged in to leave comments.
Login now