Show More
@@ -269,13 +269,12 b' def checkheads(repo, remote, outgoing, r' | |||||
269 | allfuturecommon = set(c.node() for c in repo.set('%ld', outgoing.common)) |
|
269 | allfuturecommon = set(c.node() for c in repo.set('%ld', outgoing.common)) | |
270 | allfuturecommon.update(allmissing) |
|
270 | allfuturecommon.update(allmissing) | |
271 | for branch, heads in sorted(headssum.iteritems()): |
|
271 | for branch, heads in sorted(headssum.iteritems()): | |
272 | if heads[0] is None: |
|
|||
273 | # Maybe we should abort if we push more that one head |
|
|||
274 | # for new branches ? |
|
|||
275 | continue |
|
|||
276 | candidate_newhs = set(heads[1]) |
|
272 | candidate_newhs = set(heads[1]) | |
277 | # add unsynced data |
|
273 | # add unsynced data | |
278 | oldhs = set(heads[0]) |
|
274 | if heads[0] is None: | |
|
275 | oldhs = set() | |||
|
276 | else: | |||
|
277 | oldhs = set(heads[0]) | |||
279 | oldhs.update(heads[2]) |
|
278 | oldhs.update(heads[2]) | |
280 | candidate_newhs.update(heads[2]) |
|
279 | candidate_newhs.update(heads[2]) | |
281 | dhs = None |
|
280 | dhs = None | |
@@ -310,7 +309,16 b' def checkheads(repo, remote, outgoing, r' | |||||
310 | newhs = candidate_newhs |
|
309 | newhs = candidate_newhs | |
311 | if [h for h in heads[2] if h not in discardedheads]: |
|
310 | if [h for h in heads[2] if h not in discardedheads]: | |
312 | unsynced = True |
|
311 | unsynced = True | |
313 | if len(newhs) > len(oldhs): |
|
312 | if heads[0] is None: | |
|
313 | if 1 < len(newhs): | |||
|
314 | dhs = list(newhs) | |||
|
315 | if error is None: | |||
|
316 | error = (_("push creates multiple headed new branch '%s'") | |||
|
317 | % (branch)) | |||
|
318 | hint = _("merge or" | |||
|
319 | " see \"hg help push\" for detail about" | |||
|
320 | " pushing new heads") | |||
|
321 | elif len(newhs) > len(oldhs): | |||
314 | # strip updates to existing remote heads from the new heads list |
|
322 | # strip updates to existing remote heads from the new heads list | |
315 | dhs = sorted(newhs - bookmarkedheads - oldhs) |
|
323 | dhs = sorted(newhs - bookmarkedheads - oldhs) | |
316 | if dhs: |
|
324 | if dhs: |
@@ -354,6 +354,29 b' Using --new-branch to push new named bra' | |||||
354 | adding file changes |
|
354 | adding file changes | |
355 | added 1 changesets with 1 changes to 1 files |
|
355 | added 1 changesets with 1 changes to 1 files | |
356 |
|
356 | |||
|
357 | Pushing muliple headed new branch: | |||
|
358 | ||||
|
359 | $ echo 14 > foo | |||
|
360 | $ hg -q branch f | |||
|
361 | $ hg -q ci -m 14 | |||
|
362 | $ echo 15 > foo | |||
|
363 | $ hg -q ci -m 15 | |||
|
364 | $ hg -q up 14 | |||
|
365 | $ echo 16 > foo | |||
|
366 | $ hg -q ci -m 16 | |||
|
367 | $ hg push --branch f --new-branch ../f | |||
|
368 | pushing to ../f | |||
|
369 | searching for changes | |||
|
370 | abort: push creates multiple headed new branch 'f' | |||
|
371 | (merge or see "hg help push" for detail about pushing new heads) | |||
|
372 | [255] | |||
|
373 | $ hg push --branch f --new-branch --force ../f | |||
|
374 | pushing to ../f | |||
|
375 | searching for changes | |||
|
376 | adding changesets | |||
|
377 | adding manifests | |||
|
378 | adding file changes | |||
|
379 | added 3 changesets with 3 changes to 1 files (+1 heads) | |||
357 |
|
380 | |||
358 | Checking prepush logic does not allow silently pushing |
|
381 | Checking prepush logic does not allow silently pushing | |
359 | multiple new heads: |
|
382 | multiple new heads: |
General Comments 0
You need to be logged in to leave comments.
Login now