tests/test-imerge
author Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
Tue, 18 Dec 2007 14:11:13 -0600
changeset 5664 da72b4d24797
parent 5242 9cd6578750b9
child 6213 5c5e45766224
permissions -rwxr-xr-x
Fix income/pull with bundle and -R (issue 820). Uses ui.setconfig() to tell bundlerepo where the main repo is. This is needed for when the --repository option is used. Adds tests to test-bundle and a new test script test-mq-pull-from-bundle, which plays out the situation that initially made me detect this bug (hg -R .hg/patches pull ../bundle.hg).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5044
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     1
#!/bin/sh
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     2
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     3
echo "[extensions]" >> $HGRCPATH
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     4
echo "imerge=" >> $HGRCPATH
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     5
HGMERGE=true
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     6
export HGMERGE
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     7
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     8
hg init base
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     9
cd base
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    10
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    11
echo foo > foo
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    12
echo bar > bar
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    13
hg ci -Am0 -d '0 0'
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    14
5109
86327d13d916 imerge: handle renames
Brendan Cully <brendan@kublai.com>
parents: 5044
diff changeset
    15
hg mv foo foo2
86327d13d916 imerge: handle renames
Brendan Cully <brendan@kublai.com>
parents: 5044
diff changeset
    16
echo foo >> foo2
5044
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    17
hg ci -m1 -d '1 0'
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    18
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    19
hg up -C 0
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    20
echo bar >> foo
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    21
echo bar >> bar
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    22
hg ci -m2 -d '2 0'
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    23
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    24
echo % start imerge
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    25
hg imerge
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    26
5109
86327d13d916 imerge: handle renames
Brendan Cully <brendan@kublai.com>
parents: 5044
diff changeset
    27
cat foo2
5044
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    28
cat bar
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    29
5111
12930b97a729 imerge: gussy up dispatcher to support subcommand opts.
Brendan Cully <brendan@kublai.com>
parents: 5109
diff changeset
    30
echo % status -v
12930b97a729 imerge: gussy up dispatcher to support subcommand opts.
Brendan Cully <brendan@kublai.com>
parents: 5109
diff changeset
    31
hg -v imerge st
5044
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    32
5109
86327d13d916 imerge: handle renames
Brendan Cully <brendan@kublai.com>
parents: 5044
diff changeset
    33
echo % next
86327d13d916 imerge: handle renames
Brendan Cully <brendan@kublai.com>
parents: 5044
diff changeset
    34
hg imerge next
86327d13d916 imerge: handle renames
Brendan Cully <brendan@kublai.com>
parents: 5044
diff changeset
    35
5044
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    36
echo % merge next
5109
86327d13d916 imerge: handle renames
Brendan Cully <brendan@kublai.com>
parents: 5044
diff changeset
    37
hg --traceback imerge
5044
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    38
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    39
echo % unresolve
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    40
hg imerge unres foo
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    41
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    42
echo % merge foo
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    43
hg imerge merge foo
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    44
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    45
echo % save
5109
86327d13d916 imerge: handle renames
Brendan Cully <brendan@kublai.com>
parents: 5044
diff changeset
    46
echo foo > foo2
5044
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    47
hg imerge save ../savedmerge
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    48
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    49
echo % load
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    50
hg up -C 0
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    51
hg imerge --traceback load ../savedmerge
5109
86327d13d916 imerge: handle renames
Brendan Cully <brendan@kublai.com>
parents: 5044
diff changeset
    52
cat foo2
5044
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    53
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    54
hg ci -m'merged' -d '3 0'
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    55
hg tip -v
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    56
5242
9cd6578750b9 improve error message for 'hg merge' when repo already at branchtip
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5111
diff changeset
    57
echo % nothing to merge -- tip
9cd6578750b9 improve error message for 'hg merge' when repo already at branchtip
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5111
diff changeset
    58
hg imerge
9cd6578750b9 improve error message for 'hg merge' when repo already at branchtip
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5111
diff changeset
    59
9cd6578750b9 improve error message for 'hg merge' when repo already at branchtip
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5111
diff changeset
    60
hg up 0
5044
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    61
echo % nothing to merge
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    62
hg imerge
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    63
58006f8b8275 imerge extension and test
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    64
exit 0