tests/test-mq-guards
author Vadim Gelfer <vadim.gelfer@gmail.com>
Tue, 08 Aug 2006 21:42:50 -0700
changeset 2821 2e4ace008c94
child 2829 05316bb57d01
permissions -rwxr-xr-x
mq: new commands qselect, qguard implement quilt-style guards for mq. guards allow to control whether patch can be pushed. if guard X is active and patch is guarded by +X (called "posative guard"), patch can be pushed. if patch is guarded by -X (called "nagative guard"), patch cannot be pushed and is skipped. use qguard to set/list guards on patches. use qselect to set/list active guards. also "qseries -v" prints guarded patches with "G" now.
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
2e4ace008c94 mq: new commands qselect, qguard
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    62
hg qpush -a