tests/test-merge-internal-tools-pattern
author Mads Kiilerich <mads@kiilerich.com>
Thu, 09 Jul 2009 23:59:03 +0200
changeset 9110 561ff8d9e4f0
parent 6521 a3668330f14a
child 12156 4c94b6d0fb1c
permissions -rwxr-xr-x
mq: qpop now tells which patches are popped When navigating through a patch series by qpushing and qpopping it was easy to get lost because qpop was silent. I found myself often running qnext after qpop to see which patch I just dropped - especially if I was about to qrm it. This patch makes qpop more symmetric to qpush by showing which patches are applied/"unapplied". I think it is a good change even though it changes output by adding a new line of output.

#!/bin/sh

# make sure that the internal merge tools (internal:fail, internal:local, and
# internal:other) are used when matched by a merge-pattern in hgrc

unset HGMERGE # make sure HGMERGE doesn't interfere with the test

hg init

echo "# initial file contents"
echo "line 1" > f
echo "line 2" >> f
echo "line 3" >> f
hg commit -Am "revision 0" -d "1000000 0"
cat f
echo "# branch 1: editing line 1"
sed 's/line 1/first line/' f > f.new
mv f.new f
hg commit -Am "edited first line" -d "1000000 0"

echo "# branch 2: editing line 3"
hg update 0
sed 's/line 3/third line/' f > f.new
mv f.new f
hg commit -Am "edited third line" -d "1000000 0"

echo "# merge using internal:fail tool"
echo "[merge-patterns]" > .hg/hgrc
echo "* = internal:fail" >> .hg/hgrc
hg merge
cat f
hg stat

echo "# merge using internal:local tool"
hg update -C 2
sed 's/internal:fail/internal:local/' .hg/hgrc > .hg/hgrc.new
mv .hg/hgrc.new .hg/hgrc
hg merge
cat f
hg stat

echo "# merge using internal:other tool"
hg update -C 2
sed 's/internal:local/internal:other/' .hg/hgrc > .hg/hgrc.new
mv .hg/hgrc.new .hg/hgrc
hg merge
cat f
hg stat

echo "# merge using default tool"
hg update -C 2
rm .hg/hgrc
hg merge
cat f
hg stat