Permalink
Browse files

remote: add a rebase checkbox to the pull dialog

The pull dialog now has a 'Rebase' checkbox that tells cola
to pass the --rebase option to pull.

Signed-off-by: David Aguilar <davvid@gmail.com>
  • Loading branch information...
1 parent 90e23ce commit fd3a43bef15b51350256e31d6ae2a1df996a3497 @davvid davvid committed Dec 25, 2008
Showing with 18 additions and 2 deletions.
  1. +5 −0 cola/controllers/remote.py
  2. +6 −2 cola/models.py
  3. +7 −0 ui/remote.ui
@@ -13,12 +13,15 @@ def remote_action(model, parent, action):
model = model.clone()
model.create(remotename='',
tags_checkbox=False,
+ rebase_checkbox=False,
ffwd_only_checkbox=True)
view = RemoteView(parent, action)
if action == 'Fetch' or action == 'Pull':
model.set_tags_checkbox(False)
if action == 'Pull':
view.tags_checkbox.hide()
+ if action != 'Pull':
+ view.rebase_checkbox.hide()
controller = RemoteController(model, view, action)
view.show()
return view.exec_() == QDialog.Accepted
@@ -32,6 +35,7 @@ def init(self, model, view, action):
'remote_branch',
'remote_branches',
'tags_checkbox',
+ 'rebase_checkbox',
'ffwd_only_checkbox')
self.action_method = {
'Fetch': self.gen_remote_callback(self.model.fetch_helper),
@@ -106,6 +110,7 @@ def get_common_args(self):
'remote_branch': self.model.get_remote_branch(),
'ffwd': self.model.get_ffwd_only_checkbox(),
'tags': self.model.get_tags_checkbox(),
+ 'rebase': self.model.get_rebase_checkbox(),
})
def show_results(self, output):
View
@@ -935,8 +935,11 @@ def remote_url(self, name):
return self.git.config('remote.%s.url' % name, get=True)
def get_remote_args(self, remote,
- local_branch='', remote_branch='',
- ffwd=True, tags=False):
+ local_branch='',
+ remote_branch='',
+ ffwd=True,
+ tags=False,
+ rebase=False):
if ffwd:
branch_arg = '%s:%s' % ( remote_branch, local_branch )
else:
@@ -947,6 +950,7 @@ def get_remote_args(self, remote,
kwargs = {
'verbose': True,
'tags': tags,
+ 'rebase': rebase,
}
return (args, kwargs)
View
@@ -84,6 +84,13 @@
</widget>
</item>
<item>
+ <widget class="QCheckBox" name="rebase_checkbox" >
+ <property name="text" >
+ <string>Rebase</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>

0 comments on commit fd3a43b

Please sign in to comment.