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