test-mq-strip
94 lines
| 1.6 KiB
| text/plain
|
TextLexer
/ tests / test-mq-strip
Martin Geisler
|
r8452 | #!/bin/sh | ||
Yuya Nishihara
|
r11208 | . $TESTDIR/helpers.sh | ||
Matt Mackall
|
r11200 | |||
Dirkjan Ochtman
|
r6635 | echo "[extensions]" >> $HGRCPATH | ||
echo "mq=" >> $HGRCPATH | ||||
Nicolas Dumazet
|
r11789 | echo "graphlog=" >> $HGRCPATH | ||
Dirkjan Ochtman
|
r6635 | |||
Nicolas Dumazet
|
r11789 | restore() { | ||
hg unbundle -q .hg/strip-backup/* | ||||
rm .hg/strip-backup/* | ||||
} | ||||
Dirkjan Ochtman
|
r6635 | teststrip() { | ||
hg up -C $1 | ||||
echo % before update $1, strip $2 | ||||
hg parents | ||||
Nicolas Dumazet
|
r11789 | hg --traceback strip $2 | hidebackup | ||
Dirkjan Ochtman
|
r6635 | echo % after update $1, strip $2 | ||
hg parents | ||||
Nicolas Dumazet
|
r11789 | restore | ||
Dirkjan Ochtman
|
r6635 | } | ||
hg init test | ||||
cd test | ||||
echo foo > bar | ||||
hg ci -Ama | ||||
echo more >> bar | ||||
hg ci -Amb | ||||
echo blah >> bar | ||||
hg ci -Amc | ||||
hg up 1 | ||||
echo blah >> bar | ||||
hg ci -Amd | ||||
echo final >> bar | ||||
hg ci -Ame | ||||
hg log | ||||
teststrip 4 4 | ||||
teststrip 4 3 | ||||
teststrip 1 4 | ||||
teststrip 4 2 | ||||
teststrip 4 1 | ||||
teststrip null 4 | ||||
hg log | ||||
hg up -C 2 | ||||
hg merge 4 | ||||
echo % before strip of merge parent | ||||
hg parents | ||||
Matt Mackall
|
r11200 | hg strip 4 2>&1 | hidebackup | ||
Dirkjan Ochtman
|
r6635 | echo % after strip of merge parent | ||
hg parents | ||||
Nicolas Dumazet
|
r11789 | restore | ||
hg up | ||||
hg glog | ||||
echo % 2 is parent of 3, only one strip should happen | ||||
hg strip 2 3 | hidebackup | ||||
hg glog | ||||
restore | ||||
hg glog | ||||
echo % 2 different branches: 2 strips | ||||
hg strip 2 4 | hidebackup | ||||
hg glog | ||||
restore | ||||
echo % 2 different branches and a common ancestor: 1 strip | ||||
hg strip 1 2 4 | hidebackup | ||||
restore | ||||
# remove branchy history for qimport tests | ||||
hg strip 3 | hidebackup | ||||
Vishakh H
|
r11637 | |||
#strip of applied mq should cleanup status file | ||||
hg up -C 3 | ||||
echo fooagain >> bar | ||||
hg ci -mf | ||||
hg qimport -r tip:2 | ||||
echo % applied patches before strip | ||||
hg qapplied | ||||
echo % stripping revision in queue | ||||
hg strip 3 | hidebackup | ||||
echo % applied patches after stripping rev in queue | ||||
hg qapplied | ||||
echo % stripping ancestor of queue | ||||
hg strip 1 | hidebackup | ||||
echo % applied patches after stripping ancestor of queue | ||||
hg qapplied | ||||