comparison tests/test-histedit-fold.t @ 26246:bf81b696b8f4

histedit: use one editor when multiple folds happen in a row (issue3524) (BC) This was the first ever feature request for histedit, originally filed back on April 4, 2009. Finally fixed. In the future we'll probably want to make it possible for other preprocessing steps to be added to the list, but for now we're skipping that because it's unclear what the API should look like without a proposed consumer.
author Augie Fackler <augie@google.com>
date Thu, 27 Aug 2015 14:46:26 -0400
parents ba8089433090
children ef1eb6df7071
comparison
equal deleted inserted replaced
26245:d53212d70893 26246:bf81b696b8f4
507 507
508 $ echo "foo" > amended.txt 508 $ echo "foo" > amended.txt
509 $ hg add amended.txt 509 $ hg add amended.txt
510 $ hg ci -q --config extensions.largefiles= --amend -I amended.txt 510 $ hg ci -q --config extensions.largefiles= --amend -I amended.txt
511 511
512 Test that folding multiple changes in a row doesn't show multiple
513 editors.
514
515 $ echo foo >> foo
516 $ hg add foo
517 $ hg ci -m foo1
518 $ echo foo >> foo
519 $ hg ci -m foo2
520 $ echo foo >> foo
521 $ hg ci -m foo3
522 $ hg logt
523 4:21679ff7675c foo3
524 3:b7389cc4d66e foo2
525 2:0e01aeef5fa8 foo1
526 1:578c7455730c a
527 0:79b99e9c8e49 b
528 $ cat > $TESTTMP/editor.sh <<EOF
529 > echo ran editor >> $TESTTMP/editorlog.txt
530 > cat \$1 >> $TESTTMP/editorlog.txt
531 > echo END >> $TESTTMP/editorlog.txt
532 > echo merged foos > \$1
533 > EOF
534 $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit 1 --commands - 2>&1 <<EOF | fixbundle
535 > pick 578c7455730c 1 a
536 > pick 0e01aeef5fa8 2 foo1
537 > fold b7389cc4d66e 3 foo2
538 > fold 21679ff7675c 4 foo3
539 > EOF
540 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
541 reverting foo
542 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
543 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
544 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
545 merging foo
546 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
547 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
548 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
549 $ hg logt
550 2:e8bedbda72c1 merged foos
551 1:578c7455730c a
552 0:79b99e9c8e49 b
553 Editor should have run only once
554 $ cat $TESTTMP/editorlog.txt
555 ran editor
556 foo1
557 ***
558 foo2
559 ***
560 foo3
561
562
563
564 HG: Enter commit message. Lines beginning with 'HG:' are removed.
565 HG: Leave message empty to abort commit.
566 HG: --
567 HG: user: test
568 HG: branch 'default'
569 HG: added foo
570 END
571
512 $ cd .. 572 $ cd ..