Mercurial > hg
annotate tests/test-push-warn.t @ 12781:0d09991f91ee
gendoc: automatically create help for default extensions.
Adds a section in the hg.1 manpage and corresponding hg.1.html
file. Each extension is listed with its module docstring, followed by
the commands defined by that extendsion.
Creates help for extensions by extracting doc strings from the extension modules
and its commands.
author | Erik Zielke <ez@aragost.com> |
---|---|
date | Wed, 20 Oct 2010 17:45:09 +0200 |
parents | 4fee1fd3de9a |
children | c7d23b4ca4ba |
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" | |
10875
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 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
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) | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
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 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
102 $ hg push -r 2 ../c |
12279 | 103 pushing to ../c |
104 searching for changes | |
105 no changes found | |
106 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
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) | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
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 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
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) | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
119 [255] |
12279 | 120 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
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 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
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 | |
12399
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12365
diff
changeset
|
144 Issue450: push -r warns about remote head creation even if no heads |
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12365
diff
changeset
|
145 will be created |
3923
27230c29bfec
fix calculation of new heads added during push with -r
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3803
diff
changeset
|
146 |
12279 | 147 $ hg init ../e |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
148 $ hg push -r 0 ../e |
12279 | 149 pushing to ../e |
150 searching for changes | |
151 adding changesets | |
152 adding manifests | |
153 adding file changes | |
154 added 1 changesets with 1 changes to 1 files | |
155 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
156 $ hg push -r 1 ../e |
12279 | 157 pushing to ../e |
158 searching for changes | |
159 adding changesets | |
160 adding manifests | |
161 adding file changes | |
162 added 1 changesets with 1 changes to 1 files | |
163 | |
164 $ cd .. | |
165 | |
166 | |
12399
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12365
diff
changeset
|
167 Issue736: named branches are not considered for detection of |
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12365
diff
changeset
|
168 unmerged heads in "hg push" |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
169 |
12279 | 170 $ hg init f |
171 $ cd f | |
172 $ hg -q branch a | |
173 $ echo 0 > foo | |
174 $ hg -q ci -Am 0 | |
175 $ echo 1 > foo | |
176 $ hg -q ci -m 1 | |
177 $ hg -q up 0 | |
178 $ echo 2 > foo | |
179 $ hg -q ci -m 2 | |
180 $ hg -q up 0 | |
181 $ hg -q branch b | |
182 $ echo 3 > foo | |
183 $ hg -q ci -m 3 | |
184 $ cd .. | |
185 | |
186 $ hg -q clone f g | |
187 $ cd g | |
188 | |
189 Push on existing branch and new branch: | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
190 |
12279 | 191 $ hg -q up 1 |
192 $ echo 4 > foo | |
193 $ hg -q ci -m 4 | |
194 $ hg -q up 0 | |
195 $ echo 5 > foo | |
196 $ hg -q branch c | |
197 $ hg -q ci -m 5 | |
198 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
199 $ hg push ../f |
12279 | 200 pushing to ../f |
201 searching for changes | |
202 abort: push creates new remote branches: c! | |
203 (use 'hg push --new-branch' to create new remote branches) | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
204 [255] |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
205 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
206 $ hg push -r 4 -r 5 ../f |
12279 | 207 pushing to ../f |
208 searching for changes | |
209 abort: push creates new remote branches: c! | |
210 (use 'hg push --new-branch' to create new remote branches) | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
211 [255] |
12279 | 212 |
213 | |
214 Multiple new branches: | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
215 |
12279 | 216 $ hg -q branch d |
217 $ echo 6 > foo | |
218 $ hg -q ci -m 6 | |
219 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
220 $ hg push ../f |
12279 | 221 pushing to ../f |
222 searching for changes | |
223 abort: push creates new remote branches: c, d! | |
224 (use 'hg push --new-branch' to create new remote branches) | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
225 [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
|
226 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
227 $ hg push -r 4 -r 6 ../f |
12279 | 228 pushing to ../f |
229 searching for changes | |
230 abort: push creates new remote branches: c, d! | |
231 (use 'hg push --new-branch' to create new remote branches) | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
232 [255] |
12279 | 233 |
234 $ cd ../g | |
235 | |
236 | |
237 Fail on multiple head push: | |
238 | |
239 $ hg -q up 1 | |
240 $ echo 7 > foo | |
241 $ hg -q ci -m 7 | |
242 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
243 $ hg push -r 4 -r 7 ../f |
12279 | 244 pushing to ../f |
245 searching for changes | |
246 abort: push creates new remote heads on branch 'a'! | |
247 (did you forget to merge? use push -f to force) | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
248 [255] |
12279 | 249 |
250 Push replacement head on existing branches: | |
251 | |
252 $ hg -q up 3 | |
253 $ echo 8 > foo | |
254 $ hg -q ci -m 8 | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
255 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
256 $ hg push -r 7 -r 8 ../f |
12279 | 257 pushing to ../f |
258 searching for changes | |
259 adding changesets | |
260 adding manifests | |
261 adding file changes | |
262 added 2 changesets with 2 changes to 1 files | |
263 | |
264 | |
265 Merge of branch a to other branch b followed by unrelated push | |
266 on branch a: | |
267 | |
268 $ hg -q up 7 | |
269 $ HGMERGE=true hg -q merge 8 | |
270 $ hg -q ci -m 9 | |
271 $ hg -q up 8 | |
272 $ echo 10 > foo | |
273 $ hg -q ci -m 10 | |
274 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
275 $ hg push -r 9 ../f |
12279 | 276 pushing to ../f |
277 searching for changes | |
278 adding changesets | |
279 adding manifests | |
280 adding file changes | |
281 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:
3923
diff
changeset
|
282 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
283 $ hg push -r 10 ../f |
12279 | 284 pushing to ../f |
285 searching for changes | |
286 adding changesets | |
287 adding manifests | |
288 adding file changes | |
289 added 1 changesets with 1 changes to 1 files (+1 heads) | |
290 | |
291 | |
292 Cheating the counting algorithm: | |
293 | |
294 $ hg -q up 9 | |
295 $ HGMERGE=true hg -q merge 2 | |
296 $ hg -q ci -m 11 | |
297 $ hg -q up 1 | |
298 $ echo 12 > foo | |
299 $ hg -q ci -m 12 | |
300 | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
301 $ hg push -r 11 -r 12 ../f |
12279 | 302 pushing to ../f |
303 searching for changes | |
304 adding changesets | |
305 adding manifests | |
306 adding file changes | |
307 added 2 changesets with 2 changes to 1 files | |
308 | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
309 |
12279 | 310 Failed push of new named branch: |
311 | |
312 $ echo 12 > foo | |
313 $ hg -q ci -m 12a | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
314 [1] |
12279 | 315 $ hg -q up 11 |
316 $ echo 13 > foo | |
317 $ hg -q branch e | |
318 $ hg -q ci -m 13d | |
8565
268d16b2ec25
tests: add tests for new pre-push logic (issue736)
Sune Foldager <cryo@cyanite.org>
parents:
3923
diff
changeset
|
319 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
320 $ hg push -r 12 -r 13 ../f |
12279 | 321 pushing to ../f |
322 searching for changes | |
323 abort: push creates new remote branches: e! | |
324 (use 'hg push --new-branch' to create new remote branches) | |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
325 [255] |
12279 | 326 |
327 | |
328 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
|
329 |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
330 $ hg push --new-branch -r 12 -r 13 ../f |
12279 | 331 pushing to ../f |
332 searching for changes | |
333 adding changesets | |
334 adding manifests | |
335 adding file changes | |
336 added 1 changesets with 1 changes to 1 files | |
337 | |
11211
e43c23d189a5
push: add --new-branch option to allow intial push of new branches
Sune Foldager <cryo@cyanite.org>
parents:
10925
diff
changeset
|
338 |
12279 | 339 Checking prepush logic does not allow silently pushing |
340 multiple new heads: | |
341 | |
342 $ cd .. | |
343 $ hg init h | |
344 $ echo init > h/init | |
345 $ hg -R h ci -Am init | |
346 adding init | |
347 $ echo a > h/a | |
348 $ hg -R h ci -Am a | |
349 adding a | |
350 $ hg clone h i | |
351 updating to branch default | |
352 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
353 $ hg -R h up 0 | |
354 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
355 $ echo b > h/b | |
356 $ hg -R h ci -Am b | |
357 adding b | |
358 created new head | |
359 $ hg -R i up 0 | |
360 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
361 $ echo c > i/c | |
362 $ hg -R i ci -Am c | |
363 adding c | |
364 created new head | |
9479
f3569d95c2ab
push: fix subtle bug in prepush logic
Sune Foldager <cryo@cyanite.org>
parents:
8565
diff
changeset
|
365 |
12279 | 366 $ hg -R i push h |
367 pushing to h | |
368 searching for changes | |
369 abort: push creates new remote heads on branch 'default'! | |
370 (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
|
371 [255] |
12279 | 372 |
373 | |
374 Check prepush logic with merged branches: | |
375 | |
376 $ hg init j | |
377 $ hg -R j branch a | |
378 marked working directory as branch a | |
379 $ echo init > j/foo | |
380 $ hg -R j ci -Am init | |
381 adding foo | |
382 $ hg clone j k | |
383 updating to branch a | |
384 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
385 $ echo a1 > j/foo | |
386 $ hg -R j ci -m a1 | |
387 $ hg -R k branch b | |
388 marked working directory as branch b | |
389 $ echo b > k/foo | |
390 $ hg -R k ci -m b | |
391 $ hg -R k up 0 | |
392 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
393 | |
394 $ hg -R k merge b | |
395 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
396 (branch merge, don't forget to commit) | |
397 | |
398 $ hg -R k ci -m merge | |
9954
d6a307719ccb
fix bug in prepush logic involving merge changesets
Sune Foldager <cryo@cyanite.org>
parents:
9609
diff
changeset
|
399 |
12279 | 400 $ hg -R k push -r a j |
401 pushing to j | |
402 searching for changes | |
403 abort: push creates new remote branches: b! | |
404 (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
|
405 [255] |
12279 | 406 |
407 | |
408 Prepush -r should not allow you to sneak in new heads: | |
10875
a9702c47a19f
partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents:
10771
diff
changeset
|
409 |
12279 | 410 $ hg init l |
411 $ cd l | |
412 $ echo a >> foo | |
413 $ hg -q add foo | |
414 $ hg -q branch a | |
415 $ hg -q ci -ma | |
416 $ hg -q up null | |
417 $ echo a >> foo | |
418 $ hg -q add foo | |
419 $ hg -q branch b | |
420 $ hg -q ci -mb | |
421 $ cd .. | |
422 $ hg -q clone l m -u a | |
423 $ cd m | |
424 $ hg -q merge b | |
425 $ hg -q ci -mmb | |
426 $ hg -q up 0 | |
427 $ echo a >> foo | |
428 $ hg -q ci -ma2 | |
429 $ hg -q up 2 | |
430 $ echo a >> foo | |
431 $ hg -q branch -f b | |
432 $ hg -q ci -mb2 | |
433 $ hg -q merge 3 | |
434 $ hg -q ci -mma | |
435 | |
436 $ hg push ../l -b b | |
437 pushing to ../l | |
438 searching for changes | |
439 abort: push creates new remote heads on branch 'a'! | |
440 (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
|
441 [255] |
12279 | 442 |
443 $ cd .. | |
444 | |
445 | |
446 Check prepush with new branch head on former topo non-head: | |
447 | |
448 $ hg init n | |
449 $ cd n | |
450 $ hg branch A | |
451 marked working directory as branch A | |
452 $ echo a >a | |
453 $ hg ci -Ama | |
454 adding a | |
455 $ hg branch B | |
456 marked working directory as branch B | |
457 $ echo b >b | |
458 $ hg ci -Amb | |
459 adding b | |
460 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
461 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
|
462 a is now branch head of A, but not a topological head |
12279 | 463 |
464 $ hg clone . inner | |
465 updating to branch B | |
466 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
467 $ cd inner | |
468 $ hg up B | |
469 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
470 $ echo b1 >b1 | |
471 $ hg ci -Amb1 | |
472 adding b1 | |
473 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
474 in the clone b1 is now the head of B |
12279 | 475 |
476 $ cd .. | |
477 $ hg up 0 | |
478 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
479 $ echo a2 >a2 | |
480 $ hg ci -Ama2 | |
481 adding a2 | |
482 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
483 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
|
484 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
|
485 A, not B |
12279 | 486 |
487 glog of local: | |
488 | |
489 $ hg glog --template "{rev}: {branches} {desc}\n" | |
490 @ 2: A a2 | |
491 | | |
492 | o 1: B b | |
493 |/ | |
494 o 0: A a | |
495 | |
496 glog of remote: | |
497 | |
498 $ hg glog -R inner --template "{rev}: {branches} {desc}\n" | |
499 @ 2: B b1 | |
500 | | |
501 o 1: B b | |
502 | | |
503 o 0: A a | |
504 | |
505 outgoing: | |
506 | |
507 $ hg out inner --template "{rev}: {branches} {desc}\n" | |
508 comparing with inner | |
509 searching for changes | |
510 2: A a2 | |
511 | |
512 $ hg push inner | |
513 pushing to inner | |
514 searching for changes | |
515 adding changesets | |
516 adding manifests | |
517 adding file changes | |
518 added 1 changesets with 1 changes to 1 files (+1 heads) | |
519 | |
520 $ cd .. | |
521 | |
522 | |
523 Check prepush with new branch head on former topo head: | |
10875
a9702c47a19f
partial backout of 1e819576e926 and add tests (issue2131)
Sune Foldager <cryo@cyanite.org>
parents:
10771
diff
changeset
|
524 |
12279 | 525 $ hg init o |
526 $ cd o | |
527 $ hg branch A | |
528 marked working directory as branch A | |
529 $ echo a >a | |
530 $ hg ci -Ama | |
531 adding a | |
532 $ hg branch B | |
533 marked working directory as branch B | |
534 $ echo b >b | |
535 $ hg ci -Amb | |
536 adding b | |
537 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
538 b is now branch head of B, and a topological head |
12279 | 539 |
540 $ hg up 0 | |
541 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
542 $ echo a1 >a1 | |
543 $ hg ci -Ama1 | |
544 adding a1 | |
545 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
546 a1 is now branch head of A, and a topological head |
12279 | 547 |
548 $ hg clone . inner | |
549 updating to branch A | |
550 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
551 $ cd inner | |
552 $ hg up B | |
553 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
554 $ echo b1 >b1 | |
555 $ hg ci -Amb1 | |
556 adding b1 | |
557 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
558 in the clone b1 is now the head of B |
12279 | 559 |
560 $ cd .. | |
561 $ echo a2 >a2 | |
562 $ hg ci -Ama2 | |
563 adding a2 | |
564 | |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
565 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
|
566 it replaces a former topological and branch head, so this should not warn |
12279 | 567 |
568 glog of local: | |
569 | |
570 $ hg glog --template "{rev}: {branches} {desc}\n" | |
571 @ 3: A a2 | |
572 | | |
573 o 2: A a1 | |
574 | | |
575 | o 1: B b | |
576 |/ | |
577 o 0: A a | |
578 | |
579 glog of remote: | |
580 | |
581 $ hg glog -R inner --template "{rev}: {branches} {desc}\n" | |
582 @ 3: B b1 | |
583 | | |
584 | o 2: A a1 | |
585 | | | |
586 o | 1: B b | |
587 |/ | |
588 o 0: A a | |
589 | |
590 outgoing: | |
591 | |
592 $ hg out inner --template "{rev}: {branches} {desc}\n" | |
593 comparing with inner | |
594 searching for changes | |
595 3: A a2 | |
596 | |
597 $ hg push inner | |
598 pushing to inner | |
599 searching for changes | |
600 adding changesets | |
601 adding manifests | |
602 adding file changes | |
603 added 1 changesets with 1 changes to 1 files | |
604 | |
605 $ cd .. | |
606 | |
607 | |
608 Check prepush with new branch head and new child of former branch head | |
609 but child is on different branch: | |
610 | |
611 $ hg init p | |
612 $ cd p | |
613 $ hg branch A | |
614 marked working directory as branch A | |
615 $ echo a0 >a | |
616 $ hg ci -Ama0 | |
617 adding a | |
618 $ echo a1 >a | |
619 $ hg ci -ma1 | |
620 $ hg up null | |
621 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
622 $ hg branch B | |
623 marked working directory as branch B | |
624 $ echo b0 >b | |
625 $ hg ci -Amb0 | |
626 adding b | |
627 $ echo b1 >b | |
628 $ hg ci -mb1 | |
629 | |
630 $ hg clone . inner | |
631 updating to branch B | |
632 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
|
633 |
12279 | 634 $ hg up A |
635 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
636 $ hg branch -f B | |
637 marked working directory as branch B | |
638 $ echo a3 >a | |
639 $ hg ci -ma3 | |
640 created new head | |
641 $ hg up 3 | |
642 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
643 $ hg branch -f A | |
644 marked working directory as branch A | |
645 $ echo b3 >b | |
646 $ hg ci -mb3 | |
647 created new head | |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
648 |
12279 | 649 glog of local: |
650 | |
651 $ hg glog --template "{rev}: {branches} {desc}\n" | |
652 @ 5: A b3 | |
653 | | |
654 | o 4: B a3 | |
655 | | | |
656 o | 3: B b1 | |
657 | | | |
658 o | 2: B b0 | |
659 / | |
660 o 1: A a1 | |
661 | | |
662 o 0: A a0 | |
663 | |
664 glog of remote: | |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
665 |
12279 | 666 $ hg glog -R inner --template "{rev}: {branches} {desc}\n" |
667 @ 3: B b1 | |
668 | | |
669 o 2: B b0 | |
670 | |
671 o 1: A a1 | |
672 | | |
673 o 0: A a0 | |
674 | |
675 outgoing: | |
676 | |
677 $ hg out inner --template "{rev}: {branches} {desc}\n" | |
678 comparing with inner | |
679 searching for changes | |
680 4: B a3 | |
681 5: A b3 | |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
682 |
12279 | 683 $ hg push inner |
684 pushing to inner | |
685 searching for changes | |
686 abort: push creates new remote heads on branch 'A'! | |
687 (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
|
688 [255] |
10909
29a83fb8c067
prepush: add more test cases
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
10908
diff
changeset
|
689 |
12279 | 690 $ hg push inner -r4 -r5 |
691 pushing to inner | |
692 searching for changes | |
693 abort: push creates new remote heads on branch 'A'! | |
694 (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
|
695 [255] |
12279 | 696 |
697 $ hg in inner | |
698 comparing with inner | |
699 searching for changes | |
700 no changes found | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
701 [1] |