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

mq: implement patch guard set method

Changeset bc036e086929

Parent 06f10a6ba12c

by Steve Borho

Changes to one file · Browse files at bc036e086929 Showing diff from parent 06f10a6ba12c Diff from another changeset...

 
158
159
160
 
161
162
163
 
254
255
256
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
257
258
259
 
426
427
428
 
429
430
431
 
158
159
160
161
162
163
164
 
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
 
458
459
460
461
462
463
464
@@ -158,6 +158,7 @@
  self.qpushMoveBtn.clicked.connect(self.onPushMove)   self.qpopAllBtn.clicked.connect(self.onPopAll)   self.qpopBtn.clicked.connect(self.onPop) + self.setGuardsBtn.clicked.connect(self.onGuardConfigure)   self.qdeleteBtn.clicked.connect(self.onDelete)   self.newCheckBox.toggled.connect(self.onNewModeToggled)   self.qnewOrRefreshBtn.clicked.connect(self.onQNewOrQRefresh) @@ -254,6 +255,37 @@
  self.cmd.run(cmdline)     @pyqtSlot() + def onGuardConfigure(self): + item = self.queueListWidget.currentItem() + patch = item._thgpatch + if item._thgguards: + uguards = hglib.tounicode(' '.join(item._thgguards)) + else: + uguards = '' + new, ok = QInputDialog.getText(self, + _('Configure guards'), + _('Input new guards for %s:') % hglib.tounicode(patch), + text=uguards, flags=Qt.Sheet) + if not ok or new == uguards: + return + guards = [] + for guard in hglib.fromunicode(new).split(' '): + guard = guard.strip() + if not guard: + continue + if not (guard[0] == '+' or guard[0] == '-'): + self.showMessage.emit(_('Guards must begin with "+" or "-"')) + continue + guards.append(guard) + cmdline = ['qguard', '-R', self.repo.root, '--', patch] + if guards: + cmdline += guards + else: + cmdline.insert(3, '--none') + self.repo.incrementBusyCount() + self.cmd.run(cmdline) + + @pyqtSlot()   def onDelete(self):   from tortoisehg.hgqt import qdelete   patch = self.queueListWidget.currentItem()._thgpatch @@ -426,6 +458,7 @@
  uguards = _('no guards')   uname = hglib.tounicode(patch)   item._thgpatch = patch + item._thgguards = patchguards   item.setToolTip(u'%s: %s' % (uname, uguards))   item.setFlags(Qt.ItemIsSelectable |   Qt.ItemIsEditable |