equal
deleted
inserted
replaced
14 ) |
14 ) |
15 |
15 |
16 from . import ( |
16 from . import ( |
17 bookmarks, |
17 bookmarks, |
18 branchmap, |
18 branchmap, |
|
19 error, |
19 obsolete, |
20 obsolete, |
20 phases, |
21 phases, |
21 setdiscovery, |
22 setdiscovery, |
22 treediscovery, |
23 treediscovery, |
23 util, |
24 util, |
260 newbranches = [branch for branch, heads in headssum.iteritems() |
261 newbranches = [branch for branch, heads in headssum.iteritems() |
261 if heads[0] is None] |
262 if heads[0] is None] |
262 # 1. Check for new branches on the remote. |
263 # 1. Check for new branches on the remote. |
263 if newbranches and not newbranch: # new branch requires --new-branch |
264 if newbranches and not newbranch: # new branch requires --new-branch |
264 branchnames = ', '.join(sorted(newbranches)) |
265 branchnames = ', '.join(sorted(newbranches)) |
265 raise util.Abort(_("push creates new remote branches: %s!") |
266 raise error.Abort(_("push creates new remote branches: %s!") |
266 % branchnames, |
267 % branchnames, |
267 hint=_("use 'hg push --new-branch' to create" |
268 hint=_("use 'hg push --new-branch' to create" |
268 " new remote branches")) |
269 " new remote branches")) |
269 |
270 |
270 # 2. Compute newly pushed bookmarks. We don't warn about bookmarked heads. |
271 # 2. Compute newly pushed bookmarks. We don't warn about bookmarked heads. |
388 else: |
389 else: |
389 repo.ui.note(_("new remote heads on branch '%s':\n") % branch) |
390 repo.ui.note(_("new remote heads on branch '%s':\n") % branch) |
390 for h in dhs: |
391 for h in dhs: |
391 repo.ui.note((" %s\n") % short(h)) |
392 repo.ui.note((" %s\n") % short(h)) |
392 if errormsg: |
393 if errormsg: |
393 raise util.Abort(errormsg, hint=hint) |
394 raise error.Abort(errormsg, hint=hint) |