Source

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

#!/bin/sh

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

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

EDITED=`pwd`/editedhistory
cat > $EDITED <<EOF
pick 177f92b77385 c
pick 055a42cdd887 d
edit e860deea161a e
pick 652413bf663e f
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 % edit the revision
echo a > e
HGEDITOR='echo "foobaz" > ' hg histedit --continue 2>&1 | grep -v 'saving bundle'

hg log --graph

echo '% contents of e:'
hg cat e

echo % EOF
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.