#2551 : add new mode in postpull : update or rebase

34 views
Skip to first unread message

CHRIST, FABIENNE (FABIENNE)

unread,
May 15, 2013, 7:05:10 AM5/15/13
to thg...@googlegroups.com
# HG changeset patch
# User Fabienne Christ <Fabienn...@alcatel-lucent.com>
# Date 1368460404 -7200
# Branch stable
# Node ID b320ff3d10d18c66ff918cdd5f9fe75eea02d26d
# Parent  b30e0080d313e3a7fec6095dd9a5418108d05200
sync: add new mode in postpull: update or rebase (closes #2551)
 
diff --git a/tortoisehg/hgqt/settings.py b/tortoisehg/hgqt/settings.py
--- a/tortoisehg/hgqt/settings.py
+++ b/tortoisehg/hgqt/settings.py
@@ -678,10 +678,11 @@
           'standard tags inserted by the Mercurial Queues Extension. '
           'Default: None (leave blank)')),
     _fi(_('After Pull Operation'), 'tortoisehg.postpull', (genDefaultCombo,
-        ['none', 'update', 'fetch', 'rebase']),
+        ['none', 'update', 'fetch', 'rebase', 'updateOrRebase']),
         _('Operation which is performed directly after a successful pull. '
           'update equates to pull --update, fetch equates to the fetch '
-          'extension, rebase equates to pull --rebase.  Default: none')),
+          'extension, rebase equates to pull --rebase, '
+          'updateOrRebase equates to pull -u --rebase.  Default: none')),
     _fi(_('Default Push'), 'tortoisehg.defaultpush', (genDefaultCombo,
         ['all', 'branch', 'revision']),
         _('Select the revisions that will be pushed by default, '
diff --git a/tortoisehg/hgqt/sync.py b/tortoisehg/hgqt/sync.py
--- a/tortoisehg/hgqt/sync.py
+++ b/tortoisehg/hgqt/sync.py
@@ -747,7 +747,7 @@
                                       % (link, ret))
             self.pullCompleted.emit()
             # handle file conflicts during rebase
-            if self.opts.get('rebase'):
+            if self.opts.get('rebase') or self.opts.get('updateOrRebase'):
                 if os.path.exists(self.repo.join('rebasestate')):
                     dlg = rebase.RebaseDialog(self.repo, self)
                     dlg.finished.connect(dlg.deleteLater)
@@ -771,6 +771,8 @@
             cmdline += ['--rebase', '--config', uimerge]
         elif self.cachedpp == 'update':
             cmdline += ['--update', '--config', uimerge]
+        elif self.cachedpp == 'updateOrRebase':
+            cmdline += ['--update', '--rebase', '--config', uimerge]
         elif self.cachedpp == 'fetch':
             cmdline[2] = 'fetch'
         elif self.opts.get('mq'):
@@ -1026,13 +1028,15 @@
             layout.addWidget(self.fetch)
         else:
             self.fetch = None
-        if 'rebase' in repo.extensions() or repo.postpull == 'rebase':
+        if 'rebase' in repo.extensions() or repo.postpull == 'rebase' or repo.postpull == 'updateOrRebase':
             if 'rebase' in repo.extensions():
                 btntxt = _('Rebase - rebase local commits above pulled changes')
             else:
                 btntxt = _('Rebase - use rebase extension (rebase is not active!)')
             self.rebase = QRadioButton(btntxt)
             layout.addWidget(self.rebase)
+            self.updateOrRebase = QRadioButton(_('UpdateOrRebase - pull, then try to update or rebase'))
+            layout.addWidget(self.updateOrRebase)
 
         self.none.setChecked(True)
         if repo.postpull == 'update':
@@ -1041,6 +1045,8 @@
             self.fetch.setChecked(True)
         elif repo.postpull == 'rebase':
             self.rebase.setChecked(True)
+        elif repo.postpull == 'updateOrRebase':
+            self.updateOrRebase.setChecked(True)
 
         self.autoresolve_chk = QCheckBox(_('Automatically resolve merge conflicts '
                                            'where possible'))
@@ -1074,8 +1080,10 @@
             return 'update'
         elif (self.fetch and self.fetch.isChecked()):
             return 'fetch'
+        elif (self.rebase and self.rebase.isChecked()):
+            return 'rebase'
         else:
-            return 'rebase'
+            return 'updateOrRebase'
 
     def accept(self):
         path = self.repo.join('hgrc')
diff --git a/tortoisehg/hgqt/thgrepo.py b/tortoisehg/hgqt/thgrepo.py
--- a/tortoisehg/hgqt/thgrepo.py
+++ b/tortoisehg/hgqt/thgrepo.py
@@ -372,7 +372,7 @@
         @propertycache
         def postpull(self):
             pp = self.ui.config('tortoisehg', 'postpull')
-            if pp in ('rebase', 'update', 'fetch'):
+            if pp in ('rebase', 'update', 'fetch', 'updateOrRebase'):
                 return pp
             return 'none'
 
 
 
 

Steve Borho

unread,
May 23, 2013, 10:37:18 PM5/23/13
to thg...@googlegroups.com
On Wed, May 15, 2013 at 6:05 AM, CHRIST, FABIENNE (FABIENNE) <Fabienn...@alcatel-lucent.com> wrote:
# HG changeset patch
# User Fabienne Christ <Fabienn...@alcatel-lucent.com>
# Date 1368460404 -7200
# Branch stable
# Node ID b320ff3d10d18c66ff918cdd5f9fe75eea02d26d
# Parent  b30e0080d313e3a7fec6095dd9a5418108d05200
sync: add new mode in postpull: update or rebase (closes #2551)

A modified version of this is on our default branch.
 

--
You received this message because you are subscribed to the Google Groups "TortoiseHg Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thg-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Steve Borho
Reply all
Reply to author
Forward
0 new messages