tests/test-mq-qnew
author Christian Ebert <blacktrash@gmx.net>
Wed, 23 Dec 2009 12:04:17 +0000
branchstable
changeset 10117 98867145f4b5
parent 10114 3e7663b2f3fc
child 10372 27d542bc0f5b
permissions -rwxr-xr-x
keyword: go into restricted mode when transplanting Expanded keyword is read into diff with transplant -b otherwise. Test this scenario. Thanks to Adam Berkes for providing an example case.
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
7297
bd6deb7525f4 mq: use cmdutil.matchfiles instead of match for qnew -f.
Brendan Cully <brendan@kublai.com>
parents: 7296
diff changeset
    47
echo '% qnew -f from a subdirectory'
bd6deb7525f4 mq: use cmdutil.matchfiles instead of match for qnew -f.
Brendan Cully <brendan@kublai.com>
parents: 7296
diff changeset
    48
hg qpop -a
bd6deb7525f4 mq: use cmdutil.matchfiles instead of match for qnew -f.
Brendan Cully <brendan@kublai.com>
parents: 7296
diff changeset
    49
mkdir d
bd6deb7525f4 mq: use cmdutil.matchfiles instead of match for qnew -f.
Brendan Cully <brendan@kublai.com>
parents: 7296
diff changeset
    50
cd d
bd6deb7525f4 mq: use cmdutil.matchfiles instead of match for qnew -f.
Brendan Cully <brendan@kublai.com>
parents: 7296
diff changeset
    51
echo b > b
bd6deb7525f4 mq: use cmdutil.matchfiles instead of match for qnew -f.
Brendan Cully <brendan@kublai.com>
parents: 7296
diff changeset
    52
hg ci -Am t
bd6deb7525f4 mq: use cmdutil.matchfiles instead of match for qnew -f.
Brendan Cully <brendan@kublai.com>
parents: 7296
diff changeset
    53
echo b >> b
bd6deb7525f4 mq: use cmdutil.matchfiles instead of match for qnew -f.
Brendan Cully <brendan@kublai.com>
parents: 7296
diff changeset
    54
hg st
bd6deb7525f4 mq: use cmdutil.matchfiles instead of match for qnew -f.
Brendan Cully <brendan@kublai.com>
parents: 7296
diff changeset
    55
hg qnew -g -f p
bd6deb7525f4 mq: use cmdutil.matchfiles instead of match for qnew -f.
Brendan Cully <brendan@kublai.com>
parents: 7296
diff changeset
    56
cat ../.hg/patches/p
9733
f16ec85f125c mq: do not call ui.username unless it is necessary
Martin Geisler <mg@lazybytes.net>
parents: 7297
diff changeset
    57
f16ec85f125c mq: do not call ui.username unless it is necessary
Martin Geisler <mg@lazybytes.net>
parents: 7297
diff changeset
    58
echo '% qnew -u with no username configured'
f16ec85f125c mq: do not call ui.username unless it is necessary
Martin Geisler <mg@lazybytes.net>
parents: 7297
diff changeset
    59
HGUSER= hg qnew -u blue red
f16ec85f125c mq: do not call ui.username unless it is necessary
Martin Geisler <mg@lazybytes.net>
parents: 7297
diff changeset
    60
cat ../.hg/patches/red
10114
3e7663b2f3fc mq: qnew -f should reject merge working directories
timeless <timeless@mozdev.org>
parents: 9733
diff changeset
    61
3e7663b2f3fc mq: qnew -f should reject merge working directories
timeless <timeless@mozdev.org>
parents: 9733
diff changeset
    62
echo '% fail when trying to import a merge'
3e7663b2f3fc mq: qnew -f should reject merge working directories
timeless <timeless@mozdev.org>
parents: 9733
diff changeset
    63
hg init merge
3e7663b2f3fc mq: qnew -f should reject merge working directories
timeless <timeless@mozdev.org>
parents: 9733
diff changeset
    64
cd merge
3e7663b2f3fc mq: qnew -f should reject merge working directories
timeless <timeless@mozdev.org>
parents: 9733
diff changeset
    65
touch a
3e7663b2f3fc mq: qnew -f should reject merge working directories
timeless <timeless@mozdev.org>
parents: 9733
diff changeset
    66
hg ci -Am null
3e7663b2f3fc mq: qnew -f should reject merge working directories
timeless <timeless@mozdev.org>
parents: 9733
diff changeset
    67
echo a >> a
3e7663b2f3fc mq: qnew -f should reject merge working directories
timeless <timeless@mozdev.org>
parents: 9733
diff changeset
    68
hg ci -m a
3e7663b2f3fc mq: qnew -f should reject merge working directories
timeless <timeless@mozdev.org>
parents: 9733
diff changeset
    69
hg up -r 0
3e7663b2f3fc mq: qnew -f should reject merge working directories
timeless <timeless@mozdev.org>
parents: 9733
diff changeset
    70
echo b >> a
3e7663b2f3fc mq: qnew -f should reject merge working directories
timeless <timeless@mozdev.org>
parents: 9733
diff changeset
    71
hg ci -m b
3e7663b2f3fc mq: qnew -f should reject merge working directories
timeless <timeless@mozdev.org>
parents: 9733
diff changeset
    72
hg merge -f 1
3e7663b2f3fc mq: qnew -f should reject merge working directories
timeless <timeless@mozdev.org>
parents: 9733
diff changeset
    73
hg resolve --mark a
3e7663b2f3fc mq: qnew -f should reject merge working directories
timeless <timeless@mozdev.org>
parents: 9733
diff changeset
    74
hg qnew -f merge
3e7663b2f3fc mq: qnew -f should reject merge working directories
timeless <timeless@mozdev.org>
parents: 9733
diff changeset
    75
3e7663b2f3fc mq: qnew -f should reject merge working directories
timeless <timeless@mozdev.org>
parents: 9733
diff changeset
    76
exit 0