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