tests/test-histedit-fold-non-commute
changeset 17090 e64d416b6b94
parent 17076 75f4180509a4
parent 17089 0c1d10351869
child 17091 f7a2849ef8cd
equal deleted inserted replaced
17076:75f4180509a4 17090:e64d416b6b94
     1 #!/bin/sh
       
     2 
       
     3 . "$TESTDIR/histedit-helpers.sh"
       
     4 
       
     5 cat >> $HGRCPATH <<EOF
       
     6 [extensions]
       
     7 graphlog=
       
     8 histedit=
       
     9 EOF
       
    10 
       
    11 EDITED=`pwd`/editedhistory
       
    12 cat > $EDITED <<EOF
       
    13 pick 177f92b77385 c
       
    14 pick 055a42cdd887 d
       
    15 fold bfa474341cc9 does not commute with e
       
    16 pick e860deea161a e
       
    17 pick 652413bf663e f
       
    18 EOF
       
    19 initrepo ()
       
    20 {
       
    21     hg init r
       
    22     cd r
       
    23     for x in a b c d e f ; do
       
    24         echo $x > $x
       
    25         hg add $x
       
    26         hg ci -m $x
       
    27     done
       
    28     echo a >> e
       
    29     hg ci -m 'does not commute with e'
       
    30 }
       
    31 
       
    32 initrepo
       
    33 
       
    34 echo % log before edit
       
    35 hg log --graph
       
    36 
       
    37 echo % edit the history
       
    38 HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
       
    39 
       
    40 echo % fix up
       
    41 echo a > e
       
    42 hg add e
       
    43 cat > cat.py <<EOF
       
    44 import sys
       
    45 print open(sys.argv[1]).read()
       
    46 print
       
    47 print
       
    48 EOF
       
    49 HGEDITOR="python cat.py" hg histedit --continue 2>&1 | fixbundle | grep -v '2 files removed'
       
    50 
       
    51 echo
       
    52 echo % just continue this time
       
    53 hg histedit --continue 2>&1 | fixbundle
       
    54 
       
    55 
       
    56 echo % log after edit
       
    57 hg log --graph
       
    58 
       
    59 echo % contents of e
       
    60 hg cat e
       
    61 
       
    62 echo % manifest
       
    63 hg manifest
       
    64 
       
    65 echo % EOF