tests/test-patchbomb
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
Tue, 14 Oct 2008 20:13:53 +0200
changeset 7104 9514cbb6e4f6
parent 5753 ea1016b32e94
child 7193 12fc42c78598
permissions -rwxr-xr-x
bdiff: normalize the diff (issue1295) When the common part of a diff can be moved forward, move it forward. Otherwise we don't get deterministic results (it would depends on the way we split for the recursion). That way we get identical hunks when doing the same change, it helps to solve issue1295 (inconsistent diffs on different side during a merge).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4420
b0656b33cc02 add test for patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     1
#!/bin/sh
b0656b33cc02 add test for patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     2
5753
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
     3
fixheaders()
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
     4
{
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
     5
    sed -e 's/\(Message-Id:.*@\).*/\1/'  \
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
     6
        -e 's/\(In-Reply-To:.*@\).*/\1/' \
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
     7
        -e 's/===.*/===/'
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
     8
}
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
     9
4420
b0656b33cc02 add test for patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    10
echo "[extensions]" >> $HGRCPATH
b0656b33cc02 add test for patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    11
echo "patchbomb=" >> $HGRCPATH
b0656b33cc02 add test for patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    12
5753
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    13
hg init t
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    14
cd t
4420
b0656b33cc02 add test for patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    15
echo a > a
b0656b33cc02 add test for patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    16
hg commit -Ama -d '1 0'
b0656b33cc02 add test for patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    17
4567
8b87bd4fb7ce Correct tests/test-patchbomb* files:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4566
diff changeset
    18
hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar tip | \
5753
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    19
  fixheaders
4420
b0656b33cc02 add test for patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    20
b0656b33cc02 add test for patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    21
echo b > b
b0656b33cc02 add test for patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    22
hg commit -Amb -d '2 0'
b0656b33cc02 add test for patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    23
4567
8b87bd4fb7ce Correct tests/test-patchbomb* files:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4566
diff changeset
    24
hg email --date '1970-1-1 0:2' -n -f quux -t foo -c bar -s test 0:tip | \
5753
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    25
  fixheaders
4565
1cf908c00479 Don't validate email config if we're not sending email.
Bryan O'Sullivan <bos@serpentine.com>
parents: 4420
diff changeset
    26
4567
8b87bd4fb7ce Correct tests/test-patchbomb* files:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4566
diff changeset
    27
hg email -m test.mbox -f quux -t foo -c bar -s test 0:tip
5753
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    28
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    29
cd ..
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    30
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    31
hg clone -q t t2
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    32
cd t2
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    33
echo c > c
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    34
hg commit -Amc -d '3 0'
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    35
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    36
cat > description <<EOF
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    37
a multiline
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    38
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    39
description
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    40
EOF
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    41
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    42
echo % test bundle and description
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    43
hg email --date '1970-1-1 0:3' -n -f quux -t foo \
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    44
    -c bar -s test -r tip -b --desc description | \
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    45
    fixheaders
ea1016b32e94 patchbomb: make --bundle respect --desc
Patrick Mezard <pmezard@gmail.com>
parents: 4597
diff changeset
    46