tests/test-fetch
author Christian Ebert <blacktrash@gmx.net>
Sun, 19 Apr 2009 13:27:03 +0100
changeset 8083 29ac24a36ed7
parent 7855 aa1a87f7544f
child 9093 0b2b269ba3d0
permissions -rwxr-xr-x
test-highlight: adapt output to latest pygments keeping backwards compatibility
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2822
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     2
6246
35bf9c23e17a adjust test-fetch output to non-default HGPORT, e.g. with run-tests.py -j
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6235
diff changeset
     3
# adjust to non-default HGPORT, e.g. with run-tests.py -j
35bf9c23e17a adjust test-fetch output to non-default HGPORT, e.g. with run-tests.py -j
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6235
diff changeset
     4
hideport() { sed "s/localhost:$HGPORT/localhost:20059/"; }
35bf9c23e17a adjust test-fetch output to non-default HGPORT, e.g. with run-tests.py -j
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6235
diff changeset
     5
hidehash() { sed "s/changeset 3:............ merges/changeset 3:... merges/"; }
35bf9c23e17a adjust test-fetch output to non-default HGPORT, e.g. with run-tests.py -j
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6235
diff changeset
     6
2990
61fcd9fac434 Make tests append settings to $HGRCPATH instead of $HGTMP/.hgrc
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2823
diff changeset
     7
echo "[extensions]" >> $HGRCPATH
61fcd9fac434 Make tests append settings to $HGRCPATH instead of $HGTMP/.hgrc
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2823
diff changeset
     8
echo "fetch=" >> $HGRCPATH
2822
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     9
7007
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    10
echo % test fetch with default branches only
2822
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    11
hg init a
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    12
echo a > a/a
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    13
hg --cwd a commit -d '1 0' -Ama
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    14
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    15
hg clone a b
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    16
hg clone a c
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    17
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    18
echo b > a/b
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    19
hg --cwd a commit -d '2 0' -Amb
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    20
hg --cwd a parents -q
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    21
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    22
echo % should pull one change
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    23
hg --cwd b fetch ../a
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    24
hg --cwd b parents -q
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    25
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    26
echo c > c/c
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    27
hg --cwd c commit -d '3 0' -Amc
5798
86f5d8f608b7 fetch: hide authentication details
Bryan O'Sullivan <bos@serpentine.com>
parents: 2990
diff changeset
    28
86f5d8f608b7 fetch: hide authentication details
Bryan O'Sullivan <bos@serpentine.com>
parents: 2990
diff changeset
    29
hg clone c d
86f5d8f608b7 fetch: hide authentication details
Bryan O'Sullivan <bos@serpentine.com>
parents: 2990
diff changeset
    30
hg clone c e
86f5d8f608b7 fetch: hide authentication details
Bryan O'Sullivan <bos@serpentine.com>
parents: 2990
diff changeset
    31
6207
03b13d853dc6 fetch: make test reproducible, tiny code cleanup
Bryan O'Sullivan <bos@serpentine.com>
parents: 6206
diff changeset
    32
# We cannot use the default commit message if fetching from a local
03b13d853dc6 fetch: make test reproducible, tiny code cleanup
Bryan O'Sullivan <bos@serpentine.com>
parents: 6206
diff changeset
    33
# repo, because the path of the repo will be included in the commit
03b13d853dc6 fetch: make test reproducible, tiny code cleanup
Bryan O'Sullivan <bos@serpentine.com>
parents: 6206
diff changeset
    34
# message, making every commit appear different.
03b13d853dc6 fetch: make test reproducible, tiny code cleanup
Bryan O'Sullivan <bos@serpentine.com>
parents: 6206
diff changeset
    35
6206
0b6f12495276 fetch: switch the default parent used for a merge
Bryan O'Sullivan <bos@serpentine.com>
parents: 5798
diff changeset
    36
echo % should merge c into a
2823
e0caea53c997 test-fetch: make output stable
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2822
diff changeset
    37
hg --cwd c fetch -d '4 0' -m 'automated merge' ../a
2822
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    38
ls c
5798
86f5d8f608b7 fetch: hide authentication details
Bryan O'Sullivan <bos@serpentine.com>
parents: 2990
diff changeset
    39
7344
58fd3c718ca4 tests: add killdaemons helper script
Matt Mackall <mpm@selenic.com>
parents: 7049
diff changeset
    40
netstat -tnap 2>/dev/null | grep $HGPORT | grep LISTEN
5798
86f5d8f608b7 fetch: hide authentication details
Bryan O'Sullivan <bos@serpentine.com>
parents: 2990
diff changeset
    41
hg --cwd a serve -a localhost -p $HGPORT -d --pid-file=hg.pid
86f5d8f608b7 fetch: hide authentication details
Bryan O'Sullivan <bos@serpentine.com>
parents: 2990
diff changeset
    42
cat a/hg.pid >> "$DAEMON_PIDS"
86f5d8f608b7 fetch: hide authentication details
Bryan O'Sullivan <bos@serpentine.com>
parents: 2990
diff changeset
    43
86f5d8f608b7 fetch: hide authentication details
Bryan O'Sullivan <bos@serpentine.com>
parents: 2990
diff changeset
    44
echo '% fetch over http, no auth'
6246
35bf9c23e17a adjust test-fetch output to non-default HGPORT, e.g. with run-tests.py -j
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6235
diff changeset
    45
hg --cwd d fetch -d '5 0' http://localhost:$HGPORT/ | hideport | hidehash
35bf9c23e17a adjust test-fetch output to non-default HGPORT, e.g. with run-tests.py -j
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6235
diff changeset
    46
hg --cwd d tip --template '{desc}\n' | hideport
5798
86f5d8f608b7 fetch: hide authentication details
Bryan O'Sullivan <bos@serpentine.com>
parents: 2990
diff changeset
    47
86f5d8f608b7 fetch: hide authentication details
Bryan O'Sullivan <bos@serpentine.com>
parents: 2990
diff changeset
    48
echo '% fetch over http with auth (should be hidden in desc)'
6246
35bf9c23e17a adjust test-fetch output to non-default HGPORT, e.g. with run-tests.py -j
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6235
diff changeset
    49
hg --cwd e fetch -d '5 0' http://user:password@localhost:$HGPORT/ | hideport | hidehash
35bf9c23e17a adjust test-fetch output to non-default HGPORT, e.g. with run-tests.py -j
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6235
diff changeset
    50
hg --cwd e tip --template '{desc}\n' | hideport
6206
0b6f12495276 fetch: switch the default parent used for a merge
Bryan O'Sullivan <bos@serpentine.com>
parents: 5798
diff changeset
    51
0b6f12495276 fetch: switch the default parent used for a merge
Bryan O'Sullivan <bos@serpentine.com>
parents: 5798
diff changeset
    52
hg clone a f
0b6f12495276 fetch: switch the default parent used for a merge
Bryan O'Sullivan <bos@serpentine.com>
parents: 5798
diff changeset
    53
hg clone a g
0b6f12495276 fetch: switch the default parent used for a merge
Bryan O'Sullivan <bos@serpentine.com>
parents: 5798
diff changeset
    54
0b6f12495276 fetch: switch the default parent used for a merge
Bryan O'Sullivan <bos@serpentine.com>
parents: 5798
diff changeset
    55
echo f > f/f
0b6f12495276 fetch: switch the default parent used for a merge
Bryan O'Sullivan <bos@serpentine.com>
parents: 5798
diff changeset
    56
hg --cwd f ci -d '6 0' -Amf
0b6f12495276 fetch: switch the default parent used for a merge
Bryan O'Sullivan <bos@serpentine.com>
parents: 5798
diff changeset
    57
0b6f12495276 fetch: switch the default parent used for a merge
Bryan O'Sullivan <bos@serpentine.com>
parents: 5798
diff changeset
    58
echo g > g/g
0b6f12495276 fetch: switch the default parent used for a merge
Bryan O'Sullivan <bos@serpentine.com>
parents: 5798
diff changeset
    59
hg --cwd g ci -d '6 0' -Amg
0b6f12495276 fetch: switch the default parent used for a merge
Bryan O'Sullivan <bos@serpentine.com>
parents: 5798
diff changeset
    60
6226
bd61e44eb2cc fetch: don't proceed if working directory is missing files (issue988)
Bryan O'Sullivan <bos@serpentine.com>
parents: 6207
diff changeset
    61
hg clone -q f h
bd61e44eb2cc fetch: don't proceed if working directory is missing files (issue988)
Bryan O'Sullivan <bos@serpentine.com>
parents: 6207
diff changeset
    62
hg clone -q g i
bd61e44eb2cc fetch: don't proceed if working directory is missing files (issue988)
Bryan O'Sullivan <bos@serpentine.com>
parents: 6207
diff changeset
    63
6206
0b6f12495276 fetch: switch the default parent used for a merge
Bryan O'Sullivan <bos@serpentine.com>
parents: 5798
diff changeset
    64
echo % should merge f into g
6207
03b13d853dc6 fetch: make test reproducible, tiny code cleanup
Bryan O'Sullivan <bos@serpentine.com>
parents: 6206
diff changeset
    65
hg --cwd g fetch -d '7 0' --switch -m 'automated merge' ../f
6226
bd61e44eb2cc fetch: don't proceed if working directory is missing files (issue988)
Bryan O'Sullivan <bos@serpentine.com>
parents: 6207
diff changeset
    66
bd61e44eb2cc fetch: don't proceed if working directory is missing files (issue988)
Bryan O'Sullivan <bos@serpentine.com>
parents: 6207
diff changeset
    67
rm i/g
bd61e44eb2cc fetch: don't proceed if working directory is missing files (issue988)
Bryan O'Sullivan <bos@serpentine.com>
parents: 6207
diff changeset
    68
echo % should abort, because i is modified
bd61e44eb2cc fetch: don't proceed if working directory is missing files (issue988)
Bryan O'Sullivan <bos@serpentine.com>
parents: 6207
diff changeset
    69
hg --cwd i fetch ../h
6235
d16798000be0 test-fetch failed due to non-zero exit code
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6226
diff changeset
    70
7007
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    71
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    72
echo % test fetch with named branches
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    73
hg init nbase
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    74
echo base > nbase/a
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    75
hg -R nbase ci -d '1 0' -Am base
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    76
hg -R nbase branch a
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    77
echo a > nbase/a
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    78
hg -R nbase ci -d '2 0' -m a
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    79
hg -R nbase up -C 0
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    80
hg -R nbase branch b
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    81
echo b > nbase/b
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    82
hg -R nbase ci -Ad '3 0' -m b
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    83
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    84
echo
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    85
echo % pull in change on foreign branch
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    86
hg clone nbase n1
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    87
hg clone nbase n2
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    88
hg -R n1 up -C a
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    89
echo aa > n1/a
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    90
hg -R n1 ci -d '4 0' -m a1
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    91
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    92
hg -R n2 up -C b
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    93
hg -R n2 fetch -d '9 0' -m 'merge' n1
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    94
echo '% parent should be 2 (no automatic update)'
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    95
hg -R n2 parents --template '{rev}\n'
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    96
rm -fr n1 n2
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    97
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    98
echo
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
    99
echo % pull in changes on both foreign and local branches
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   100
hg clone nbase n1
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   101
hg clone nbase n2
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   102
hg -R n1 up -C a
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   103
echo aa > n1/a
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   104
hg -R n1 ci -d '4 0' -m a1
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   105
hg -R n1 up -C b
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   106
echo bb > n1/b
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   107
hg -R n1 ci -d '5 0' -m b1
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   108
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   109
hg -R n2 up -C b
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   110
hg -R n2 fetch -d '9 0' -m 'merge' n1
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   111
echo '% parent should be 4 (fast forward)'
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   112
hg -R n2 parents --template '{rev}\n'
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   113
rm -fr n1 n2
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   114
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   115
echo
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   116
echo '% pull changes on foreign (2 new heads) and local (1 new head) branches'
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   117
echo % with a local change
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   118
hg clone nbase n1
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   119
hg clone nbase n2
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   120
hg -R n1 up -C a
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   121
echo a1 > n1/a
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   122
hg -R n1 ci -d '4 0' -m a1
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   123
hg -R n1 up -C b
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   124
echo bb > n1/b
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   125
hg -R n1 ci -d '5 0' -m b1
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   126
hg -R n1 up -C 1
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   127
echo a2 > n1/a
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   128
hg -R n1 ci -d '6 0' -m a2
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   129
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   130
hg -R n2 up -C b
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   131
echo change >> n2/c
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   132
hg -R n2 ci -Ad '7 0' -m local
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   133
hg -R n2 fetch -d '9 0' -m 'merge' n1
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   134
echo '% parent should be 7 (new merge changeset)'
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   135
hg -R n2 parents --template '{rev}\n'
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   136
rm -fr n1 n2
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   137
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   138
echo '% pull in changes on foreign (merge of local branch) and local (2 new'
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   139
echo '% heads) with a local change'
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   140
hg clone nbase n1
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   141
hg clone nbase n2
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   142
hg -R n1 up -C a
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   143
hg -R n1 merge b
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   144
hg -R n1 ci -d '4 0' -m merge
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   145
hg -R n1 up -C 2
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   146
echo c > n1/a
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   147
hg -R n1 ci -d '5 0' -m c
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   148
hg -R n1 up -C 2
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   149
echo cc > n1/a
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   150
hg -R n1 ci -d '6 0' -m cc
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   151
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   152
hg -R n2 up -C b
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   153
echo change >> n2/b
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   154
hg -R n2 ci -Ad '7 0' -m local
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   155
hg -R n2 fetch -d '9 0' -m 'merge' n1
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   156
echo '% parent should be 3 (fetch did not merge anything)'
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   157
hg -R n2 parents --template '{rev}\n'
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   158
rm -fr n1 n2
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   159
7049
6489ee64b522 fetch: use dirstate branch instead of first parents
Sune Foldager <cryo@cyanite.org>
parents: 7007
diff changeset
   160
echo % pull in change on different branch than dirstate
6489ee64b522 fetch: use dirstate branch instead of first parents
Sune Foldager <cryo@cyanite.org>
parents: 7007
diff changeset
   161
hg init n1
6489ee64b522 fetch: use dirstate branch instead of first parents
Sune Foldager <cryo@cyanite.org>
parents: 7007
diff changeset
   162
echo a > n1/a
6489ee64b522 fetch: use dirstate branch instead of first parents
Sune Foldager <cryo@cyanite.org>
parents: 7007
diff changeset
   163
hg -R n1 ci -Am initial
6489ee64b522 fetch: use dirstate branch instead of first parents
Sune Foldager <cryo@cyanite.org>
parents: 7007
diff changeset
   164
hg clone n1 n2
6489ee64b522 fetch: use dirstate branch instead of first parents
Sune Foldager <cryo@cyanite.org>
parents: 7007
diff changeset
   165
echo b > n1/a
6489ee64b522 fetch: use dirstate branch instead of first parents
Sune Foldager <cryo@cyanite.org>
parents: 7007
diff changeset
   166
hg -R n1 ci -m next
6489ee64b522 fetch: use dirstate branch instead of first parents
Sune Foldager <cryo@cyanite.org>
parents: 7007
diff changeset
   167
hg -R n2 branch topic
6489ee64b522 fetch: use dirstate branch instead of first parents
Sune Foldager <cryo@cyanite.org>
parents: 7007
diff changeset
   168
hg -R n2 fetch -d '0 0' -m merge n1
6489ee64b522 fetch: use dirstate branch instead of first parents
Sune Foldager <cryo@cyanite.org>
parents: 7007
diff changeset
   169
echo '% parent should be 0 (fetch did not update or merge anything)'
6489ee64b522 fetch: use dirstate branch instead of first parents
Sune Foldager <cryo@cyanite.org>
parents: 7007
diff changeset
   170
hg -R n2 parents --template '{rev}\n'
6489ee64b522 fetch: use dirstate branch instead of first parents
Sune Foldager <cryo@cyanite.org>
parents: 7007
diff changeset
   171
rm -fr n1 n2
6489ee64b522 fetch: use dirstate branch instead of first parents
Sune Foldager <cryo@cyanite.org>
parents: 7007
diff changeset
   172
7855
aa1a87f7544f regression test for issue1552
Benjamin Pollack <benjamin@bitquabit.com>
parents: 7344
diff changeset
   173
echo % test fetch with inactive branches
aa1a87f7544f regression test for issue1552
Benjamin Pollack <benjamin@bitquabit.com>
parents: 7344
diff changeset
   174
hg init ib1
aa1a87f7544f regression test for issue1552
Benjamin Pollack <benjamin@bitquabit.com>
parents: 7344
diff changeset
   175
echo a > ib1/a
aa1a87f7544f regression test for issue1552
Benjamin Pollack <benjamin@bitquabit.com>
parents: 7344
diff changeset
   176
hg --cwd ib1 ci -Am base
aa1a87f7544f regression test for issue1552
Benjamin Pollack <benjamin@bitquabit.com>
parents: 7344
diff changeset
   177
hg --cwd ib1 branch second
aa1a87f7544f regression test for issue1552
Benjamin Pollack <benjamin@bitquabit.com>
parents: 7344
diff changeset
   178
echo b > ib1/b
aa1a87f7544f regression test for issue1552
Benjamin Pollack <benjamin@bitquabit.com>
parents: 7344
diff changeset
   179
hg --cwd ib1 ci -Am onsecond
aa1a87f7544f regression test for issue1552
Benjamin Pollack <benjamin@bitquabit.com>
parents: 7344
diff changeset
   180
hg --cwd ib1 branch -f default
aa1a87f7544f regression test for issue1552
Benjamin Pollack <benjamin@bitquabit.com>
parents: 7344
diff changeset
   181
echo c > ib1/c
aa1a87f7544f regression test for issue1552
Benjamin Pollack <benjamin@bitquabit.com>
parents: 7344
diff changeset
   182
hg --cwd ib1 ci -Am newdefault
aa1a87f7544f regression test for issue1552
Benjamin Pollack <benjamin@bitquabit.com>
parents: 7344
diff changeset
   183
hg clone ib1 ib2
aa1a87f7544f regression test for issue1552
Benjamin Pollack <benjamin@bitquabit.com>
parents: 7344
diff changeset
   184
echo % fetch should succeed
aa1a87f7544f regression test for issue1552
Benjamin Pollack <benjamin@bitquabit.com>
parents: 7344
diff changeset
   185
hg --cwd ib2 fetch ../ib1
aa1a87f7544f regression test for issue1552
Benjamin Pollack <benjamin@bitquabit.com>
parents: 7344
diff changeset
   186
rm -fr ib1 ib2
aa1a87f7544f regression test for issue1552
Benjamin Pollack <benjamin@bitquabit.com>
parents: 7344
diff changeset
   187
7344
58fd3c718ca4 tests: add killdaemons helper script
Matt Mackall <mpm@selenic.com>
parents: 7049
diff changeset
   188
"$TESTDIR/killdaemons.py"
58fd3c718ca4 tests: add killdaemons helper script
Matt Mackall <mpm@selenic.com>
parents: 7049
diff changeset
   189
6235
d16798000be0 test-fetch failed due to non-zero exit code
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6226
diff changeset
   190
true