Mercurial > hg > mercurial-source
annotate tests/test-push-warn.t @ 12366:22f3353bcc36
tests: cleanup exit code handling in unified tests
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 21 Sep 2010 16:00:02 -0500 |
parents | b63f6422d2a7 |
children | 4fee1fd3de9a |
rev | line source |
---|---|
12279 | 1 $ echo "[extensions]" >> $HGRCPATH |
2 $ echo "graphlog=" >> $HGRCPATH | |
816
8674b7803714
Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff
changeset
|
3 |
12279 | 4 $ mkdir a |
5 $ cd a | |
6 $ hg init | |
7 $ echo foo > t1 | |
8 $ hg add t1 | |
9 $ hg commit -m "1" | |
10874
a9702c47a19f
partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents:
10771
diff
changeset
|
10 |
12279 | 11 $ cd .. |
12 $ hg clone a b | |
13 updating to branch default | |
14 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
15 | |
16 $ cd a | |
17 $ echo foo > t2 | |
18 $ hg add t2 | |
19 $ hg commit -m "2" | |
20 | |
21 $ cd ../b | |
22 $ echo foo > t3 | |
23 $ hg add t3 | |
24 $ hg commit -m "3" | |
816
8674b7803714
Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff
changeset
|
25 |
12279 | 26 $ hg push ../a |
27 pushing to ../a | |
28 searching for changes | |
29 abort: push creates new remote heads on branch 'default'! | |
30 (you should pull and merge or use push -f to force) | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
31 [255] |
816
8674b7803714
Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff
changeset
|
32 |
12279 | 33 $ hg pull ../a |
34 pulling from ../a | |
35 searching for changes | |
36 adding changesets | |
37 adding manifests | |
38 adding file changes | |
39 added 1 changesets with 1 changes to 1 files (+1 heads) | |
40 (run 'hg heads' to see heads, 'hg merge' to merge) | |
816
8674b7803714
Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff
changeset
|
41 |
12279 | 42 $ hg push ../a |
43 pushing to ../a | |
44 searching for changes | |
45 abort: push creates new remote heads on branch 'default'! | |
46 (did you forget to merge? use push -f to force) | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
47 [255] |
12279 | 48 |
49 $ hg merge | |
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
51 (branch merge, don't forget to commit) | |
816
8674b7803714
Warn on pushing unsynced repo or adding new heads
mpm@selenic.com
parents:
diff
changeset
|
52 |
12279 | 53 $ hg commit -m "4" |
54 $ hg push ../a | |
55 pushing to ../a | |
56 searching for changes | |
57 adding changesets | |
58 adding manifests | |
59 adding file changes | |
60 added 2 changesets with 1 changes to 1 files | |
61 | |
62 $ cd .. | |
63 | |
64 $ hg init c | |
65 $ cd c | |
66 $ for i in 0 1 2; do | |
67 > echo $i >> foo | |
68 > hg ci -Am $i | |
69 > done | |
70 adding foo | |
71 $ cd .. | |
72 | |
73 $ hg clone c d | |
74 updating to branch default | |
75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
2021
fc22ed56afe3
Fix hg push and hg push -r sometimes creating new heads without --force.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
76 |
12279 | 77 $ cd d |
78 $ for i in 0 1; do | |
79 > hg co -C $i | |
80 > echo d-$i >> foo | |
81 > hg ci -m d-$i | |
82 > done | |
83 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
84 created new head | |
85 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
86 created new head | |
87 | |
88 $ HGMERGE=true hg merge 3 | |
89 merging foo | |
90 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
91 (branch merge, don't forget to commit) | |
92 | |
93 $ hg ci -m c-d | |
2021
fc22ed56afe3
Fix hg push and hg push -r sometimes creating new heads without --force.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
94 |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
95 $ hg push ../c |
12279 | 96 pushing to ../c |
97 searching for changes | |
98 abort: push creates new remote heads on branch 'default'! | |
99 (did you forget to merge? use push -f to force) | |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
100 [255] |
2021
fc22ed56afe3
Fix hg push and hg push -r sometimes creating new heads without --force.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
101 |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
102 $ hg push -r 2 ../c |
12279 | 103 pushing to ../c |
104 searching for changes | |
105 no changes found | |
106 | |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
107 $ hg push -r 3 ../c |
12279 | 108 pushing to ../c |
109 searching for changes | |
110 abort: push creates new remote heads on branch 'default'! | |
111 (did you forget to merge? use push -f to force) | |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
112 [255] |
2021
fc22ed56afe3
Fix hg push and hg push -r sometimes creating new heads without --force.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
113 |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
114 $ hg push -r 3 -r 4 ../c |
12279 | 115 pushing to ../c |
116 searching for changes | |
117 abort: push creates new remote heads on branch 'default'! | |
118 (did you forget to merge? use push -f to force) | |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
119 [255] |
12279 | 120 |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
121 $ hg push -f -r 3 -r 4 ../c |
12279 | 122 pushing to ../c |
123 searching for changes | |
124 adding changesets | |
125 adding manifests | |
126 adding file changes | |
127 added 2 changesets with 2 changes to 1 files (+2 heads) | |
128 | |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
129 $ hg push -r 5 ../c |
12279 | 130 pushing to ../c |
131 searching for changes | |
132 adding changesets | |
133 adding manifests | |
134 adding file changes | |
135 added 1 changesets with 1 changes to 1 files (-1 heads) | |
2021
fc22ed56afe3
Fix hg push and hg push -r sometimes creating new heads without --force.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
136 |
12279 | 137 $ hg in ../c |
138 comparing with ../c | |
139 searching for changes | |
140 no changes found | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
141 [1] |
12279 | 142 |
143 | |
144 Issue 450: | |
3925
27230c29bfec
fix calculation of new heads added during push with -r
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3797
diff
changeset
|
145 |
12279 | 146 $ hg init ../e |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
147 $ hg push -r 0 ../e |
12279 | 148 pushing to ../e |
149 searching for changes | |
150 adding changesets | |
151 adding manifests | |
152 adding file changes | |
153 added 1 changesets with 1 changes to 1 files | |
154 | |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
155 $ hg push -r 1 ../e |
12279 | 156 pushing to ../e |
157 searching for changes | |
158 adding changesets | |
159 adding manifests | |
160 adding file changes | |
161 added 1 changesets with 1 changes to 1 files | |
162 | |
163 $ cd .. | |
164 | |
165 | |
166 Issue 736: | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3925
diff
changeset
|
167 |
12279 | 168 $ hg init f |
169 $ cd f | |
170 $ hg -q branch a | |
171 $ echo 0 > foo | |
172 $ hg -q ci -Am 0 | |
173 $ echo 1 > foo | |
174 $ hg -q ci -m 1 | |
175 $ hg -q up 0 | |
176 $ echo 2 > foo | |
177 $ hg -q ci -m 2 | |
178 $ hg -q up 0 | |
179 $ hg -q branch b | |
180 $ echo 3 > foo | |
181 $ hg -q ci -m 3 | |
182 $ cd .. | |
183 | |
184 $ hg -q clone f g | |
185 $ cd g | |
186 | |
187 Push on existing branch and new branch: | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3925
diff
changeset
|
188 |
12279 | 189 $ hg -q up 1 |
190 $ echo 4 > foo | |
191 $ hg -q ci -m 4 | |
192 $ hg -q up 0 | |
193 $ echo 5 > foo | |
194 $ hg -q branch c | |
195 $ hg -q ci -m 5 | |
196 | |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
197 $ hg push ../f |
12279 | 198 pushing to ../f |
199 searching for changes | |
200 abort: push creates new remote branches: c! | |
201 (use 'hg push --new-branch' to create new remote branches) | |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
202 [255] |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3925
diff
changeset
|
203 |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
204 $ hg push -r 4 -r 5 ../f |
12279 | 205 pushing to ../f |
206 searching for changes | |
207 abort: push creates new remote branches: c! | |
208 (use 'hg push --new-branch' to create new remote branches) | |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
209 [255] |
12279 | 210 |
211 | |
212 Multiple new branches: | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3925
diff
changeset
|
213 |
12279 | 214 $ hg -q branch d |
215 $ echo 6 > foo | |
216 $ hg -q ci -m 6 | |
217 | |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
218 $ hg push ../f |
12279 | 219 pushing to ../f |
220 searching for changes | |
221 abort: push creates new remote branches: c, d! | |
222 (use 'hg push --new-branch' to create new remote branches) | |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
223 [255] |
10354
844d83da2da9
prepush: warn about every new outgoing named branch, not just the first
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
9954
diff
changeset
|
224 |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
225 $ hg push -r 4 -r 6 ../f |
12279 | 226 pushing to ../f |
227 searching for changes | |
228 abort: push creates new remote branches: c, d! | |
229 (use 'hg push --new-branch' to create new remote branches) | |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
230 [255] |
12279 | 231 |
232 $ cd ../g | |
233 | |
234 | |
235 Fail on multiple head push: | |
236 | |
237 $ hg -q up 1 | |
238 $ echo 7 > foo | |
239 $ hg -q ci -m 7 | |
240 | |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
241 $ hg push -r 4 -r 7 ../f |
12279 | 242 pushing to ../f |
243 searching for changes | |
244 abort: push creates new remote heads on branch 'a'! | |
245 (did you forget to merge? use push -f to force) | |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
246 [255] |
12279 | 247 |
248 Push replacement head on existing branches: | |
249 | |
250 $ hg -q up 3 | |
251 $ echo 8 > foo | |
252 $ hg -q ci -m 8 | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3925
diff
changeset
|
253 |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
254 $ hg push -r 7 -r 8 ../f |
12279 | 255 pushing to ../f |
256 searching for changes | |
257 adding changesets | |
258 adding manifests | |
259 adding file changes | |
260 added 2 changesets with 2 changes to 1 files | |
261 | |
262 | |
263 Merge of branch a to other branch b followed by unrelated push | |
264 on branch a: | |
265 | |
266 $ hg -q up 7 | |
267 $ HGMERGE=true hg -q merge 8 | |
268 $ hg -q ci -m 9 | |
269 $ hg -q up 8 | |
270 $ echo 10 > foo | |
271 $ hg -q ci -m 10 | |
272 | |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
273 $ hg push -r 9 ../f |
12279 | 274 pushing to ../f |
275 searching for changes | |
276 adding changesets | |
277 adding manifests | |
278 adding file changes | |
279 added 1 changesets with 1 changes to 1 files (-1 heads) | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3925
diff
changeset
|
280 |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
281 $ hg push -r 10 ../f |
12279 | 282 pushing to ../f |
283 searching for changes | |
284 adding changesets | |
285 adding manifests | |
286 adding file changes | |
287 added 1 changesets with 1 changes to 1 files (+1 heads) | |
288 | |
289 | |
290 Cheating the counting algorithm: | |
291 | |
292 $ hg -q up 9 | |
293 $ HGMERGE=true hg -q merge 2 | |
294 $ hg -q ci -m 11 | |
295 $ hg -q up 1 | |
296 $ echo 12 > foo | |
297 $ hg -q ci -m 12 | |
298 | |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
299 $ hg push -r 11 -r 12 ../f |
12279 | 300 pushing to ../f |
301 searching for changes | |
302 adding changesets | |
303 adding manifests | |
304 adding file changes | |
305 added 2 changesets with 2 changes to 1 files | |
306 | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3925
diff
changeset
|
307 |
12279 | 308 Failed push of new named branch: |
309 | |
310 $ echo 12 > foo | |
311 $ hg -q ci -m 12a | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
312 [1] |
12279 | 313 $ hg -q up 11 |
314 $ echo 13 > foo | |
315 $ hg -q branch e | |
316 $ hg -q ci -m 13d | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3925
diff
changeset
|
317 |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
318 $ hg push -r 12 -r 13 ../f |
12279 | 319 pushing to ../f |
320 searching for changes | |
321 abort: push creates new remote branches: e! | |
322 (use 'hg push --new-branch' to create new remote branches) | |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
323 [255] |
12279 | 324 |
325 | |
326 Using --new-branch to push new named branch: | |
11211
e43c23d189a5
push: add --new-branch option to allow intial push of new branches
Sune Foldager <cryo@cyanite.org>
parents:
10925
diff
changeset
|
327 |
12366
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12334
diff
changeset
|
328 $ hg push --new-branch -r 12 -r 13 ../f |
12279 | 329 pushing to ../f |
330 searching for changes | |
331 adding changesets | |
332 adding manifests | |
333 adding file changes | |
334 added 1 changesets with 1 changes to 1 files | |
335 | |
11211
e43c23d189a5
push: add --new-branch option to allow intial push of new branches
Sune Foldager <cryo@cyanite.org>
parents:
10925
diff
changeset
|
336 |
12279 | 337 Checking prepush logic does not allow silently pushing |
338 multiple new heads: | |
339 | |
340 $ cd .. | |
341 $ hg init h | |
342 $ echo init > h/init | |
343 $ hg -R h ci -Am init | |
344 adding init | |
345 $ echo a > h/a | |
346 $ hg -R h ci -Am a | |
347 adding a | |
348 $ hg clone h i | |
349 updating to branch default | |
350 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
351 $ hg -R h up 0 | |
352 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
353 $ echo b > h/b | |
354 $ hg -R h ci -Am b | |
355 adding b | |
356 created new head | |
357 $ hg -R i up 0 | |
358 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
359 $ echo c > i/c | |
360 $ hg -R i ci -Am c | |
361 adding c | |
362 created new head | |
9479
f3569d95c2ab
push: fix subtle bug in prepush logic
Sune Foldager <cryo@cyanite.org>
parents:
8565
diff
changeset
|
363 |
12279 | 364 $ hg -R i push h |
365 pushing to h | |
366 searching for changes | |
367 abort: push creates new remote heads on branch 'default'! | |
368 (you should pull and merge or use push -f to force) | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
369 [255] |
12279 | 370 |
371 | |
372 Check prepush logic with merged branches: | |
373 | |
374 $ hg init j | |
375 $ hg -R j branch a | |
376 marked working directory as branch a | |
377 $ echo init > j/foo | |
378 $ hg -R j ci -Am init | |
379 adding foo | |
380 $ hg clone j k | |
381 updating to branch a | |
382 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
383 $ echo a1 > j/foo | |
384 $ hg -R j ci -m a1 | |
385 $ hg -R k branch b | |
386 marked working directory as branch b | |
387 $ echo b > k/foo | |
388 $ hg -R k ci -m b | |
389 $ hg -R k up 0 | |
390 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
391 | |
392 $ hg -R k merge b | |
393 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
394 (branch merge, don't forget to commit) | |
395 | |
396 $ hg -R k ci -m merge | |
9954
d6a307719ccb
fix bug in prepush logic involving merge changesets
Sune Foldager <cryo@cyanite.org>
parents:
9606
diff
changeset
|
397 |
12279 | 398 $ hg -R k push -r a j |
399 pushing to j | |
400 searching for changes | |
401 abort: push creates new remote branches: b! | |
402 (use 'hg push --new-branch' to create new remote branches) | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
403 [255] |
12279 | 404 |
405 | |
406 Prepush -r should not allow you to sneak in new heads: | |
10874
a9702c47a19f
partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents:
10771
diff
changeset
|
407 |
12279 | 408 $ hg init l |
409 $ cd l | |
410 $ echo a >> foo | |
411 $ hg -q add foo | |
412 $ hg -q branch a | |
413 $ hg -q ci -ma | |
414 $ hg -q up null | |
415 $ echo a >> foo | |
416 $ hg -q add foo | |
417 $ hg -q branch b | |
418 $ hg -q ci -mb | |
419 $ cd .. | |
420 $ hg -q clone l m -u a | |
421 $ cd m | |
422 $ hg -q merge b | |
423 $ hg -q ci -mmb | |
424 $ hg -q up 0 | |
425 $ echo a >> foo | |
426 $ hg -q ci -ma2 | |
427 $ hg -q up 2 | |
428 $ echo a >> foo | |
429 $ hg -q branch -f b | |
430 $ hg -q ci -mb2 | |
431 $ hg -q merge 3 | |
432 $ hg -q ci -mma | |
433 | |
434 $ hg push ../l -b b | |
435 pushing to ../l | |
436 searching for changes | |
437 abort: push creates new remote heads on branch 'a'! | |
438 (did you forget to merge? use push -f to force) | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
439 [255] |
12279 | 440 |
441 $ cd .. | |
442 | |
443 | |
444 Check prepush with new branch head on former topo non-head: | |
445 | |
446 $ hg init n | |
447 $ cd n | |
448 $ hg branch A | |
449 marked working directory as branch A | |
450 $ echo a >a | |
451 $ hg ci -Ama | |
452 adding a | |
453 $ hg branch B | |
454 marked working directory as branch B | |
455 $ echo b >b | |
456 $ hg ci -Amb | |
457 adding b | |
458 | |
12334
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
459 b is now branch head of B, and a topological head |
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
460 a is now branch head of A, but not a topological head |
12279 | 461 |
462 $ hg clone . inner | |
463 updating to branch B | |
464 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
465 $ cd inner | |
466 $ hg up B | |
467 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
468 $ echo b1 >b1 | |
469 $ hg ci -Amb1 | |
470 adding b1 | |
471 | |
12334
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
472 in the clone b1 is now the head of B |
12279 | 473 |
474 $ cd .. | |
475 $ hg up 0 | |
476 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
477 $ echo a2 >a2 | |
478 $ hg ci -Ama2 | |
479 adding a2 | |
480 | |
12334
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
481 a2 is now the new branch head of A, and a new topological head |
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
482 it replaces a former inner branch head, so it should at most warn about |
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
483 A, not B |
12279 | 484 |
485 glog of local: | |
486 | |
487 $ hg glog --template "{rev}: {branches} {desc}\n" | |
488 @ 2: A a2 | |
489 | | |
490 | o 1: B b | |
491 |/ | |
492 o 0: A a | |
493 | |
494 glog of remote: | |
495 | |
496 $ hg glog -R inner --template "{rev}: {branches} {desc}\n" | |
497 @ 2: B b1 | |
498 | | |
499 o 1: B b | |
500 | | |
501 o 0: A a | |
502 | |
503 outgoing: | |
504 | |
505 $ hg out inner --template "{rev}: {branches} {desc}\n" | |
506 comparing with inner | |
507 searching for changes | |
508 2: A a2 | |
509 | |
510 $ hg push inner | |
511 pushing to inner | |
512 searching for changes | |
513 adding changesets | |
514 adding manifests | |
515 adding file changes | |
516 added 1 changesets with 1 changes to 1 files (+1 heads) | |
517 | |
518 $ cd .. | |
519 | |
520 | |
521 Check prepush with new branch head on former topo head: | |
10874
a9702c47a19f
partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents:
10771
diff
changeset
|
522 |
12279 | 523 $ hg init o |
524 $ cd o | |
525 $ hg branch A | |
526 marked working directory as branch A | |
527 $ echo a >a | |
528 $ hg ci -Ama | |
529 adding a | |
530 $ hg branch B | |
531 marked working directory as branch B | |
532 $ echo b >b | |
533 $ hg ci -Amb | |
534 adding b | |
535 | |
12334
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
536 b is now branch head of B, and a topological head |
12279 | 537 |
538 $ hg up 0 | |
539 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
540 $ echo a1 >a1 | |
541 $ hg ci -Ama1 | |
542 adding a1 | |
543 | |
12334
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
544 a1 is now branch head of A, and a topological head |
12279 | 545 |
546 $ hg clone . inner | |
547 updating to branch A | |
548 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
549 $ cd inner | |
550 $ hg up B | |
551 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
552 $ echo b1 >b1 | |
553 $ hg ci -Amb1 | |
554 adding b1 | |
555 | |
12334
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
556 in the clone b1 is now the head of B |
12279 | 557 |
558 $ cd .. | |
559 $ echo a2 >a2 | |
560 $ hg ci -Ama2 | |
561 adding a2 | |
562 | |
12334
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
563 a2 is now the new branch head of A, and a topological head |
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
564 it replaces a former topological and branch head, so this should not warn |
12279 | 565 |
566 glog of local: | |
567 | |
568 $ hg glog --template "{rev}: {branches} {desc}\n" | |
569 @ 3: A a2 | |
570 | | |
571 o 2: A a1 | |
572 | | |
573 | o 1: B b | |
574 |/ | |
575 o 0: A a | |
576 | |
577 glog of remote: | |
578 | |
579 $ hg glog -R inner --template "{rev}: {branches} {desc}\n" | |
580 @ 3: B b1 | |
581 | | |
582 | o 2: A a1 | |
583 | | | |
584 o | 1: B b | |
585 |/ | |
586 o 0: A a | |
587 | |
588 outgoing: | |
589 | |
590 $ hg out inner --template "{rev}: {branches} {desc}\n" | |
591 comparing with inner | |
592 searching for changes | |
593 3: A a2 | |
594 | |
595 $ hg push inner | |
596 pushing to inner | |
597 searching for changes | |
598 adding changesets | |
599 adding manifests | |
600 adding file changes | |
601 added 1 changesets with 1 changes to 1 files | |
602 | |
603 $ cd .. | |
604 | |
605 | |
606 Check prepush with new branch head and new child of former branch head | |
607 but child is on different branch: | |
608 | |
609 $ hg init p | |
610 $ cd p | |
611 $ hg branch A | |
612 marked working directory as branch A | |
613 $ echo a0 >a | |
614 $ hg ci -Ama0 | |
615 adding a | |
616 $ echo a1 >a | |
617 $ hg ci -ma1 | |
618 $ hg up null | |
619 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
620 $ hg branch B | |
621 marked working directory as branch B | |
622 $ echo b0 >b | |
623 $ hg ci -Amb0 | |
624 adding b | |
625 $ echo b1 >b | |
626 $ hg ci -mb1 | |
627 | |
628 $ hg clone . inner | |
629 updating to branch B | |
630 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
10771
01f097c4ae66
push: fix bug in prepush logic and its tests
Sune Foldager <cryo@cyanite.org>
parents:
10354
diff
changeset
|
631 |
12279 | 632 $ hg up A |
633 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
634 $ hg branch -f B | |
635 marked working directory as branch B | |
636 $ echo a3 >a | |
637 $ hg ci -ma3 | |
638 created new head | |
639 $ hg up 3 | |
640 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
641 $ hg branch -f A | |
642 marked working directory as branch A | |
643 $ echo b3 >b | |
644 $ hg ci -mb3 | |
645 created new head | |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
646 |
12279 | 647 glog of local: |
648 | |
649 $ hg glog --template "{rev}: {branches} {desc}\n" | |
650 @ 5: A b3 | |
651 | | |
652 | o 4: B a3 | |
653 | | | |
654 o | 3: B b1 | |
655 | | | |
656 o | 2: B b0 | |
657 / | |
658 o 1: A a1 | |
659 | | |
660 o 0: A a0 | |
661 | |
662 glog of remote: | |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
663 |
12279 | 664 $ hg glog -R inner --template "{rev}: {branches} {desc}\n" |
665 @ 3: B b1 | |
666 | | |
667 o 2: B b0 | |
668 | |
669 o 1: A a1 | |
670 | | |
671 o 0: A a0 | |
672 | |
673 outgoing: | |
674 | |
675 $ hg out inner --template "{rev}: {branches} {desc}\n" | |
676 comparing with inner | |
677 searching for changes | |
678 4: B a3 | |
679 5: A b3 | |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
680 |
12279 | 681 $ hg push inner |
682 pushing to inner | |
683 searching for changes | |
684 abort: push creates new remote heads on branch 'A'! | |
685 (did you forget to merge? use push -f to force) | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
686 [255] |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
687 |
12279 | 688 $ hg push inner -r4 -r5 |
689 pushing to inner | |
690 searching for changes | |
691 abort: push creates new remote heads on branch 'A'! | |
692 (did you forget to merge? use push -f to force) | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
693 [255] |
12279 | 694 |
695 $ hg in inner | |
696 comparing with inner | |
697 searching for changes | |
698 no changes found | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
699 [1] |