test-mq-header-date
217 lines
| 3.1 KiB
| text/plain
|
TextLexer
/ tests / test-mq-header-date
Peter Arrenbrecht
|
r5788 | #!/bin/sh | ||
echo "[extensions]" >> $HGRCPATH | ||||
echo "mq=" >> $HGRCPATH | ||||
echo "[diff]" >> $HGRCPATH | ||||
echo "nodates=true" >> $HGRCPATH | ||||
catpatch() { | ||||
Steve Losh
|
r10397 | cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \ | ||
-e "s/^\(# Parent \).*/\1/" | ||||
Peter Arrenbrecht
|
r5788 | } | ||
catlog() { | ||||
catpatch $1 | ||||
hg log --template "{rev}: {desc} - {author}\n" | ||||
} | ||||
catlogd() { | ||||
catpatch $1 | ||||
hg log --template "{rev}: {desc} - {author} - {date}\n" | ||||
} | ||||
drop() { | ||||
hg qpop | ||||
hg qdel $1.patch | ||||
} | ||||
Steve Losh
|
r10397 | runtest() { | ||
echo ==== init | ||||
hg init a | ||||
cd a | ||||
hg qinit | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qnew -d | ||
hg qnew -d '3 0' 1.patch | ||||
catlogd 1 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qref | ||
echo "1" >1 | ||||
hg add | ||||
hg qref | ||||
catlogd 1 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qref -d | ||
hg qref -d '4 0' | ||||
catlogd 1 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qnew | ||
hg qnew 2.patch | ||||
echo "2" >2 | ||||
hg add | ||||
hg qref | ||||
catlog 2 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qref -d | ||
hg qref -d '5 0' | ||||
catlog 2 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | drop 2 | ||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qnew -d -m | ||
hg qnew -d '6 0' -m "Three" 3.patch | ||||
catlogd 3 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qref | ||
echo "3" >3 | ||||
hg add | ||||
hg qref | ||||
catlogd 3 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qref -m | ||
hg qref -m "Drei" | ||||
catlogd 3 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qref -d | ||
hg qref -d '7 0' | ||||
catlogd 3 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qref -d -m | ||
hg qref -d '8 0' -m "Three (again)" | ||||
catlogd 3 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qnew -m | ||
hg qnew -m "Four" 4.patch | ||||
echo "4" >4 | ||||
hg add | ||||
hg qref | ||||
catlog 4 | ||||
echo ==== qref -d | ||||
hg qref -d '9 0' | ||||
catlog 4 | ||||
drop 4 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qnew with HG header | ||
hg qnew --config 'mq.plain=true' 5.patch | ||||
hg qpop | ||||
echo "# HG changeset patch" >>.hg/patches/5.patch | ||||
echo "# Date 10 0" >>.hg/patches/5.patch | ||||
hg qpush 2>&1 | grep 'Now at' | ||||
catlogd 5 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== hg qref | ||
echo "5" >5 | ||||
hg add | ||||
hg qref | ||||
catlogd 5 | ||||
echo ==== hg qref -d | ||||
hg qref -d '11 0' | ||||
catlogd 5 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qnew with plain header | ||
hg qnew --config 'mq.plain=true' -d '12 0' 6.patch | ||||
hg qpop | ||||
hg qpush 2>&1 | grep 'now at' | ||||
catlog 6 | ||||
echo ==== hg qref | ||||
echo "6" >6 | ||||
hg add | ||||
hg qref | ||||
catlogd 6 | ||||
echo ==== hg qref -d | ||||
hg qref -d '13 0' | ||||
catlogd 6 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | drop 6 | ||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qnew -u | ||
hg qnew -u jane 6.patch | ||||
echo "6" >6 | ||||
hg add | ||||
hg qref | ||||
catlog 6 | ||||
echo ==== qref -d | ||||
hg qref -d '12 0' | ||||
catlog 6 | ||||
drop 6 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qnew -d | ||
hg qnew -d '13 0' 7.patch | ||||
echo "7" >7 | ||||
hg add | ||||
hg qref | ||||
catlog 7 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qref -u | ||
hg qref -u john | ||||
catlogd 7 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qnew | ||
hg qnew 8.patch | ||||
echo "8" >8 | ||||
hg add | ||||
hg qref | ||||
catlog 8 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qref -u -d | ||
hg qref -u john -d '14 0' | ||||
catlog 8 | ||||
drop 8 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qnew -m | ||
hg qnew -m "Nine" 9.patch | ||||
echo "9" >9 | ||||
hg add | ||||
hg qref | ||||
catlog 9 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== qref -u -d | ||
hg qref -u john -d '15 0' | ||||
catlog 9 | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | drop 9 | ||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ==== "qpop -a / qpush -a" | ||
hg qpop -a | ||||
hg qpush -a | ||||
hg log --template "{rev}: {desc} - {author} - {date}\n" | ||||
} | ||||
Peter Arrenbrecht
|
r5788 | |||
Steve Losh
|
r10397 | echo ======= plain headers | ||
echo "[mq]" >> $HGRCPATH | ||||
echo "plain=true" >> $HGRCPATH | ||||
mkdir sandbox | ||||
(cd sandbox ; runtest) | ||||
rm -r sandbox | ||||
echo ======= hg headers | ||||
echo "plain=false" >> $HGRCPATH | ||||
mkdir sandbox | ||||
(cd sandbox ; runtest) | ||||
rm -r sandbox | ||||