test-mq-guards
173 lines
| 2.9 KiB
| text/plain
|
TextLexer
/ tests / test-mq-guards
Vadim Gelfer
|
r2821 | #!/bin/sh | ||
Thomas Arendsen Hein
|
r2990 | echo "[extensions]" >> $HGRCPATH | ||
echo "mq=" >> $HGRCPATH | ||||
Vadim Gelfer
|
r2821 | |||
hg init | ||||
hg qinit | ||||
echo x > x | ||||
hg ci -Ama | ||||
hg qnew a.patch | ||||
echo a > a | ||||
hg add a | ||||
hg qrefresh | ||||
hg qnew b.patch | ||||
echo b > b | ||||
hg add b | ||||
hg qrefresh | ||||
hg qnew c.patch | ||||
echo c > c | ||||
hg add c | ||||
hg qrefresh | ||||
hg qpop -a | ||||
echo % should fail | ||||
Christian Ebert
|
r4133 | hg qguard does-not-exist.patch +bleh | ||
echo % should fail | ||||
Vadim Gelfer
|
r2821 | hg qguard +fail | ||
hg qpush | ||||
echo % should guard a.patch | ||||
hg qguard +a | ||||
echo % should print +a | ||||
hg qguard | ||||
hg qpop | ||||
Brendan Cully
|
r7398 | echo % should fail | ||
hg qpush a.patch | ||||
Vadim Gelfer
|
r2821 | hg qguard a.patch | ||
echo % should push b.patch | ||||
hg qpush | ||||
hg qpop | ||||
Patrick Mezard
|
r6607 | echo % test selection of an empty guard | ||
hg qselect "" | ||||
Vadim Gelfer
|
r2821 | hg qselect a | ||
echo % should push a.patch | ||||
hg qpush | ||||
Augie Fackler
|
r7772 | hg qguard -- c.patch -a | ||
Vadim Gelfer
|
r2821 | echo % should print -a | ||
hg qguard c.patch | ||||
echo % should skip c.patch | ||||
hg qpush -a | ||||
Matt Mackall
|
r9439 | echo % should display b.patch | ||
hg qtop | ||||
Vadim Gelfer
|
r2821 | |||
hg qguard -n c.patch | ||||
echo % should push c.patch | ||||
hg qpush -a | ||||
hg qpop -a | ||||
hg qselect -n | ||||
Vadim Gelfer
|
r2829 | echo % should push all | ||
Vadim Gelfer
|
r2821 | hg qpush -a | ||
Vadim Gelfer
|
r2829 | |||
hg qpop -a | ||||
Vadim Gelfer
|
r2850 | hg qguard a.patch +1 | ||
hg qguard b.patch +2 | ||||
Vadim Gelfer
|
r2829 | hg qselect 1 | ||
Vadim Gelfer
|
r2850 | echo % should push a.patch, not b.patch | ||
hg qpush | ||||
hg qpush | ||||
hg qpop -a | ||||
hg qselect 2 | ||||
Vadim Gelfer
|
r2829 | echo % should push b.patch | ||
hg qpush | ||||
Patrick Mezard
|
r4340 | hg qpush -a | ||
Matt Mackall
|
r9439 | # Used to be an issue with holes in the patch sequence | ||
# So, put one hole on the base and ask for topmost patch. | ||||
hg qtop | ||||
Vadim Gelfer
|
r2829 | hg qpop -a | ||
Vadim Gelfer
|
r2850 | hg qselect 1 2 | ||
echo % should push a.patch, b.patch | ||||
Vadim Gelfer
|
r2829 | hg qpush | ||
hg qpush | ||||
hg qpop -a | ||||
Augie Fackler
|
r7772 | hg qguard -- a.patch +1 +2 -3 | ||
Vadim Gelfer
|
r2829 | hg qselect 1 2 3 | ||
Dan Villiom Podlaski Christiansen
|
r11819 | |||
Vadim Gelfer
|
r2850 | echo % list patches and guards | ||
hg qguard -l | ||||
Dan Villiom Podlaski Christiansen
|
r11819 | echo % have at least one patch applied to test coloring | ||
hg qpush | ||||
Brodie Rao
|
r10826 | echo % list patches and guards with color | ||
Patrick Mezard
|
r11141 | hg --config extensions.color= qguard --config color.mode=ansi \ | ||
-l --color=always | ||||
Dan Villiom Podlaski Christiansen
|
r11819 | echo % should pop b.patch | ||
hg qpop | ||||
Vadim Gelfer
|
r2850 | echo % list series | ||
hg qseries -v | ||||
echo % list guards | ||||
hg qselect | ||||
Vadim Gelfer
|
r2829 | echo % should push b.patch | ||
hg qpush | ||||
Vadim Gelfer
|
r2844 | |||
hg qpush -a | ||||
hg qselect -n --reapply | ||||
Vadim Gelfer
|
r2850 | echo % guards in series file: +1 +2 -3 | ||
hg qselect -s | ||||
echo % should show c.patch | ||||
hg qapplied | ||||
Mathieu Clabaut
|
r3685 | |||
hg qrename a.patch new.patch | ||||
echo % should show : | ||||
echo % new.patch: +1 +2 -3 | ||||
echo % b.patch: +2 | ||||
echo % c.patch: unguarded | ||||
hg qguard -l | ||||
Alexis S. L. Carvalho
|
r3763 | hg qnew d.patch | ||
hg qpop | ||||
echo % should show new.patch and b.patch as Guarded, c.patch as Applied | ||||
echo % and d.patch as Unapplied | ||||
hg qseries -v | ||||
Brodie Rao
|
r10826 | echo % qseries again, but with color | ||
hg --config extensions.color= qseries -v --color=always | ||||
Mathieu Clabaut
|
r3685 | |||
Alexis S. L. Carvalho
|
r3763 | hg qguard d.patch +2 | ||
echo % new.patch, b.patch: Guarded. c.patch: Applied. d.patch: Guarded. | ||||
hg qseries -v | ||||
Thomas Arendsen Hein
|
r4240 | |||
qappunappv() | ||||
Jim Hague
|
r5471 | { | ||
Thomas Arendsen Hein
|
r4240 | for command in qapplied "qapplied -v" qunapplied "qunapplied -v"; do | ||
echo % hg $command | ||||
hg $command | ||||
done | ||||
Jim Hague
|
r5471 | } | ||
Thomas Arendsen Hein
|
r4240 | |||
hg qpop -a | ||||
hg qguard -l | ||||
qappunappv | ||||
hg qselect 1 | ||||
qappunappv | ||||
hg qpush -a | ||||
qappunappv | ||||
hg qselect 2 | ||||
qappunappv | ||||
for patch in `hg qseries`; do | ||||
echo % hg qapplied $patch | ||||
hg qapplied $patch | ||||
echo % hg qunapplied $patch | ||||
hg qunapplied $patch | ||||
done | ||||
Thomas Arendsen Hein
|
r4241 | |||
echo % hg qseries -m: only b.patch should be shown | ||||
echo the guards file was not ignored in the past | ||||
hg qdelete -k b.patch | ||||
hg qseries -m | ||||
Brodie Rao
|
r10826 | echo % hg qseries -m with color | ||
hg --config extensions.color= qseries -m --color=always | ||||