tests/test-rebase-rename
author Martin Geisler <mg@lazybytes.net>
Sat, 11 Sep 2010 00:40:19 +0200
changeset 12248 e1cf13e9e051
parent 11208 2313dc4d9817
permissions -rwxr-xr-x
merge with i18n-default

#!/bin/sh

. $TESTDIR/helpers.sh

echo "[extensions]" >> $HGRCPATH
echo "rebase=" >> $HGRCPATH
echo "[diff]" >> $HGRCPATH
echo "git=1" >> $HGRCPATH

BASE=`pwd`

hg init repo1
cd repo1
echo "a">a
hg commit -Am "A" --date '0 0'
echo "b"> b
hg commit -Am "B" --date '1 0'
hg up -C 0
hg mv a a-renamed
hg commit -m 'rename A' --date '2 0'

echo
echo '% Rename is tracked'
hg log -p -r tip --template '{rev}:{desc}\n'

echo '% Rebase the revision containing the rename'
hg rebase -s 2 -d 1 --quiet | cleanrebase

echo
echo '% Rename is not lost'
hg log -p -r tip --template '{rev}:{desc}\n'

cd $BASE
rm -rf repo1
hg init repo1
cd repo1
echo "a">a
hg commit -Am "A" --date '0 0'
echo "b"> b
hg commit -Am "B" --date '1 0'
hg up -C 0
hg cp a a-copied
hg commit -m 'copy A' --date '2 0'

echo
echo '% Copy is tracked'
hg log -p -r tip --template '{rev}:{desc}\n'

echo '% Rebase the revision containing the copy'
hg rebase -s 2 -d 1 --quiet | cleanrebase

echo
echo '% Copy is not lost'
hg log -p -r tip --template '{rev}:{desc}\n'