test-rebase-collapse
91 lines
| 1.5 KiB
| text/plain
|
TextLexer
/ tests / test-rebase-collapse
Stefano Tortarolo
|
r6906 | #!/bin/sh | ||
echo "[extensions]" >> $HGRCPATH | ||||
echo "graphlog=" >> $HGRCPATH | ||||
echo "rebase=" >> $HGRCPATH | ||||
BASE=`pwd` | ||||
Brendan Cully
|
r6910 | addcommit () { | ||
Stefano Tortarolo
|
r6906 | echo $1 > $1 | ||
hg add $1 | ||||
hg commit -d "${2} 0" -u test -m $1 | ||||
} | ||||
Brendan Cully
|
r6910 | |||
commit () { | ||||
Stefano Tortarolo
|
r6906 | hg commit -d "${2} 0" -u test -m $1 | ||
} | ||||
Brendan Cully
|
r6910 | createrepo () { | ||
Stefano Tortarolo
|
r6906 | cd $BASE | ||
rm -rf a | ||||
hg init a | ||||
cd a | ||||
addcommit "A" 0 | ||||
addcommit "B" 1 | ||||
addcommit "C" 2 | ||||
addcommit "D" 3 | ||||
hg update -C 0 | ||||
addcommit "E" 4 | ||||
hg update -C 0 | ||||
addcommit "F" 5 | ||||
hg merge -r 4 | ||||
commit "G" 6 | ||||
hg update -C 5 | ||||
addcommit "H" 7 | ||||
} | ||||
createrepo > /dev/null 2>&1 | ||||
hg glog --template '{rev}: {desc}\n' | ||||
echo '% Rebasing' | ||||
hg up -C 3 | ||||
hg rebase --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/' | ||||
hg glog --template '{rev}: {desc}\n' | ||||
createrepo > /dev/null 2>&1 | ||||
echo '% Rebasing' | ||||
hg rebase --base 6 --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/' | ||||
hg glog --template '{rev}: {desc}\n' | ||||
Brendan Cully
|
r6910 | createrepocomplex () { | ||
Stefano Tortarolo
|
r6906 | cd $BASE | ||
rm -rf a | ||||
hg init a | ||||
cd a | ||||
addcommit "A" 0 | ||||
addcommit "B" 1 | ||||
hg up 0 | ||||
addcommit "C" 2 | ||||
hg merge | ||||
commit "D" 3 | ||||
hg up 1 | ||||
addcommit "E" 4 | ||||
addcommit "F" 5 | ||||
hg merge | ||||
commit "G" 6 | ||||
hg up 0 | ||||
addcommit "H" 7 | ||||
} | ||||
createrepocomplex > /dev/null 2>&1 | ||||
hg glog --template '{rev}: {desc}\n' | ||||
echo | ||||
echo '% Rebase and collapse - more than one external (fail)' | ||||
hg rebase -s 2 --collapse | ||||
echo | ||||
echo '% Rebase and collapse' | ||||
hg rebase -s 4 --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/' | ||||
hg glog --template '{rev}: {desc}\n' | ||||
exit 0 | ||||