Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py

changeset 202
6854bb0beda5
parent 199
675623ee5d7d
child 213
42bb97ff0bbb
equal deleted inserted replaced
201:a434e007ab9a 202:6854bb0beda5
424 """<p>This closes the current branch of the local project.</p>""" 424 """<p>This closes the current branch of the local project.</p>"""
425 )) 425 ))
426 self.connect(self.hgCloseBranchAct, SIGNAL('triggered()'), self.__hgCloseBranch) 426 self.connect(self.hgCloseBranchAct, SIGNAL('triggered()'), self.__hgCloseBranch)
427 self.actions.append(self.hgCloseBranchAct) 427 self.actions.append(self.hgCloseBranchAct)
428 428
429 self.hgShowBranchAct = E5Action(self.trUtf8('Show current branch'),
430 self.trUtf8('Show current branch'),
431 0, 0, self, 'mercurial_show_branch')
432 self.hgShowBranchAct.setStatusTip(self.trUtf8(
433 'Show the current branch of the project'
434 ))
435 self.hgShowBranchAct.setWhatsThis(self.trUtf8(
436 """<b>Show current branch</b>"""
437 """<p>This shows the current branch of the project.</p>"""
438 ))
439 self.connect(self.hgShowBranchAct, SIGNAL('triggered()'), self.__hgShowBranch)
440 self.actions.append(self.hgShowBranchAct)
441
429 self.vcsSwitchAct = E5Action(self.trUtf8('Switch'), 442 self.vcsSwitchAct = E5Action(self.trUtf8('Switch'),
430 UI.PixmapCache.getIcon("vcsSwitch.png"), 443 UI.PixmapCache.getIcon("vcsSwitch.png"),
431 self.trUtf8('S&witch...'), 444 self.trUtf8('S&witch...'),
432 0, 0, self, 'mercurial_switch') 445 0, 0, self, 'mercurial_switch')
433 self.vcsSwitchAct.setStatusTip(self.trUtf8( 446 self.vcsSwitchAct.setStatusTip(self.trUtf8(
593 """<p>This applies one or several changegroup files generated by""" 606 """<p>This applies one or several changegroup files generated by"""
594 """ the 'Create changegroup' action (hg unbundle).</p>""" 607 """ the 'Create changegroup' action (hg unbundle).</p>"""
595 )) 608 ))
596 self.connect(self.hgUnbundleAct, SIGNAL('triggered()'), self.__hgUnbundle) 609 self.connect(self.hgUnbundleAct, SIGNAL('triggered()'), self.__hgUnbundle)
597 self.actions.append(self.hgUnbundleAct) 610 self.actions.append(self.hgUnbundleAct)
611
612 self.hgBisectGoodAct = E5Action(self.trUtf8('Mark as "good"'),
613 self.trUtf8('Mark as "good"...'),
614 0, 0, self, 'mercurial_bisect_good')
615 self.hgBisectGoodAct.setStatusTip(self.trUtf8(
616 'Mark a selectable changeset as good'
617 ))
618 self.hgBisectGoodAct.setWhatsThis(self.trUtf8(
619 """<b>Mark as good</b>"""
620 """<p>This marks a selectable changeset as good.</p>"""
621 ))
622 self.connect(self.hgBisectGoodAct, SIGNAL('triggered()'), self.__hgBisectGood)
623 self.actions.append(self.hgBisectGoodAct)
624
625 self.hgBisectBadAct = E5Action(self.trUtf8('Mark as "bad"'),
626 self.trUtf8('Mark as "bad"...'),
627 0, 0, self, 'mercurial_bisect_bad')
628 self.hgBisectBadAct.setStatusTip(self.trUtf8(
629 'Mark a selectable changeset as bad'
630 ))
631 self.hgBisectBadAct.setWhatsThis(self.trUtf8(
632 """<b>Mark as bad</b>"""
633 """<p>This marks a selectable changeset as bad.</p>"""
634 ))
635 self.connect(self.hgBisectBadAct, SIGNAL('triggered()'), self.__hgBisectBad)
636 self.actions.append(self.hgBisectBadAct)
637
638 self.hgBisectSkipAct = E5Action(self.trUtf8('Skip'),
639 self.trUtf8('Skip'),
640 0, 0, self, 'mercurial_bisect_skip')
641 self.hgBisectSkipAct.setStatusTip(self.trUtf8(
642 'Skip the current changeset'
643 ))
644 self.hgBisectSkipAct.setWhatsThis(self.trUtf8(
645 """<b>Skip</b>"""
646 """<p>This skips the current changeset.</p>"""
647 ))
648 self.connect(self.hgBisectSkipAct, SIGNAL('triggered()'), self.__hgBisectSkip)
649 self.actions.append(self.hgBisectSkipAct)
650
651 self.hgBisectResetAct = E5Action(self.trUtf8('Reset'),
652 self.trUtf8('Reset'),
653 0, 0, self, 'mercurial_bisect_reset')
654 self.hgBisectResetAct.setStatusTip(self.trUtf8(
655 'Reset the bisect search data'
656 ))
657 self.hgBisectResetAct.setWhatsThis(self.trUtf8(
658 """<b>Reset</b>"""
659 """<p>This resets the bisect search data.</p>"""
660 ))
661 self.connect(self.hgBisectResetAct, SIGNAL('triggered()'), self.__hgBisectReset)
662 self.actions.append(self.hgBisectResetAct)
598 663
599 def initMenu(self, menu): 664 def initMenu(self, menu):
600 """ 665 """
601 Public method to generate the VCS menu. 666 Public method to generate the VCS menu.
602 667
606 671
607 adminMenu = QMenu(self.trUtf8("Repository Administration"), menu) 672 adminMenu = QMenu(self.trUtf8("Repository Administration"), menu)
608 adminMenu.addAction(self.hgHeadsAct) 673 adminMenu.addAction(self.hgHeadsAct)
609 adminMenu.addAction(self.hgParentsAct) 674 adminMenu.addAction(self.hgParentsAct)
610 adminMenu.addAction(self.hgTipAct) 675 adminMenu.addAction(self.hgTipAct)
676 adminMenu.addAction(self.hgShowBranchAct)
611 adminMenu.addSeparator() 677 adminMenu.addSeparator()
612 adminMenu.addAction(self.hgShowPathsAct) 678 adminMenu.addAction(self.hgShowPathsAct)
613 adminMenu.addSeparator() 679 adminMenu.addSeparator()
614 adminMenu.addAction(self.hgShowConfigAct) 680 adminMenu.addAction(self.hgShowConfigAct)
615 adminMenu.addAction(self.hgRepoConfigAct) 681 adminMenu.addAction(self.hgRepoConfigAct)
622 688
623 bundleMenu = QMenu(self.trUtf8("Changegroup Management"), menu) 689 bundleMenu = QMenu(self.trUtf8("Changegroup Management"), menu)
624 bundleMenu.addAction(self.hgBundleAct) 690 bundleMenu.addAction(self.hgBundleAct)
625 bundleMenu.addAction(self.hgUnbundleAct) 691 bundleMenu.addAction(self.hgUnbundleAct)
626 692
693 bisectMenu = QMenu(self.trUtf8("Bisect"), menu)
694 bisectMenu.addAction(self.hgBisectGoodAct)
695 bisectMenu.addAction(self.hgBisectBadAct)
696 bisectMenu.addAction(self.hgBisectSkipAct)
697 bisectMenu.addAction(self.hgBisectResetAct)
698
627 act = menu.addAction( 699 act = menu.addAction(
628 UI.PixmapCache.getIcon( 700 UI.PixmapCache.getIcon(
629 os.path.join("VcsPlugins", "vcsMercurial", "icons", "mercurial.png")), 701 os.path.join("VcsPlugins", "vcsMercurial", "icons", "mercurial.png")),
630 self.vcs.vcsName(), self._vcsInfoDisplay) 702 self.vcs.vcsName(), self._vcsInfoDisplay)
631 font = act.font() 703 font = act.font()
668 menu.addAction(self.vcsMergeAct) 740 menu.addAction(self.vcsMergeAct)
669 menu.addAction(self.vcsResolveAct) 741 menu.addAction(self.vcsResolveAct)
670 menu.addSeparator() 742 menu.addSeparator()
671 menu.addAction(self.vcsSwitchAct) 743 menu.addAction(self.vcsSwitchAct)
672 menu.addSeparator() 744 menu.addSeparator()
745 menu.addMenu(bisectMenu)
746 menu.addSeparator()
673 menu.addAction(self.vcsCleanupAct) 747 menu.addAction(self.vcsCleanupAct)
674 menu.addSeparator() 748 menu.addSeparator()
675 menu.addAction(self.vcsCommandAct) 749 menu.addAction(self.vcsCommandAct)
676 menu.addSeparator() 750 menu.addSeparator()
677 menu.addMenu(adminMenu) 751 menu.addMenu(adminMenu)
761 def __hgBranch(self): 835 def __hgBranch(self):
762 """ 836 """
763 Private slot used to create a new branch for the project. 837 Private slot used to create a new branch for the project.
764 """ 838 """
765 self.vcs.hgBranch(self.project.ppath) 839 self.vcs.hgBranch(self.project.ppath)
840
841 def __hgShowBranch(self):
842 """
843 Private slot used to show the current branch for the project.
844 """
845 self.vcs.hgShowBranch(self.project.ppath)
766 846
767 def __hgConfigure(self): 847 def __hgConfigure(self):
768 """ 848 """
769 Private method to open the configuration dialog. 849 Private method to open the configuration dialog.
770 """ 850 """
825 def __hgUnbundle(self): 905 def __hgUnbundle(self):
826 """ 906 """
827 Protected slot used to apply changegroup files. 907 Protected slot used to apply changegroup files.
828 """ 908 """
829 self.vcs.hgUnbundle(self.project.ppath) 909 self.vcs.hgUnbundle(self.project.ppath)
910
911 def __hgBisectGood(self):
912 """
913 Protected slot used to execute the bisect --good command.
914 """
915 self.vcs.hgBisect(self.project.ppath, "good")
916
917 def __hgBisectBad(self):
918 """
919 Protected slot used to execute the bisect --bad command.
920 """
921 self.vcs.hgBisect(self.project.ppath, "bad")
922
923 def __hgBisectSkip(self):
924 """
925 Protected slot used to execute the bisect --skip command.
926 """
927 self.vcs.hgBisect(self.project.ppath, "skip")
928
929 def __hgBisectReset(self):
930 """
931 Protected slot used to execute the bisect --reset command.
932 """
933 self.vcs.hgBisect(self.project.ppath, "reset")

eric ide

mercurial