#!/bin/sh . "$TESTDIR/histedit-helpers.sh" cat >> $HGRCPATH < $EDITED < $x hg add $x hg ci -m $x done } initrepo echo % log before edit hg log --graph echo % show the edit commands offered HGEDITOR=cat hg histedit 177f92b77385 echo % edit the history HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle echo % rules should end up in .hg/histedit-last-edit.txt: cat .hg/histedit-last-edit.txt echo '**** end of rules file ****' echo % log after edit hg log --graph echo % put things back cat > $EDITED <&1 | fixbundle hg log --graph echo % slightly different this time cat > $EDITED <&1 | fixbundle hg log --graph echo % keep prevents stripping dead revs cat > $EDITED <&1 | fixbundle hg log --graph echo '% try with --rev' cat > $EDITED <&1 | fixbundle hg log --graph echo % should also work if a commit message is missing BUNDLE="$TESTDIR/missing-comment.hg" hg init missing cd missing hg unbundle $BUNDLE hg co tip hg log --graph hg histedit 0