Commits

Anonymous committed 508f0e1

SyncMq patch inception

  • Participants
  • Parent commits ad8001b

Comments (0)

Files changed (2)

+# HG changeset patch
+# Parent 4caebca2112cff34e24d001d40e900e964ed36bd
+sync: support --mq option for the sync commands
+
+diff -r 4caebca2112c tortoisehg/hgqt/sync.py
+--- a/tortoisehg/hgqt/sync.py	Wed Nov 16 00:57:35 2011 +0900
++++ b/tortoisehg/hgqt/sync.py	Thu Nov 17 09:21:36 2011 +0100
+@@ -92,7 +92,7 @@
+         self.targetargs = []
+ 
+         s = QSettings()
+-        for opt in ('subrepos', 'force', 'new-branch', 'noproxy', 'debug'):
++        for opt in ('subrepos', 'force', 'new-branch', 'noproxy', 'debug', 'mq'):
+             val = s.value('sync/' + opt, None).toBool()
+             if val:
+                 self.opts[opt] = val
+@@ -719,7 +719,8 @@
+ 
+         safeurl = self.currentUrl(True)
+         display = ' '.join(cmdline + [safeurl]).replace('\n', '^M')
+-        cmdline.append(cururl)
++        if not self.opts['mq']:
++            cmdline.append(cururl)
+         self.repo.incrementBusyCount()
+         self.cmd.run(cmdline, display=display, useproc='p4://' in cururl)
+ 
+@@ -796,7 +797,7 @@
+             self.finishfunc = finished
+             cmdline = ['--repository', self.repo.root, 'incoming', '--quiet',
+                        '--bundle', bfile]
+-            self.run(cmdline, ('force', 'branch', 'rev'))
++            self.run(cmdline, ('force', 'branch', 'rev', 'mq'))
+         else:
+             def finished(ret, output):
+                 if ret == 0:
+@@ -807,7 +808,7 @@
+                     self.showMessage.emit(_('Incoming from %s aborted, ret %d') % (urlu, ret))
+             self.finishfunc = finished
+             cmdline = ['--repository', self.repo.root, 'incoming']
+-            self.run(cmdline, ('force', 'branch', 'rev', 'subrepos'))
++            self.run(cmdline, ('force', 'branch', 'rev', 'subrepos', 'mq'))
+ 
+     def pullclicked(self):
+         self.syncStarted.emit()
+@@ -846,7 +847,7 @@
+             cmdline += ['--update', '--config', uimerge]
+         elif self.cachedpp == 'fetch':
+             cmdline[2] = 'fetch'
+-        self.run(cmdline, ('force', 'branch', 'rev', 'bookmark'))
++        self.run(cmdline, ('force', 'branch', 'rev', 'bookmark', 'mq'))
+ 
+     def outclicked(self):
+         self.syncStarted.emit()
+@@ -873,11 +874,11 @@
+             self.finishfunc = outputnodes
+             cmdline = ['--repository', self.repo.root, 'outgoing', '--quiet',
+                        '--template', '{node}\n']
+-            self.run(cmdline, ('force', 'branch', 'rev'))
++            self.run(cmdline, ('force', 'branch', 'rev', 'mq'))
+         else:
+             self.finishfunc = None
+             cmdline = ['--repository', self.repo.root, 'outgoing']
+-            self.run(cmdline, ('force', 'branch', 'rev', 'subrepos'))
++            self.run(cmdline, ('force', 'branch', 'rev', 'subrepos', 'mq'))
+ 
+     def p4pending(self):
+         p4url = self.currentUrl(False)
+@@ -923,7 +924,7 @@
+         self.run(['--repository', self.repo.root, 'p4pending', '--verbose'], ())
+ 
+     def pushclicked(self, confirm, rev=None, branch=None):
+-        validopts = ('force', 'new-branch', 'branch', 'rev', 'bookmark')
++        validopts = ('force', 'new-branch', 'branch', 'rev', 'bookmark', 'mq')
+         self.syncStarted.emit()
+         url = self.currentUrl(True)
+         urlu = hglib.tounicode(url)
+@@ -1546,6 +1547,11 @@
+         self.debugcb.setChecked(opts.get('debug', False))
+         layout.addWidget(self.debugcb)
+ 
++	self.mqcb = QCheckBox(
++            _('Work on patch queue (--mq)'))
++        self.mqcb.setChecked(opts.get('mq', False))
++        layout.addWidget(self.mqcb)
++
+         form = QFormLayout()
+         layout.addLayout(form)
+ 
+@@ -1579,6 +1585,7 @@
+         outopts['new-branch'] = self.newbranchcb.isChecked()
+         outopts['noproxy'] = self.noproxycb.isChecked()
+         outopts['debug'] = self.debugcb.isChecked()
++        outopts['mq'] = self.mqcb.isChecked()
+ 
+         self.outopts = outopts
+         QDialog.accept(self)
+SyncMq
 # Placed by Bitbucket