tests/test-mq-qnew
author Brendan Cully <brendan@kublai.com>
Thu, 30 Oct 2008 12:31:24 -0700
changeset 7296 695383442347
parent 2990 tests/test-mq-qnew-twice@61fcd9fac434
child 7297 bd6deb7525f4
permissions -rwxr-xr-x
mq: put qnew tests into own file, fold in qnew-twice
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2711
ca97be5babf8 mq: do not allow to qnew a patch twice
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
ca97be5babf8 mq: do not allow to qnew a patch twice
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     2
2990
61fcd9fac434 Make tests append settings to $HGRCPATH instead of $HGTMP/.hgrc
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2714
diff changeset
     3
echo "[extensions]" >> $HGRCPATH
61fcd9fac434 Make tests append settings to $HGRCPATH instead of $HGTMP/.hgrc
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2714
diff changeset
     4
echo "mq=" >> $HGRCPATH
2711
ca97be5babf8 mq: do not allow to qnew a patch twice
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     5
7296
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
     6
hg init mq
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
     7
cd mq
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
     8
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
     9
echo a > a
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    10
hg ci -Ama
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    11
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    12
echo '% qnew should refuse bad patch names'
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    13
hg qnew series
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    14
hg qnew status
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    15
hg qnew guards
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    16
hg qnew .hgignore
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    17
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    18
hg qinit -c
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    19
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    20
echo '% qnew with uncommitted changes'
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    21
echo a > somefile
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    22
hg add somefile
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    23
hg qnew uncommitted.patch
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    24
hg st
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    25
hg qseries
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    26
hg revert --no-backup somefile
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    27
rm somefile
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    28
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    29
echo '% qnew implies add'
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    30
hg qnew test.patch
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    31
hg -R .hg/patches st
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    32
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    33
echo '% qnew missing'
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    34
hg qnew missing.patch missing
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    35
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    36
echo '% qnew -m'
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    37
hg qnew -m 'foo bar' mtest.patch
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    38
cat .hg/patches/mtest.patch
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    39
695383442347 mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents: 2990
diff changeset
    40
echo '% qnew twice'
2711
ca97be5babf8 mq: do not allow to qnew a patch twice
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    41
hg qnew first.patch
ca97be5babf8 mq: do not allow to qnew a patch twice
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    42
hg qnew first.patch
ca97be5babf8 mq: do not allow to qnew a patch twice
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    43
ca97be5babf8 mq: do not allow to qnew a patch twice
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    44
touch ../first.patch
ca97be5babf8 mq: do not allow to qnew a patch twice
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    45
hg qimport ../first.patch
2714
85070b784896 Fix test-mq-qnew-twice exit code and output.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2711
diff changeset
    46
85070b784896 Fix test-mq-qnew-twice exit code and output.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2711
diff changeset
    47
exit 0