tests/test-rebase-conflicts
author Edouard Gomez <ed.gomez@free.fr>
Sun, 04 Jan 2009 02:36:48 +0100
changeset 7583 77fec2d270ae
parent 7278 45495d784ad6
child 8168 8766fee6f225
permissions -rwxr-xr-x
convert/gnuarch: parse continuation-of revisions in gnuarch source In GNU Arch, continuation-of was often used for: - tagging revisions - continue working on a project in a new archive, because arch was scaling poorly in revision numbers (cat-logs were slow to be parsed and scanned through) - very similar to the previous point, fork his own branch of a project. Parsing this header information will allow to 'follow' new history because it often hints at older/forked/personal revision trees. This patch however just implements the parsing of the continuation-of header. A followup patch will implement the proper use of this new information.

#!/bin/sh

echo "[extensions]" >> $HGRCPATH
echo "graphlog=" >> $HGRCPATH
echo "rebase=" >> $HGRCPATH

cleanoutput () {
    sed -e 's/\(Rebase status stored to\).*/\1/'  \
        -e 's/\(Rebase status restored from\).*/\1/' \
        -e 's/\(saving bundle to \).*/\1/'
}

hg init a
cd a
echo 'c1' >common
hg add common
hg commit -d '0 0' -u test -m "C1"

echo 'c2' >>common
hg commit -d '1 0' -u test -m "C2"

echo 'c3' >>common
hg commit -d '2 0' -u test -m "C3"

hg update -C 1
echo 'l1' >>extra
hg add extra
hg commit -d '3 0' -u test -m "L1"

sed -e 's/c2/l2/' common > common.new
mv common.new common
hg commit -d '4 0' -u test -m "L2"

echo 'l3' >> extra2
hg add extra2
hg commit -d '5 0' -u test -m "L3"

hg glog  --template '{rev}: {desc}\n'

echo
echo '% Try to call --continue'
hg rebase --continue

echo
echo '% Conflicting rebase'
hg rebase -s 3 -d 2

echo
echo '% Try to continue without solving the conflict'
hg rebase --continue 

echo
echo '% Conclude rebase'
echo 'resolved merge' >common
hg resolve -m common
hg rebase --continue 2>&1 | cleanoutput

hg glog  --template '{rev}: {desc}\n'

echo
echo '% Check correctness'
echo '  - Rev. 0'
hg cat -r 0 common

echo '  - Rev. 1'
hg cat -r 1 common

echo '  - Rev. 2'
hg cat -r 2 common

echo '  - Rev. 3'
hg cat -r 3 common

echo '  - Rev. 4'
hg cat -r 4 common

echo '  - Rev. 5'
hg cat -r 5 common