src/eric7/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/queues.py

branch
eric7
changeset 9482
a2bc06a54d9d
parent 9473
3f23dbf37dbe
child 9653
e67609152c5e
equal deleted inserted replaced
9481:0b936ff1bbb9 9482:a2bc06a54d9d
214 Public method to refresh the current patch. 214 Public method to refresh the current patch.
215 215
216 @param editMessage flag indicating to edit the current 216 @param editMessage flag indicating to edit the current
217 commit message (boolean) 217 commit message (boolean)
218 """ 218 """
219 from .HgQueuesNewPatchDialog import HgQueuesNewPatchDialog
220
219 args = self.vcs.initCommand("qrefresh") 221 args = self.vcs.initCommand("qrefresh")
220 222
221 if editMessage: 223 if editMessage:
222 currentMessage = self.__getCommitMessage() 224 currentMessage = self.__getCommitMessage()
223 from .HgQueuesNewPatchDialog import HgQueuesNewPatchDialog
224
225 dlg = HgQueuesNewPatchDialog( 225 dlg = HgQueuesNewPatchDialog(
226 HgQueuesNewPatchDialog.REFRESH_MODE, currentMessage 226 HgQueuesNewPatchDialog.REFRESH_MODE, currentMessage
227 ) 227 )
228 if dlg.exec() == QDialog.DialogCode.Accepted: 228 if dlg.exec() == QDialog.DialogCode.Accepted:
229 ( 229 (
371 371
372 def hgQueueRenamePatch(self): 372 def hgQueueRenamePatch(self):
373 """ 373 """
374 Public method to rename the current or a selected patch. 374 Public method to rename the current or a selected patch.
375 """ 375 """
376 from .HgQueuesRenamePatchDialog import HgQueuesRenamePatchDialog
377
376 args = self.vcs.initCommand("qrename") 378 args = self.vcs.initCommand("qrename")
377 patchnames = sorted(self.__getPatchesList(Queues.SERIES_LIST)) 379 patchnames = sorted(self.__getPatchesList(Queues.SERIES_LIST))
378 if patchnames: 380 if patchnames:
379 currentPatch = self.__getCurrentPatch() 381 currentPatch = self.__getCurrentPatch()
380 if currentPatch: 382 if currentPatch:
381 from .HgQueuesRenamePatchDialog import HgQueuesRenamePatchDialog
382
383 dlg = HgQueuesRenamePatchDialog(currentPatch, patchnames) 383 dlg = HgQueuesRenamePatchDialog(currentPatch, patchnames)
384 if dlg.exec() == QDialog.DialogCode.Accepted: 384 if dlg.exec() == QDialog.DialogCode.Accepted:
385 newName, selectedPatch = dlg.getData() 385 newName, selectedPatch = dlg.getData()
386 if selectedPatch: 386 if selectedPatch:
387 args.append(selectedPatch) 387 args.append(selectedPatch)
421 421
422 def hgQueueFoldUnappliedPatches(self): 422 def hgQueueFoldUnappliedPatches(self):
423 """ 423 """
424 Public method to fold patches into the current patch. 424 Public method to fold patches into the current patch.
425 """ 425 """
426 from .HgQueuesFoldDialog import HgQueuesFoldDialog
427
426 args = self.vcs.initCommand("qfold") 428 args = self.vcs.initCommand("qfold")
427 patchnames = sorted( 429 patchnames = sorted(
428 self.__getPatchesList(Queues.UNAPPLIED_LIST, withSummary=True) 430 self.__getPatchesList(Queues.UNAPPLIED_LIST, withSummary=True)
429 ) 431 )
430 if patchnames: 432 if patchnames:
431 from .HgQueuesFoldDialog import HgQueuesFoldDialog
432
433 dlg = HgQueuesFoldDialog(patchnames) 433 dlg = HgQueuesFoldDialog(patchnames)
434 if dlg.exec() == QDialog.DialogCode.Accepted: 434 if dlg.exec() == QDialog.DialogCode.Accepted:
435 message, patchesList = dlg.getData() 435 message, patchesList = dlg.getData()
436 if message: 436 if message:
437 args.append("--message") 437 args.append("--message")
458 458
459 def hgQueueGuardsList(self): 459 def hgQueueGuardsList(self):
460 """ 460 """
461 Public method to list the guards for the current or a named patch. 461 Public method to list the guards for the current or a named patch.
462 """ 462 """
463 from .HgQueuesListGuardsDialog import HgQueuesListGuardsDialog
464
463 patchnames = sorted(self.__getPatchesList(Queues.SERIES_LIST)) 465 patchnames = sorted(self.__getPatchesList(Queues.SERIES_LIST))
464 if patchnames: 466 if patchnames:
465 from .HgQueuesListGuardsDialog import HgQueuesListGuardsDialog
466
467 self.queuesListGuardsDialog = HgQueuesListGuardsDialog(self.vcs, patchnames) 467 self.queuesListGuardsDialog = HgQueuesListGuardsDialog(self.vcs, patchnames)
468 self.queuesListGuardsDialog.show() 468 self.queuesListGuardsDialog.show()
469 self.queuesListGuardsDialog.start() 469 self.queuesListGuardsDialog.start()
470 else: 470 else:
471 EricMessageBox.information( 471 EricMessageBox.information(
486 486
487 def hgQueueGuardsDefine(self): 487 def hgQueueGuardsDefine(self):
488 """ 488 """
489 Public method to define guards for the current or a named patch. 489 Public method to define guards for the current or a named patch.
490 """ 490 """
491 from .HgQueuesDefineGuardsDialog import HgQueuesDefineGuardsDialog
492
491 patchnames = sorted(self.__getPatchesList(Queues.SERIES_LIST)) 493 patchnames = sorted(self.__getPatchesList(Queues.SERIES_LIST))
492 if patchnames: 494 if patchnames:
493 from .HgQueuesDefineGuardsDialog import HgQueuesDefineGuardsDialog
494
495 self.queuesDefineGuardsDialog = HgQueuesDefineGuardsDialog( 495 self.queuesDefineGuardsDialog = HgQueuesDefineGuardsDialog(
496 self.vcs, self, patchnames 496 self.vcs, self, patchnames
497 ) 497 )
498 self.queuesDefineGuardsDialog.show() 498 self.queuesDefineGuardsDialog.show()
499 self.queuesDefineGuardsDialog.start() 499 self.queuesDefineGuardsDialog.start()
538 538
539 def hgQueueGuardsSetActive(self): 539 def hgQueueGuardsSetActive(self):
540 """ 540 """
541 Public method to set the active guards. 541 Public method to set the active guards.
542 """ 542 """
543 from .HgQueuesGuardsSelectionDialog import HgQueuesGuardsSelectionDialog
544
543 guardsList = self.getGuardsList() 545 guardsList = self.getGuardsList()
544 if guardsList: 546 if guardsList:
545 activeGuardsList = self.getGuardsList(allGuards=False) 547 activeGuardsList = self.getGuardsList(allGuards=False)
546 from .HgQueuesGuardsSelectionDialog import HgQueuesGuardsSelectionDialog
547
548 dlg = HgQueuesGuardsSelectionDialog( 548 dlg = HgQueuesGuardsSelectionDialog(
549 guardsList, activeGuards=activeGuardsList, listOnly=False 549 guardsList, activeGuards=activeGuardsList, listOnly=False
550 ) 550 )
551 if dlg.exec() == QDialog.DialogCode.Accepted: 551 if dlg.exec() == QDialog.DialogCode.Accepted:
552 guards = dlg.getData() 552 guards = dlg.getData()
580 580
581 def hgQueueGuardsIdentifyActive(self): 581 def hgQueueGuardsIdentifyActive(self):
582 """ 582 """
583 Public method to list all active guards. 583 Public method to list all active guards.
584 """ 584 """
585 from .HgQueuesGuardsSelectionDialog import HgQueuesGuardsSelectionDialog
586
585 guardsList = self.getGuardsList(allGuards=False) 587 guardsList = self.getGuardsList(allGuards=False)
586 if guardsList: 588 if guardsList:
587 from .HgQueuesGuardsSelectionDialog import HgQueuesGuardsSelectionDialog
588
589 dlg = HgQueuesGuardsSelectionDialog(guardsList, listOnly=True) 589 dlg = HgQueuesGuardsSelectionDialog(guardsList, listOnly=True)
590 dlg.exec() 590 dlg.exec()
591 591
592 def hgQueueCreateRenameQueue(self, isCreate): 592 def hgQueueCreateRenameQueue(self, isCreate):
593 """ 593 """
638 638
639 @param operation operation to be performed (Queues.QUEUE_DELETE, 639 @param operation operation to be performed (Queues.QUEUE_DELETE,
640 Queues.QUEUE_PURGE, Queues.QUEUE_ACTIVATE) 640 Queues.QUEUE_PURGE, Queues.QUEUE_ACTIVATE)
641 @exception ValueError raised to indicate an invalid operation 641 @exception ValueError raised to indicate an invalid operation
642 """ 642 """
643 from .HgQueuesQueueManagementDialog import HgQueuesQueueManagementDialog
644
643 if operation not in ( 645 if operation not in (
644 Queues.QUEUE_PURGE, 646 Queues.QUEUE_PURGE,
645 Queues.QUEUE_DELETE, 647 Queues.QUEUE_DELETE,
646 Queues.QUEUE_ACTIVATE, 648 Queues.QUEUE_ACTIVATE,
647 ): 649 ):
651 title = self.tr("Purge Queue") 653 title = self.tr("Purge Queue")
652 elif operation == Queues.QUEUE_DELETE: 654 elif operation == Queues.QUEUE_DELETE:
653 title = self.tr("Delete Queue") 655 title = self.tr("Delete Queue")
654 else: 656 else:
655 title = self.tr("Activate Queue") 657 title = self.tr("Activate Queue")
656
657 from .HgQueuesQueueManagementDialog import HgQueuesQueueManagementDialog
658 658
659 dlg = HgQueuesQueueManagementDialog( 659 dlg = HgQueuesQueueManagementDialog(
660 HgQueuesQueueManagementDialog.QUEUE_INPUT, title, True, self.vcs 660 HgQueuesQueueManagementDialog.QUEUE_INPUT, title, True, self.vcs
661 ) 661 )
662 if dlg.exec() == QDialog.DialogCode.Accepted: 662 if dlg.exec() == QDialog.DialogCode.Accepted:

eric ide

mercurial