Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9.2, 1.9.3, and 2.0

update: use shelve tool to shelve changes, remove unimplemented patch option

Changeset 0e9e73cfc1f7

Parent 0a45ee231e32

by Steve Borho

Changes to one file · Browse files at 0e9e73cfc1f7 Showing diff from parent 0a45ee231e32 Diff from another changeset...

 
218
219
220
221
222
 
 
223
224
225
226
227
228
 
229
230
231
 
233
234
235
236
 
237
238
239
 
249
250
251
252
253
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
255
256
 
218
219
220
 
 
221
222
223
224
225
226
227
 
228
229
230
231
 
233
234
235
 
236
237
238
239
 
249
250
251
 
 
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
@@ -218,14 +218,14 @@
  'Please select to continue:\n\n')   data = {'discard': (_('&Discard'),   _('Discard - discard local changes, no backup')), - 'patch': (_('&Patch'), - _('Patch - move local changes to MQ patch')), + 'shelve': (_('&Shelve'), + _('Shelve - move local changes to a patch')),   'merge': (_('&Merge'),   _('Merge - allow to merge with local changes')),}     opts = [data['discard']]   if not ismergedchange(): - opts.append(data['patch']) + opts.append(data['shelve'])   if islocalmerge(cur, node, clean):   opts.append(data['merge'])   @@ -233,7 +233,7 @@
  dlg = QMessageBox(QMessageBox.Question, _('Confirm Update'),   msg, QMessageBox.Cancel, self)   buttons = {} - for name in ('discard', 'patch', 'merge'): + for name in ('discard', 'shelve', 'merge'):   label, desc = data[name]   buttons[name] = dlg.addButton(label, QMessageBox.ActionRole)   dlg.exec_() @@ -249,8 +249,20 @@
  buttons, clicked = confirmupdate(clean)   if buttons['discard'] == clicked:   cmdline.append('--clean') - elif buttons['patch'] == clicked: - return # TODO: not implemented yet + elif buttons['shelve'] == clicked: + def finished(): + self.setWindowModality(Qt.ApplicationModal) + self.shelvedlg.setWindowModality(Qt.NonModal) + self.shelvedlg.hide() + self.update() + from tortoisehg.hgqt import shelve + self.shelvedlg = dlg = shelve.ShelveDialog(self.repo) + dlg.finished.connect(finished) + dlg.show() + dlg.raise_() + dlg.setWindowModality(Qt.ApplicationModal) + self.setWindowModality(Qt.NonModal) + return   elif buttons['merge'] == clicked:   pass # no args   else: