Mercurial > hg
annotate tests/test-fetch.t @ 44322:72c15641c8b4
nodemap: introduce an explicit class/object for the docket
We are about to add more information to this docket, having a clear location to
stock them in memory will help.
Differential Revision: https://phab.mercurial-scm.org/D7884
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 15 Jan 2020 15:49:35 +0100 |
parents | eb586ed5d8ce |
children | 5c2a4f37eace |
rev | line source |
---|---|
22046
7a9cbb315d84
tests: replace exit 80 with #require
Matt Mackall <mpm@selenic.com>
parents:
21406
diff
changeset
|
1 #require serve |
15446
c5c9ca3719f9
tests: use 'hghave serve' to guard tests that requires serve daemon management
Mads Kiilerich <mads@kiilerich.com>
parents:
15244
diff
changeset
|
2 |
12426 | 3 $ echo "[extensions]" >> $HGRCPATH |
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 | 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 | 8 $ hg init a |
9 $ echo a > a/a | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
10 $ hg --cwd a commit -Ama |
12426 | 11 adding a |
12 $ hg clone a b | |
13 updating to branch default | |
14 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
15 $ hg clone a c | |
16 updating to branch default | |
17 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
18 $ echo b > a/b | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
19 $ hg --cwd a commit -Amb |
12426 | 20 adding b |
21 $ hg --cwd a parents -q | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
22 1:d2ae7f538514 |
2822
4f7abf341cd4
fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff
changeset
|
23 |
12426 | 24 should pull one change |
2822
4f7abf341cd4
fetch: fix breakage from mpm.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff
changeset
|
25 |
12426 | 26 $ hg --cwd b fetch ../a |
27 pulling from ../a | |
28 searching for changes | |
29 adding changesets | |
30 adding manifests | |
31 adding file changes | |
32 added 1 changesets with 1 changes to 1 files | |
34661
eb586ed5d8ce
transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
28964
diff
changeset
|
33 new changesets d2ae7f538514 |
12426 | 34 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
35 $ hg --cwd b parents -q | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
36 1:d2ae7f538514 |
12426 | 37 $ echo c > c/c |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
38 $ hg --cwd c commit -Amc |
12426 | 39 adding c |
40 $ hg clone c d | |
41 updating to branch default | |
42 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
43 $ hg clone c e | |
44 updating to branch default | |
45 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
|
46 |
12426 | 47 We cannot use the default commit message if fetching from a local |
48 repo, because the path of the repo will be included in the commit | |
49 message, making every commit appear different. | |
50 should merge c into a | |
5798
86f5d8f608b7
fetch: hide authentication details
Bryan O'Sullivan <bos@serpentine.com>
parents:
2990
diff
changeset
|
51 |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
52 $ hg --cwd c fetch -d '0 0' -m 'automated merge' ../a |
12426 | 53 pulling from ../a |
54 searching for changes | |
55 adding changesets | |
56 adding manifests | |
57 adding file changes | |
58 added 1 changesets with 1 changes to 1 files (+1 heads) | |
34661
eb586ed5d8ce
transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
28964
diff
changeset
|
59 new changesets d2ae7f538514 |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
60 updating to 2:d2ae7f538514 |
12426 | 61 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
62 merging with 1:d36c0562f908 |
12426 | 63 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
64 new changeset 3:a323a0c43ec4 merges remote changes with local |
12426 | 65 $ ls c |
66 a | |
67 b | |
68 c | |
28549 | 69 $ hg serve --cwd a -a localhost -p $HGPORT -d --pid-file=hg.pid |
12426 | 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 | 72 fetch over http, no auth |
21406
288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16913
diff
changeset
|
73 (this also tests that editor is invoked if '--edit' is specified) |
5798
86f5d8f608b7
fetch: hide authentication details
Bryan O'Sullivan <bos@serpentine.com>
parents:
2990
diff
changeset
|
74 |
21406
288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16913
diff
changeset
|
75 $ HGEDITOR=cat hg --cwd d fetch --edit http://localhost:$HGPORT/ |
12643
d08bb64888bc
tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents:
12535
diff
changeset
|
76 pulling from http://localhost:$HGPORT/ |
12426 | 77 searching for changes |
78 adding changesets | |
79 adding manifests | |
80 adding file changes | |
81 added 1 changesets with 1 changes to 1 files (+1 heads) | |
34661
eb586ed5d8ce
transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
28964
diff
changeset
|
82 new changesets d2ae7f538514 |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
83 updating to 2:d2ae7f538514 |
12426 | 84 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
85 merging with 1:d36c0562f908 |
12426 | 86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
21406
288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16913
diff
changeset
|
87 Automated merge with http://localhost:$HGPORT/ |
288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16913
diff
changeset
|
88 |
288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16913
diff
changeset
|
89 |
288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16913
diff
changeset
|
90 HG: Enter commit message. Lines beginning with 'HG:' are removed. |
288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16913
diff
changeset
|
91 HG: Leave message empty to abort commit. |
288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16913
diff
changeset
|
92 HG: -- |
288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16913
diff
changeset
|
93 HG: user: test |
288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16913
diff
changeset
|
94 HG: branch merge |
288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16913
diff
changeset
|
95 HG: branch 'default' |
288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16913
diff
changeset
|
96 HG: changed c |
12535
975ec4ce961c
tests: fix test-fetch port number variability
Matt Mackall <mpm@selenic.com>
parents:
12426
diff
changeset
|
97 new changeset 3:* merges remote changes with local (glob) |
12426 | 98 $ hg --cwd d tip --template '{desc}\n' |
12643
d08bb64888bc
tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents:
12535
diff
changeset
|
99 Automated merge with http://localhost:$HGPORT/ |
21406
288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16913
diff
changeset
|
100 $ hg --cwd d status --rev 'tip^1' --rev tip |
288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16913
diff
changeset
|
101 A c |
288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16913
diff
changeset
|
102 $ hg --cwd d status --rev 'tip^2' --rev tip |
288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16913
diff
changeset
|
103 A b |
6206
0b6f12495276
fetch: switch the default parent used for a merge
Bryan O'Sullivan <bos@serpentine.com>
parents:
5798
diff
changeset
|
104 |
12426 | 105 fetch over http with auth (should be hidden in desc) |
21406
288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16913
diff
changeset
|
106 (this also tests that editor is not invoked if '--edit' is not |
288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16913
diff
changeset
|
107 specified, even though commit message is not specified explicitly) |
6206
0b6f12495276
fetch: switch the default parent used for a merge
Bryan O'Sullivan <bos@serpentine.com>
parents:
5798
diff
changeset
|
108 |
21406
288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16913
diff
changeset
|
109 $ HGEDITOR=cat hg --cwd e fetch http://user:password@localhost:$HGPORT/ |
12643
d08bb64888bc
tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents:
12535
diff
changeset
|
110 pulling from http://user:***@localhost:$HGPORT/ |
12426 | 111 searching for changes |
112 adding changesets | |
113 adding manifests | |
114 adding file changes | |
115 added 1 changesets with 1 changes to 1 files (+1 heads) | |
34661
eb586ed5d8ce
transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
28964
diff
changeset
|
116 new changesets d2ae7f538514 |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
117 updating to 2:d2ae7f538514 |
12426 | 118 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
119 merging with 1:d36c0562f908 |
12426 | 120 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
|
121 new changeset 3:* merges remote changes with local (glob) |
12426 | 122 $ hg --cwd e tip --template '{desc}\n' |
12643
d08bb64888bc
tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents:
12535
diff
changeset
|
123 Automated merge with http://localhost:$HGPORT/ |
12426 | 124 $ hg clone a f |
125 updating to branch default | |
126 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
127 $ hg clone a g | |
128 updating to branch default | |
129 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
130 $ echo f > f/f | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
131 $ hg --cwd f ci -Amf |
12426 | 132 adding f |
133 $ echo g > g/g | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
134 $ hg --cwd g ci -Amg |
12426 | 135 adding g |
136 $ hg clone -q f h | |
137 $ 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
|
138 |
12426 | 139 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
|
140 |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
141 $ hg --cwd g fetch -d '0 0' --switch -m 'automated merge' ../f |
12426 | 142 pulling from ../f |
143 searching for changes | |
144 adding changesets | |
145 adding manifests | |
146 adding file changes | |
147 added 1 changesets with 1 changes to 1 files (+1 heads) | |
34661
eb586ed5d8ce
transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
28964
diff
changeset
|
148 new changesets 6343ca3eff20 |
12426 | 149 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
150 merging with 3:6343ca3eff20 |
12426 | 151 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
152 new changeset 4:f7faa0b7d3c6 merges remote changes with local |
12426 | 153 $ 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
|
154 |
12426 | 155 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
|
156 |
12426 | 157 $ hg --cwd i fetch ../h |
22676
a014fdc97154
fetch: use cmdutil.bailifchanged()
Martin von Zweigbergk <martinvonz@gmail.com>
parents:
22046
diff
changeset
|
158 abort: uncommitted changes |
12426 | 159 [255] |
7007
a6b74fbb5ce0
fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents:
6246
diff
changeset
|
160 |
12426 | 161 test fetch with named branches |
162 | |
163 $ hg init nbase | |
164 $ echo base > nbase/a | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
165 $ hg -R nbase ci -Am base |
12426 | 166 adding a |
167 $ hg -R nbase branch a | |
168 marked working directory as branch a | |
15615 | 169 (branches are permanent and global, did you want a bookmark?) |
12426 | 170 $ echo a > nbase/a |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
171 $ hg -R nbase ci -m a |
12426 | 172 $ hg -R nbase up -C 0 |
173 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
174 $ hg -R nbase branch b | |
175 marked working directory as branch b | |
176 $ echo b > nbase/b | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
177 $ hg -R nbase ci -Am b |
12426 | 178 adding b |
179 | |
180 pull in change on foreign branch | |
7007
a6b74fbb5ce0
fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents:
6246
diff
changeset
|
181 |
12426 | 182 $ hg clone nbase n1 |
183 updating to branch default | |
184 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
185 $ hg clone nbase n2 | |
186 updating to branch default | |
187 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
188 $ hg -R n1 up -C a | |
189 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
190 $ echo aa > n1/a | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
191 $ hg -R n1 ci -m a1 |
12426 | 192 $ hg -R n2 up -C b |
193 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
194 $ hg -R n2 fetch -m 'merge' n1 |
12426 | 195 pulling from n1 |
196 searching for changes | |
197 adding changesets | |
198 adding manifests | |
199 adding file changes | |
200 added 1 changesets with 1 changes to 1 files | |
34661
eb586ed5d8ce
transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
28964
diff
changeset
|
201 new changesets 8fdc9284bbc5 |
7007
a6b74fbb5ce0
fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents:
6246
diff
changeset
|
202 |
12426 | 203 parent should be 2 (no automatic update) |
7007
a6b74fbb5ce0
fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents:
6246
diff
changeset
|
204 |
12426 | 205 $ hg -R n2 parents --template '{rev}\n' |
206 2 | |
207 $ rm -fr n1 n2 | |
208 | |
209 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
|
210 |
12426 | 211 $ hg clone nbase n1 |
212 updating to branch default | |
213 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
214 $ hg clone nbase n2 | |
215 updating to branch default | |
216 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
217 $ hg -R n1 up -C a | |
218 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
219 $ echo aa > n1/a | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
220 $ hg -R n1 ci -m a1 |
12426 | 221 $ hg -R n1 up -C b |
222 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
223 $ echo bb > n1/b | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
224 $ hg -R n1 ci -m b1 |
12426 | 225 $ hg -R n2 up -C b |
226 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
227 $ hg -R n2 fetch -m 'merge' n1 |
12426 | 228 pulling from n1 |
229 searching for changes | |
230 adding changesets | |
231 adding manifests | |
232 adding file changes | |
233 added 2 changesets with 2 changes to 2 files | |
34661
eb586ed5d8ce
transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
28964
diff
changeset
|
234 new changesets 8fdc9284bbc5:3c4a837a864f |
12426 | 235 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
|
236 |
12426 | 237 parent should be 4 (fast forward) |
238 | |
239 $ hg -R n2 parents --template '{rev}\n' | |
240 4 | |
241 $ rm -fr n1 n2 | |
242 | |
243 pull changes on foreign (2 new heads) and local (1 new head) branches | |
244 with a local change | |
7007
a6b74fbb5ce0
fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents:
6246
diff
changeset
|
245 |
12426 | 246 $ hg clone nbase n1 |
247 updating to branch default | |
248 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
249 $ hg clone nbase n2 | |
250 updating to branch default | |
251 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
252 $ hg -R n1 up -C a | |
253 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
254 $ echo a1 > n1/a | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
255 $ hg -R n1 ci -m a1 |
12426 | 256 $ hg -R n1 up -C b |
257 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
258 $ echo bb > n1/b | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
259 $ hg -R n1 ci -m b1 |
12426 | 260 $ hg -R n1 up -C 1 |
261 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
262 $ echo a2 > n1/a | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
263 $ hg -R n1 ci -m a2 |
12426 | 264 created new head |
265 $ hg -R n2 up -C b | |
266 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
267 $ echo change >> n2/c | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
268 $ hg -R n2 ci -A -m local |
12426 | 269 adding c |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
270 $ hg -R n2 fetch -d '0 0' -m 'merge' n1 |
12426 | 271 pulling from n1 |
272 searching for changes | |
273 adding changesets | |
274 adding manifests | |
275 adding file changes | |
276 added 3 changesets with 3 changes to 2 files (+2 heads) | |
34661
eb586ed5d8ce
transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
28964
diff
changeset
|
277 new changesets d05ce59ff88d:a7954de24e4c |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
278 updating to 5:3c4a837a864f |
12426 | 279 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
280 merging with 3:1267f84a9ea5 |
12426 | 281 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
282 new changeset 7:2cf2a1261f21 merges remote changes with local |
7007
a6b74fbb5ce0
fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents:
6246
diff
changeset
|
283 |
12426 | 284 parent should be 7 (new merge changeset) |
7007
a6b74fbb5ce0
fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents:
6246
diff
changeset
|
285 |
12426 | 286 $ hg -R n2 parents --template '{rev}\n' |
287 7 | |
288 $ rm -fr n1 n2 | |
289 | |
290 pull in changes on foreign (merge of local branch) and local (2 new | |
291 heads) with a local change | |
7007
a6b74fbb5ce0
fetch: added support for named branches
Sune Foldager <cryo@cyanite.org>
parents:
6246
diff
changeset
|
292 |
12426 | 293 $ hg clone nbase n1 |
294 updating to branch default | |
295 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
296 $ hg clone nbase n2 | |
297 updating to branch default | |
298 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
299 $ hg -R n1 up -C a | |
300 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
301 $ hg -R n1 merge b | |
302 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
303 (branch merge, don't forget to commit) | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
304 $ hg -R n1 ci -m merge |
12426 | 305 $ hg -R n1 up -C 2 |
306 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
307 $ echo c > n1/a | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
308 $ hg -R n1 ci -m c |
12426 | 309 $ hg -R n1 up -C 2 |
310 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
311 $ echo cc > n1/a | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
312 $ hg -R n1 ci -m cc |
12426 | 313 created new head |
314 $ hg -R n2 up -C b | |
315 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
316 $ echo change >> n2/b | |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
317 $ hg -R n2 ci -A -m local |
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
318 $ hg -R n2 fetch -m 'merge' n1 |
12426 | 319 pulling from n1 |
320 searching for changes | |
321 adding changesets | |
322 adding manifests | |
323 adding file changes | |
324 added 3 changesets with 2 changes to 1 files (+2 heads) | |
34661
eb586ed5d8ce
transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
28964
diff
changeset
|
325 new changesets b84e8d0f020f:3d3bf54f99c0 |
12426 | 326 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
|
327 [1] |
7049
6489ee64b522
fetch: use dirstate branch instead of first parents
Sune Foldager <cryo@cyanite.org>
parents:
7007
diff
changeset
|
328 |
12426 | 329 parent should be 3 (fetch did not merge anything) |
330 | |
331 $ hg -R n2 parents --template '{rev}\n' | |
332 3 | |
333 $ rm -fr n1 n2 | |
334 | |
335 pull in change on different branch than dirstate | |
336 | |
337 $ hg init n1 | |
338 $ echo a > n1/a | |
339 $ hg -R n1 ci -Am initial | |
340 adding a | |
341 $ hg clone n1 n2 | |
342 updating to branch default | |
343 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
344 $ echo b > n1/a | |
345 $ hg -R n1 ci -m next | |
346 $ hg -R n2 branch topic | |
347 marked working directory as branch topic | |
15615 | 348 (branches are permanent and global, did you want a bookmark?) |
15244
f6d5d01725db
tests: cleanup of test-fetch.t
Mads Kiilerich <mads@kiilerich.com>
parents:
15243
diff
changeset
|
349 $ hg -R n2 fetch -m merge n1 |
24368
55fd99a23fdc
fetch: use an abort hint where appropriate
Yuya Nishihara <yuya@tcha.org>
parents:
24365
diff
changeset
|
350 abort: working directory not at branch tip |
28964
9dcc9ed26d33
fetch: use single quotes around command hint
timeless <timeless@mozdev.org>
parents:
28549
diff
changeset
|
351 (use 'hg update' to check out branch tip) |
12426 | 352 [255] |
353 | |
354 parent should be 0 (fetch did not update or merge anything) | |
355 | |
356 $ hg -R n2 parents --template '{rev}\n' | |
357 0 | |
358 $ rm -fr n1 n2 | |
359 | |
360 test fetch with inactive branches | |
7855
aa1a87f7544f
regression test for issue1552
Benjamin Pollack <benjamin@bitquabit.com>
parents:
7344
diff
changeset
|
361 |
12426 | 362 $ hg init ib1 |
363 $ echo a > ib1/a | |
364 $ hg --cwd ib1 ci -Am base | |
365 adding a | |
366 $ hg --cwd ib1 branch second | |
367 marked working directory as branch second | |
15615 | 368 (branches are permanent and global, did you want a bookmark?) |
12426 | 369 $ echo b > ib1/b |
370 $ hg --cwd ib1 ci -Am onsecond | |
371 adding b | |
372 $ hg --cwd ib1 branch -f default | |
373 marked working directory as branch default | |
374 $ echo c > ib1/c | |
375 $ hg --cwd ib1 ci -Am newdefault | |
376 adding c | |
377 created new head | |
378 $ hg clone ib1 ib2 | |
379 updating to branch default | |
380 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
381 | |
382 fetch should succeed | |
383 | |
384 $ hg --cwd ib2 fetch ../ib1 | |
385 pulling from ../ib1 | |
386 searching for changes | |
387 no changes found | |
388 $ rm -fr ib1 ib2 | |
389 | |
390 test issue1726 | |
9093
0b2b269ba3d0
branch heads: fix regression introduced in e67e5b60e55f (issue1726)
Henrik Stuart <hg@hstuart.dk>
parents:
7855
diff
changeset
|
391 |
12426 | 392 $ hg init i1726r1 |
393 $ echo a > i1726r1/a | |
394 $ hg --cwd i1726r1 ci -Am base | |
395 adding a | |
396 $ hg clone i1726r1 i1726r2 | |
397 updating to branch default | |
398 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
399 $ echo b > i1726r1/a | |
400 $ hg --cwd i1726r1 ci -m second | |
401 $ echo c > i1726r2/a | |
402 $ hg --cwd i1726r2 ci -m third | |
403 $ HGMERGE=true hg --cwd i1726r2 fetch ../i1726r1 | |
404 pulling from ../i1726r1 | |
405 searching for changes | |
406 adding changesets | |
407 adding manifests | |
408 adding file changes | |
409 added 1 changesets with 1 changes to 1 files (+1 heads) | |
34661
eb586ed5d8ce
transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
28964
diff
changeset
|
410 new changesets 7837755a2789 |
12426 | 411 updating to 2:7837755a2789 |
412 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
413 merging with 1:d1f0c6c48ebd | |
414 merging a | |
415 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
416 new changeset 3:* merges remote changes with local (glob) | |
417 $ hg --cwd i1726r2 heads default --template '{rev}\n' | |
418 3 | |
10580
612c142b7a82
fetch: fix newheads calculation (issue2047)
Sune Foldager <cryo@cyanite.org>
parents:
10398
diff
changeset
|
419 |
12426 | 420 test issue2047 |
7344
58fd3c718ca4
tests: add killdaemons helper script
Matt Mackall <mpm@selenic.com>
parents:
7049
diff
changeset
|
421 |
12426 | 422 $ hg -q init i2047a |
423 $ cd i2047a | |
424 $ echo a > a | |
425 $ hg -q ci -Am a | |
426 $ hg -q branch stable | |
427 $ echo b > b | |
428 $ hg -q ci -Am b | |
429 $ cd .. | |
430 $ hg -q clone -r 0 i2047a i2047b | |
431 $ cd i2047b | |
432 $ hg fetch ../i2047a | |
433 pulling from ../i2047a | |
434 searching for changes | |
435 adding changesets | |
436 adding manifests | |
437 adding file changes | |
438 added 1 changesets with 1 changes to 1 files | |
34661
eb586ed5d8ce
transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
28964
diff
changeset
|
439 new changesets c8735224de5c |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
15623
diff
changeset
|
440 |
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
15623
diff
changeset
|
441 $ cd .. |