64
64
Option('owner', help='Owner of the new remote branch.', type=str),
65
Option('project', help='Project name for the new remote branch.', type=str),
65
Option('project', help='Project name for the new remote branch.',
66
67
Option('name', help='Name of the new remote branch.', type=str),
67
Option('no-allow-lossy', help='Allow fallback to lossy push, if necessary.'),
68
Option('no-allow-lossy',
69
help='Allow fallback to lossy push, if necessary.'),
68
70
Option('overwrite', help="Overwrite existing commits."),
70
72
takes_args = ['submit_branch?']
92
94
note(gettext("Pushed to %s") % public_url)
95
def summarize_unmerged(branch, target):
97
def summarize_unmerged(local_branch, remote_branch, target):
96
98
"""Generate a text description of the unmerged revisions in branch.
98
100
:param branch: The proposed branch
99
101
:param target: Target branch
100
102
:return: A string
102
log_format = _mod_log.log_formatter_registry.get_default(branch)
104
log_format = _mod_log.log_formatter_registry.get_default(local_branch)
103
105
to_file = StringIO()
104
106
lf = log_format(to_file=to_file, show_ids=False, show_timezone='original')
105
107
local_extra = _mod_missing.find_unmerged(
106
branch, target, restrict='local')[0]
108
remote_branch, target, restrict='local')[0]
108
if branch.supports_tags():
109
rev_tag_dict = branch.tags.get_reverse_tag_dict()
110
if remote_branch.supports_tags():
111
rev_tag_dict = remote_branch.tags.get_reverse_tag_dict()
111
113
rev_tag_dict = {}
113
115
for revision in _mod_missing.iter_log_revisions(
114
local_extra, branch.repository, False, rev_tag_dict):
116
local_extra, local_branch.repository, False, rev_tag_dict):
115
117
lf.log_revision(revision)
116
118
return to_file.getvalue()
171
173
if description is None:
172
174
body = proposal_builder.get_initial_body()
173
175
info = proposal_builder.get_infotext()
174
info += "\n\n" + summarize_unmerged(branch, target)
176
info += "\n\n" + summarize_unmerged(branch, remote_branch, target)
175
177
description = msgeditor.edit_commit_message(
176
178
info, start_message=body)
203
205
if submit_branch is None:
204
206
submit_branch = branch.get_parent()
205
207
if submit_branch is None:
206
raise errors.BzrCommandError(gettext("No target location specified or remembered"))
208
raise errors.BzrCommandError(
209
gettext("No target location specified or remembered"))
208
211
target = _mod_branch.Branch.open(submit_branch)
209
212
hoster = _mod_propose.get_hoster(branch)
219
222
takes_args = ['username?']
221
224
def run(self, username=None):
224
225
from github import Github, GithubException
225
226
from breezy.config import AuthenticationConfig
226
227
authconfig = AuthenticationConfig()