##// END OF EJS Templates
test-commit-interactive: add more globs for no-execbit platforms...
Matt Harbison -
r24884:d7778b88 stable
parent child Browse files
Show More
@@ -1,1499 +1,1500 b''
1 1 Set up a repo
2 2
3 3 $ cat <<EOF >> $HGRCPATH
4 4 > [ui]
5 5 > interactive = true
6 6 > [extensions]
7 7 > record =
8 8 > EOF
9 9
10 10 $ hg init a
11 11 $ cd a
12 12
13 13 Select no files
14 14
15 15 $ touch empty-rw
16 16 $ hg add empty-rw
17 17
18 18 $ hg commit -i empty-rw<<EOF
19 19 > n
20 20 > EOF
21 21 diff --git a/empty-rw b/empty-rw
22 22 new file mode 100644
23 23 examine changes to 'empty-rw'? [Ynesfdaq?] n
24 24
25 25 no changes to record
26 26
27 27 $ hg tip -p
28 28 changeset: -1:000000000000
29 29 tag: tip
30 30 user:
31 31 date: Thu Jan 01 00:00:00 1970 +0000
32 32
33 33
34 34
35 35 Select files but no hunks
36 36
37 37 $ hg commit -i empty-rw<<EOF
38 38 > y
39 39 > n
40 40 > EOF
41 41 diff --git a/empty-rw b/empty-rw
42 42 new file mode 100644
43 43 examine changes to 'empty-rw'? [Ynesfdaq?] y
44 44
45 45 abort: empty commit message
46 46 [255]
47 47
48 48 $ hg tip -p
49 49 changeset: -1:000000000000
50 50 tag: tip
51 51 user:
52 52 date: Thu Jan 01 00:00:00 1970 +0000
53 53
54 54
55 55
56 56 Record empty file
57 57
58 58 $ hg commit -i -d '0 0' -m empty empty-rw<<EOF
59 59 > y
60 60 > y
61 61 > EOF
62 62 diff --git a/empty-rw b/empty-rw
63 63 new file mode 100644
64 64 examine changes to 'empty-rw'? [Ynesfdaq?] y
65 65
66 66
67 67 $ hg tip -p
68 68 changeset: 0:c0708cf4e46e
69 69 tag: tip
70 70 user: test
71 71 date: Thu Jan 01 00:00:00 1970 +0000
72 72 summary: empty
73 73
74 74
75 75
76 76 Summary shows we updated to the new cset
77 77
78 78 $ hg summary
79 79 parent: 0:c0708cf4e46e tip
80 80 empty
81 81 branch: default
82 82 commit: (clean)
83 83 update: (current)
84 84
85 85 Rename empty file
86 86
87 87 $ hg mv empty-rw empty-rename
88 88 $ hg commit -i -d '1 0' -m rename<<EOF
89 89 > y
90 90 > EOF
91 91 diff --git a/empty-rw b/empty-rename
92 92 rename from empty-rw
93 93 rename to empty-rename
94 94 examine changes to 'empty-rw' and 'empty-rename'? [Ynesfdaq?] y
95 95
96 96
97 97 $ hg tip -p
98 98 changeset: 1:d695e8dcb197
99 99 tag: tip
100 100 user: test
101 101 date: Thu Jan 01 00:00:01 1970 +0000
102 102 summary: rename
103 103
104 104
105 105
106 106 Copy empty file
107 107
108 108 $ hg cp empty-rename empty-copy
109 109 $ hg commit -i -d '2 0' -m copy<<EOF
110 110 > y
111 111 > EOF
112 112 diff --git a/empty-rename b/empty-copy
113 113 copy from empty-rename
114 114 copy to empty-copy
115 115 examine changes to 'empty-rename' and 'empty-copy'? [Ynesfdaq?] y
116 116
117 117
118 118 $ hg tip -p
119 119 changeset: 2:1d4b90bea524
120 120 tag: tip
121 121 user: test
122 122 date: Thu Jan 01 00:00:02 1970 +0000
123 123 summary: copy
124 124
125 125
126 126
127 127 Delete empty file
128 128
129 129 $ hg rm empty-copy
130 130 $ hg commit -i -d '3 0' -m delete<<EOF
131 131 > y
132 132 > EOF
133 133 diff --git a/empty-copy b/empty-copy
134 134 deleted file mode 100644
135 135 examine changes to 'empty-copy'? [Ynesfdaq?] y
136 136
137 137
138 138 $ hg tip -p
139 139 changeset: 3:b39a238f01a1
140 140 tag: tip
141 141 user: test
142 142 date: Thu Jan 01 00:00:03 1970 +0000
143 143 summary: delete
144 144
145 145
146 146
147 147 Add binary file
148 148
149 149 $ hg bundle --base -2 tip.bundle
150 150 1 changesets found
151 151 $ hg add tip.bundle
152 152 $ hg commit -i -d '4 0' -m binary<<EOF
153 153 > y
154 154 > EOF
155 155 diff --git a/tip.bundle b/tip.bundle
156 156 new file mode 100644
157 157 this is a binary file
158 158 examine changes to 'tip.bundle'? [Ynesfdaq?] y
159 159
160 160
161 161 $ hg tip -p
162 162 changeset: 4:ad816da3711e
163 163 tag: tip
164 164 user: test
165 165 date: Thu Jan 01 00:00:04 1970 +0000
166 166 summary: binary
167 167
168 168 diff -r b39a238f01a1 -r ad816da3711e tip.bundle
169 169 Binary file tip.bundle has changed
170 170
171 171
172 172 Change binary file
173 173
174 174 $ hg bundle --base -2 tip.bundle
175 175 1 changesets found
176 176 $ hg commit -i -d '5 0' -m binary-change<<EOF
177 177 > y
178 178 > EOF
179 179 diff --git a/tip.bundle b/tip.bundle
180 180 this modifies a binary file (all or nothing)
181 181 examine changes to 'tip.bundle'? [Ynesfdaq?] y
182 182
183 183
184 184 $ hg tip -p
185 185 changeset: 5:dccd6f3eb485
186 186 tag: tip
187 187 user: test
188 188 date: Thu Jan 01 00:00:05 1970 +0000
189 189 summary: binary-change
190 190
191 191 diff -r ad816da3711e -r dccd6f3eb485 tip.bundle
192 192 Binary file tip.bundle has changed
193 193
194 194
195 195 Rename and change binary file
196 196
197 197 $ hg mv tip.bundle top.bundle
198 198 $ hg bundle --base -2 top.bundle
199 199 1 changesets found
200 200 $ hg commit -i -d '6 0' -m binary-change-rename<<EOF
201 201 > y
202 202 > EOF
203 203 diff --git a/tip.bundle b/top.bundle
204 204 rename from tip.bundle
205 205 rename to top.bundle
206 206 this modifies a binary file (all or nothing)
207 207 examine changes to 'tip.bundle' and 'top.bundle'? [Ynesfdaq?] y
208 208
209 209
210 210 $ hg tip -p
211 211 changeset: 6:7fa44105f5b3
212 212 tag: tip
213 213 user: test
214 214 date: Thu Jan 01 00:00:06 1970 +0000
215 215 summary: binary-change-rename
216 216
217 217 diff -r dccd6f3eb485 -r 7fa44105f5b3 tip.bundle
218 218 Binary file tip.bundle has changed
219 219 diff -r dccd6f3eb485 -r 7fa44105f5b3 top.bundle
220 220 Binary file top.bundle has changed
221 221
222 222
223 223 Add plain file
224 224
225 225 $ for i in 1 2 3 4 5 6 7 8 9 10; do
226 226 > echo $i >> plain
227 227 > done
228 228
229 229 $ hg add plain
230 230 $ hg commit -i -d '7 0' -m plain plain<<EOF
231 231 > y
232 232 > y
233 233 > EOF
234 234 diff --git a/plain b/plain
235 235 new file mode 100644
236 236 examine changes to 'plain'? [Ynesfdaq?] y
237 237
238 238 @@ -0,0 +1,10 @@
239 239 +1
240 240 +2
241 241 +3
242 242 +4
243 243 +5
244 244 +6
245 245 +7
246 246 +8
247 247 +9
248 248 +10
249 249 record this change to 'plain'? [Ynesfdaq?] y
250 250
251 251 $ hg tip -p
252 252 changeset: 7:11fb457c1be4
253 253 tag: tip
254 254 user: test
255 255 date: Thu Jan 01 00:00:07 1970 +0000
256 256 summary: plain
257 257
258 258 diff -r 7fa44105f5b3 -r 11fb457c1be4 plain
259 259 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
260 260 +++ b/plain Thu Jan 01 00:00:07 1970 +0000
261 261 @@ -0,0 +1,10 @@
262 262 +1
263 263 +2
264 264 +3
265 265 +4
266 266 +5
267 267 +6
268 268 +7
269 269 +8
270 270 +9
271 271 +10
272 272
273 273 Modify end of plain file with username unset
274 274
275 275 $ echo 11 >> plain
276 276 $ unset HGUSER
277 277 $ hg commit -i --config ui.username= -d '8 0' -m end plain
278 278 abort: no username supplied
279 279 (use "hg config --edit" to set your username)
280 280 [255]
281 281
282 282
283 283 Modify end of plain file, also test that diffopts are accounted for
284 284
285 285 $ HGUSER="test"
286 286 $ export HGUSER
287 287 $ hg commit -i --config diff.showfunc=true -d '8 0' -m end plain <<EOF
288 288 > y
289 289 > y
290 290 > EOF
291 291 diff --git a/plain b/plain
292 292 1 hunks, 1 lines changed
293 293 examine changes to 'plain'? [Ynesfdaq?] y
294 294
295 295 @@ -8,3 +8,4 @@ 7
296 296 8
297 297 9
298 298 10
299 299 +11
300 300 record this change to 'plain'? [Ynesfdaq?] y
301 301
302 302
303 303 Modify end of plain file, no EOL
304 304
305 305 $ hg tip --template '{node}' >> plain
306 306 $ hg commit -i -d '9 0' -m noeol plain <<EOF
307 307 > y
308 308 > y
309 309 > EOF
310 310 diff --git a/plain b/plain
311 311 1 hunks, 1 lines changed
312 312 examine changes to 'plain'? [Ynesfdaq?] y
313 313
314 314 @@ -9,3 +9,4 @@
315 315 9
316 316 10
317 317 11
318 318 +7264f99c5f5ff3261504828afa4fb4d406c3af54
319 319 \ No newline at end of file
320 320 record this change to 'plain'? [Ynesfdaq?] y
321 321
322 322
323 323 Modify end of plain file, add EOL
324 324
325 325 $ echo >> plain
326 326 $ echo 1 > plain2
327 327 $ hg add plain2
328 328 $ hg commit -i -d '10 0' -m eol plain plain2 <<EOF
329 329 > y
330 330 > y
331 331 > y
332 332 > y
333 333 > EOF
334 334 diff --git a/plain b/plain
335 335 1 hunks, 1 lines changed
336 336 examine changes to 'plain'? [Ynesfdaq?] y
337 337
338 338 @@ -9,4 +9,4 @@
339 339 9
340 340 10
341 341 11
342 342 -7264f99c5f5ff3261504828afa4fb4d406c3af54
343 343 \ No newline at end of file
344 344 +7264f99c5f5ff3261504828afa4fb4d406c3af54
345 345 record change 1/2 to 'plain'? [Ynesfdaq?] y
346 346
347 347 diff --git a/plain2 b/plain2
348 348 new file mode 100644
349 349 examine changes to 'plain2'? [Ynesfdaq?] y
350 350
351 351 @@ -0,0 +1,1 @@
352 352 +1
353 353 record change 2/2 to 'plain2'? [Ynesfdaq?] y
354 354
355 355 Modify beginning, trim end, record both, add another file to test
356 356 changes numbering
357 357
358 358 $ rm plain
359 359 $ for i in 2 2 3 4 5 6 7 8 9 10; do
360 360 > echo $i >> plain
361 361 > done
362 362 $ echo 2 >> plain2
363 363
364 364 $ hg commit -i -d '10 0' -m begin-and-end plain plain2 <<EOF
365 365 > y
366 366 > y
367 367 > y
368 368 > y
369 369 > y
370 370 > EOF
371 371 diff --git a/plain b/plain
372 372 2 hunks, 3 lines changed
373 373 examine changes to 'plain'? [Ynesfdaq?] y
374 374
375 375 @@ -1,4 +1,4 @@
376 376 -1
377 377 +2
378 378 2
379 379 3
380 380 4
381 381 record change 1/3 to 'plain'? [Ynesfdaq?] y
382 382
383 383 @@ -8,5 +8,3 @@
384 384 8
385 385 9
386 386 10
387 387 -11
388 388 -7264f99c5f5ff3261504828afa4fb4d406c3af54
389 389 record change 2/3 to 'plain'? [Ynesfdaq?] y
390 390
391 391 diff --git a/plain2 b/plain2
392 392 1 hunks, 1 lines changed
393 393 examine changes to 'plain2'? [Ynesfdaq?] y
394 394
395 395 @@ -1,1 +1,2 @@
396 396 1
397 397 +2
398 398 record change 3/3 to 'plain2'? [Ynesfdaq?] y
399 399
400 400
401 401 $ hg tip -p
402 402 changeset: 11:21df83db12b8
403 403 tag: tip
404 404 user: test
405 405 date: Thu Jan 01 00:00:10 1970 +0000
406 406 summary: begin-and-end
407 407
408 408 diff -r ddb8b281c3ff -r 21df83db12b8 plain
409 409 --- a/plain Thu Jan 01 00:00:10 1970 +0000
410 410 +++ b/plain Thu Jan 01 00:00:10 1970 +0000
411 411 @@ -1,4 +1,4 @@
412 412 -1
413 413 +2
414 414 2
415 415 3
416 416 4
417 417 @@ -8,5 +8,3 @@
418 418 8
419 419 9
420 420 10
421 421 -11
422 422 -7264f99c5f5ff3261504828afa4fb4d406c3af54
423 423 diff -r ddb8b281c3ff -r 21df83db12b8 plain2
424 424 --- a/plain2 Thu Jan 01 00:00:10 1970 +0000
425 425 +++ b/plain2 Thu Jan 01 00:00:10 1970 +0000
426 426 @@ -1,1 +1,2 @@
427 427 1
428 428 +2
429 429
430 430
431 431 Trim beginning, modify end
432 432
433 433 $ rm plain
434 434 > for i in 4 5 6 7 8 9 10.new; do
435 435 > echo $i >> plain
436 436 > done
437 437
438 438 Record end
439 439
440 440 $ hg commit -i -d '11 0' -m end-only plain <<EOF
441 441 > y
442 442 > n
443 443 > y
444 444 > EOF
445 445 diff --git a/plain b/plain
446 446 2 hunks, 4 lines changed
447 447 examine changes to 'plain'? [Ynesfdaq?] y
448 448
449 449 @@ -1,9 +1,6 @@
450 450 -2
451 451 -2
452 452 -3
453 453 4
454 454 5
455 455 6
456 456 7
457 457 8
458 458 9
459 459 record change 1/2 to 'plain'? [Ynesfdaq?] n
460 460
461 461 @@ -4,7 +1,7 @@
462 462 4
463 463 5
464 464 6
465 465 7
466 466 8
467 467 9
468 468 -10
469 469 +10.new
470 470 record change 2/2 to 'plain'? [Ynesfdaq?] y
471 471
472 472
473 473 $ hg tip -p
474 474 changeset: 12:99337501826f
475 475 tag: tip
476 476 user: test
477 477 date: Thu Jan 01 00:00:11 1970 +0000
478 478 summary: end-only
479 479
480 480 diff -r 21df83db12b8 -r 99337501826f plain
481 481 --- a/plain Thu Jan 01 00:00:10 1970 +0000
482 482 +++ b/plain Thu Jan 01 00:00:11 1970 +0000
483 483 @@ -7,4 +7,4 @@
484 484 7
485 485 8
486 486 9
487 487 -10
488 488 +10.new
489 489
490 490
491 491 Record beginning
492 492
493 493 $ hg commit -i -d '12 0' -m begin-only plain <<EOF
494 494 > y
495 495 > y
496 496 > EOF
497 497 diff --git a/plain b/plain
498 498 1 hunks, 3 lines changed
499 499 examine changes to 'plain'? [Ynesfdaq?] y
500 500
501 501 @@ -1,6 +1,3 @@
502 502 -2
503 503 -2
504 504 -3
505 505 4
506 506 5
507 507 6
508 508 record this change to 'plain'? [Ynesfdaq?] y
509 509
510 510
511 511 $ hg tip -p
512 512 changeset: 13:bbd45465d540
513 513 tag: tip
514 514 user: test
515 515 date: Thu Jan 01 00:00:12 1970 +0000
516 516 summary: begin-only
517 517
518 518 diff -r 99337501826f -r bbd45465d540 plain
519 519 --- a/plain Thu Jan 01 00:00:11 1970 +0000
520 520 +++ b/plain Thu Jan 01 00:00:12 1970 +0000
521 521 @@ -1,6 +1,3 @@
522 522 -2
523 523 -2
524 524 -3
525 525 4
526 526 5
527 527 6
528 528
529 529
530 530 Add to beginning, trim from end
531 531
532 532 $ rm plain
533 533 $ for i in 1 2 3 4 5 6 7 8 9; do
534 534 > echo $i >> plain
535 535 > done
536 536
537 537 Record end
538 538
539 539 $ hg commit -i --traceback -d '13 0' -m end-again plain<<EOF
540 540 > y
541 541 > n
542 542 > y
543 543 > EOF
544 544 diff --git a/plain b/plain
545 545 2 hunks, 4 lines changed
546 546 examine changes to 'plain'? [Ynesfdaq?] y
547 547
548 548 @@ -1,6 +1,9 @@
549 549 +1
550 550 +2
551 551 +3
552 552 4
553 553 5
554 554 6
555 555 7
556 556 8
557 557 9
558 558 record change 1/2 to 'plain'? [Ynesfdaq?] n
559 559
560 560 @@ -1,7 +4,6 @@
561 561 4
562 562 5
563 563 6
564 564 7
565 565 8
566 566 9
567 567 -10.new
568 568 record change 2/2 to 'plain'? [Ynesfdaq?] y
569 569
570 570
571 571 Add to beginning, middle, end
572 572
573 573 $ rm plain
574 574 $ for i in 1 2 3 4 5 5.new 5.reallynew 6 7 8 9 10 11; do
575 575 > echo $i >> plain
576 576 > done
577 577
578 578 Record beginning, middle, and test that format-breaking diffopts are ignored
579 579
580 580 $ hg commit -i --config diff.noprefix=True -d '14 0' -m middle-only plain <<EOF
581 581 > y
582 582 > y
583 583 > y
584 584 > n
585 585 > EOF
586 586 diff --git a/plain b/plain
587 587 3 hunks, 7 lines changed
588 588 examine changes to 'plain'? [Ynesfdaq?] y
589 589
590 590 @@ -1,2 +1,5 @@
591 591 +1
592 592 +2
593 593 +3
594 594 4
595 595 5
596 596 record change 1/3 to 'plain'? [Ynesfdaq?] y
597 597
598 598 @@ -1,6 +4,8 @@
599 599 4
600 600 5
601 601 +5.new
602 602 +5.reallynew
603 603 6
604 604 7
605 605 8
606 606 9
607 607 record change 2/3 to 'plain'? [Ynesfdaq?] y
608 608
609 609 @@ -3,4 +8,6 @@
610 610 6
611 611 7
612 612 8
613 613 9
614 614 +10
615 615 +11
616 616 record change 3/3 to 'plain'? [Ynesfdaq?] n
617 617
618 618
619 619 $ hg tip -p
620 620 changeset: 15:f34a7937ec33
621 621 tag: tip
622 622 user: test
623 623 date: Thu Jan 01 00:00:14 1970 +0000
624 624 summary: middle-only
625 625
626 626 diff -r 82c065d0b850 -r f34a7937ec33 plain
627 627 --- a/plain Thu Jan 01 00:00:13 1970 +0000
628 628 +++ b/plain Thu Jan 01 00:00:14 1970 +0000
629 629 @@ -1,5 +1,10 @@
630 630 +1
631 631 +2
632 632 +3
633 633 4
634 634 5
635 635 +5.new
636 636 +5.reallynew
637 637 6
638 638 7
639 639 8
640 640
641 641
642 642 Record end
643 643
644 644 $ hg commit -i -d '15 0' -m end-only plain <<EOF
645 645 > y
646 646 > y
647 647 > EOF
648 648 diff --git a/plain b/plain
649 649 1 hunks, 2 lines changed
650 650 examine changes to 'plain'? [Ynesfdaq?] y
651 651
652 652 @@ -9,3 +9,5 @@
653 653 7
654 654 8
655 655 9
656 656 +10
657 657 +11
658 658 record this change to 'plain'? [Ynesfdaq?] y
659 659
660 660
661 661 $ hg tip -p
662 662 changeset: 16:f9900b71a04c
663 663 tag: tip
664 664 user: test
665 665 date: Thu Jan 01 00:00:15 1970 +0000
666 666 summary: end-only
667 667
668 668 diff -r f34a7937ec33 -r f9900b71a04c plain
669 669 --- a/plain Thu Jan 01 00:00:14 1970 +0000
670 670 +++ b/plain Thu Jan 01 00:00:15 1970 +0000
671 671 @@ -9,3 +9,5 @@
672 672 7
673 673 8
674 674 9
675 675 +10
676 676 +11
677 677
678 678
679 679 $ mkdir subdir
680 680 $ cd subdir
681 681 $ echo a > a
682 682 $ hg ci -d '16 0' -Amsubdir
683 683 adding subdir/a
684 684
685 685 $ echo a >> a
686 686 $ hg commit -i -d '16 0' -m subdir-change a <<EOF
687 687 > y
688 688 > y
689 689 > EOF
690 690 diff --git a/subdir/a b/subdir/a
691 691 1 hunks, 1 lines changed
692 692 examine changes to 'subdir/a'? [Ynesfdaq?] y
693 693
694 694 @@ -1,1 +1,2 @@
695 695 a
696 696 +a
697 697 record this change to 'subdir/a'? [Ynesfdaq?] y
698 698
699 699
700 700 $ hg tip -p
701 701 changeset: 18:61be427a9deb
702 702 tag: tip
703 703 user: test
704 704 date: Thu Jan 01 00:00:16 1970 +0000
705 705 summary: subdir-change
706 706
707 707 diff -r a7ffae4d61cb -r 61be427a9deb subdir/a
708 708 --- a/subdir/a Thu Jan 01 00:00:16 1970 +0000
709 709 +++ b/subdir/a Thu Jan 01 00:00:16 1970 +0000
710 710 @@ -1,1 +1,2 @@
711 711 a
712 712 +a
713 713
714 714
715 715 $ echo a > f1
716 716 $ echo b > f2
717 717 $ hg add f1 f2
718 718
719 719 $ hg ci -mz -d '17 0'
720 720
721 721 $ echo a >> f1
722 722 $ echo b >> f2
723 723
724 724 Help, quit
725 725
726 726 $ hg commit -i <<EOF
727 727 > ?
728 728 > q
729 729 > EOF
730 730 diff --git a/subdir/f1 b/subdir/f1
731 731 1 hunks, 1 lines changed
732 732 examine changes to 'subdir/f1'? [Ynesfdaq?] ?
733 733
734 734 y - yes, record this change
735 735 n - no, skip this change
736 736 e - edit this change manually
737 737 s - skip remaining changes to this file
738 738 f - record remaining changes to this file
739 739 d - done, skip remaining changes and files
740 740 a - record all changes to all remaining files
741 741 q - quit, recording no changes
742 742 ? - ? (display help)
743 743 examine changes to 'subdir/f1'? [Ynesfdaq?] q
744 744
745 745 abort: user quit
746 746 [255]
747 747
748 748 Skip
749 749
750 750 $ hg commit -i <<EOF
751 751 > s
752 752 > EOF
753 753 diff --git a/subdir/f1 b/subdir/f1
754 754 1 hunks, 1 lines changed
755 755 examine changes to 'subdir/f1'? [Ynesfdaq?] s
756 756
757 757 diff --git a/subdir/f2 b/subdir/f2
758 758 1 hunks, 1 lines changed
759 759 examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
760 760 [255]
761 761
762 762 No
763 763
764 764 $ hg commit -i <<EOF
765 765 > n
766 766 > EOF
767 767 diff --git a/subdir/f1 b/subdir/f1
768 768 1 hunks, 1 lines changed
769 769 examine changes to 'subdir/f1'? [Ynesfdaq?] n
770 770
771 771 diff --git a/subdir/f2 b/subdir/f2
772 772 1 hunks, 1 lines changed
773 773 examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
774 774 [255]
775 775
776 776 f, quit
777 777
778 778 $ hg commit -i <<EOF
779 779 > f
780 780 > q
781 781 > EOF
782 782 diff --git a/subdir/f1 b/subdir/f1
783 783 1 hunks, 1 lines changed
784 784 examine changes to 'subdir/f1'? [Ynesfdaq?] f
785 785
786 786 diff --git a/subdir/f2 b/subdir/f2
787 787 1 hunks, 1 lines changed
788 788 examine changes to 'subdir/f2'? [Ynesfdaq?] q
789 789
790 790 abort: user quit
791 791 [255]
792 792
793 793 s, all
794 794
795 795 $ hg commit -i -d '18 0' -mx <<EOF
796 796 > s
797 797 > a
798 798 > EOF
799 799 diff --git a/subdir/f1 b/subdir/f1
800 800 1 hunks, 1 lines changed
801 801 examine changes to 'subdir/f1'? [Ynesfdaq?] s
802 802
803 803 diff --git a/subdir/f2 b/subdir/f2
804 804 1 hunks, 1 lines changed
805 805 examine changes to 'subdir/f2'? [Ynesfdaq?] a
806 806
807 807
808 808 $ hg tip -p
809 809 changeset: 20:b3df3dda369a
810 810 tag: tip
811 811 user: test
812 812 date: Thu Jan 01 00:00:18 1970 +0000
813 813 summary: x
814 814
815 815 diff -r 6e02d6c9906d -r b3df3dda369a subdir/f2
816 816 --- a/subdir/f2 Thu Jan 01 00:00:17 1970 +0000
817 817 +++ b/subdir/f2 Thu Jan 01 00:00:18 1970 +0000
818 818 @@ -1,1 +1,2 @@
819 819 b
820 820 +b
821 821
822 822
823 823 f
824 824
825 825 $ hg commit -i -d '19 0' -my <<EOF
826 826 > f
827 827 > EOF
828 828 diff --git a/subdir/f1 b/subdir/f1
829 829 1 hunks, 1 lines changed
830 830 examine changes to 'subdir/f1'? [Ynesfdaq?] f
831 831
832 832
833 833 $ hg tip -p
834 834 changeset: 21:38ec577f126b
835 835 tag: tip
836 836 user: test
837 837 date: Thu Jan 01 00:00:19 1970 +0000
838 838 summary: y
839 839
840 840 diff -r b3df3dda369a -r 38ec577f126b subdir/f1
841 841 --- a/subdir/f1 Thu Jan 01 00:00:18 1970 +0000
842 842 +++ b/subdir/f1 Thu Jan 01 00:00:19 1970 +0000
843 843 @@ -1,1 +1,2 @@
844 844 a
845 845 +a
846 846
847 847
848 848 #if execbit
849 849
850 850 Preserve chmod +x
851 851
852 852 $ chmod +x f1
853 853 $ echo a >> f1
854 854 $ hg commit -i -d '20 0' -mz <<EOF
855 855 > y
856 856 > y
857 857 > y
858 858 > EOF
859 859 diff --git a/subdir/f1 b/subdir/f1
860 860 old mode 100644
861 861 new mode 100755
862 862 1 hunks, 1 lines changed
863 863 examine changes to 'subdir/f1'? [Ynesfdaq?] y
864 864
865 865 @@ -1,2 +1,3 @@
866 866 a
867 867 a
868 868 +a
869 869 record this change to 'subdir/f1'? [Ynesfdaq?] y
870 870
871 871
872 872 $ hg tip --config diff.git=True -p
873 873 changeset: 22:3261adceb075
874 874 tag: tip
875 875 user: test
876 876 date: Thu Jan 01 00:00:20 1970 +0000
877 877 summary: z
878 878
879 879 diff --git a/subdir/f1 b/subdir/f1
880 880 old mode 100644
881 881 new mode 100755
882 882 --- a/subdir/f1
883 883 +++ b/subdir/f1
884 884 @@ -1,2 +1,3 @@
885 885 a
886 886 a
887 887 +a
888 888
889 889
890 890 Preserve execute permission on original
891 891
892 892 $ echo b >> f1
893 893 $ hg commit -i -d '21 0' -maa <<EOF
894 894 > y
895 895 > y
896 896 > y
897 897 > EOF
898 898 diff --git a/subdir/f1 b/subdir/f1
899 899 1 hunks, 1 lines changed
900 900 examine changes to 'subdir/f1'? [Ynesfdaq?] y
901 901
902 902 @@ -1,3 +1,4 @@
903 903 a
904 904 a
905 905 a
906 906 +b
907 907 record this change to 'subdir/f1'? [Ynesfdaq?] y
908 908
909 909
910 910 $ hg tip --config diff.git=True -p
911 911 changeset: 23:b429867550db
912 912 tag: tip
913 913 user: test
914 914 date: Thu Jan 01 00:00:21 1970 +0000
915 915 summary: aa
916 916
917 917 diff --git a/subdir/f1 b/subdir/f1
918 918 --- a/subdir/f1
919 919 +++ b/subdir/f1
920 920 @@ -1,3 +1,4 @@
921 921 a
922 922 a
923 923 a
924 924 +b
925 925
926 926
927 927 Preserve chmod -x
928 928
929 929 $ chmod -x f1
930 930 $ echo c >> f1
931 931 $ hg commit -i -d '22 0' -mab <<EOF
932 932 > y
933 933 > y
934 934 > y
935 935 > EOF
936 936 diff --git a/subdir/f1 b/subdir/f1
937 937 old mode 100755
938 938 new mode 100644
939 939 1 hunks, 1 lines changed
940 940 examine changes to 'subdir/f1'? [Ynesfdaq?] y
941 941
942 942 @@ -2,3 +2,4 @@
943 943 a
944 944 a
945 945 b
946 946 +c
947 947 record this change to 'subdir/f1'? [Ynesfdaq?] y
948 948
949 949
950 950 $ hg tip --config diff.git=True -p
951 951 changeset: 24:0b082130c20a
952 952 tag: tip
953 953 user: test
954 954 date: Thu Jan 01 00:00:22 1970 +0000
955 955 summary: ab
956 956
957 957 diff --git a/subdir/f1 b/subdir/f1
958 958 old mode 100755
959 959 new mode 100644
960 960 --- a/subdir/f1
961 961 +++ b/subdir/f1
962 962 @@ -2,3 +2,4 @@
963 963 a
964 964 a
965 965 b
966 966 +c
967 967
968 968
969 969 #else
970 970
971 971 Slightly bogus tests to get almost same repo structure as when x bit is used
972 972 - but with different hashes.
973 973
974 974 Mock "Preserve chmod +x"
975 975
976 976 $ echo a >> f1
977 977 $ hg commit -i -d '20 0' -mz <<EOF
978 978 > y
979 979 > y
980 980 > y
981 981 > EOF
982 982 diff --git a/subdir/f1 b/subdir/f1
983 983 1 hunks, 1 lines changed
984 984 examine changes to 'subdir/f1'? [Ynesfdaq?] y
985 985
986 986 @@ -1,2 +1,3 @@
987 987 a
988 988 a
989 989 +a
990 990 record this change to 'subdir/f1'? [Ynesfdaq?] y
991 991
992 992
993 993 $ hg tip --config diff.git=True -p
994 994 changeset: 22:0d463bd428f5
995 995 tag: tip
996 996 user: test
997 997 date: Thu Jan 01 00:00:20 1970 +0000
998 998 summary: z
999 999
1000 1000 diff --git a/subdir/f1 b/subdir/f1
1001 1001 --- a/subdir/f1
1002 1002 +++ b/subdir/f1
1003 1003 @@ -1,2 +1,3 @@
1004 1004 a
1005 1005 a
1006 1006 +a
1007 1007
1008 1008
1009 1009 Mock "Preserve execute permission on original"
1010 1010
1011 1011 $ echo b >> f1
1012 1012 $ hg commit -i -d '21 0' -maa <<EOF
1013 1013 > y
1014 1014 > y
1015 1015 > y
1016 1016 > EOF
1017 1017 diff --git a/subdir/f1 b/subdir/f1
1018 1018 1 hunks, 1 lines changed
1019 1019 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1020 1020
1021 1021 @@ -1,3 +1,4 @@
1022 1022 a
1023 1023 a
1024 1024 a
1025 1025 +b
1026 1026 record this change to 'subdir/f1'? [Ynesfdaq?] y
1027 1027
1028 1028
1029 1029 $ hg tip --config diff.git=True -p
1030 1030 changeset: 23:0eab41a3e524
1031 1031 tag: tip
1032 1032 user: test
1033 1033 date: Thu Jan 01 00:00:21 1970 +0000
1034 1034 summary: aa
1035 1035
1036 1036 diff --git a/subdir/f1 b/subdir/f1
1037 1037 --- a/subdir/f1
1038 1038 +++ b/subdir/f1
1039 1039 @@ -1,3 +1,4 @@
1040 1040 a
1041 1041 a
1042 1042 a
1043 1043 +b
1044 1044
1045 1045
1046 1046 Mock "Preserve chmod -x"
1047 1047
1048 1048 $ chmod -x f1
1049 1049 $ echo c >> f1
1050 1050 $ hg commit -i -d '22 0' -mab <<EOF
1051 1051 > y
1052 1052 > y
1053 1053 > y
1054 1054 > EOF
1055 1055 diff --git a/subdir/f1 b/subdir/f1
1056 1056 1 hunks, 1 lines changed
1057 1057 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1058 1058
1059 1059 @@ -2,3 +2,4 @@
1060 1060 a
1061 1061 a
1062 1062 b
1063 1063 +c
1064 1064 record this change to 'subdir/f1'? [Ynesfdaq?] y
1065 1065
1066 1066
1067 1067 $ hg tip --config diff.git=True -p
1068 1068 changeset: 24:f4f718f27b7c
1069 1069 tag: tip
1070 1070 user: test
1071 1071 date: Thu Jan 01 00:00:22 1970 +0000
1072 1072 summary: ab
1073 1073
1074 1074 diff --git a/subdir/f1 b/subdir/f1
1075 1075 --- a/subdir/f1
1076 1076 +++ b/subdir/f1
1077 1077 @@ -2,3 +2,4 @@
1078 1078 a
1079 1079 a
1080 1080 b
1081 1081 +c
1082 1082
1083 1083
1084 1084 #endif
1085 1085
1086 1086 $ cd ..
1087 1087
1088 1088
1089 1089 Abort early when a merge is in progress
1090 1090
1091 1091 $ hg up 4
1092 1092 1 files updated, 0 files merged, 6 files removed, 0 files unresolved
1093 1093
1094 1094 $ touch iwillmergethat
1095 1095 $ hg add iwillmergethat
1096 1096
1097 1097 $ hg branch thatbranch
1098 1098 marked working directory as branch thatbranch
1099 1099 (branches are permanent and global, did you want a bookmark?)
1100 1100
1101 1101 $ hg ci -m'new head'
1102 1102
1103 1103 $ hg up default
1104 1104 6 files updated, 0 files merged, 2 files removed, 0 files unresolved
1105 1105
1106 1106 $ hg merge thatbranch
1107 1107 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1108 1108 (branch merge, don't forget to commit)
1109 1109
1110 1110 $ hg commit -i -m'will abort'
1111 1111 abort: cannot partially commit a merge (use "hg commit" instead)
1112 1112 [255]
1113 1113
1114 1114 $ hg up -C
1115 1115 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1116 1116
1117 1117 Editing patch (and ignoring trailing text)
1118 1118
1119 1119 $ cat > editor.sh << '__EOF__'
1120 1120 > sed -e 7d -e '5s/^-/ /' -e '/^# ---/i\
1121 1121 > trailing\nditto' "$1" > tmp
1122 1122 > mv tmp "$1"
1123 1123 > __EOF__
1124 1124 $ cat > editedfile << '__EOF__'
1125 1125 > This is the first line
1126 1126 > This is the second line
1127 1127 > This is the third line
1128 1128 > __EOF__
1129 1129 $ hg add editedfile
1130 1130 $ hg commit -medit-patch-1
1131 1131 $ cat > editedfile << '__EOF__'
1132 1132 > This line has changed
1133 1133 > This change will be committed
1134 1134 > This is the third line
1135 1135 > __EOF__
1136 1136 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-2 <<EOF
1137 1137 > y
1138 1138 > e
1139 1139 > EOF
1140 1140 diff --git a/editedfile b/editedfile
1141 1141 1 hunks, 2 lines changed
1142 1142 examine changes to 'editedfile'? [Ynesfdaq?] y
1143 1143
1144 1144 @@ -1,3 +1,3 @@
1145 1145 -This is the first line
1146 1146 -This is the second line
1147 1147 +This line has changed
1148 1148 +This change will be committed
1149 1149 This is the third line
1150 1150 record this change to 'editedfile'? [Ynesfdaq?] e
1151 1151
1152 1152 $ cat editedfile
1153 1153 This line has changed
1154 1154 This change will be committed
1155 1155 This is the third line
1156 1156 $ hg cat -r tip editedfile
1157 1157 This is the first line
1158 1158 This change will be committed
1159 1159 This is the third line
1160 1160 $ hg revert editedfile
1161 1161
1162 1162 Trying to edit patch for whole file
1163 1163
1164 1164 $ echo "This is the fourth line" >> editedfile
1165 1165 $ hg commit -i <<EOF
1166 1166 > e
1167 1167 > q
1168 1168 > EOF
1169 1169 diff --git a/editedfile b/editedfile
1170 1170 1 hunks, 1 lines changed
1171 1171 examine changes to 'editedfile'? [Ynesfdaq?] e
1172 1172
1173 1173 cannot edit patch for whole file
1174 1174 examine changes to 'editedfile'? [Ynesfdaq?] q
1175 1175
1176 1176 abort: user quit
1177 1177 [255]
1178 1178 $ hg revert editedfile
1179 1179
1180 1180 Removing changes from patch
1181 1181
1182 1182 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1183 1183 $ mv tmp editedfile
1184 1184 $ echo "This line has been added" >> editedfile
1185 1185 $ cat > editor.sh << '__EOF__'
1186 1186 > sed -e 's/^[-+]/ /' "$1" > tmp
1187 1187 > mv tmp "$1"
1188 1188 > __EOF__
1189 1189 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1190 1190 > y
1191 1191 > e
1192 1192 > EOF
1193 1193 diff --git a/editedfile b/editedfile
1194 1194 1 hunks, 3 lines changed
1195 1195 examine changes to 'editedfile'? [Ynesfdaq?] y
1196 1196
1197 1197 @@ -1,3 +1,3 @@
1198 1198 -This is the first line
1199 1199 -This change will be committed
1200 1200 -This is the third line
1201 1201 +This change will not be committed
1202 1202 +This is the second line
1203 1203 +This line has been added
1204 1204 record this change to 'editedfile'? [Ynesfdaq?] e
1205 1205
1206 1206 no changes to record
1207 1207 $ cat editedfile
1208 1208 This change will not be committed
1209 1209 This is the second line
1210 1210 This line has been added
1211 1211 $ hg cat -r tip editedfile
1212 1212 This is the first line
1213 1213 This change will be committed
1214 1214 This is the third line
1215 1215 $ hg revert editedfile
1216 1216
1217 1217 Invalid patch
1218 1218
1219 1219 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1220 1220 $ mv tmp editedfile
1221 1221 $ echo "This line has been added" >> editedfile
1222 1222 $ cat > editor.sh << '__EOF__'
1223 1223 > sed s/This/That/ "$1" > tmp
1224 1224 > mv tmp "$1"
1225 1225 > __EOF__
1226 1226 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1227 1227 > y
1228 1228 > e
1229 1229 > EOF
1230 1230 diff --git a/editedfile b/editedfile
1231 1231 1 hunks, 3 lines changed
1232 1232 examine changes to 'editedfile'? [Ynesfdaq?] y
1233 1233
1234 1234 @@ -1,3 +1,3 @@
1235 1235 -This is the first line
1236 1236 -This change will be committed
1237 1237 -This is the third line
1238 1238 +This change will not be committed
1239 1239 +This is the second line
1240 1240 +This line has been added
1241 1241 record this change to 'editedfile'? [Ynesfdaq?] e
1242 1242
1243 1243 patching file editedfile
1244 1244 Hunk #1 FAILED at 0
1245 1245 1 out of 1 hunks FAILED -- saving rejects to file editedfile.rej
1246 1246 abort: patch failed to apply
1247 1247 [255]
1248 1248 $ cat editedfile
1249 1249 This change will not be committed
1250 1250 This is the second line
1251 1251 This line has been added
1252 1252 $ hg cat -r tip editedfile
1253 1253 This is the first line
1254 1254 This change will be committed
1255 1255 This is the third line
1256 1256 $ cat editedfile.rej
1257 1257 --- editedfile
1258 1258 +++ editedfile
1259 1259 @@ -1,3 +1,3 @@
1260 1260 -That is the first line
1261 1261 -That change will be committed
1262 1262 -That is the third line
1263 1263 +That change will not be committed
1264 1264 +That is the second line
1265 1265 +That line has been added
1266 1266
1267 1267 Malformed patch - error handling
1268 1268
1269 1269 $ cat > editor.sh << '__EOF__'
1270 1270 > sed -e '/^@/p' "$1" > tmp
1271 1271 > mv tmp "$1"
1272 1272 > __EOF__
1273 1273 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1274 1274 > y
1275 1275 > e
1276 1276 > EOF
1277 1277 diff --git a/editedfile b/editedfile
1278 1278 1 hunks, 3 lines changed
1279 1279 examine changes to 'editedfile'? [Ynesfdaq?] y
1280 1280
1281 1281 @@ -1,3 +1,3 @@
1282 1282 -This is the first line
1283 1283 -This change will be committed
1284 1284 -This is the third line
1285 1285 +This change will not be committed
1286 1286 +This is the second line
1287 1287 +This line has been added
1288 1288 record this change to 'editedfile'? [Ynesfdaq?] e
1289 1289
1290 1290 abort: error parsing patch: unhandled transition: range -> range
1291 1291 [255]
1292 1292
1293 1293 random text in random positions is still an error
1294 1294
1295 1295 $ cat > editor.sh << '__EOF__'
1296 1296 > sed -e '/^@/i\
1297 1297 > other' "$1" > tmp
1298 1298 > mv tmp "$1"
1299 1299 > __EOF__
1300 1300 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1301 1301 > y
1302 1302 > e
1303 1303 > EOF
1304 1304 diff --git a/editedfile b/editedfile
1305 1305 1 hunks, 3 lines changed
1306 1306 examine changes to 'editedfile'? [Ynesfdaq?] y
1307 1307
1308 1308 @@ -1,3 +1,3 @@
1309 1309 -This is the first line
1310 1310 -This change will be committed
1311 1311 -This is the third line
1312 1312 +This change will not be committed
1313 1313 +This is the second line
1314 1314 +This line has been added
1315 1315 record this change to 'editedfile'? [Ynesfdaq?] e
1316 1316
1317 1317 abort: error parsing patch: unhandled transition: file -> other
1318 1318 [255]
1319 1319
1320 1320 $ hg up -C
1321 1321 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1322 1322
1323 1323 With win32text
1324 1324
1325 1325 $ echo '[extensions]' >> .hg/hgrc
1326 1326 $ echo 'win32text = ' >> .hg/hgrc
1327 1327 $ echo '[decode]' >> .hg/hgrc
1328 1328 $ echo '** = cleverdecode:' >> .hg/hgrc
1329 1329 $ echo '[encode]' >> .hg/hgrc
1330 1330 $ echo '** = cleverencode:' >> .hg/hgrc
1331 1331 $ echo '[patch]' >> .hg/hgrc
1332 1332 $ echo 'eol = crlf' >> .hg/hgrc
1333 1333
1334 1334 Ignore win32text deprecation warning for now:
1335 1335
1336 1336 $ echo '[win32text]' >> .hg/hgrc
1337 1337 $ echo 'warn = no' >> .hg/hgrc
1338 1338
1339 1339 $ echo d >> subdir/f1
1340 1340 $ hg commit -i -d '24 0' -mw1 <<EOF
1341 1341 > y
1342 1342 > y
1343 1343 > EOF
1344 1344 diff --git a/subdir/f1 b/subdir/f1
1345 1345 1 hunks, 1 lines changed
1346 1346 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1347 1347
1348 1348 @@ -3,3 +3,4 @@
1349 1349 a
1350 1350 b
1351 1351 c
1352 1352 +d
1353 1353 record this change to 'subdir/f1'? [Ynesfdaq?] y
1354 1354
1355 1355
1356 1356 $ hg tip -p
1357 1357 changeset: 28:* (glob)
1358 1358 tag: tip
1359 1359 user: test
1360 1360 date: Thu Jan 01 00:00:24 1970 +0000
1361 1361 summary: w1
1362 1362
1363 1363 diff -r ???????????? -r ???????????? subdir/f1 (glob)
1364 1364 --- a/subdir/f1 Thu Jan 01 00:00:23 1970 +0000
1365 1365 +++ b/subdir/f1 Thu Jan 01 00:00:24 1970 +0000
1366 1366 @@ -3,3 +3,4 @@
1367 1367 a
1368 1368 b
1369 1369 c
1370 1370 +d
1371 1371
1372 1372
1373 1373
1374 1374 Test --user when ui.username not set
1375 1375 $ unset HGUSER
1376 1376 $ echo e >> subdir/f1
1377 1377 $ hg commit -i --config ui.username= -d '8 0' --user xyz -m "user flag" <<EOF
1378 1378 > y
1379 1379 > y
1380 1380 > EOF
1381 1381 diff --git a/subdir/f1 b/subdir/f1
1382 1382 1 hunks, 1 lines changed
1383 1383 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1384 1384
1385 1385 @@ -4,3 +4,4 @@
1386 1386 b
1387 1387 c
1388 1388 d
1389 1389 +e
1390 1390 record this change to 'subdir/f1'? [Ynesfdaq?] y
1391 1391
1392 1392 $ hg log --template '{author}\n' -l 1
1393 1393 xyz
1394 1394 $ HGUSER="test"
1395 1395 $ export HGUSER
1396 1396
1397 1397
1398 1398 Moving files
1399 1399
1400 1400 $ hg update -C .
1401 1401 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1402 1402 $ hg mv plain plain3
1403 1403 $ echo somechange >> plain3
1404 1404 $ hg commit -i -d '23 0' -mmoving_files << EOF
1405 1405 > y
1406 1406 > y
1407 1407 > EOF
1408 1408 diff --git a/plain b/plain3
1409 1409 rename from plain
1410 1410 rename to plain3
1411 1411 1 hunks, 1 lines changed
1412 1412 examine changes to 'plain' and 'plain3'? [Ynesfdaq?] y
1413 1413
1414 1414 @@ -11,3 +11,4 @@
1415 1415 9
1416 1416 10
1417 1417 11
1418 1418 +somechange
1419 1419 record this change to 'plain3'? [Ynesfdaq?] y
1420 1420
1421 1421 The #if execbit block above changes the hash here on some systems
1422 1422 $ hg tip
1423 1423 changeset: 30:* (glob)
1424 1424 tag: tip
1425 1425 user: test
1426 1426 date: Thu Jan 01 00:00:23 1970 +0000
1427 1427 summary: moving_files
1428 1428
1429 1429 Editing patch of newly added file
1430 1430
1431 1431 $ hg update -C .
1432 1432 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1433 1433 $ cat > editor.sh << '__EOF__'
1434 1434 > cat "$1" | sed "s/first/very/g" > tt
1435 1435 > mv tt "$1"
1436 1436 > __EOF__
1437 1437 $ cat > newfile << '__EOF__'
1438 1438 > This is the first line
1439 1439 > This is the second line
1440 1440 > This is the third line
1441 1441 > __EOF__
1442 1442 $ hg add newfile
1443 1443 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-new <<EOF
1444 1444 > y
1445 1445 > e
1446 1446 > EOF
1447 1447 diff --git a/newfile b/newfile
1448 1448 new file mode 100644
1449 1449 examine changes to 'newfile'? [Ynesfdaq?] y
1450 1450
1451 1451 @@ -0,0 +1,3 @@
1452 1452 +This is the first line
1453 1453 +This is the second line
1454 1454 +This is the third line
1455 1455 record this change to 'newfile'? [Ynesfdaq?] e
1456 1456
1457 1457 $ hg cat -r tip newfile
1458 1458 This is the very line
1459 1459 This is the second line
1460 1460 This is the third line
1461 1461
1462 1462 $ cat newfile
1463 1463 This is the first line
1464 1464 This is the second line
1465 1465 This is the third line
1466 1466
1467 1467 Add new file from within a subdirectory
1468 1468 $ hg update -C .
1469 1469 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1470 1470 $ mkdir folder
1471 1471 $ cd folder
1472 1472 $ echo "foo" > bar
1473 1473 $ hg add bar
1474 1474 $ hg commit -i -d '23 0' -mnewfilesubdir <<EOF
1475 1475 > y
1476 1476 > y
1477 1477 > EOF
1478 1478 diff --git a/folder/bar b/folder/bar
1479 1479 new file mode 100644
1480 1480 examine changes to 'folder/bar'? [Ynesfdaq?] y
1481 1481
1482 1482 @@ -0,0 +1,1 @@
1483 1483 +foo
1484 1484 record this change to 'folder/bar'? [Ynesfdaq?] y
1485 1485
1486 The #if execbit block above changes the hashes here on some systems
1486 1487 $ hg tip -p
1487 changeset: 32:fb46c2a66466
1488 changeset: 32:* (glob)
1488 1489 tag: tip
1489 1490 user: test
1490 1491 date: Thu Jan 01 00:00:23 1970 +0000
1491 1492 summary: newfilesubdir
1492 1493
1493 diff -r 34c65441ddfb -r fb46c2a66466 folder/bar
1494 diff -r * -r * folder/bar (glob)
1494 1495 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1495 1496 +++ b/folder/bar Thu Jan 01 00:00:23 1970 +0000
1496 1497 @@ -0,0 +1,1 @@
1497 1498 +foo
1498 1499
1499 1500 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now