Mercurial > hg
comparison tests/test-commit-interactive.t @ 27412:14b184263846
record: fix hunk handling to remember the current function
author | timeless <timeless@mozdev.org> |
---|---|
date | Thu, 17 Dec 2015 20:13:29 +0000 |
parents | c84a07530040 |
children | baa9810ee3ec |
comparison
equal
deleted
inserted
replaced
27411:c84a07530040 | 27412:14b184263846 |
---|---|
325 +7264f99c5f5ff3261504828afa4fb4d406c3af54 | 325 +7264f99c5f5ff3261504828afa4fb4d406c3af54 |
326 \ No newline at end of file | 326 \ No newline at end of file |
327 record this change to 'plain'? [Ynesfdaq?] y | 327 record this change to 'plain'? [Ynesfdaq?] y |
328 | 328 |
329 | 329 |
330 Record showfunc should preserve function across sections | |
331 | |
332 $ cat > f1.py <<EOF | |
333 > def annotate(ui, repo, *pats, **opts): | |
334 > """show changeset information by line for each file | |
335 > | |
336 > List changes in files, showing the revision id responsible for | |
337 > each line. | |
338 > | |
339 > This command is useful for discovering when a change was made and | |
340 > by whom. | |
341 > | |
342 > If you include -f/-u/-d, the revision number is suppressed unless | |
343 > you also include -the revision number is suppressed unless | |
344 > you also include -n. | |
345 > | |
346 > Without the -a/--text option, annotate will avoid processing files | |
347 > it detects as binary. With -a, annotate will annotate the file | |
348 > anyway, although the results will probably be neither useful | |
349 > nor desirable. | |
350 > | |
351 > Returns 0 on success. | |
352 > """ | |
353 > return 0 | |
354 > def archive(ui, repo, dest, **opts): | |
355 > '''create an unversioned archive of a repository revision | |
356 > | |
357 > By default, the revision used is the parent of the working | |
358 > directory; use -r/--rev to specify a different revision. | |
359 > | |
360 > The archive type is automatically detected based on file | |
361 > extension (to override, use -t/--type). | |
362 > | |
363 > .. container:: verbose | |
364 > | |
365 > Valid types are: | |
366 > EOF | |
367 $ hg add f1.py | |
368 $ hg commit -m funcs | |
369 $ cat > f1.py <<EOF | |
370 > def annotate(ui, repo, *pats, **opts): | |
371 > """show changeset information by line for each file | |
372 > | |
373 > List changes in files, showing the revision id responsible for | |
374 > each line | |
375 > | |
376 > This command is useful for discovering when a change was made and | |
377 > by whom. | |
378 > | |
379 > Without the -a/--text option, annotate will avoid processing files | |
380 > it detects as binary. With -a, annotate will annotate the file | |
381 > anyway, although the results will probably be neither useful | |
382 > nor desirable. | |
383 > | |
384 > Returns 0 on success. | |
385 > """ | |
386 > return 0 | |
387 > def archive(ui, repo, dest, **opts): | |
388 > '''create an unversioned archive of a repository revision | |
389 > | |
390 > By default, the revision used is the parent of the working | |
391 > directory; use -r/--rev to specify a different revision. | |
392 > | |
393 > The archive type is automatically detected based on file | |
394 > extension (or override using -t/--type). | |
395 > | |
396 > .. container:: verbose | |
397 > | |
398 > Valid types are: | |
399 > EOF | |
400 $ hg commit -i -m interactive <<EOF | |
401 > y | |
402 > y | |
403 > y | |
404 > y | |
405 > EOF | |
406 diff --git a/f1.py b/f1.py | |
407 3 hunks, 6 lines changed | |
408 examine changes to 'f1.py'? [Ynesfdaq?] y | |
409 | |
410 @@ -2,8 +2,8 @@ def annotate(ui, repo, *pats, **opts): | |
411 """show changeset information by line for each file | |
412 | |
413 List changes in files, showing the revision id responsible for | |
414 - each line. | |
415 + each line | |
416 | |
417 This command is useful for discovering when a change was made and | |
418 by whom. | |
419 | |
420 record change 1/3 to 'f1.py'? [Ynesfdaq?] y | |
421 | |
422 @@ -6,11 +6,7 @@ def annotate(ui, repo, *pats, **opts): | |
423 | |
424 This command is useful for discovering when a change was made and | |
425 by whom. | |
426 | |
427 - If you include -f/-u/-d, the revision number is suppressed unless | |
428 - you also include -the revision number is suppressed unless | |
429 - you also include -n. | |
430 - | |
431 Without the -a/--text option, annotate will avoid processing files | |
432 it detects as binary. With -a, annotate will annotate the file | |
433 anyway, although the results will probably be neither useful | |
434 record change 2/3 to 'f1.py'? [Ynesfdaq?] y | |
435 | |
436 @@ -26,7 +22,7 @@ def archive(ui, repo, dest, **opts): | |
437 directory; use -r/--rev to specify a different revision. | |
438 | |
439 The archive type is automatically detected based on file | |
440 - extension (to override, use -t/--type). | |
441 + extension (or override using -t/--type). | |
442 | |
443 .. container:: verbose | |
444 | |
445 record change 3/3 to 'f1.py'? [Ynesfdaq?] y | |
446 | |
447 | |
330 Modify end of plain file, add EOL | 448 Modify end of plain file, add EOL |
331 | 449 |
332 $ echo >> plain | 450 $ echo >> plain |
333 $ echo 1 > plain2 | 451 $ echo 1 > plain2 |
334 $ hg add plain2 | 452 $ hg add plain2 |
404 +2 | 522 +2 |
405 record change 3/3 to 'plain2'? [Ynesfdaq?] y | 523 record change 3/3 to 'plain2'? [Ynesfdaq?] y |
406 | 524 |
407 | 525 |
408 $ hg tip -p | 526 $ hg tip -p |
409 changeset: 11:21df83db12b8 | 527 changeset: 13:f941910cff62 |
410 tag: tip | 528 tag: tip |
411 user: test | 529 user: test |
412 date: Thu Jan 01 00:00:10 1970 +0000 | 530 date: Thu Jan 01 00:00:10 1970 +0000 |
413 summary: begin-and-end | 531 summary: begin-and-end |
414 | 532 |
415 diff -r ddb8b281c3ff -r 21df83db12b8 plain | 533 diff -r 33abe24d946c -r f941910cff62 plain |
416 --- a/plain Thu Jan 01 00:00:10 1970 +0000 | 534 --- a/plain Thu Jan 01 00:00:10 1970 +0000 |
417 +++ b/plain Thu Jan 01 00:00:10 1970 +0000 | 535 +++ b/plain Thu Jan 01 00:00:10 1970 +0000 |
418 @@ -1,4 +1,4 @@ | 536 @@ -1,4 +1,4 @@ |
419 -1 | 537 -1 |
420 +2 | 538 +2 |
425 8 | 543 8 |
426 9 | 544 9 |
427 10 | 545 10 |
428 -11 | 546 -11 |
429 -7264f99c5f5ff3261504828afa4fb4d406c3af54 | 547 -7264f99c5f5ff3261504828afa4fb4d406c3af54 |
430 diff -r ddb8b281c3ff -r 21df83db12b8 plain2 | 548 diff -r 33abe24d946c -r f941910cff62 plain2 |
431 --- a/plain2 Thu Jan 01 00:00:10 1970 +0000 | 549 --- a/plain2 Thu Jan 01 00:00:10 1970 +0000 |
432 +++ b/plain2 Thu Jan 01 00:00:10 1970 +0000 | 550 +++ b/plain2 Thu Jan 01 00:00:10 1970 +0000 |
433 @@ -1,1 +1,2 @@ | 551 @@ -1,1 +1,2 @@ |
434 1 | 552 1 |
435 +2 | 553 +2 |
476 +10.new | 594 +10.new |
477 record change 2/2 to 'plain'? [Ynesfdaq?] y | 595 record change 2/2 to 'plain'? [Ynesfdaq?] y |
478 | 596 |
479 | 597 |
480 $ hg tip -p | 598 $ hg tip -p |
481 changeset: 12:99337501826f | 599 changeset: 14:4915f538659b |
482 tag: tip | 600 tag: tip |
483 user: test | 601 user: test |
484 date: Thu Jan 01 00:00:11 1970 +0000 | 602 date: Thu Jan 01 00:00:11 1970 +0000 |
485 summary: end-only | 603 summary: end-only |
486 | 604 |
487 diff -r 21df83db12b8 -r 99337501826f plain | 605 diff -r f941910cff62 -r 4915f538659b plain |
488 --- a/plain Thu Jan 01 00:00:10 1970 +0000 | 606 --- a/plain Thu Jan 01 00:00:10 1970 +0000 |
489 +++ b/plain Thu Jan 01 00:00:11 1970 +0000 | 607 +++ b/plain Thu Jan 01 00:00:11 1970 +0000 |
490 @@ -7,4 +7,4 @@ | 608 @@ -7,4 +7,4 @@ |
491 7 | 609 7 |
492 8 | 610 8 |
514 6 | 632 6 |
515 record this change to 'plain'? [Ynesfdaq?] y | 633 record this change to 'plain'? [Ynesfdaq?] y |
516 | 634 |
517 | 635 |
518 $ hg tip -p | 636 $ hg tip -p |
519 changeset: 13:bbd45465d540 | 637 changeset: 15:1b1f93d4b94b |
520 tag: tip | 638 tag: tip |
521 user: test | 639 user: test |
522 date: Thu Jan 01 00:00:12 1970 +0000 | 640 date: Thu Jan 01 00:00:12 1970 +0000 |
523 summary: begin-only | 641 summary: begin-only |
524 | 642 |
525 diff -r 99337501826f -r bbd45465d540 plain | 643 diff -r 4915f538659b -r 1b1f93d4b94b plain |
526 --- a/plain Thu Jan 01 00:00:11 1970 +0000 | 644 --- a/plain Thu Jan 01 00:00:11 1970 +0000 |
527 +++ b/plain Thu Jan 01 00:00:12 1970 +0000 | 645 +++ b/plain Thu Jan 01 00:00:12 1970 +0000 |
528 @@ -1,6 +1,3 @@ | 646 @@ -1,6 +1,3 @@ |
529 -2 | 647 -2 |
530 -2 | 648 -2 |
622 +11 | 740 +11 |
623 record change 3/3 to 'plain'? [Ynesfdaq?] n | 741 record change 3/3 to 'plain'? [Ynesfdaq?] n |
624 | 742 |
625 | 743 |
626 $ hg tip -p | 744 $ hg tip -p |
627 changeset: 15:f34a7937ec33 | 745 changeset: 17:41cf3f5c55ae |
628 tag: tip | 746 tag: tip |
629 user: test | 747 user: test |
630 date: Thu Jan 01 00:00:14 1970 +0000 | 748 date: Thu Jan 01 00:00:14 1970 +0000 |
631 summary: middle-only | 749 summary: middle-only |
632 | 750 |
633 diff -r 82c065d0b850 -r f34a7937ec33 plain | 751 diff -r a69d252246e1 -r 41cf3f5c55ae plain |
634 --- a/plain Thu Jan 01 00:00:13 1970 +0000 | 752 --- a/plain Thu Jan 01 00:00:13 1970 +0000 |
635 +++ b/plain Thu Jan 01 00:00:14 1970 +0000 | 753 +++ b/plain Thu Jan 01 00:00:14 1970 +0000 |
636 @@ -1,5 +1,10 @@ | 754 @@ -1,5 +1,10 @@ |
637 +1 | 755 +1 |
638 +2 | 756 +2 |
664 +11 | 782 +11 |
665 record this change to 'plain'? [Ynesfdaq?] y | 783 record this change to 'plain'? [Ynesfdaq?] y |
666 | 784 |
667 | 785 |
668 $ hg tip -p | 786 $ hg tip -p |
669 changeset: 16:f9900b71a04c | 787 changeset: 18:58a72f46bc24 |
670 tag: tip | 788 tag: tip |
671 user: test | 789 user: test |
672 date: Thu Jan 01 00:00:15 1970 +0000 | 790 date: Thu Jan 01 00:00:15 1970 +0000 |
673 summary: end-only | 791 summary: end-only |
674 | 792 |
675 diff -r f34a7937ec33 -r f9900b71a04c plain | 793 diff -r 41cf3f5c55ae -r 58a72f46bc24 plain |
676 --- a/plain Thu Jan 01 00:00:14 1970 +0000 | 794 --- a/plain Thu Jan 01 00:00:14 1970 +0000 |
677 +++ b/plain Thu Jan 01 00:00:15 1970 +0000 | 795 +++ b/plain Thu Jan 01 00:00:15 1970 +0000 |
678 @@ -9,3 +9,5 @@ | 796 @@ -9,3 +9,5 @@ |
679 7 | 797 7 |
680 8 | 798 8 |
703 +a | 821 +a |
704 record this change to 'subdir/a'? [Ynesfdaq?] y | 822 record this change to 'subdir/a'? [Ynesfdaq?] y |
705 | 823 |
706 | 824 |
707 $ hg tip -p | 825 $ hg tip -p |
708 changeset: 18:61be427a9deb | 826 changeset: 20:e0f6b99f6c49 |
709 tag: tip | 827 tag: tip |
710 user: test | 828 user: test |
711 date: Thu Jan 01 00:00:16 1970 +0000 | 829 date: Thu Jan 01 00:00:16 1970 +0000 |
712 summary: subdir-change | 830 summary: subdir-change |
713 | 831 |
714 diff -r a7ffae4d61cb -r 61be427a9deb subdir/a | 832 diff -r abd26b51de37 -r e0f6b99f6c49 subdir/a |
715 --- a/subdir/a Thu Jan 01 00:00:16 1970 +0000 | 833 --- a/subdir/a Thu Jan 01 00:00:16 1970 +0000 |
716 +++ b/subdir/a Thu Jan 01 00:00:16 1970 +0000 | 834 +++ b/subdir/a Thu Jan 01 00:00:16 1970 +0000 |
717 @@ -1,1 +1,2 @@ | 835 @@ -1,1 +1,2 @@ |
718 a | 836 a |
719 +a | 837 +a |
811 1 hunks, 1 lines changed | 929 1 hunks, 1 lines changed |
812 examine changes to 'subdir/f2'? [Ynesfdaq?] a | 930 examine changes to 'subdir/f2'? [Ynesfdaq?] a |
813 | 931 |
814 | 932 |
815 $ hg tip -p | 933 $ hg tip -p |
816 changeset: 20:b3df3dda369a | 934 changeset: 22:6afbbefacf35 |
817 tag: tip | 935 tag: tip |
818 user: test | 936 user: test |
819 date: Thu Jan 01 00:00:18 1970 +0000 | 937 date: Thu Jan 01 00:00:18 1970 +0000 |
820 summary: x | 938 summary: x |
821 | 939 |
822 diff -r 6e02d6c9906d -r b3df3dda369a subdir/f2 | 940 diff -r b73c401c693c -r 6afbbefacf35 subdir/f2 |
823 --- a/subdir/f2 Thu Jan 01 00:00:17 1970 +0000 | 941 --- a/subdir/f2 Thu Jan 01 00:00:17 1970 +0000 |
824 +++ b/subdir/f2 Thu Jan 01 00:00:18 1970 +0000 | 942 +++ b/subdir/f2 Thu Jan 01 00:00:18 1970 +0000 |
825 @@ -1,1 +1,2 @@ | 943 @@ -1,1 +1,2 @@ |
826 b | 944 b |
827 +b | 945 +b |
836 1 hunks, 1 lines changed | 954 1 hunks, 1 lines changed |
837 examine changes to 'subdir/f1'? [Ynesfdaq?] f | 955 examine changes to 'subdir/f1'? [Ynesfdaq?] f |
838 | 956 |
839 | 957 |
840 $ hg tip -p | 958 $ hg tip -p |
841 changeset: 21:38ec577f126b | 959 changeset: 23:715028a33949 |
842 tag: tip | 960 tag: tip |
843 user: test | 961 user: test |
844 date: Thu Jan 01 00:00:19 1970 +0000 | 962 date: Thu Jan 01 00:00:19 1970 +0000 |
845 summary: y | 963 summary: y |
846 | 964 |
847 diff -r b3df3dda369a -r 38ec577f126b subdir/f1 | 965 diff -r 6afbbefacf35 -r 715028a33949 subdir/f1 |
848 --- a/subdir/f1 Thu Jan 01 00:00:18 1970 +0000 | 966 --- a/subdir/f1 Thu Jan 01 00:00:18 1970 +0000 |
849 +++ b/subdir/f1 Thu Jan 01 00:00:19 1970 +0000 | 967 +++ b/subdir/f1 Thu Jan 01 00:00:19 1970 +0000 |
850 @@ -1,1 +1,2 @@ | 968 @@ -1,1 +1,2 @@ |
851 a | 969 a |
852 +a | 970 +a |
875 +a | 993 +a |
876 record this change to 'subdir/f1'? [Ynesfdaq?] y | 994 record this change to 'subdir/f1'? [Ynesfdaq?] y |
877 | 995 |
878 | 996 |
879 $ hg tip --config diff.git=True -p | 997 $ hg tip --config diff.git=True -p |
880 changeset: 22:3261adceb075 | 998 changeset: 24:db967c1e5884 |
881 tag: tip | 999 tag: tip |
882 user: test | 1000 user: test |
883 date: Thu Jan 01 00:00:20 1970 +0000 | 1001 date: Thu Jan 01 00:00:20 1970 +0000 |
884 summary: z | 1002 summary: z |
885 | 1003 |
913 +b | 1031 +b |
914 record this change to 'subdir/f1'? [Ynesfdaq?] y | 1032 record this change to 'subdir/f1'? [Ynesfdaq?] y |
915 | 1033 |
916 | 1034 |
917 $ hg tip --config diff.git=True -p | 1035 $ hg tip --config diff.git=True -p |
918 changeset: 23:b429867550db | 1036 changeset: 25:88903aef81c3 |
919 tag: tip | 1037 tag: tip |
920 user: test | 1038 user: test |
921 date: Thu Jan 01 00:00:21 1970 +0000 | 1039 date: Thu Jan 01 00:00:21 1970 +0000 |
922 summary: aa | 1040 summary: aa |
923 | 1041 |
953 +c | 1071 +c |
954 record this change to 'subdir/f1'? [Ynesfdaq?] y | 1072 record this change to 'subdir/f1'? [Ynesfdaq?] y |
955 | 1073 |
956 | 1074 |
957 $ hg tip --config diff.git=True -p | 1075 $ hg tip --config diff.git=True -p |
958 changeset: 24:0b082130c20a | 1076 changeset: 26:7af84b6cf560 |
959 tag: tip | 1077 tag: tip |
960 user: test | 1078 user: test |
961 date: Thu Jan 01 00:00:22 1970 +0000 | 1079 date: Thu Jan 01 00:00:22 1970 +0000 |
962 summary: ab | 1080 summary: ab |
963 | 1081 |
1094 | 1212 |
1095 | 1213 |
1096 Abort early when a merge is in progress | 1214 Abort early when a merge is in progress |
1097 | 1215 |
1098 $ hg up 4 | 1216 $ hg up 4 |
1099 1 files updated, 0 files merged, 6 files removed, 0 files unresolved | 1217 1 files updated, 0 files merged, 7 files removed, 0 files unresolved |
1100 | 1218 |
1101 $ touch iwillmergethat | 1219 $ touch iwillmergethat |
1102 $ hg add iwillmergethat | 1220 $ hg add iwillmergethat |
1103 | 1221 |
1104 $ hg branch thatbranch | 1222 $ hg branch thatbranch |
1106 (branches are permanent and global, did you want a bookmark?) | 1224 (branches are permanent and global, did you want a bookmark?) |
1107 | 1225 |
1108 $ hg ci -m'new head' | 1226 $ hg ci -m'new head' |
1109 | 1227 |
1110 $ hg up default | 1228 $ hg up default |
1111 6 files updated, 0 files merged, 2 files removed, 0 files unresolved | 1229 7 files updated, 0 files merged, 2 files removed, 0 files unresolved |
1112 | 1230 |
1113 $ hg merge thatbranch | 1231 $ hg merge thatbranch |
1114 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1232 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
1115 (branch merge, don't forget to commit) | 1233 (branch merge, don't forget to commit) |
1116 | 1234 |
1388 | 1506 |
1389 | 1507 |
1390 $ hg status -A subdir/f1 | 1508 $ hg status -A subdir/f1 |
1391 C subdir/f1 | 1509 C subdir/f1 |
1392 $ hg tip -p | 1510 $ hg tip -p |
1393 changeset: 28:* (glob) | 1511 changeset: 30:* (glob) |
1394 tag: tip | 1512 tag: tip |
1395 user: test | 1513 user: test |
1396 date: Thu Jan 01 00:00:24 1970 +0000 | 1514 date: Thu Jan 01 00:00:24 1970 +0000 |
1397 summary: w1 | 1515 summary: w1 |
1398 | 1516 |
1458 | 1576 |
1459 The #if execbit block above changes the hash here on some systems | 1577 The #if execbit block above changes the hash here on some systems |
1460 $ hg status -A plain3 | 1578 $ hg status -A plain3 |
1461 C plain3 | 1579 C plain3 |
1462 $ hg tip | 1580 $ hg tip |
1463 changeset: 30:* (glob) | 1581 changeset: 32:* (glob) |
1464 tag: tip | 1582 tag: tip |
1465 user: test | 1583 user: test |
1466 date: Thu Jan 01 00:00:23 1970 +0000 | 1584 date: Thu Jan 01 00:00:23 1970 +0000 |
1467 summary: moving_files | 1585 summary: moving_files |
1468 | 1586 |
1523 +foo | 1641 +foo |
1524 record this change to 'folder/bar'? [Ynesfdaq?] y | 1642 record this change to 'folder/bar'? [Ynesfdaq?] y |
1525 | 1643 |
1526 The #if execbit block above changes the hashes here on some systems | 1644 The #if execbit block above changes the hashes here on some systems |
1527 $ hg tip -p | 1645 $ hg tip -p |
1528 changeset: 32:* (glob) | 1646 changeset: 34:* (glob) |
1529 tag: tip | 1647 tag: tip |
1530 user: test | 1648 user: test |
1531 date: Thu Jan 01 00:00:23 1970 +0000 | 1649 date: Thu Jan 01 00:00:23 1970 +0000 |
1532 summary: newfilesubdir | 1650 summary: newfilesubdir |
1533 | 1651 |