1. Gustavo Picon
  2. MacHg

Source

MacHg / LocalMercurial / hgext / histedit / tests / test-histedit-fold

#!/bin/sh

cat >> $HGRCPATH <<EOF
[extensions]
hgext.graphlog=
EOF

echo "histedit=$(echo $(dirname $(dirname $0)))" >> $HGRCPATH

EDITED=`pwd`/editedhistory
cat > $EDITED <<EOF
pick e860deea161a e
pick 652413bf663e f
fold 177f92b77385 c
pick 055a42cdd887 d
EOF
initrepo ()
{
    hg init r
    cd r
    for x in a b c d e f ; do
        echo $x > $x
        hg add $x
        hg ci -m $x
    done
}

initrepo

echo % log before edit
hg log --graph

echo % edit the history
HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | grep -v 'saving bundle'

echo % log after edit
hg log --graph

echo % post-fold manifest
hg manifest

echo % EOF