tests/test-histedit-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 pick 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 % abort the edit
       
    41 hg histedit --abort 2>&1 | fixbundle
       
    42 
       
    43 echo
       
    44 echo
       
    45 echo % second edit set
       
    46 
       
    47 hg log --graph
       
    48 
       
    49 echo % edit the history
       
    50 HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
       
    51 
       
    52 echo % fix up
       
    53 echo a > e
       
    54 hg add e
       
    55 hg histedit --continue 2>&1 | fixbundle
       
    56 
       
    57 echo
       
    58 echo % just continue this time
       
    59 hg histedit --continue 2>&1 | fixbundle
       
    60 
       
    61 echo % log after edit
       
    62 hg log --graph
       
    63 
       
    64 echo % start over
       
    65 
       
    66 cd ..
       
    67 rm -r r
       
    68 initrepo
       
    69 cat > $EDITED <<EOF
       
    70 pick 177f92b77385 c
       
    71 pick 055a42cdd887 d
       
    72 mess bfa474341cc9 does not commute with e
       
    73 pick e860deea161a e
       
    74 pick 652413bf663e f
       
    75 EOF
       
    76 
       
    77 echo % edit the history, this time with a fold action
       
    78 HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
       
    79 
       
    80 echo
       
    81 echo a > e
       
    82 hg add e
       
    83 HGEDITOR="cat $EDITED > " hg histedit --continue 2>&1 | fixbundle
       
    84 echo % second edit also fails, but just continue
       
    85 hg histedit --continue 2>&1 | fixbundle
       
    86 
       
    87 echo % post message fix
       
    88 hg log --graph
       
    89 
       
    90 echo % EOF