tests/test-simplemerge-cmd
author Edouard Gomez <ed.gomez@free.fr>
Sun, 04 Jan 2009 02:36:48 +0100
changeset 7583 77fec2d270ae
parent 4367 c6413f8f2f8e
child 8446 e1f4343db740
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

cp "$TESTDIR"/../contrib/simplemerge .

echo base > base

echo local > local
cat base >> local
cp local orig

cat base > other
echo other >> other

echo '% changing local directly'
python simplemerge local base other && echo "merge succeeded"
cat local
cp orig local

echo '% printing to stdout'
python simplemerge -p local base other
echo ' local:'
cat local

echo '% conflicts'
cp base conflict-local
cp other conflict-other
echo not other >> conflict-local
echo end >> conflict-local
echo end >> conflict-other
python simplemerge -p conflict-local base conflict-other || echo "merge failed"

echo '% --no-minimal'
python simplemerge -p --no-minimal conflict-local base conflict-other

echo '% 1 label'
python simplemerge -p -L foo conflict-local base conflict-other

echo '% 2 labels'
python simplemerge -p -L foo -L bar conflict-local base conflict-other

echo '% too many labels'
python simplemerge -p -L foo -L bar -L baz conflict-local base conflict-other

echo '% binary file'
python -c "f = file('binary-local', 'w'); f.write('\x00'); f.close()"
cat orig >> binary-local
python simplemerge -p binary-local base other

echo '% binary file --text'
python simplemerge -a -p binary-local base other

echo '% help'
python simplemerge --help

echo '% wrong number of arguments'
python simplemerge

echo '% bad option'
python simplemerge --foo -p local base other

exit 0