view tests/test-qrecord @ 7429:dbc40381620e

tests: Skip tests if they will fail because of outer repo For different reasons these tests will fail if run in a tmpdir which is in a hg repo. The following three tests assumes no .hg in path dirs - I don't know how to work around that: * test-dispatch explicitly tests for no repo and expects "abort: There is no Mercurial repository here (.hg not found)!" * test-extension expects parentui to be None when not cd'ed to a repo dir * test-globalopts tests that implicit -R works correctly - that could perhaps be done from another repo instead of assuming no repo The following two might be worth investigating further: * test-convert-svn-sink fails for unknown reasons, starting with "abort: unresolved merge conflicts (see hg resolve)" * test-glog gets strange failures when testing "from outer space"
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 27 Nov 2008 00:57:31 +0100
parents 942287cb1f57
children 6c82beaaa11a
line wrap: on
line source

#!/bin/sh

echo "[ui]" >> $HGRCPATH
echo "interactive=true" >> $HGRCPATH
echo "[extensions]"     >> $HGRCPATH
echo "record="          >> $HGRCPATH

echo "% help (no mq, so no qrecord)"

hg help qrecord

echo "mq="              >> $HGRCPATH

echo "% help (mq present)"

hg help qrecord

hg init a
cd a

echo % base commit

cat > 1.txt <<EOF
1
2
3
4
5
EOF
cat > 2.txt <<EOF
a
b
c
d
e
f
EOF
mkdir dir
cat > dir/a.txt <<EOF
hello world

someone
up
there
loves
me
EOF

hg add 1.txt 2.txt dir/a.txt
hg commit -d '0 0' -m 'initial checkin'

echo % changing files

sed -e 's/2/2 2/;s/4/4 4/' 1.txt > 1.txt.new
sed -e 's/b/b b/' 2.txt > 2.txt.new
sed -e 's/hello world/hello world!/' dir/a.txt > dir/a.txt.new

mv -f 1.txt.new 1.txt
mv -f 2.txt.new 2.txt
mv -f dir/a.txt.new dir/a.txt

echo % whole diff

hg diff --nodates

echo % qrecord a.patch

hg qrecord -d '0 0' -m aaa a.patch <<EOF
y
y
n
y
y
n
EOF

echo
echo % "after qrecord a.patch 'tip'"
hg tip -p
echo
echo % "after qrecord a.patch 'diff'"
hg diff --nodates

echo % qrecord b.patch
hg qrecord -d '0 0' -m bbb b.patch <<EOF
y
y
y
y
EOF

echo
echo % "after qrecord b.patch 'tip'"
hg tip -p
echo
echo % "after qrecord b.patch 'diff'"
hg diff --nodates

echo
echo % --- end ---