Commits

Piotr Klecha committed 381c9df

mq: support for --keep-changes option

Comments (0)

Files changed (1)

tortoisehg/hgqt/mq.py

         assert parent is None or isinstance(parent, QWidget)
         self._repoagent = None
         self._cmdsession = cmdcore.nullCmdSession()
-        self._opts = {'force': False}
+        self._opts = {'force': False, 'keep_changes': False}
 
     def setRepoAgent(self, repoagent):
         self._repoagent = repoagent
 
     def gotoPatch(self, patch):
-        opts = {'force': self._opts['force']}
+        opts = {'force': self._opts['force'],
+                'keep_changes': self._opts['keep_changes']}
         return self._runCommand('qgoto', [patch], opts, self._onPushFinished)
 
     @pyqtSlot()
 
     def _runPush(self, patch, **opts):
         opts['force'] = self._opts['force']
+        opts['keep_changes'] = self._opts['keep_changes']
         return self._runCommand('qpush', [patch], opts, self._onPushFinished)
 
     @pyqtSlot()
 
     def _runPop(self, patch, **opts):
         opts['force'] = self._opts['force']
+        opts['keep_changes'] = self._opts['keep_changes']
         return self._runCommand('qpop', [patch], opts)
 
     def renamePatch(self, patch, newname):
             _('Force push or pop (--force)'))
         layout.addWidget(self.forcecb)
 
+        self.keepcb = QCheckBox(
+            _('Tolerate non-conflicting local changes (--keep-changes)'))
+        layout.addWidget(self.keepcb)
+
         self.forcecb.setChecked(opts.get('force', False))
+        self.keepcb.setChecked(opts.get('keep_changes', False))
 
         BB = QDialogButtonBox
         bb = QDialogButtonBox(BB.Ok|BB.Cancel)
     def accept(self):
         outopts = {}
         outopts['force'] = self.forcecb.isChecked()
+        outopts['keep_changes'] = self.keepcb.isChecked()
         self.outopts = outopts
         QDialog.accept(self)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.