equal
deleted
inserted
replaced
360 |
360 |
361 |
361 |
362 def checkheads(pushop): |
362 def checkheads(pushop): |
363 """Check that a push won't add any outgoing head |
363 """Check that a push won't add any outgoing head |
364 |
364 |
365 raise Abort error and display ui message as needed. |
365 raise StateError error and display ui message as needed. |
366 """ |
366 """ |
367 |
367 |
368 repo = pushop.repo.unfiltered() |
368 repo = pushop.repo.unfiltered() |
369 remote = pushop.remote |
369 remote = pushop.remote |
370 outgoing = pushop.outgoing |
370 outgoing = pushop.outgoing |
407 len(closedbranches), |
407 len(closedbranches), |
408 ) |
408 ) |
409 else: |
409 else: |
410 errmsg = _(b"push creates new remote branches: %s") % branchnames |
410 errmsg = _(b"push creates new remote branches: %s") % branchnames |
411 hint = _(b"use 'hg push --new-branch' to create new remote branches") |
411 hint = _(b"use 'hg push --new-branch' to create new remote branches") |
412 raise error.Abort(errmsg, hint=hint) |
412 raise error.StateError(errmsg, hint=hint) |
413 |
413 |
414 # 2. Find heads that we need not warn about |
414 # 2. Find heads that we need not warn about |
415 nowarnheads = _nowarnheads(pushop) |
415 nowarnheads = _nowarnheads(pushop) |
416 |
416 |
417 # 3. Check for new heads. |
417 # 3. Check for new heads. |
503 else: |
503 else: |
504 repo.ui.note(_(b"new remote heads on branch '%s':\n") % branch) |
504 repo.ui.note(_(b"new remote heads on branch '%s':\n") % branch) |
505 for h in dhs: |
505 for h in dhs: |
506 repo.ui.note(b" %s\n" % short(h)) |
506 repo.ui.note(b" %s\n" % short(h)) |
507 if errormsg: |
507 if errormsg: |
508 raise error.Abort(errormsg, hint=hint) |
508 raise error.StateError(errormsg, hint=hint) |
509 |
509 |
510 |
510 |
511 def _postprocessobsolete(pushop, futurecommon, candidate_newhs): |
511 def _postprocessobsolete(pushop, futurecommon, candidate_newhs): |
512 """post process the list of new heads with obsolescence information |
512 """post process the list of new heads with obsolescence information |
513 |
513 |