Suggest a 'cherry-picked from' line when cherry picking
Emulates the behavior of "git cherry-pick -x" and the web UI. Change-Id: I1c3654e39351cd0c6fc84a57b04560877bdf3b31
This commit is contained in:
parent
cd60a82f6a
commit
e96a663f1e
@ -97,6 +97,14 @@ class EditHashtagsDialog(mywid.ButtonDialog):
|
||||
|
||||
class CherryPickDialog(urwid.WidgetWrap, mywid.LineBoxTitlePropertyMixin):
|
||||
signals = ['save', 'cancel']
|
||||
|
||||
def _cherry_pick_message(self, change):
|
||||
revision = change.revisions[-1]
|
||||
return "{}\n(cherry picked from commit {})".format(
|
||||
revision.message.rstrip('\n'),
|
||||
revision.commit,
|
||||
)
|
||||
|
||||
def __init__(self, app, change):
|
||||
save_button = mywid.FixedButton('Propose Change')
|
||||
cancel_button = mywid.FixedButton('Cancel')
|
||||
@ -108,7 +116,7 @@ class CherryPickDialog(urwid.WidgetWrap, mywid.LineBoxTitlePropertyMixin):
|
||||
('pack', cancel_button)]
|
||||
button_columns = urwid.Columns(button_widgets, dividechars=2)
|
||||
rows = []
|
||||
self.entry = mywid.MyEdit(edit_text=change.revisions[-1].message,
|
||||
self.entry = mywid.MyEdit(edit_text=self._cherry_pick_message(change),
|
||||
multiline=True, ring=app.ring)
|
||||
self.branch_buttons = []
|
||||
rows.append(urwid.Text(u"Branch:"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user