tests/test-fetch.t
author Martin Geisler <mg@aragost.com>
Thu, 10 Mar 2011 16:49:37 +0100
changeset 13576 edd06611a7c6
parent 12711 b885f28fa4fa
child 15243 1e9451476bf8
permissions -rw-r--r--
ui: yield unchanged values in walkconfig Ever since walkconfig was introduced back in 25e7ea0f2cff, the values yielded has been mutated by replacing "\n" with "\\n". This makes walkconfig less useful than it could and there is no other way to iterate over all config sections. The third-party reposettings extension used ui.walkconfig but did not take the replacement into account -- this change will actually fix a bug in the extension when a value contains a newline.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
     1
adjust to non-default HGPORT, e.g. with run-tests.py -j
2822
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     2
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
     3
  $ echo "[extensions]" >> $HGRCPATH
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
     4
  $ echo "fetch=" >> $HGRCPATH
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
     5
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
     6
test fetch with default branches only
2822
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     7
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
     8
  $ hg init a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
     9
  $ echo a > a/a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    10
  $ hg --cwd a commit -d '1 0' -Ama
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    11
  adding a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    12
  $ hg clone a b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    13
  updating to branch default
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    14
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    15
  $ hg clone a c
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    16
  updating to branch default
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    17
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    18
  $ echo b > a/b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    19
  $ hg --cwd a commit -d '2 0' -Amb
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    20
  adding b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    21
  $ hg --cwd a parents -q
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    22
  1:97d72e5f12c7
2822
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    23
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    24
should pull one change
2822
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    25
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    26
  $ hg --cwd b fetch ../a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    27
  pulling from ../a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    28
  searching for changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    29
  adding changesets
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    30
  adding manifests
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    31
  adding file changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    32
  added 1 changesets with 1 changes to 1 files
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    33
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    34
  $ hg --cwd b parents -q
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    35
  1:97d72e5f12c7
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    36
  $ echo c > c/c
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    37
  $ hg --cwd c commit -d '3 0' -Amc
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    38
  adding c
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    39
  $ hg clone c d
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    40
  updating to branch default
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    41
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    42
  $ hg clone c e
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    43
  updating to branch default
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    44
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
2822
4f7abf341cd4 fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    45
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    46
We cannot use the default commit message if fetching from a local
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    47
repo, because the path of the repo will be included in the commit
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    48
message, making every commit appear different.
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    49
should merge c into a
5798
86f5d8f608b7 fetch: hide authentication details
Bryan O'Sullivan <bos@serpentine.com>
parents: 2990
diff changeset
    50
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    51
  $ hg --cwd c fetch -d '4 0' -m 'automated merge' ../a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    52
  pulling from ../a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    53
  searching for changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    54
  adding changesets
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    55
  adding manifests
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    56
  adding file changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    57
  added 1 changesets with 1 changes to 1 files (+1 heads)
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    58
  updating to 2:97d72e5f12c7
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    59
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    60
  merging with 1:5e056962225c
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    61
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    62
  new changeset 3:cd3a41621cf0 merges remote changes with local
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    63
  $ ls c
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    64
  a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    65
  b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    66
  c
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    67
  $ netstat -tnap 2>/dev/null | grep $HGPORT | grep LISTEN
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    68
  [1]
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    69
  $ hg --cwd a serve -a localhost -p $HGPORT -d --pid-file=hg.pid
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    70
  $ cat a/hg.pid >> "$DAEMON_PIDS"
5798
86f5d8f608b7 fetch: hide authentication details
Bryan O'Sullivan <bos@serpentine.com>
parents: 2990
diff changeset
    71
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    72
fetch over http, no auth
5798
86f5d8f608b7 fetch: hide authentication details
Bryan O'Sullivan <bos@serpentine.com>
parents: 2990
diff changeset
    73
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    74
  $ hg --cwd d fetch -d '5 0' http://localhost:$HGPORT/
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12535
diff changeset
    75
  pulling from http://localhost:$HGPORT/
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    76
  searching for changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    77
  adding changesets
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    78
  adding manifests
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    79
  adding file changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    80
  added 1 changesets with 1 changes to 1 files (+1 heads)
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    81
  updating to 2:97d72e5f12c7
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    82
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    83
  merging with 1:5e056962225c
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    84
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
12535
975ec4ce961c tests: fix test-fetch port number variability
Matt Mackall <mpm@selenic.com>
parents: 12426
diff changeset
    85
  new changeset 3:* merges remote changes with local (glob)
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    86
  $ hg --cwd d tip --template '{desc}\n'
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12535
diff changeset
    87
  Automated merge with http://localhost:$HGPORT/
6206
0b6f12495276 fetch: switch the default parent used for a merge
Bryan O'Sullivan <bos@serpentine.com>
parents: 5798
diff changeset
    88
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    89
fetch over http with auth (should be hidden in desc)
6206
0b6f12495276 fetch: switch the default parent used for a merge
Bryan O'Sullivan <bos@serpentine.com>
parents: 5798
diff changeset
    90
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    91
  $ hg --cwd e fetch -d '5 0' http://user:password@localhost:$HGPORT/
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12535
diff changeset
    92
  pulling from http://user:***@localhost:$HGPORT/
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    93
  searching for changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    94
  adding changesets
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    95
  adding manifests
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    96
  adding file changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    97
  added 1 changesets with 1 changes to 1 files (+1 heads)
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    98
  updating to 2:97d72e5f12c7
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
    99
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   100
  merging with 1:5e056962225c
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   101
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
12535
975ec4ce961c tests: fix test-fetch port number variability
Matt Mackall <mpm@selenic.com>
parents: 12426
diff changeset
   102
  new changeset 3:* merges remote changes with local (glob)
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   103
  $ hg --cwd e tip --template '{desc}\n'
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12535
diff changeset
   104
  Automated merge with http://localhost:$HGPORT/
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   105
  $ hg clone a f
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   106
  updating to branch default
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   107
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   108
  $ hg clone a g
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   109
  updating to branch default
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   110
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   111
  $ echo f > f/f
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   112
  $ hg --cwd f ci -d '6 0' -Amf
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   113
  adding f
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   114
  $ echo g > g/g
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   115
  $ hg --cwd g ci -d '6 0' -Amg
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   116
  adding g
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   117
  $ hg clone -q f h
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   118
  $ hg clone -q g i
6206
0b6f12495276 fetch: switch the default parent used for a merge
Bryan O'Sullivan <bos@serpentine.com>
parents: 5798
diff changeset
   119
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   120
should merge f into g
6226
bd61e44eb2cc fetch: don't proceed if working directory is missing files (issue988)
Bryan O'Sullivan <bos@serpentine.com>
parents: 6207
diff changeset
   121
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   122
  $ hg --cwd g fetch -d '7 0' --switch -m 'automated merge' ../f
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   123
  pulling from ../f
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   124
  searching for changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   125
  adding changesets
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   126
  adding manifests
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   127
  adding file changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   128
  added 1 changesets with 1 changes to 1 files (+1 heads)
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   129
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   130
  merging with 3:cc6a3744834d
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   131
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   132
  new changeset 4:55aa4f32ec59 merges remote changes with local
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   133
  $ rm i/g
6226
bd61e44eb2cc fetch: don't proceed if working directory is missing files (issue988)
Bryan O'Sullivan <bos@serpentine.com>
parents: 6207
diff changeset
   134
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   135
should abort, because i is modified
6235
d16798000be0 test-fetch failed due to non-zero exit code
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6226
diff changeset
   136
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   137
  $ hg --cwd i fetch ../h
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   138
  abort: working directory is missing some files
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   139
  [255]
7007
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   140
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   141
test fetch with named branches
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   142
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   143
  $ hg init nbase
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   144
  $ echo base > nbase/a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   145
  $ hg -R nbase ci -d '1 0' -Am base
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   146
  adding a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   147
  $ hg -R nbase branch a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   148
  marked working directory as branch a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   149
  $ echo a > nbase/a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   150
  $ hg -R nbase ci -d '2 0' -m a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   151
  $ hg -R nbase up -C 0
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   152
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   153
  $ hg -R nbase branch b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   154
  marked working directory as branch b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   155
  $ echo b > nbase/b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   156
  $ hg -R nbase ci -Ad '3 0' -m b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   157
  adding b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   158
  $ echo
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   159
  
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   160
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   161
pull in change on foreign branch
7007
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   162
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   163
  $ hg clone nbase n1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   164
  updating to branch default
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   165
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   166
  $ hg clone nbase n2
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   167
  updating to branch default
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   168
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   169
  $ hg -R n1 up -C a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   170
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   171
  $ echo aa > n1/a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   172
  $ hg -R n1 ci -d '4 0' -m a1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   173
  $ hg -R n2 up -C b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   174
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   175
  $ hg -R n2 fetch -d '9 0' -m 'merge' n1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   176
  pulling from n1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   177
  searching for changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   178
  adding changesets
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   179
  adding manifests
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   180
  adding file changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   181
  added 1 changesets with 1 changes to 1 files
7007
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   182
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   183
parent should be 2 (no automatic update)
7007
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   184
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   185
  $ hg -R n2 parents --template '{rev}\n'
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   186
  2
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   187
  $ rm -fr n1 n2
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   188
  $ echo
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   189
  
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   190
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   191
pull in changes on both foreign and local branches
7007
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   192
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   193
  $ hg clone nbase n1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   194
  updating to branch default
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   195
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   196
  $ hg clone nbase n2
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   197
  updating to branch default
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   198
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   199
  $ hg -R n1 up -C a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   200
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   201
  $ echo aa > n1/a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   202
  $ hg -R n1 ci -d '4 0' -m a1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   203
  $ hg -R n1 up -C b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   204
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   205
  $ echo bb > n1/b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   206
  $ hg -R n1 ci -d '5 0' -m b1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   207
  $ hg -R n2 up -C b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   208
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   209
  $ hg -R n2 fetch -d '9 0' -m 'merge' n1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   210
  pulling from n1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   211
  searching for changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   212
  adding changesets
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   213
  adding manifests
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   214
  adding file changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   215
  added 2 changesets with 2 changes to 2 files
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   216
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
7007
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   217
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   218
parent should be 4 (fast forward)
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   219
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   220
  $ hg -R n2 parents --template '{rev}\n'
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   221
  4
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   222
  $ rm -fr n1 n2
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   223
  $ echo
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   224
  
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   225
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   226
pull changes on foreign (2 new heads) and local (1 new head) branches
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   227
with a local change
7007
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   228
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   229
  $ hg clone nbase n1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   230
  updating to branch default
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   231
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   232
  $ hg clone nbase n2
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   233
  updating to branch default
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   234
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   235
  $ hg -R n1 up -C a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   236
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   237
  $ echo a1 > n1/a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   238
  $ hg -R n1 ci -d '4 0' -m a1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   239
  $ hg -R n1 up -C b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   240
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   241
  $ echo bb > n1/b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   242
  $ hg -R n1 ci -d '5 0' -m b1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   243
  $ hg -R n1 up -C 1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   244
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   245
  $ echo a2 > n1/a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   246
  $ hg -R n1 ci -d '6 0' -m a2
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   247
  created new head
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   248
  $ hg -R n2 up -C b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   249
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   250
  $ echo change >> n2/c
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   251
  $ hg -R n2 ci -Ad '7 0' -m local
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   252
  adding c
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   253
  $ hg -R n2 fetch -d '9 0' -m 'merge' n1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   254
  pulling from n1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   255
  searching for changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   256
  adding changesets
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   257
  adding manifests
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   258
  adding file changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   259
  added 3 changesets with 3 changes to 2 files (+2 heads)
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   260
  updating to 5:708c6cce3d26
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   261
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   262
  merging with 3:d83427717b1f
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   263
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   264
  new changeset 7:48f1a33f52af merges remote changes with local
7007
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   265
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   266
parent should be 7 (new merge changeset)
7007
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   267
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   268
  $ hg -R n2 parents --template '{rev}\n'
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   269
  7
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   270
  $ rm -fr n1 n2
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   271
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   272
pull in changes on foreign (merge of local branch) and local (2 new
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   273
heads) with a local change
7007
a6b74fbb5ce0 fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents: 6246
diff changeset
   274
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   275
  $ hg clone nbase n1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   276
  updating to branch default
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   277
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   278
  $ hg clone nbase n2
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   279
  updating to branch default
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   280
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   281
  $ hg -R n1 up -C a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   282
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   283
  $ hg -R n1 merge b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   284
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   285
  (branch merge, don't forget to commit)
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   286
  $ hg -R n1 ci -d '4 0' -m merge
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   287
  $ hg -R n1 up -C 2
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   288
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   289
  $ echo c > n1/a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   290
  $ hg -R n1 ci -d '5 0' -m c
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   291
  $ hg -R n1 up -C 2
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   292
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   293
  $ echo cc > n1/a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   294
  $ hg -R n1 ci -d '6 0' -m cc
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   295
  created new head
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   296
  $ hg -R n2 up -C b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   297
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   298
  $ echo change >> n2/b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   299
  $ hg -R n2 ci -Ad '7 0' -m local
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   300
  $ hg -R n2 fetch -d '9 0' -m 'merge' n1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   301
  pulling from n1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   302
  searching for changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   303
  adding changesets
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   304
  adding manifests
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   305
  adding file changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   306
  added 3 changesets with 2 changes to 1 files (+2 heads)
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   307
  not merging with 1 other new branch heads (use "hg heads ." and "hg merge" to merge them)
12711
b885f28fa4fa fetch: fix and document exit codes (issue2356)
Matt Mackall <mpm@selenic.com>
parents: 12643
diff changeset
   308
  [1]
7049
6489ee64b522 fetch: use dirstate branch instead of first parents
Sune Foldager <cryo@cyanite.org>
parents: 7007
diff changeset
   309
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   310
parent should be 3 (fetch did not merge anything)
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   311
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   312
  $ hg -R n2 parents --template '{rev}\n'
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   313
  3
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   314
  $ rm -fr n1 n2
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   315
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   316
pull in change on different branch than dirstate
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   317
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   318
  $ hg init n1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   319
  $ echo a > n1/a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   320
  $ hg -R n1 ci -Am initial
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   321
  adding a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   322
  $ hg clone n1 n2
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   323
  updating to branch default
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   324
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   325
  $ echo b > n1/a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   326
  $ hg -R n1 ci -m next
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   327
  $ hg -R n2 branch topic
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   328
  marked working directory as branch topic
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   329
  $ hg -R n2 fetch -d '0 0' -m merge n1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   330
  abort: working dir not at branch tip (use "hg update" to check out branch tip)
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   331
  [255]
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   332
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   333
parent should be 0 (fetch did not update or merge anything)
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   334
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   335
  $ hg -R n2 parents --template '{rev}\n'
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   336
  0
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   337
  $ rm -fr n1 n2
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   338
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   339
test fetch with inactive branches
7855
aa1a87f7544f regression test for issue1552
Benjamin Pollack <benjamin@bitquabit.com>
parents: 7344
diff changeset
   340
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   341
  $ hg init ib1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   342
  $ echo a > ib1/a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   343
  $ hg --cwd ib1 ci -Am base
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   344
  adding a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   345
  $ hg --cwd ib1 branch second
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   346
  marked working directory as branch second
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   347
  $ echo b > ib1/b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   348
  $ hg --cwd ib1 ci -Am onsecond
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   349
  adding b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   350
  $ hg --cwd ib1 branch -f default
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   351
  marked working directory as branch default
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   352
  $ echo c > ib1/c
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   353
  $ hg --cwd ib1 ci -Am newdefault
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   354
  adding c
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   355
  created new head
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   356
  $ hg clone ib1 ib2
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   357
  updating to branch default
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   358
  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   359
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   360
fetch should succeed
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   361
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   362
  $ hg --cwd ib2 fetch ../ib1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   363
  pulling from ../ib1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   364
  searching for changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   365
  no changes found
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   366
  $ rm -fr ib1 ib2
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   367
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   368
test issue1726
9093
0b2b269ba3d0 branch heads: fix regression introduced in e67e5b60e55f (issue1726)
Henrik Stuart <hg@hstuart.dk>
parents: 7855
diff changeset
   369
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   370
  $ hg init i1726r1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   371
  $ echo a > i1726r1/a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   372
  $ hg --cwd i1726r1 ci -Am base
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   373
  adding a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   374
  $ hg clone i1726r1 i1726r2
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   375
  updating to branch default
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   376
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   377
  $ echo b > i1726r1/a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   378
  $ hg --cwd i1726r1 ci -m second
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   379
  $ echo c > i1726r2/a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   380
  $ hg --cwd i1726r2 ci -m third
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   381
  $ HGMERGE=true hg --cwd i1726r2 fetch ../i1726r1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   382
  pulling from ../i1726r1
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   383
  searching for changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   384
  adding changesets
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   385
  adding manifests
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   386
  adding file changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   387
  added 1 changesets with 1 changes to 1 files (+1 heads)
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   388
  updating to 2:7837755a2789
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   389
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   390
  merging with 1:d1f0c6c48ebd
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   391
  merging a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   392
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   393
  new changeset 3:* merges remote changes with local (glob)
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   394
  $ hg --cwd i1726r2 heads default --template '{rev}\n'
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   395
  3
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   396
  $ echo
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   397
  
10580
612c142b7a82 fetch: fix newheads calculation (issue2047)
Sune Foldager <cryo@cyanite.org>
parents: 10398
diff changeset
   398
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   399
test issue2047
7344
58fd3c718ca4 tests: add killdaemons helper script
Matt Mackall <mpm@selenic.com>
parents: 7049
diff changeset
   400
12426
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   401
  $ hg -q init i2047a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   402
  $ cd i2047a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   403
  $ echo a > a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   404
  $ hg -q ci -Am a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   405
  $ hg -q branch stable
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   406
  $ echo b > b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   407
  $ hg -q ci -Am b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   408
  $ cd ..
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   409
  $ hg -q clone -r 0 i2047a i2047b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   410
  $ cd i2047b
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   411
  $ hg fetch ../i2047a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   412
  pulling from ../i2047a
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   413
  searching for changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   414
  adding changesets
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   415
  adding manifests
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   416
  adding file changes
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   417
  added 1 changesets with 1 changes to 1 files
dd600141616d tests: unify test-fetch
Matt Mackall <mpm@selenic.com>
parents: 10581
diff changeset
   418
  $ "$TESTDIR/killdaemons.py"