##// END OF EJS Templates
tests: stabilize test-split.t for Windows...
Matt Harbison -
r42058:0cbcb3e1 default
parent child Browse files
Show More
@@ -1,753 +1,766 b''
1 1 #testcases obsstore-on obsstore-off
2 2
3 3 $ cat > $TESTTMP/editor.py <<EOF
4 4 > #!"$PYTHON"
5 5 > import os
6 6 > import sys
7 7 > path = os.path.join(os.environ['TESTTMP'], 'messages')
8 8 > messages = open(path).read().split('--\n')
9 9 > prompt = open(sys.argv[1]).read()
10 10 > sys.stdout.write(''.join('EDITOR: %s' % l for l in prompt.splitlines(True)))
11 11 > sys.stdout.flush()
12 12 > with open(sys.argv[1], 'w') as f:
13 13 > f.write(messages[0])
14 14 > with open(path, 'w') as f:
15 15 > f.write('--\n'.join(messages[1:]))
16 16 > EOF
17 17
18 18 $ cat >> $HGRCPATH <<EOF
19 19 > [extensions]
20 20 > drawdag=$TESTDIR/drawdag.py
21 21 > split=
22 22 > [ui]
23 23 > interactive=1
24 24 > color=no
25 25 > paginate=never
26 26 > [diff]
27 27 > git=1
28 28 > unified=0
29 29 > [commands]
30 30 > commit.interactive.unified=0
31 31 > [alias]
32 32 > glog=log -G -T '{rev}:{node|short} {desc} {bookmarks}\n'
33 33 > EOF
34 34
35 35 #if obsstore-on
36 36 $ cat >> $HGRCPATH <<EOF
37 37 > [experimental]
38 38 > evolution=all
39 39 > EOF
40 40 #endif
41 41
42 42 $ hg init a
43 43 $ cd a
44 44
45 45 Nothing to split
46 46
47 47 $ hg split
48 48 nothing to split
49 49 [1]
50 50
51 51 $ hg commit -m empty --config ui.allowemptycommit=1
52 52 $ hg split
53 53 abort: cannot split an empty revision
54 54 [255]
55 55
56 56 $ rm -rf .hg
57 57 $ hg init
58 58
59 59 Cannot split working directory
60 60
61 61 $ hg split -r 'wdir()'
62 62 abort: cannot split working directory
63 63 [255]
64 64
65 65 Generate some content. The sed filter drop CR on Windows, which is dropped in
66 66 the a > b line.
67 67
68 68 $ $TESTDIR/seq.py 1 5 | sed 's/\r$//' >> a
69 69 $ hg ci -m a1 -A a -q
70 70 $ hg bookmark -i r1
71 71 $ sed 's/1/11/;s/3/33/;s/5/55/' a > b
72 72 $ mv b a
73 73 $ hg ci -m a2 -q
74 74 $ hg bookmark -i r2
75 75
76 76 Cannot split a public changeset
77 77
78 78 $ hg phase --public -r 'all()'
79 79 $ hg split .
80 80 abort: cannot split public changeset
81 81 (see 'hg help phases' for details)
82 82 [255]
83 83
84 84 $ hg phase --draft -f -r 'all()'
85 85
86 86 Cannot split while working directory is dirty
87 87
88 88 $ touch dirty
89 89 $ hg add dirty
90 90 $ hg split .
91 91 abort: uncommitted changes
92 92 [255]
93 93 $ hg forget dirty
94 94 $ rm dirty
95 95
96 96 Make a clean directory for future tests to build off of
97 97
98 98 $ cp -R . ../clean
99 99
100 100 Split a head
101 101
102 102 $ hg bookmark r3
103 103
104 104 $ hg split 'all()'
105 105 abort: cannot split multiple revisions
106 106 [255]
107 107
108 108 This function splits a bit strangely primarily to avoid changing the behavior of
109 109 the test after a bug was fixed with how split/commit --interactive handled
110 110 `commands.commit.interactive.unified=0`: when there were no context lines,
111 111 it kept only the last diff hunk. When running split, this meant that runsplit
112 112 was always recording three commits, one for each diff hunk, in reverse order
113 113 (the base commit was the last diff hunk in the file).
114 114 $ runsplit() {
115 115 > cat > $TESTTMP/messages <<EOF
116 116 > split 1
117 117 > --
118 118 > split 2
119 119 > --
120 120 > split 3
121 121 > EOF
122 122 > cat <<EOF | hg split "$@"
123 123 > y
124 124 > n
125 125 > n
126 126 > y
127 127 > y
128 128 > n
129 129 > y
130 130 > y
131 131 > y
132 132 > EOF
133 133 > }
134 134
135 135 $ HGEDITOR=false runsplit
136 136 diff --git a/a b/a
137 137 3 hunks, 3 lines changed
138 138 examine changes to 'a'? [Ynesfdaq?] y
139 139
140 140 @@ -1,1 +1,1 @@
141 141 -1
142 142 +11
143 143 record change 1/3 to 'a'? [Ynesfdaq?] n
144 144
145 145 @@ -3,1 +3,1 @@ 2
146 146 -3
147 147 +33
148 148 record change 2/3 to 'a'? [Ynesfdaq?] n
149 149
150 150 @@ -5,1 +5,1 @@ 4
151 151 -5
152 152 +55
153 153 record change 3/3 to 'a'? [Ynesfdaq?] y
154 154
155 155 transaction abort!
156 156 rollback completed
157 157 abort: edit failed: false exited with status 1
158 158 [255]
159 159 $ hg status
160 160
161 161 $ HGEDITOR="\"$PYTHON\" $TESTTMP/editor.py"
162 162 $ runsplit
163 163 diff --git a/a b/a
164 164 3 hunks, 3 lines changed
165 165 examine changes to 'a'? [Ynesfdaq?] y
166 166
167 167 @@ -1,1 +1,1 @@
168 168 -1
169 169 +11
170 170 record change 1/3 to 'a'? [Ynesfdaq?] n
171 171
172 172 @@ -3,1 +3,1 @@ 2
173 173 -3
174 174 +33
175 175 record change 2/3 to 'a'? [Ynesfdaq?] n
176 176
177 177 @@ -5,1 +5,1 @@ 4
178 178 -5
179 179 +55
180 180 record change 3/3 to 'a'? [Ynesfdaq?] y
181 181
182 182 EDITOR: HG: Splitting 1df0d5c5a3ab. Write commit message for the first split changeset.
183 183 EDITOR: a2
184 184 EDITOR:
185 185 EDITOR:
186 186 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
187 187 EDITOR: HG: Leave message empty to abort commit.
188 188 EDITOR: HG: --
189 189 EDITOR: HG: user: test
190 190 EDITOR: HG: branch 'default'
191 191 EDITOR: HG: changed a
192 192 created new head
193 193 diff --git a/a b/a
194 194 2 hunks, 2 lines changed
195 195 examine changes to 'a'? [Ynesfdaq?] y
196 196
197 197 @@ -1,1 +1,1 @@
198 198 -1
199 199 +11
200 200 record change 1/2 to 'a'? [Ynesfdaq?] n
201 201
202 202 @@ -3,1 +3,1 @@ 2
203 203 -3
204 204 +33
205 205 record change 2/2 to 'a'? [Ynesfdaq?] y
206 206
207 207 EDITOR: HG: Splitting 1df0d5c5a3ab. So far it has been split into:
208 208 EDITOR: HG: - e704349bd21b: split 1
209 209 EDITOR: HG: Write commit message for the next split changeset.
210 210 EDITOR: a2
211 211 EDITOR:
212 212 EDITOR:
213 213 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
214 214 EDITOR: HG: Leave message empty to abort commit.
215 215 EDITOR: HG: --
216 216 EDITOR: HG: user: test
217 217 EDITOR: HG: branch 'default'
218 218 EDITOR: HG: changed a
219 219 diff --git a/a b/a
220 220 1 hunks, 1 lines changed
221 221 examine changes to 'a'? [Ynesfdaq?] y
222 222
223 223 @@ -1,1 +1,1 @@
224 224 -1
225 225 +11
226 226 record this change to 'a'? [Ynesfdaq?] y
227 227
228 228 EDITOR: HG: Splitting 1df0d5c5a3ab. So far it has been split into:
229 229 EDITOR: HG: - e704349bd21b: split 1
230 230 EDITOR: HG: - a09ad58faae3: split 2
231 231 EDITOR: HG: Write commit message for the next split changeset.
232 232 EDITOR: a2
233 233 EDITOR:
234 234 EDITOR:
235 235 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
236 236 EDITOR: HG: Leave message empty to abort commit.
237 237 EDITOR: HG: --
238 238 EDITOR: HG: user: test
239 239 EDITOR: HG: branch 'default'
240 240 EDITOR: HG: changed a
241 241 saved backup bundle to $TESTTMP/a/.hg/strip-backup/1df0d5c5a3ab-8341b760-split.hg (obsstore-off !)
242 242
243 243 #if obsstore-off
244 244 $ hg bookmark
245 245 r1 0:a61bcde8c529
246 246 r2 3:00eebaf8d2e2
247 247 * r3 3:00eebaf8d2e2
248 248 $ hg glog -p
249 249 @ 3:00eebaf8d2e2 split 3 r2 r3
250 250 | diff --git a/a b/a
251 251 | --- a/a
252 252 | +++ b/a
253 253 | @@ -1,1 +1,1 @@
254 254 | -1
255 255 | +11
256 256 |
257 257 o 2:a09ad58faae3 split 2
258 258 | diff --git a/a b/a
259 259 | --- a/a
260 260 | +++ b/a
261 261 | @@ -3,1 +3,1 @@
262 262 | -3
263 263 | +33
264 264 |
265 265 o 1:e704349bd21b split 1
266 266 | diff --git a/a b/a
267 267 | --- a/a
268 268 | +++ b/a
269 269 | @@ -5,1 +5,1 @@
270 270 | -5
271 271 | +55
272 272 |
273 273 o 0:a61bcde8c529 a1 r1
274 274 diff --git a/a b/a
275 275 new file mode 100644
276 276 --- /dev/null
277 277 +++ b/a
278 278 @@ -0,0 +1,5 @@
279 279 +1
280 280 +2
281 281 +3
282 282 +4
283 283 +5
284 284
285 285 #else
286 286 $ hg bookmark
287 287 r1 0:a61bcde8c529
288 288 r2 4:00eebaf8d2e2
289 289 * r3 4:00eebaf8d2e2
290 290 $ hg glog
291 291 @ 4:00eebaf8d2e2 split 3 r2 r3
292 292 |
293 293 o 3:a09ad58faae3 split 2
294 294 |
295 295 o 2:e704349bd21b split 1
296 296 |
297 297 o 0:a61bcde8c529 a1 r1
298 298
299 299 #endif
300 300
301 301 Split a head while working parent is not that head
302 302
303 303 $ cp -R $TESTTMP/clean $TESTTMP/b
304 304 $ cd $TESTTMP/b
305 305
306 306 $ hg up 0 -q
307 307 $ hg bookmark r3
308 308
309 309 $ runsplit tip >/dev/null
310 310
311 311 #if obsstore-off
312 312 $ hg bookmark
313 313 r1 0:a61bcde8c529
314 314 r2 3:00eebaf8d2e2
315 315 * r3 0:a61bcde8c529
316 316 $ hg glog
317 317 o 3:00eebaf8d2e2 split 3 r2
318 318 |
319 319 o 2:a09ad58faae3 split 2
320 320 |
321 321 o 1:e704349bd21b split 1
322 322 |
323 323 @ 0:a61bcde8c529 a1 r1 r3
324 324
325 325 #else
326 326 $ hg bookmark
327 327 r1 0:a61bcde8c529
328 328 r2 4:00eebaf8d2e2
329 329 * r3 0:a61bcde8c529
330 330 $ hg glog
331 331 o 4:00eebaf8d2e2 split 3 r2
332 332 |
333 333 o 3:a09ad58faae3 split 2
334 334 |
335 335 o 2:e704349bd21b split 1
336 336 |
337 337 @ 0:a61bcde8c529 a1 r1 r3
338 338
339 339 #endif
340 340
341 341 Split a non-head
342 342
343 343 $ cp -R $TESTTMP/clean $TESTTMP/c
344 344 $ cd $TESTTMP/c
345 345 $ echo d > d
346 346 $ hg ci -m d1 -A d
347 347 $ hg bookmark -i d1
348 348 $ echo 2 >> d
349 349 $ hg ci -m d2
350 350 $ echo 3 >> d
351 351 $ hg ci -m d3
352 352 $ hg bookmark -i d3
353 353 $ hg up '.^' -q
354 354 $ hg bookmark d2
355 355 $ cp -R . ../d
356 356
357 357 $ runsplit -r 1 | grep rebasing
358 358 rebasing 2:b5c5ea414030 "d1" (d1)
359 359 rebasing 3:f4a0a8d004cc "d2" (d2)
360 360 rebasing 4:777940761eba "d3" (d3)
361 361 #if obsstore-off
362 362 $ hg bookmark
363 363 d1 4:c4b449ef030e
364 364 * d2 5:c9dd00ab36a3
365 365 d3 6:19f476bc865c
366 366 r1 0:a61bcde8c529
367 367 r2 3:00eebaf8d2e2
368 368 $ hg glog -p
369 369 o 6:19f476bc865c d3 d3
370 370 | diff --git a/d b/d
371 371 | --- a/d
372 372 | +++ b/d
373 373 | @@ -2,0 +3,1 @@
374 374 | +3
375 375 |
376 376 @ 5:c9dd00ab36a3 d2 d2
377 377 | diff --git a/d b/d
378 378 | --- a/d
379 379 | +++ b/d
380 380 | @@ -1,0 +2,1 @@
381 381 | +2
382 382 |
383 383 o 4:c4b449ef030e d1 d1
384 384 | diff --git a/d b/d
385 385 | new file mode 100644
386 386 | --- /dev/null
387 387 | +++ b/d
388 388 | @@ -0,0 +1,1 @@
389 389 | +d
390 390 |
391 391 o 3:00eebaf8d2e2 split 3 r2
392 392 | diff --git a/a b/a
393 393 | --- a/a
394 394 | +++ b/a
395 395 | @@ -1,1 +1,1 @@
396 396 | -1
397 397 | +11
398 398 |
399 399 o 2:a09ad58faae3 split 2
400 400 | diff --git a/a b/a
401 401 | --- a/a
402 402 | +++ b/a
403 403 | @@ -3,1 +3,1 @@
404 404 | -3
405 405 | +33
406 406 |
407 407 o 1:e704349bd21b split 1
408 408 | diff --git a/a b/a
409 409 | --- a/a
410 410 | +++ b/a
411 411 | @@ -5,1 +5,1 @@
412 412 | -5
413 413 | +55
414 414 |
415 415 o 0:a61bcde8c529 a1 r1
416 416 diff --git a/a b/a
417 417 new file mode 100644
418 418 --- /dev/null
419 419 +++ b/a
420 420 @@ -0,0 +1,5 @@
421 421 +1
422 422 +2
423 423 +3
424 424 +4
425 425 +5
426 426
427 427 #else
428 428 $ hg bookmark
429 429 d1 8:c4b449ef030e
430 430 * d2 9:c9dd00ab36a3
431 431 d3 10:19f476bc865c
432 432 r1 0:a61bcde8c529
433 433 r2 7:00eebaf8d2e2
434 434 $ hg glog
435 435 o 10:19f476bc865c d3 d3
436 436 |
437 437 @ 9:c9dd00ab36a3 d2 d2
438 438 |
439 439 o 8:c4b449ef030e d1 d1
440 440 |
441 441 o 7:00eebaf8d2e2 split 3 r2
442 442 |
443 443 o 6:a09ad58faae3 split 2
444 444 |
445 445 o 5:e704349bd21b split 1
446 446 |
447 447 o 0:a61bcde8c529 a1 r1
448 448
449 449 #endif
450 450
451 451 Split a non-head without rebase
452 452
453 453 $ cd $TESTTMP/d
454 454 #if obsstore-off
455 455 $ runsplit -r 1 --no-rebase
456 456 abort: cannot split changeset with children without rebase
457 457 [255]
458 458 #else
459 459 $ runsplit -r 1 --no-rebase >/dev/null
460 460 3 new orphan changesets
461 461 $ hg bookmark
462 462 d1 2:b5c5ea414030
463 463 * d2 3:f4a0a8d004cc
464 464 d3 4:777940761eba
465 465 r1 0:a61bcde8c529
466 466 r2 7:00eebaf8d2e2
467 467
468 468 $ hg glog
469 469 o 7:00eebaf8d2e2 split 3 r2
470 470 |
471 471 o 6:a09ad58faae3 split 2
472 472 |
473 473 o 5:e704349bd21b split 1
474 474 |
475 475 | * 4:777940761eba d3 d3
476 476 | |
477 477 | @ 3:f4a0a8d004cc d2 d2
478 478 | |
479 479 | * 2:b5c5ea414030 d1 d1
480 480 | |
481 481 | x 1:1df0d5c5a3ab a2
482 482 |/
483 483 o 0:a61bcde8c529 a1 r1
484 484
485 485 #endif
486 486
487 487 Split a non-head with obsoleted descendants
488 488
489 489 #if obsstore-on
490 490 $ hg init $TESTTMP/e
491 491 $ cd $TESTTMP/e
492 492 $ hg debugdrawdag <<'EOS'
493 493 > H I J
494 494 > | | |
495 495 > F G1 G2 # amend: G1 -> G2
496 496 > | | / # prune: F
497 497 > C D E
498 498 > \|/
499 499 > B
500 500 > |
501 501 > A
502 502 > EOS
503 503 2 new orphan changesets
504 504 $ eval `hg tags -T '{tag}={node}\n'`
505 505 $ rm .hg/localtags
506 506 $ hg split $B --config experimental.evolution=createmarkers
507 507 abort: split would leave orphaned changesets behind
508 508 [255]
509 509 $ cat > $TESTTMP/messages <<EOF
510 510 > Split B
511 511 > EOF
512 512 $ cat <<EOF | hg split $B
513 513 > y
514 514 > y
515 515 > EOF
516 516 diff --git a/B b/B
517 517 new file mode 100644
518 518 examine changes to 'B'? [Ynesfdaq?] y
519 519
520 520 @@ -0,0 +1,1 @@
521 521 +B
522 522 \ No newline at end of file
523 523 record this change to 'B'? [Ynesfdaq?] y
524 524
525 525 EDITOR: HG: Splitting 112478962961. Write commit message for the first split changeset.
526 526 EDITOR: B
527 527 EDITOR:
528 528 EDITOR:
529 529 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
530 530 EDITOR: HG: Leave message empty to abort commit.
531 531 EDITOR: HG: --
532 532 EDITOR: HG: user: test
533 533 EDITOR: HG: branch 'default'
534 534 EDITOR: HG: added B
535 535 created new head
536 536 rebasing 2:26805aba1e60 "C"
537 537 rebasing 3:be0ef73c17ad "D"
538 538 rebasing 4:49cb92066bfd "E"
539 539 rebasing 7:97a6268cc7ef "G2"
540 540 rebasing 10:e2f1e425c0db "J"
541 541 $ hg glog -r 'sort(all(), topo)'
542 542 o 16:556c085f8b52 J
543 543 |
544 544 o 15:8761f6c9123f G2
545 545 |
546 546 o 14:a7aeffe59b65 E
547 547 |
548 548 | o 13:e1e914ede9ab D
549 549 |/
550 550 | o 12:01947e9b98aa C
551 551 |/
552 552 o 11:0947baa74d47 Split B
553 553 |
554 554 | * 9:88ede1d5ee13 I
555 555 | |
556 556 | x 6:af8cbf225b7b G1
557 557 | |
558 558 | x 3:be0ef73c17ad D
559 559 | |
560 560 | | * 8:74863e5b5074 H
561 561 | | |
562 562 | | x 5:ee481a2a1e69 F
563 563 | | |
564 564 | | x 2:26805aba1e60 C
565 565 | |/
566 566 | x 1:112478962961 B
567 567 |/
568 568 o 0:426bada5c675 A
569 569
570 570 #endif
571 571
572 572 Preserve secret phase in split
573 573
574 574 $ cp -R $TESTTMP/clean $TESTTMP/phases1
575 575 $ cd $TESTTMP/phases1
576 576 $ hg phase --secret -fr tip
577 577 $ hg log -T '{short(node)} {phase}\n'
578 578 1df0d5c5a3ab secret
579 579 a61bcde8c529 draft
580 580 $ runsplit tip >/dev/null
581 581 $ hg log -T '{short(node)} {phase}\n'
582 582 00eebaf8d2e2 secret
583 583 a09ad58faae3 secret
584 584 e704349bd21b secret
585 585 a61bcde8c529 draft
586 586
587 587 Do not move things to secret even if phases.new-commit=secret
588 588
589 589 $ cp -R $TESTTMP/clean $TESTTMP/phases2
590 590 $ cd $TESTTMP/phases2
591 591 $ cat >> .hg/hgrc <<EOF
592 592 > [phases]
593 593 > new-commit=secret
594 594 > EOF
595 595 $ hg log -T '{short(node)} {phase}\n'
596 596 1df0d5c5a3ab draft
597 597 a61bcde8c529 draft
598 598 $ runsplit tip >/dev/null
599 599 $ hg log -T '{short(node)} {phase}\n'
600 600 00eebaf8d2e2 draft
601 601 a09ad58faae3 draft
602 602 e704349bd21b draft
603 603 a61bcde8c529 draft
604 604
605 605 `hg split` with ignoreblanklines=1 does not infinite loop
606 606
607 607 $ mkdir $TESTTMP/f
608 608 $ hg init $TESTTMP/f/a
609 609 $ cd $TESTTMP/f/a
610 610 $ printf '1\n2\n3\n4\n5\n' > foo
611 611 $ cp foo bar
612 612 $ hg ci -qAm initial
613 613 $ printf '1\n\n2\n3\ntest\n4\n5\n' > bar
614 614 $ printf '1\n2\n3\ntest\n4\n5\n' > foo
615 615 $ hg ci -qm splitme
616 616 $ cat > $TESTTMP/messages <<EOF
617 617 > split 1
618 618 > --
619 619 > split 2
620 620 > EOF
621 621 $ printf 'f\nn\nf\n' | hg --config extensions.split= --config diff.ignoreblanklines=1 split
622 622 diff --git a/bar b/bar
623 623 2 hunks, 2 lines changed
624 624 examine changes to 'bar'? [Ynesfdaq?] f
625 625
626 626 diff --git a/foo b/foo
627 627 1 hunks, 1 lines changed
628 628 examine changes to 'foo'? [Ynesfdaq?] n
629 629
630 630 EDITOR: HG: Splitting dd3c45017cbf. Write commit message for the first split changeset.
631 631 EDITOR: splitme
632 632 EDITOR:
633 633 EDITOR:
634 634 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
635 635 EDITOR: HG: Leave message empty to abort commit.
636 636 EDITOR: HG: --
637 637 EDITOR: HG: user: test
638 638 EDITOR: HG: branch 'default'
639 639 EDITOR: HG: changed bar
640 640 created new head
641 641 diff --git a/foo b/foo
642 642 1 hunks, 1 lines changed
643 643 examine changes to 'foo'? [Ynesfdaq?] f
644 644
645 645 EDITOR: HG: Splitting dd3c45017cbf. So far it has been split into:
646 646 EDITOR: HG: - f205aea1c624: split 1
647 647 EDITOR: HG: Write commit message for the next split changeset.
648 648 EDITOR: splitme
649 649 EDITOR:
650 650 EDITOR:
651 651 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
652 652 EDITOR: HG: Leave message empty to abort commit.
653 653 EDITOR: HG: --
654 654 EDITOR: HG: user: test
655 655 EDITOR: HG: branch 'default'
656 656 EDITOR: HG: changed foo
657 657 saved backup bundle to $TESTTMP/f/a/.hg/strip-backup/dd3c45017cbf-463441b5-split.hg (obsstore-off !)
658 658
659 659 Let's try that again, with a slightly different set of patches, to ensure that
660 660 the ignoreblanklines thing isn't somehow position dependent.
661 661
662 662 $ hg init $TESTTMP/f/b
663 663 $ cd $TESTTMP/f/b
664 664 $ printf '1\n2\n3\n4\n5\n' > foo
665 665 $ cp foo bar
666 666 $ hg ci -qAm initial
667 667 $ printf '1\n2\n3\ntest\n4\n5\n' > bar
668 668 $ printf '1\n2\n3\ntest\n4\n\n5\n' > foo
669 669 $ hg ci -qm splitme
670 670 $ cat > $TESTTMP/messages <<EOF
671 671 > split 1
672 672 > --
673 673 > split 2
674 674 > EOF
675 675 $ printf 'f\nn\nf\n' | hg --config extensions.split= --config diff.ignoreblanklines=1 split
676 676 diff --git a/bar b/bar
677 677 1 hunks, 1 lines changed
678 678 examine changes to 'bar'? [Ynesfdaq?] f
679 679
680 680 diff --git a/foo b/foo
681 681 2 hunks, 2 lines changed
682 682 examine changes to 'foo'? [Ynesfdaq?] n
683 683
684 684 EDITOR: HG: Splitting 904c80b40a4a. Write commit message for the first split changeset.
685 685 EDITOR: splitme
686 686 EDITOR:
687 687 EDITOR:
688 688 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
689 689 EDITOR: HG: Leave message empty to abort commit.
690 690 EDITOR: HG: --
691 691 EDITOR: HG: user: test
692 692 EDITOR: HG: branch 'default'
693 693 EDITOR: HG: changed bar
694 694 created new head
695 695 diff --git a/foo b/foo
696 696 2 hunks, 2 lines changed
697 697 examine changes to 'foo'? [Ynesfdaq?] f
698 698
699 699 EDITOR: HG: Splitting 904c80b40a4a. So far it has been split into:
700 700 EDITOR: HG: - ffecf40fa954: split 1
701 701 EDITOR: HG: Write commit message for the next split changeset.
702 702 EDITOR: splitme
703 703 EDITOR:
704 704 EDITOR:
705 705 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
706 706 EDITOR: HG: Leave message empty to abort commit.
707 707 EDITOR: HG: --
708 708 EDITOR: HG: user: test
709 709 EDITOR: HG: branch 'default'
710 710 EDITOR: HG: changed foo
711 711 saved backup bundle to $TESTTMP/f/b/.hg/strip-backup/904c80b40a4a-47fb907f-split.hg (obsstore-off !)
712 712
713 713
714 714 Testing the case in split when commiting flag-only file changes (issue5864)
715 715 ---------------------------------------------------------------------------
716 716 $ hg init $TESTTMP/issue5864
717 717 $ cd $TESTTMP/issue5864
718 718 $ echo foo > foo
719 719 $ hg add foo
720 720 $ hg ci -m "initial"
721 $ chmod +x foo
722 $ hg ci -m "make executable"
721 $ hg import -q --bypass -m "make executable" - <<EOF
722 > diff --git a/foo b/foo
723 > old mode 100644
724 > new mode 100755
725 > EOF
726 $ hg up -q
723 727
724 728 $ hg glog
725 729 @ 1:3a2125f0f4cb make executable
726 730 |
727 731 o 0:51f273a58d82 initial
728 732
729 733
734 #if no-windows
730 735 $ printf 'y\ny\ny\n' | hg split
731 736 diff --git a/foo b/foo
732 737 old mode 100644
733 738 new mode 100755
734 739 examine changes to 'foo'? [Ynesfdaq?] y
735 740
736 741 no changes to record
737 742 diff --git a/foo b/foo
738 743 old mode 100644
739 744 new mode 100755
740 745 examine changes to 'foo'? [Ynesfdaq?] y
741 746
742 747 no changes to record
743 748 diff --git a/foo b/foo
744 749 old mode 100644
745 750 new mode 100755
746 751 examine changes to 'foo'? [Ynesfdaq?] y
747 752
748 753 no changes to record
749 754 diff --git a/foo b/foo
750 755 old mode 100644
751 756 new mode 100755
752 757 examine changes to 'foo'? [Ynesfdaq?] abort: response expected
753 758 [255]
759 #else
760
761 TODO: Fix this on Windows. See issue 2020 and 5883
762
763 $ printf 'y\ny\ny\n' | hg split
764 abort: cannot split an empty revision
765 [255]
766 #endif
General Comments 0
You need to be logged in to leave comments. Login now