tests/test-mq-guards
author Thomas Arendsen Hein <thomas@intevation.de>
Fri, 11 Aug 2006 09:11:54 +0200
changeset 2853 619f1c65384c
parent 2850 851b07ec450c
child 2990 61fcd9fac434
permissions -rwxr-xr-x
Adjusted documentation for hgrc's "[smtp] host" for change in 9f745d3675d4.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2821
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     2
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     3
HGRCPATH=$HGTMP/.hgrc; export HGRCPATH
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     4
echo "[extensions]" >> $HGTMP/.hgrc
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     5
echo "mq=" >> $HGTMP/.hgrc
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     6
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     7
hg init
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     8
hg qinit
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     9
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    10
echo x > x
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    11
hg ci -Ama
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    12
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    13
hg qnew a.patch
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    14
echo a > a
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    15
hg add a
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    16
hg qrefresh
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    17
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    18
hg qnew b.patch
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    19
echo b > b
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    20
hg add b
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    21
hg qrefresh
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    22
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    23
hg qnew c.patch
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    24
echo c > c
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    25
hg add c
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    26
hg qrefresh
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    27
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    28
hg qpop -a
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    29
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    30
echo % should fail
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    31
hg qguard +fail
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    32
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    33
hg qpush
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    34
echo % should guard a.patch
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    35
hg qguard +a
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    36
echo % should print +a
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    37
hg qguard
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    38
hg qpop
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    39
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    40
hg qguard a.patch
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    41
echo % should push b.patch
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    42
hg qpush
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    43
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    44
hg qpop
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    45
hg qselect a
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    46
echo % should push a.patch
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    47
hg qpush
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    48
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    49
hg qguard c.patch -a
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    50
echo % should print -a
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    51
hg qguard c.patch
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    52
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    53
echo % should skip c.patch
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    54
hg qpush -a
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    55
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    56
hg qguard -n c.patch
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    57
echo % should push c.patch
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    58
hg qpush -a
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    59
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    60
hg qpop -a
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    61
hg qselect -n
2829
05316bb57d01 mq: make guards more strict, add tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2821
diff changeset
    62
echo % should push all
2821
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    63
hg qpush -a
2829
05316bb57d01 mq: make guards more strict, add tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2821
diff changeset
    64
05316bb57d01 mq: make guards more strict, add tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2821
diff changeset
    65
hg qpop -a
2850
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
    66
hg qguard a.patch +1
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
    67
hg qguard b.patch +2
2829
05316bb57d01 mq: make guards more strict, add tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2821
diff changeset
    68
hg qselect 1
2850
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
    69
echo % should push a.patch, not b.patch
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
    70
hg qpush
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
    71
hg qpush
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
    72
hg qpop -a
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
    73
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
    74
hg qselect 2
2829
05316bb57d01 mq: make guards more strict, add tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2821
diff changeset
    75
echo % should push b.patch
05316bb57d01 mq: make guards more strict, add tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2821
diff changeset
    76
hg qpush
05316bb57d01 mq: make guards more strict, add tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2821
diff changeset
    77
hg qpop -a
05316bb57d01 mq: make guards more strict, add tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2821
diff changeset
    78
2850
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
    79
hg qselect 1 2
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
    80
echo % should push a.patch, b.patch
2829
05316bb57d01 mq: make guards more strict, add tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2821
diff changeset
    81
hg qpush
05316bb57d01 mq: make guards more strict, add tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2821
diff changeset
    82
hg qpush
05316bb57d01 mq: make guards more strict, add tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2821
diff changeset
    83
hg qpop -a
05316bb57d01 mq: make guards more strict, add tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2821
diff changeset
    84
05316bb57d01 mq: make guards more strict, add tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2821
diff changeset
    85
hg qguard a.patch +1 +2 -3
05316bb57d01 mq: make guards more strict, add tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2821
diff changeset
    86
hg qselect 1 2 3
2850
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
    87
echo % list patches and guards
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
    88
hg qguard -l
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
    89
echo % list series
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
    90
hg qseries -v
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
    91
echo % list guards
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
    92
hg qselect
2829
05316bb57d01 mq: make guards more strict, add tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2821
diff changeset
    93
echo % should push b.patch
05316bb57d01 mq: make guards more strict, add tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2821
diff changeset
    94
hg qpush
2844
582cbc4392cb qselect: add --pop, --reapply options
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2829
diff changeset
    95
582cbc4392cb qselect: add --pop, --reapply options
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2829
diff changeset
    96
hg qpush -a
582cbc4392cb qselect: add --pop, --reapply options
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2829
diff changeset
    97
hg qselect -n --reapply
2850
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
    98
echo % guards in series file: +1 +2 -3
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
    99
hg qselect -s
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
   100
echo % should show c.patch
851b07ec450c mq: apply patch is any posative guard matches
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2844
diff changeset
   101
hg qapplied