eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/queues.py

changeset 7759
51aa6c6b66f7
parent 7370
5fb53279f2df
child 7900
72b88fb20261
child 7924
8a96736d465e
equal deleted inserted replaced
7758:dd54d33d21d2 7759:51aa6c6b66f7
182 if os.path.splitdrive(repodir)[1] == os.sep: 182 if os.path.splitdrive(repodir)[1] == os.sep:
183 return 183 return
184 184
185 from .HgQueuesNewPatchDialog import HgQueuesNewPatchDialog 185 from .HgQueuesNewPatchDialog import HgQueuesNewPatchDialog
186 dlg = HgQueuesNewPatchDialog(HgQueuesNewPatchDialog.NEW_MODE) 186 dlg = HgQueuesNewPatchDialog(HgQueuesNewPatchDialog.NEW_MODE)
187 if dlg.exec_() == QDialog.Accepted: 187 if dlg.exec() == QDialog.Accepted:
188 (name, message, 188 (name, message,
189 (userData, currentUser, userName), 189 (userData, currentUser, userName),
190 (dateData, currentDate, dateStr)) = dlg.getData() 190 (dateData, currentDate, dateStr)) = dlg.getData()
191 191
192 args = self.vcs.initCommand("qnew") 192 args = self.vcs.initCommand("qnew")
208 args.append(name) 208 args.append(name)
209 209
210 dia = HgDialog(self.tr('New Patch'), self.vcs) 210 dia = HgDialog(self.tr('New Patch'), self.vcs)
211 res = dia.startProcess(args, repodir) 211 res = dia.startProcess(args, repodir)
212 if res: 212 if res:
213 dia.exec_() 213 dia.exec()
214 self.vcs.checkVCSStatus() 214 self.vcs.checkVCSStatus()
215 215
216 def hgQueueRefreshPatch(self, name, editMessage=False): 216 def hgQueueRefreshPatch(self, name, editMessage=False):
217 """ 217 """
218 Public method to refresh the current patch. 218 Public method to refresh the current patch.
233 if editMessage: 233 if editMessage:
234 currentMessage = self.__getCommitMessage(repodir) 234 currentMessage = self.__getCommitMessage(repodir)
235 from .HgQueuesNewPatchDialog import HgQueuesNewPatchDialog 235 from .HgQueuesNewPatchDialog import HgQueuesNewPatchDialog
236 dlg = HgQueuesNewPatchDialog(HgQueuesNewPatchDialog.REFRESH_MODE, 236 dlg = HgQueuesNewPatchDialog(HgQueuesNewPatchDialog.REFRESH_MODE,
237 currentMessage) 237 currentMessage)
238 if dlg.exec_() == QDialog.Accepted: 238 if dlg.exec() == QDialog.Accepted:
239 (name, message, 239 (name, message,
240 (userData, currentUser, userName), 240 (userData, currentUser, userName),
241 (dateData, currentDate, dateStr)) = dlg.getData() 241 (dateData, currentDate, dateStr)) = dlg.getData()
242 if message != "" and message != currentMessage: 242 if message != "" and message != currentMessage:
243 args.append("--message") 243 args.append("--message")
258 return 258 return
259 259
260 dia = HgDialog(self.tr('Update Current Patch'), self.vcs) 260 dia = HgDialog(self.tr('Update Current Patch'), self.vcs)
261 res = dia.startProcess(args, repodir) 261 res = dia.startProcess(args, repodir)
262 if res: 262 if res:
263 dia.exec_() 263 dia.exec()
264 self.vcs.checkVCSStatus() 264 self.vcs.checkVCSStatus()
265 265
266 def hgQueueShowPatch(self, name): 266 def hgQueueShowPatch(self, name):
267 """ 267 """
268 Public method to show the contents of the current patch. 268 Public method to show the contents of the current patch.
350 return False 350 return False
351 351
352 dia = HgDialog(title, self.vcs) 352 dia = HgDialog(title, self.vcs)
353 res = dia.startProcess(args, repodir) 353 res = dia.startProcess(args, repodir)
354 if res: 354 if res:
355 dia.exec_() 355 dia.exec()
356 res = dia.hasAddOrDelete() 356 res = dia.hasAddOrDelete()
357 self.vcs.checkVCSStatus() 357 self.vcs.checkVCSStatus()
358 return res 358 return res
359 359
360 def hgQueueListPatches(self, name): 360 def hgQueueListPatches(self, name):
385 args.append("--applied") 385 args.append("--applied")
386 386
387 dia = HgDialog(self.tr('Finish Applied Patches'), self.vcs) 387 dia = HgDialog(self.tr('Finish Applied Patches'), self.vcs)
388 res = dia.startProcess(args, repodir) 388 res = dia.startProcess(args, repodir)
389 if res: 389 if res:
390 dia.exec_() 390 dia.exec()
391 self.vcs.checkVCSStatus() 391 self.vcs.checkVCSStatus()
392 392
393 def hgQueueRenamePatch(self, name): 393 def hgQueueRenamePatch(self, name):
394 """ 394 """
395 Public method to rename the current or a selected patch. 395 Public method to rename the current or a selected patch.
410 if currentPatch: 410 if currentPatch:
411 from .HgQueuesRenamePatchDialog import ( 411 from .HgQueuesRenamePatchDialog import (
412 HgQueuesRenamePatchDialog 412 HgQueuesRenamePatchDialog
413 ) 413 )
414 dlg = HgQueuesRenamePatchDialog(currentPatch, patchnames) 414 dlg = HgQueuesRenamePatchDialog(currentPatch, patchnames)
415 if dlg.exec_() == QDialog.Accepted: 415 if dlg.exec() == QDialog.Accepted:
416 newName, selectedPatch = dlg.getData() 416 newName, selectedPatch = dlg.getData()
417 if selectedPatch: 417 if selectedPatch:
418 args.append(selectedPatch) 418 args.append(selectedPatch)
419 args.append(newName) 419 args.append(newName)
420 420
421 dia = HgDialog(self.tr("Rename Patch"), self.vcs) 421 dia = HgDialog(self.tr("Rename Patch"), self.vcs)
422 res = dia.startProcess(args, repodir) 422 res = dia.startProcess(args, repodir)
423 if res: 423 if res:
424 dia.exec_() 424 dia.exec()
425 425
426 def hgQueueDeletePatch(self, name): 426 def hgQueueDeletePatch(self, name):
427 """ 427 """
428 Public method to delete a selected unapplied patch. 428 Public method to delete a selected unapplied patch.
429 429
450 args.append(patch) 450 args.append(patch)
451 451
452 dia = HgDialog(self.tr("Delete Patch"), self.vcs) 452 dia = HgDialog(self.tr("Delete Patch"), self.vcs)
453 res = dia.startProcess(args, repodir) 453 res = dia.startProcess(args, repodir)
454 if res: 454 if res:
455 dia.exec_() 455 dia.exec()
456 else: 456 else:
457 E5MessageBox.information( 457 E5MessageBox.information(
458 None, 458 None,
459 self.tr("Select Patch"), 459 self.tr("Select Patch"),
460 self.tr("""No patches to select from.""")) 460 self.tr("""No patches to select from."""))
477 self.__getPatchesList(repodir, Queues.UNAPPLIED_LIST, 477 self.__getPatchesList(repodir, Queues.UNAPPLIED_LIST,
478 withSummary=True)) 478 withSummary=True))
479 if patchnames: 479 if patchnames:
480 from .HgQueuesFoldDialog import HgQueuesFoldDialog 480 from .HgQueuesFoldDialog import HgQueuesFoldDialog
481 dlg = HgQueuesFoldDialog(patchnames) 481 dlg = HgQueuesFoldDialog(patchnames)
482 if dlg.exec_() == QDialog.Accepted: 482 if dlg.exec() == QDialog.Accepted:
483 message, patchesList = dlg.getData() 483 message, patchesList = dlg.getData()
484 if message: 484 if message:
485 args.append("--message") 485 args.append("--message")
486 args.append(message) 486 args.append(message)
487 if patchesList: 487 if patchesList:
488 args.extend(patchesList) 488 args.extend(patchesList)
489 489
490 dia = HgDialog(self.tr("Fold Patches"), self.vcs) 490 dia = HgDialog(self.tr("Fold Patches"), self.vcs)
491 res = dia.startProcess(args, repodir) 491 res = dia.startProcess(args, repodir)
492 if res: 492 if res:
493 dia.exec_() 493 dia.exec()
494 else: 494 else:
495 E5MessageBox.information( 495 E5MessageBox.information(
496 None, 496 None,
497 self.tr("Fold Patches"), 497 self.tr("Fold Patches"),
498 self.tr("""No patches selected.""")) 498 self.tr("""No patches selected."""))
623 from .HgQueuesGuardsSelectionDialog import ( 623 from .HgQueuesGuardsSelectionDialog import (
624 HgQueuesGuardsSelectionDialog 624 HgQueuesGuardsSelectionDialog
625 ) 625 )
626 dlg = HgQueuesGuardsSelectionDialog( 626 dlg = HgQueuesGuardsSelectionDialog(
627 guardsList, activeGuards=activeGuardsList, listOnly=False) 627 guardsList, activeGuards=activeGuardsList, listOnly=False)
628 if dlg.exec_() == QDialog.Accepted: 628 if dlg.exec() == QDialog.Accepted:
629 guards = dlg.getData() 629 guards = dlg.getData()
630 if guards: 630 if guards:
631 args = self.vcs.initCommand("qselect") 631 args = self.vcs.initCommand("qselect")
632 args.extend(guards) 632 args.extend(guards)
633 633
634 dia = HgDialog(self.tr('Set Active Guards'), self.vcs) 634 dia = HgDialog(self.tr('Set Active Guards'), self.vcs)
635 res = dia.startProcess(args, repodir) 635 res = dia.startProcess(args, repodir)
636 if res: 636 if res:
637 dia.exec_() 637 dia.exec()
638 else: 638 else:
639 E5MessageBox.information( 639 E5MessageBox.information(
640 None, 640 None,
641 self.tr("Set Active Guards"), 641 self.tr("Set Active Guards"),
642 self.tr("""No guards available to select from.""")) 642 self.tr("""No guards available to select from."""))
659 args.append("--none") 659 args.append("--none")
660 660
661 dia = HgDialog(self.tr('Deactivate Guards'), self.vcs) 661 dia = HgDialog(self.tr('Deactivate Guards'), self.vcs)
662 res = dia.startProcess(args, repodir) 662 res = dia.startProcess(args, repodir)
663 if res: 663 if res:
664 dia.exec_() 664 dia.exec()
665 665
666 def hgQueueGuardsIdentifyActive(self, name): 666 def hgQueueGuardsIdentifyActive(self, name):
667 """ 667 """
668 Public method to list all active guards. 668 Public method to list all active guards.
669 669
680 if guardsList: 680 if guardsList:
681 from .HgQueuesGuardsSelectionDialog import ( 681 from .HgQueuesGuardsSelectionDialog import (
682 HgQueuesGuardsSelectionDialog 682 HgQueuesGuardsSelectionDialog
683 ) 683 )
684 dlg = HgQueuesGuardsSelectionDialog(guardsList, listOnly=True) 684 dlg = HgQueuesGuardsSelectionDialog(guardsList, listOnly=True)
685 dlg.exec_() 685 dlg.exec()
686 686
687 def hgQueueCreateRenameQueue(self, name, isCreate): 687 def hgQueueCreateRenameQueue(self, name, isCreate):
688 """ 688 """
689 Public method to create a new queue or rename the active queue. 689 Public method to create a new queue or rename the active queue.
690 690
706 HgQueuesQueueManagementDialog 706 HgQueuesQueueManagementDialog
707 ) 707 )
708 dlg = HgQueuesQueueManagementDialog( 708 dlg = HgQueuesQueueManagementDialog(
709 HgQueuesQueueManagementDialog.NAME_INPUT, 709 HgQueuesQueueManagementDialog.NAME_INPUT,
710 title, False, repodir, self.vcs) 710 title, False, repodir, self.vcs)
711 if dlg.exec_() == QDialog.Accepted: 711 if dlg.exec() == QDialog.Accepted:
712 queueName = dlg.getData() 712 queueName = dlg.getData()
713 if queueName: 713 if queueName:
714 args = self.vcs.initCommand("qqueue") 714 args = self.vcs.initCommand("qqueue")
715 if isCreate: 715 if isCreate:
716 args.append("--create") 716 args.append("--create")
769 HgQueuesQueueManagementDialog 769 HgQueuesQueueManagementDialog
770 ) 770 )
771 dlg = HgQueuesQueueManagementDialog( 771 dlg = HgQueuesQueueManagementDialog(
772 HgQueuesQueueManagementDialog.QUEUE_INPUT, 772 HgQueuesQueueManagementDialog.QUEUE_INPUT,
773 title, True, repodir, self.vcs) 773 title, True, repodir, self.vcs)
774 if dlg.exec_() == QDialog.Accepted: 774 if dlg.exec() == QDialog.Accepted:
775 queueName = dlg.getData() 775 queueName = dlg.getData()
776 if queueName: 776 if queueName:
777 args = self.vcs.initCommand("qqueue") 777 args = self.vcs.initCommand("qqueue")
778 if operation == Queues.QUEUE_PURGE: 778 if operation == Queues.QUEUE_PURGE:
779 args.append("--purge") 779 args.append("--purge")
844 # init is not possible with the command server 844 # init is not possible with the command server
845 dia = HgDialog( 845 dia = HgDialog(
846 self.tr('Initializing new queue repository'), self.vcs) 846 self.tr('Initializing new queue repository'), self.vcs)
847 res = dia.startProcess(args) 847 res = dia.startProcess(args)
848 if res: 848 if res:
849 dia.exec_() 849 dia.exec()
850 850
851 def hgQueueStatus(self, name): 851 def hgQueueStatus(self, name):
852 """ 852 """
853 Public method used to view the status of a queue repository. 853 Public method used to view the status of a queue repository.
854 854

eric ide

mercurial