"Fossies" - the Fresh Open Source Software Archive

Member "eric6-20.9/eric/eric6/Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py" (2 Sep 2020, 82962 Bytes) of package /linux/misc/eric6-20.9.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "ProjectHelper.py" see the Fossies "Dox" file reference documentation.

    1 # -*- coding: utf-8 -*-
    2 
    3 # Copyright (c) 2010 - 2020 Detlev Offenbach <detlev@die-offenbachs.de>
    4 #
    5 
    6 """
    7 Module implementing the VCS project helper for Mercurial.
    8 """
    9 
   10 
   11 import os
   12 
   13 from PyQt5.QtWidgets import QMenu, QToolBar
   14 
   15 from E5Gui import E5MessageBox
   16 from E5Gui.E5Application import e5App
   17 
   18 from VCS.ProjectHelper import VcsProjectHelper
   19 
   20 from E5Gui.E5Action import E5Action
   21 
   22 import UI.PixmapCache
   23 import Preferences
   24 
   25 
   26 class HgProjectHelper(VcsProjectHelper):
   27     """
   28     Class implementing the VCS project helper for Mercurial.
   29     """
   30     def __init__(self, vcsObject, projectObject, parent=None, name=None):
   31         """
   32         Constructor
   33         
   34         @param vcsObject reference to the vcs object
   35         @param projectObject reference to the project object
   36         @param parent parent widget (QWidget)
   37         @param name name of this object (string)
   38         """
   39         VcsProjectHelper.__init__(self, vcsObject, projectObject, parent, name)
   40         
   41         # instantiate the extensions
   42         from .QueuesExtension.ProjectHelper import QueuesProjectHelper
   43         from .PurgeExtension.ProjectHelper import PurgeProjectHelper
   44         from .GpgExtension.ProjectHelper import GpgProjectHelper
   45         from .RebaseExtension.ProjectHelper import RebaseProjectHelper
   46         from .ShelveExtension.ProjectHelper import ShelveProjectHelper
   47         from .LargefilesExtension.ProjectHelper import LargefilesProjectHelper
   48         from .StripExtension.ProjectHelper import StripProjectHelper
   49         from .HisteditExtension.ProjectHelper import HisteditProjectHelper
   50         from .CloseheadExtension.ProjectHelper import CloseheadProjectHelper
   51         self.__extensions = {
   52             "mq": QueuesProjectHelper(),
   53             "purge": PurgeProjectHelper(),
   54             "gpg": GpgProjectHelper(),
   55             "rebase": RebaseProjectHelper(),
   56             "shelve": ShelveProjectHelper(),
   57             "largefiles": LargefilesProjectHelper(),
   58             "strip": StripProjectHelper(),
   59             "histedit": HisteditProjectHelper(),
   60             "closehead": CloseheadProjectHelper(),
   61         }
   62         
   63         self.__extensionMenuTitles = {}
   64         for extension in self.__extensions:
   65             self.__extensionMenuTitles[
   66                 self.__extensions[extension].menuTitle()] = extension
   67         
   68         self.__toolbarManager = None
   69     
   70     def setObjects(self, vcsObject, projectObject):
   71         """
   72         Public method to set references to the vcs and project objects.
   73         
   74         @param vcsObject reference to the vcs object
   75         @param projectObject reference to the project object
   76         """
   77         self.vcs = vcsObject
   78         self.project = projectObject
   79         
   80         for extension in self.__extensions.values():
   81             extension.setObjects(vcsObject, projectObject)
   82         
   83         self.vcs.iniFileChanged.connect(self.__checkActions)
   84         
   85         title = self.__toolbar.windowTitle()
   86         if self.vcs.version >= (3, 9):
   87             self.actions.append(self.hgBookmarkPullCurrentAct)
   88             self.__toolbarManager.addAction(self.hgBookmarkPullCurrentAct,
   89                                             title)
   90         
   91         if self.vcs.version >= (3, 8):
   92             self.actions.append(self.hgBookmarkPushCurrentAct)
   93             self.__toolbarManager.addAction(self.hgBookmarkPushCurrentAct,
   94                                             title)
   95         
   96         if self.vcs.version < (4, 7, 0):
   97             self.hgGraftStopAct.setEnabled(False)
   98             self.hgGraftAbortAct.setEnabled(False)
   99     
  100     def getProject(self):
  101         """
  102         Public method to get a reference to the project object.
  103         
  104         @return reference to the project object (Project)
  105         """
  106         return self.project
  107     
  108     def getActions(self):
  109         """
  110         Public method to get a list of all actions.
  111         
  112         @return list of all actions (list of E5Action)
  113         """
  114         actions = self.actions[:]
  115         for extension in self.__extensions.values():
  116             actions.extend(extension.getActions())
  117         return actions
  118     
  119     def initActions(self):
  120         """
  121         Public method to generate the action objects.
  122         """
  123         self.vcsNewAct = E5Action(
  124             self.tr('New from repository'),
  125             UI.PixmapCache.getIcon("vcsCheckout"),
  126             self.tr('&New from repository...'), 0, 0,
  127             self, 'mercurial_new')
  128         self.vcsNewAct.setStatusTip(self.tr(
  129             'Create (clone) a new project from a Mercurial repository'
  130         ))
  131         self.vcsNewAct.setWhatsThis(self.tr(
  132             """<b>New from repository</b>"""
  133             """<p>This creates (clones) a new local project from """
  134             """a Mercurial repository.</p>"""
  135         ))
  136         self.vcsNewAct.triggered.connect(self._vcsCheckout)
  137         self.actions.append(self.vcsNewAct)
  138         
  139         self.hgIncomingAct = E5Action(
  140             self.tr('Show incoming log'),
  141             UI.PixmapCache.getIcon("vcsUpdate"),
  142             self.tr('Show incoming log'),
  143             0, 0, self, 'mercurial_incoming')
  144         self.hgIncomingAct.setStatusTip(self.tr(
  145             'Show the log of incoming changes'
  146         ))
  147         self.hgIncomingAct.setWhatsThis(self.tr(
  148             """<b>Show incoming log</b>"""
  149             """<p>This shows the log of changes coming into the"""
  150             """ repository.</p>"""
  151         ))
  152         self.hgIncomingAct.triggered.connect(self.__hgIncoming)
  153         self.actions.append(self.hgIncomingAct)
  154         
  155         self.hgPullAct = E5Action(
  156             self.tr('Pull changes'),
  157             UI.PixmapCache.getIcon("vcsUpdate"),
  158             self.tr('Pull changes'),
  159             0, 0, self, 'mercurial_pull')
  160         self.hgPullAct.setStatusTip(self.tr(
  161             'Pull changes from a remote repository'
  162         ))
  163         self.hgPullAct.setWhatsThis(self.tr(
  164             """<b>Pull changes</b>"""
  165             """<p>This pulls changes from a remote repository into the """
  166             """local repository.</p>"""
  167         ))
  168         self.hgPullAct.triggered.connect(self.__hgPull)
  169         self.actions.append(self.hgPullAct)
  170         
  171         self.vcsUpdateAct = E5Action(
  172             self.tr('Update from repository'),
  173             UI.PixmapCache.getIcon("vcsUpdate"),
  174             self.tr('&Update from repository'), 0, 0, self,
  175             'mercurial_update')
  176         self.vcsUpdateAct.setStatusTip(self.tr(
  177             'Update the local project from the Mercurial repository'
  178         ))
  179         self.vcsUpdateAct.setWhatsThis(self.tr(
  180             """<b>Update from repository</b>"""
  181             """<p>This updates the local project from the Mercurial"""
  182             """ repository.</p>"""
  183         ))
  184         self.vcsUpdateAct.triggered.connect(self._vcsUpdate)
  185         self.actions.append(self.vcsUpdateAct)
  186         
  187         self.vcsCommitAct = E5Action(
  188             self.tr('Commit changes to repository'),
  189             UI.PixmapCache.getIcon("vcsCommit"),
  190             self.tr('&Commit changes to repository...'), 0, 0, self,
  191             'mercurial_commit')
  192         self.vcsCommitAct.setStatusTip(self.tr(
  193             'Commit changes to the local project to the Mercurial repository'
  194         ))
  195         self.vcsCommitAct.setWhatsThis(self.tr(
  196             """<b>Commit changes to repository</b>"""
  197             """<p>This commits changes to the local project to the """
  198             """Mercurial repository.</p>"""
  199         ))
  200         self.vcsCommitAct.triggered.connect(self._vcsCommit)
  201         self.actions.append(self.vcsCommitAct)
  202         
  203         self.hgOutgoingAct = E5Action(
  204             self.tr('Show outgoing log'),
  205             UI.PixmapCache.getIcon("vcsCommit"),
  206             self.tr('Show outgoing log'),
  207             0, 0, self, 'mercurial_outgoing')
  208         self.hgOutgoingAct.setStatusTip(self.tr(
  209             'Show the log of outgoing changes'
  210         ))
  211         self.hgOutgoingAct.setWhatsThis(self.tr(
  212             """<b>Show outgoing log</b>"""
  213             """<p>This shows the log of changes outgoing out of the"""
  214             """ repository.</p>"""
  215         ))
  216         self.hgOutgoingAct.triggered.connect(self.__hgOutgoing)
  217         self.actions.append(self.hgOutgoingAct)
  218         
  219         self.hgPushAct = E5Action(
  220             self.tr('Push changes'),
  221             UI.PixmapCache.getIcon("vcsCommit"),
  222             self.tr('Push changes'),
  223             0, 0, self, 'mercurial_push')
  224         self.hgPushAct.setStatusTip(self.tr(
  225             'Push changes to a remote repository'
  226         ))
  227         self.hgPushAct.setWhatsThis(self.tr(
  228             """<b>Push changes</b>"""
  229             """<p>This pushes changes from the local repository to a """
  230             """remote repository.</p>"""
  231         ))
  232         self.hgPushAct.triggered.connect(self.__hgPush)
  233         self.actions.append(self.hgPushAct)
  234         
  235         self.hgPushForcedAct = E5Action(
  236             self.tr('Push changes (force)'),
  237             UI.PixmapCache.getIcon("vcsCommit"),
  238             self.tr('Push changes (force)'),
  239             0, 0, self, 'mercurial_push_forced')
  240         self.hgPushForcedAct.setStatusTip(self.tr(
  241             'Push changes to a remote repository with force option'
  242         ))
  243         self.hgPushForcedAct.setWhatsThis(self.tr(
  244             """<b>Push changes (force)</b>"""
  245             """<p>This pushes changes from the local repository to a """
  246             """remote repository using the 'force' option.</p>"""
  247         ))
  248         self.hgPushForcedAct.triggered.connect(self.__hgPushForced)
  249         self.actions.append(self.hgPushForcedAct)
  250         
  251         self.vcsExportAct = E5Action(
  252             self.tr('Export from repository'),
  253             UI.PixmapCache.getIcon("vcsExport"),
  254             self.tr('&Export from repository...'),
  255             0, 0, self, 'mercurial_export_repo')
  256         self.vcsExportAct.setStatusTip(self.tr(
  257             'Export a project from the repository'
  258         ))
  259         self.vcsExportAct.setWhatsThis(self.tr(
  260             """<b>Export from repository</b>"""
  261             """<p>This exports a project from the repository.</p>"""
  262         ))
  263         self.vcsExportAct.triggered.connect(self._vcsExport)
  264         self.actions.append(self.vcsExportAct)
  265         
  266         self.hgLogBrowserAct = E5Action(
  267             self.tr('Show log browser'),
  268             UI.PixmapCache.getIcon("vcsLog"),
  269             self.tr('Show log browser'),
  270             0, 0, self, 'mercurial_log_browser')
  271         self.hgLogBrowserAct.setStatusTip(self.tr(
  272             'Show a dialog to browse the log of the local project'
  273         ))
  274         self.hgLogBrowserAct.setWhatsThis(self.tr(
  275             """<b>Show log browser</b>"""
  276             """<p>This shows a dialog to browse the log of the local"""
  277             """ project. A limited number of entries is shown first."""
  278             """ More can be retrieved later on.</p>"""
  279         ))
  280         self.hgLogBrowserAct.triggered.connect(self._vcsLogBrowser)
  281         self.actions.append(self.hgLogBrowserAct)
  282         
  283         self.vcsDiffAct = E5Action(
  284             self.tr('Show differences'),
  285             UI.PixmapCache.getIcon("vcsDiff"),
  286             self.tr('Show &difference'),
  287             0, 0, self, 'mercurial_diff')
  288         self.vcsDiffAct.setStatusTip(self.tr(
  289             'Show the difference of the local project to the repository'
  290         ))
  291         self.vcsDiffAct.setWhatsThis(self.tr(
  292             """<b>Show differences</b>"""
  293             """<p>This shows differences of the local project to the"""
  294             """ repository.</p>"""
  295         ))
  296         self.vcsDiffAct.triggered.connect(self._vcsDiff)
  297         self.actions.append(self.vcsDiffAct)
  298         
  299         self.hgExtDiffAct = E5Action(
  300             self.tr('Show differences (extended)'),
  301             UI.PixmapCache.getIcon("vcsDiff"),
  302             self.tr('Show differences (extended)'),
  303             0, 0, self, 'mercurial_extendeddiff')
  304         self.hgExtDiffAct.setStatusTip(self.tr(
  305             'Show the difference of revisions of the project to the repository'
  306         ))
  307         self.hgExtDiffAct.setWhatsThis(self.tr(
  308             """<b>Show differences (extended)</b>"""
  309             """<p>This shows differences of selectable revisions of the"""
  310             """ project.</p>"""
  311         ))
  312         self.hgExtDiffAct.triggered.connect(self.__hgExtendedDiff)
  313         self.actions.append(self.hgExtDiffAct)
  314         
  315         self.vcsStatusAct = E5Action(
  316             self.tr('Show status'),
  317             UI.PixmapCache.getIcon("vcsStatus"),
  318             self.tr('Show &status...'),
  319             0, 0, self, 'mercurial_status')
  320         self.vcsStatusAct.setStatusTip(self.tr(
  321             'Show the status of the local project'
  322         ))
  323         self.vcsStatusAct.setWhatsThis(self.tr(
  324             """<b>Show status</b>"""
  325             """<p>This shows the status of the local project.</p>"""
  326         ))
  327         self.vcsStatusAct.triggered.connect(self._vcsStatus)
  328         self.actions.append(self.vcsStatusAct)
  329         
  330         self.hgSummaryAct = E5Action(
  331             self.tr('Show Summary'),
  332             UI.PixmapCache.getIcon("vcsSummary"),
  333             self.tr('Show summary...'),
  334             0, 0, self, 'mercurial_summary')
  335         self.hgSummaryAct.setStatusTip(self.tr(
  336             'Show summary information of the working directory status'
  337         ))
  338         self.hgSummaryAct.setWhatsThis(self.tr(
  339             """<b>Show summary</b>"""
  340             """<p>This shows some summary information of the working"""
  341             """ directory status.</p>"""
  342         ))
  343         self.hgSummaryAct.triggered.connect(self.__hgSummary)
  344         self.actions.append(self.hgSummaryAct)
  345         
  346         self.hgHeadsAct = E5Action(
  347             self.tr('Show heads'),
  348             self.tr('Show heads'),
  349             0, 0, self, 'mercurial_heads')
  350         self.hgHeadsAct.setStatusTip(self.tr(
  351             'Show the heads of the repository'
  352         ))
  353         self.hgHeadsAct.setWhatsThis(self.tr(
  354             """<b>Show heads</b>"""
  355             """<p>This shows the heads of the repository.</p>"""
  356         ))
  357         self.hgHeadsAct.triggered.connect(self.__hgHeads)
  358         self.actions.append(self.hgHeadsAct)
  359         
  360         self.hgParentsAct = E5Action(
  361             self.tr('Show parents'),
  362             self.tr('Show parents'),
  363             0, 0, self, 'mercurial_parents')
  364         self.hgParentsAct.setStatusTip(self.tr(
  365             'Show the parents of the repository'
  366         ))
  367         self.hgParentsAct.setWhatsThis(self.tr(
  368             """<b>Show parents</b>"""
  369             """<p>This shows the parents of the repository.</p>"""
  370         ))
  371         self.hgParentsAct.triggered.connect(self.__hgParents)
  372         self.actions.append(self.hgParentsAct)
  373         
  374         self.hgTipAct = E5Action(
  375             self.tr('Show tip'),
  376             self.tr('Show tip'),
  377             0, 0, self, 'mercurial_tip')
  378         self.hgTipAct.setStatusTip(self.tr(
  379             'Show the tip of the repository'
  380         ))
  381         self.hgTipAct.setWhatsThis(self.tr(
  382             """<b>Show tip</b>"""
  383             """<p>This shows the tip of the repository.</p>"""
  384         ))
  385         self.hgTipAct.triggered.connect(self.__hgTip)
  386         self.actions.append(self.hgTipAct)
  387         
  388         self.vcsRevertAct = E5Action(
  389             self.tr('Revert changes'),
  390             UI.PixmapCache.getIcon("vcsRevert"),
  391             self.tr('Re&vert changes'),
  392             0, 0, self, 'mercurial_revert')
  393         self.vcsRevertAct.setStatusTip(self.tr(
  394             'Revert all changes made to the local project'
  395         ))
  396         self.vcsRevertAct.setWhatsThis(self.tr(
  397             """<b>Revert changes</b>"""
  398             """<p>This reverts all changes made to the local project.</p>"""
  399         ))
  400         self.vcsRevertAct.triggered.connect(self.__hgRevert)
  401         self.actions.append(self.vcsRevertAct)
  402         
  403         self.vcsMergeAct = E5Action(
  404             self.tr('Merge'),
  405             UI.PixmapCache.getIcon("vcsMerge"),
  406             self.tr('Mer&ge changes...'),
  407             0, 0, self, 'mercurial_merge')
  408         self.vcsMergeAct.setStatusTip(self.tr(
  409             'Merge changes of a revision into the local project'
  410         ))
  411         self.vcsMergeAct.setWhatsThis(self.tr(
  412             """<b>Merge</b>"""
  413             """<p>This merges changes of a revision into the local"""
  414             """ project.</p>"""
  415         ))
  416         self.vcsMergeAct.triggered.connect(self._vcsMerge)
  417         self.actions.append(self.vcsMergeAct)
  418         
  419         self.hgCommitMergeAct = E5Action(
  420             self.tr('Commit Merge'),
  421             self.tr('Commit Merge'),
  422             0, 0, self, 'mercurial_commit_merge')
  423         self.hgCommitMergeAct.setStatusTip(self.tr(
  424             'Commit all the merged changes.'
  425         ))
  426         self.hgCommitMergeAct.setWhatsThis(self.tr(
  427             """<b>Commit a merge</b>"""
  428             """<p>This commits a merge working directory</p>"""
  429         ))
  430         self.hgCommitMergeAct.triggered.connect(self.__hgCommitMerge)
  431         self.actions.append(self.hgCommitMergeAct)
  432         
  433         self.hgAbortMergeAct = E5Action(
  434             self.tr('Abort Merge'),
  435             self.tr('Abort Merge'),
  436             0, 0, self, 'mercurial_cancel_merge')
  437         self.hgAbortMergeAct.setStatusTip(self.tr(
  438             'Abort an uncommitted merge and lose all changes'
  439         ))
  440         self.hgAbortMergeAct.setWhatsThis(self.tr(
  441             """<b>Abort uncommitted merge</b>"""
  442             """<p>This aborts an uncommitted merge causing all changes"""
  443             """ to be lost.</p>"""
  444         ))
  445         self.hgAbortMergeAct.triggered.connect(self.__hgAbortMerge)
  446         self.actions.append(self.hgAbortMergeAct)
  447         
  448         self.hgReMergeAct = E5Action(
  449             self.tr('Re-Merge'),
  450             UI.PixmapCache.getIcon("vcsMerge"),
  451             self.tr('Re-Merge'),
  452             0, 0, self, 'mercurial_remerge')
  453         self.hgReMergeAct.setStatusTip(self.tr(
  454             'Re-Merge all conflicting, unresolved files of the project'
  455         ))
  456         self.hgReMergeAct.setWhatsThis(self.tr(
  457             """<b>Re-Merge</b>"""
  458             """<p>This re-merges all conflicting, unresolved files of the"""
  459             """ project discarding any previous merge attempt.</p>"""
  460         ))
  461         self.hgReMergeAct.triggered.connect(self.__hgReMerge)
  462         self.actions.append(self.hgReMergeAct)
  463         
  464         self.hgShowConflictsAct = E5Action(
  465             self.tr('Show conflicts'),
  466             self.tr('Show conflicts...'),
  467             0, 0, self, 'mercurial_show_conflicts')
  468         self.hgShowConflictsAct.setStatusTip(self.tr(
  469             'Show a dialog listing all files with conflicts'
  470         ))
  471         self.hgShowConflictsAct.setWhatsThis(self.tr(
  472             """<b>Show conflicts</b>"""
  473             """<p>This shows a dialog listing all files which had or still"""
  474             """ have conflicts.</p>"""
  475         ))
  476         self.hgShowConflictsAct.triggered.connect(self.__hgShowConflicts)
  477         self.actions.append(self.hgShowConflictsAct)
  478         
  479         self.vcsResolveAct = E5Action(
  480             self.tr('Conflicts resolved'),
  481             self.tr('Con&flicts resolved'),
  482             0, 0, self, 'mercurial_resolve')
  483         self.vcsResolveAct.setStatusTip(self.tr(
  484             'Mark all conflicts of the local project as resolved'
  485         ))
  486         self.vcsResolveAct.setWhatsThis(self.tr(
  487             """<b>Conflicts resolved</b>"""
  488             """<p>This marks all conflicts of the local project as"""
  489             """ resolved.</p>"""
  490         ))
  491         self.vcsResolveAct.triggered.connect(self.__hgResolved)
  492         self.actions.append(self.vcsResolveAct)
  493         
  494         self.hgUnresolveAct = E5Action(
  495             self.tr('Conflicts unresolved'),
  496             self.tr('Conflicts unresolved'),
  497             0, 0, self, 'mercurial_unresolve')
  498         self.hgUnresolveAct.setStatusTip(self.tr(
  499             'Mark all conflicts of the local project as unresolved'
  500         ))
  501         self.hgUnresolveAct.setWhatsThis(self.tr(
  502             """<b>Conflicts unresolved</b>"""
  503             """<p>This marks all conflicts of the local project as"""
  504             """ unresolved.</p>"""
  505         ))
  506         self.hgUnresolveAct.triggered.connect(self.__hgUnresolved)
  507         self.actions.append(self.hgUnresolveAct)
  508         
  509         self.vcsTagAct = E5Action(
  510             self.tr('Tag in repository'),
  511             UI.PixmapCache.getIcon("vcsTag"),
  512             self.tr('&Tag in repository...'),
  513             0, 0, self, 'mercurial_tag')
  514         self.vcsTagAct.setStatusTip(self.tr(
  515             'Tag the local project in the repository'
  516         ))
  517         self.vcsTagAct.setWhatsThis(self.tr(
  518             """<b>Tag in repository</b>"""
  519             """<p>This tags the local project in the repository.</p>"""
  520         ))
  521         self.vcsTagAct.triggered.connect(self._vcsTag)
  522         self.actions.append(self.vcsTagAct)
  523         
  524         self.hgTagListAct = E5Action(
  525             self.tr('List tags'),
  526             self.tr('List tags...'),
  527             0, 0, self, 'mercurial_list_tags')
  528         self.hgTagListAct.setStatusTip(self.tr(
  529             'List tags of the project'
  530         ))
  531         self.hgTagListAct.setWhatsThis(self.tr(
  532             """<b>List tags</b>"""
  533             """<p>This lists the tags of the project.</p>"""
  534         ))
  535         self.hgTagListAct.triggered.connect(self.__hgTagList)
  536         self.actions.append(self.hgTagListAct)
  537         
  538         self.hgBranchListAct = E5Action(
  539             self.tr('List branches'),
  540             self.tr('List branches...'),
  541             0, 0, self, 'mercurial_list_branches')
  542         self.hgBranchListAct.setStatusTip(self.tr(
  543             'List branches of the project'
  544         ))
  545         self.hgBranchListAct.setWhatsThis(self.tr(
  546             """<b>List branches</b>"""
  547             """<p>This lists the branches of the project.</p>"""
  548         ))
  549         self.hgBranchListAct.triggered.connect(self.__hgBranchList)
  550         self.actions.append(self.hgBranchListAct)
  551         
  552         self.hgBranchAct = E5Action(
  553             self.tr('Create branch'),
  554             UI.PixmapCache.getIcon("vcsBranch"),
  555             self.tr('Create &branch...'),
  556             0, 0, self, 'mercurial_branch')
  557         self.hgBranchAct.setStatusTip(self.tr(
  558             'Create a new branch for the local project in the repository'
  559         ))
  560         self.hgBranchAct.setWhatsThis(self.tr(
  561             """<b>Create branch</b>"""
  562             """<p>This creates a new branch for the local project """
  563             """in the repository.</p>"""
  564         ))
  565         self.hgBranchAct.triggered.connect(self.__hgBranch)
  566         self.actions.append(self.hgBranchAct)
  567         
  568         self.hgPushBranchAct = E5Action(
  569             self.tr('Push new branch'),
  570             UI.PixmapCache.getIcon("vcsCommit"),
  571             self.tr('Push new branch'),
  572             0, 0, self, 'mercurial_push_branch')
  573         self.hgPushBranchAct.setStatusTip(self.tr(
  574             'Push the current branch of the local project as a new named'
  575             ' branch'
  576         ))
  577         self.hgPushBranchAct.setWhatsThis(self.tr(
  578             """<b>Push new branch</b>"""
  579             """<p>This pushes the current branch of the local project"""
  580             """ as a new named branch.</p>"""
  581         ))
  582         self.hgPushBranchAct.triggered.connect(self.__hgPushNewBranch)
  583         self.actions.append(self.hgPushBranchAct)
  584         
  585         self.hgCloseBranchAct = E5Action(
  586             self.tr('Close branch'),
  587             UI.PixmapCache.getIcon("closehead"),
  588             self.tr('Close branch'),
  589             0, 0, self, 'mercurial_close_branch')
  590         self.hgCloseBranchAct.setStatusTip(self.tr(
  591             'Close the current branch of the local project'
  592         ))
  593         self.hgCloseBranchAct.setWhatsThis(self.tr(
  594             """<b>Close branch</b>"""
  595             """<p>This closes the current branch of the local project.</p>"""
  596         ))
  597         self.hgCloseBranchAct.triggered.connect(self.__hgCloseBranch)
  598         self.actions.append(self.hgCloseBranchAct)
  599         
  600         self.hgShowBranchAct = E5Action(
  601             self.tr('Show current branch'),
  602             self.tr('Show current branch'),
  603             0, 0, self, 'mercurial_show_branch')
  604         self.hgShowBranchAct.setStatusTip(self.tr(
  605             'Show the current branch of the project'
  606         ))
  607         self.hgShowBranchAct.setWhatsThis(self.tr(
  608             """<b>Show current branch</b>"""
  609             """<p>This shows the current branch of the project.</p>"""
  610         ))
  611         self.hgShowBranchAct.triggered.connect(self.__hgShowBranch)
  612         self.actions.append(self.hgShowBranchAct)
  613         
  614         self.vcsSwitchAct = E5Action(
  615             self.tr('Switch'),
  616             UI.PixmapCache.getIcon("vcsSwitch"),
  617             self.tr('S&witch...'),
  618             0, 0, self, 'mercurial_switch')
  619         self.vcsSwitchAct.setStatusTip(self.tr(
  620             'Switch the working directory to another revision'
  621         ))
  622         self.vcsSwitchAct.setWhatsThis(self.tr(
  623             """<b>Switch</b>"""
  624             """<p>This switches the working directory to another"""
  625             """ revision.</p>"""
  626         ))
  627         self.vcsSwitchAct.triggered.connect(self._vcsSwitch)
  628         self.actions.append(self.vcsSwitchAct)
  629         
  630         self.vcsCleanupAct = E5Action(
  631             self.tr('Cleanup'),
  632             self.tr('Cleanu&p'),
  633             0, 0, self, 'mercurial_cleanup')
  634         self.vcsCleanupAct.setStatusTip(self.tr(
  635             'Cleanup the local project'
  636         ))
  637         self.vcsCleanupAct.setWhatsThis(self.tr(
  638             """<b>Cleanup</b>"""
  639             """<p>This performs a cleanup of the local project.</p>"""
  640         ))
  641         self.vcsCleanupAct.triggered.connect(self._vcsCleanup)
  642         self.actions.append(self.vcsCleanupAct)
  643         
  644         self.vcsCommandAct = E5Action(
  645             self.tr('Execute command'),
  646             self.tr('E&xecute command...'),
  647             0, 0, self, 'mercurial_command')
  648         self.vcsCommandAct.setStatusTip(self.tr(
  649             'Execute an arbitrary Mercurial command'
  650         ))
  651         self.vcsCommandAct.setWhatsThis(self.tr(
  652             """<b>Execute command</b>"""
  653             """<p>This opens a dialog to enter an arbitrary Mercurial"""
  654             """ command.</p>"""
  655         ))
  656         self.vcsCommandAct.triggered.connect(self._vcsCommand)
  657         self.actions.append(self.vcsCommandAct)
  658         
  659         self.hgConfigAct = E5Action(
  660             self.tr('Configure'),
  661             self.tr('Configure...'),
  662             0, 0, self, 'mercurial_configure')
  663         self.hgConfigAct.setStatusTip(self.tr(
  664             'Show the configuration dialog with the Mercurial page selected'
  665         ))
  666         self.hgConfigAct.setWhatsThis(self.tr(
  667             """<b>Configure</b>"""
  668             """<p>Show the configuration dialog with the Mercurial page"""
  669             """ selected.</p>"""
  670         ))
  671         self.hgConfigAct.triggered.connect(self.__hgConfigure)
  672         self.actions.append(self.hgConfigAct)
  673         
  674         self.hgEditUserConfigAct = E5Action(
  675             self.tr('Edit user configuration'),
  676             self.tr('Edit user configuration...'),
  677             0, 0, self, 'mercurial_user_configure')
  678         self.hgEditUserConfigAct.setStatusTip(self.tr(
  679             'Show an editor to edit the user configuration file'
  680         ))
  681         self.hgEditUserConfigAct.setWhatsThis(self.tr(
  682             """<b>Edit user configuration</b>"""
  683             """<p>Show an editor to edit the user configuration file.</p>"""
  684         ))
  685         self.hgEditUserConfigAct.triggered.connect(self.__hgEditUserConfig)
  686         self.actions.append(self.hgEditUserConfigAct)
  687         
  688         self.hgRepoConfigAct = E5Action(
  689             self.tr('Edit repository configuration'),
  690             self.tr('Edit repository configuration...'),
  691             0, 0, self, 'mercurial_repo_configure')
  692         self.hgRepoConfigAct.setStatusTip(self.tr(
  693             'Show an editor to edit the repository configuration file'
  694         ))
  695         self.hgRepoConfigAct.setWhatsThis(self.tr(
  696             """<b>Edit repository configuration</b>"""
  697             """<p>Show an editor to edit the repository configuration"""
  698             """ file.</p>"""
  699         ))
  700         self.hgRepoConfigAct.triggered.connect(self.__hgEditRepoConfig)
  701         self.actions.append(self.hgRepoConfigAct)
  702         
  703         self.hgShowConfigAct = E5Action(
  704             self.tr('Show combined configuration settings'),
  705             self.tr('Show combined configuration settings...'),
  706             0, 0, self, 'mercurial_show_config')
  707         self.hgShowConfigAct.setStatusTip(self.tr(
  708             'Show the combined configuration settings from all configuration'
  709             ' files'
  710         ))
  711         self.hgShowConfigAct.setWhatsThis(self.tr(
  712             """<b>Show combined configuration settings</b>"""
  713             """<p>This shows the combined configuration settings"""
  714             """ from all configuration files.</p>"""
  715         ))
  716         self.hgShowConfigAct.triggered.connect(self.__hgShowConfig)
  717         self.actions.append(self.hgShowConfigAct)
  718         
  719         self.hgShowPathsAct = E5Action(
  720             self.tr('Show paths'),
  721             self.tr('Show paths...'),
  722             0, 0, self, 'mercurial_show_paths')
  723         self.hgShowPathsAct.setStatusTip(self.tr(
  724             'Show the aliases for remote repositories'
  725         ))
  726         self.hgShowPathsAct.setWhatsThis(self.tr(
  727             """<b>Show paths</b>"""
  728             """<p>This shows the aliases for remote repositories.</p>"""
  729         ))
  730         self.hgShowPathsAct.triggered.connect(self.__hgShowPaths)
  731         self.actions.append(self.hgShowPathsAct)
  732         
  733         self.hgVerifyAct = E5Action(
  734             self.tr('Verify repository'),
  735             self.tr('Verify repository...'),
  736             0, 0, self, 'mercurial_verify')
  737         self.hgVerifyAct.setStatusTip(self.tr(
  738             'Verify the integrity of the repository'
  739         ))
  740         self.hgVerifyAct.setWhatsThis(self.tr(
  741             """<b>Verify repository</b>"""
  742             """<p>This verifies the integrity of the repository.</p>"""
  743         ))
  744         self.hgVerifyAct.triggered.connect(self.__hgVerify)
  745         self.actions.append(self.hgVerifyAct)
  746         
  747         self.hgRecoverAct = E5Action(
  748             self.tr('Recover'),
  749             self.tr('Recover...'),
  750             0, 0, self, 'mercurial_recover')
  751         self.hgRecoverAct.setStatusTip(self.tr(
  752             'Recover from an interrupted transaction'
  753         ))
  754         self.hgRecoverAct.setWhatsThis(self.tr(
  755             """<b>Recover</b>"""
  756             """<p>This recovers from an interrupted transaction.</p>"""
  757         ))
  758         self.hgRecoverAct.triggered.connect(self.__hgRecover)
  759         self.actions.append(self.hgRecoverAct)
  760         
  761         self.hgIdentifyAct = E5Action(
  762             self.tr('Identify'),
  763             self.tr('Identify...'),
  764             0, 0, self, 'mercurial_identify')
  765         self.hgIdentifyAct.setStatusTip(self.tr(
  766             'Identify the project directory'
  767         ))
  768         self.hgIdentifyAct.setWhatsThis(self.tr(
  769             """<b>Identify</b>"""
  770             """<p>This identifies the project directory.</p>"""
  771         ))
  772         self.hgIdentifyAct.triggered.connect(self.__hgIdentify)
  773         self.actions.append(self.hgIdentifyAct)
  774         
  775         self.hgCreateIgnoreAct = E5Action(
  776             self.tr('Create .hgignore'),
  777             self.tr('Create .hgignore'),
  778             0, 0, self, 'mercurial_create ignore')
  779         self.hgCreateIgnoreAct.setStatusTip(self.tr(
  780             'Create a .hgignore file with default values'
  781         ))
  782         self.hgCreateIgnoreAct.setWhatsThis(self.tr(
  783             """<b>Create .hgignore</b>"""
  784             """<p>This creates a .hgignore file with default values.</p>"""
  785         ))
  786         self.hgCreateIgnoreAct.triggered.connect(self.__hgCreateIgnore)
  787         self.actions.append(self.hgCreateIgnoreAct)
  788         
  789         self.hgBundleAct = E5Action(
  790             self.tr('Create changegroup'),
  791             UI.PixmapCache.getIcon("vcsCreateChangegroup"),
  792             self.tr('Create changegroup...'),
  793             0, 0, self, 'mercurial_bundle')
  794         self.hgBundleAct.setStatusTip(self.tr(
  795             'Create changegroup file collecting changesets'
  796         ))
  797         self.hgBundleAct.setWhatsThis(self.tr(
  798             """<b>Create changegroup</b>"""
  799             """<p>This creates a changegroup file collecting selected"""
  800             """ changesets (hg bundle).</p>"""
  801         ))
  802         self.hgBundleAct.triggered.connect(self.__hgBundle)
  803         self.actions.append(self.hgBundleAct)
  804         
  805         self.hgPreviewBundleAct = E5Action(
  806             self.tr('Preview changegroup'),
  807             UI.PixmapCache.getIcon("vcsPreviewChangegroup"),
  808             self.tr('Preview changegroup...'),
  809             0, 0, self, 'mercurial_preview_bundle')
  810         self.hgPreviewBundleAct.setStatusTip(self.tr(
  811             'Preview a changegroup file containing a collection of changesets'
  812         ))
  813         self.hgPreviewBundleAct.setWhatsThis(self.tr(
  814             """<b>Preview changegroup</b>"""
  815             """<p>This previews a changegroup file containing a collection"""
  816             """ of changesets.</p>"""
  817         ))
  818         self.hgPreviewBundleAct.triggered.connect(self.__hgPreviewBundle)
  819         self.actions.append(self.hgPreviewBundleAct)
  820         
  821         self.hgUnbundleAct = E5Action(
  822             self.tr('Apply changegroups'),
  823             UI.PixmapCache.getIcon("vcsApplyChangegroup"),
  824             self.tr('Apply changegroups...'),
  825             0, 0, self, 'mercurial_unbundle')
  826         self.hgUnbundleAct.setStatusTip(self.tr(
  827             'Apply one or several changegroup files'
  828         ))
  829         self.hgUnbundleAct.setWhatsThis(self.tr(
  830             """<b>Apply changegroups</b>"""
  831             """<p>This applies one or several changegroup files generated by"""
  832             """ the 'Create changegroup' action (hg unbundle).</p>"""
  833         ))
  834         self.hgUnbundleAct.triggered.connect(self.__hgUnbundle)
  835         self.actions.append(self.hgUnbundleAct)
  836         
  837         self.hgBisectGoodAct = E5Action(
  838             self.tr('Mark as "good"'),
  839             self.tr('Mark as "good"...'),
  840             0, 0, self, 'mercurial_bisect_good')
  841         self.hgBisectGoodAct.setStatusTip(self.tr(
  842             'Mark a selectable changeset as good'
  843         ))
  844         self.hgBisectGoodAct.setWhatsThis(self.tr(
  845             """<b>Mark as good</b>"""
  846             """<p>This marks a selectable changeset as good.</p>"""
  847         ))
  848         self.hgBisectGoodAct.triggered.connect(self.__hgBisectGood)
  849         self.actions.append(self.hgBisectGoodAct)
  850         
  851         self.hgBisectBadAct = E5Action(
  852             self.tr('Mark as "bad"'),
  853             self.tr('Mark as "bad"...'),
  854             0, 0, self, 'mercurial_bisect_bad')
  855         self.hgBisectBadAct.setStatusTip(self.tr(
  856             'Mark a selectable changeset as bad'
  857         ))
  858         self.hgBisectBadAct.setWhatsThis(self.tr(
  859             """<b>Mark as bad</b>"""
  860             """<p>This marks a selectable changeset as bad.</p>"""
  861         ))
  862         self.hgBisectBadAct.triggered.connect(self.__hgBisectBad)
  863         self.actions.append(self.hgBisectBadAct)
  864         
  865         self.hgBisectSkipAct = E5Action(
  866             self.tr('Skip'),
  867             self.tr('Skip...'),
  868             0, 0, self, 'mercurial_bisect_skip')
  869         self.hgBisectSkipAct.setStatusTip(self.tr(
  870             'Skip a selectable changeset'
  871         ))
  872         self.hgBisectSkipAct.setWhatsThis(self.tr(
  873             """<b>Skip</b>"""
  874             """<p>This skips a selectable changeset.</p>"""
  875         ))
  876         self.hgBisectSkipAct.triggered.connect(self.__hgBisectSkip)
  877         self.actions.append(self.hgBisectSkipAct)
  878         
  879         self.hgBisectResetAct = E5Action(
  880             self.tr('Reset'),
  881             self.tr('Reset'),
  882             0, 0, self, 'mercurial_bisect_reset')
  883         self.hgBisectResetAct.setStatusTip(self.tr(
  884             'Reset the bisect search data'
  885         ))
  886         self.hgBisectResetAct.setWhatsThis(self.tr(
  887             """<b>Reset</b>"""
  888             """<p>This resets the bisect search data.</p>"""
  889         ))
  890         self.hgBisectResetAct.triggered.connect(self.__hgBisectReset)
  891         self.actions.append(self.hgBisectResetAct)
  892         
  893         self.hgBackoutAct = E5Action(
  894             self.tr('Back out changeset'),
  895             self.tr('Back out changeset'),
  896             0, 0, self, 'mercurial_backout')
  897         self.hgBackoutAct.setStatusTip(self.tr(
  898             'Back out changes of an earlier changeset'
  899         ))
  900         self.hgBackoutAct.setWhatsThis(self.tr(
  901             """<b>Back out changeset</b>"""
  902             """<p>This backs out changes of an earlier changeset.</p>"""
  903         ))
  904         self.hgBackoutAct.triggered.connect(self.__hgBackout)
  905         self.actions.append(self.hgBackoutAct)
  906         
  907         self.hgRollbackAct = E5Action(
  908             self.tr('Rollback last transaction'),
  909             self.tr('Rollback last transaction'),
  910             0, 0, self, 'mercurial_rollback')
  911         self.hgRollbackAct.setStatusTip(self.tr(
  912             'Rollback the last transaction'
  913         ))
  914         self.hgRollbackAct.setWhatsThis(self.tr(
  915             """<b>Rollback last transaction</b>"""
  916             """<p>This performs a rollback of the last transaction."""
  917             """ Transactions are used to encapsulate the effects of all"""
  918             """ commands that create new changesets or propagate existing"""
  919             """ changesets into a repository. For example, the following"""
  920             """ commands are transactional, and their effects can be"""
  921             """ rolled back:<ul>"""
  922             """<li>commit</li>"""
  923             """<li>import</li>"""
  924             """<li>pull</li>"""
  925             """<li>push (with this repository as the destination)</li>"""
  926             """<li>unbundle</li>"""
  927             """</ul>"""
  928             """</p><p><strong>This command is dangerous. Please use with"""
  929             """ care. </strong></p>"""
  930         ))
  931         self.hgRollbackAct.triggered.connect(self.__hgRollback)
  932         self.actions.append(self.hgRollbackAct)
  933         
  934         self.hgServeAct = E5Action(
  935             self.tr('Serve project repository'),
  936             self.tr('Serve project repository...'),
  937             0, 0, self, 'mercurial_serve')
  938         self.hgServeAct.setStatusTip(self.tr(
  939             'Serve the project repository'
  940         ))
  941         self.hgServeAct.setWhatsThis(self.tr(
  942             """<b>Serve project repository</b>"""
  943             """<p>This serves the project repository.</p>"""
  944         ))
  945         self.hgServeAct.triggered.connect(self.__hgServe)
  946         self.actions.append(self.hgServeAct)
  947         
  948         self.hgImportAct = E5Action(
  949             self.tr('Import Patch'),
  950             UI.PixmapCache.getIcon("vcsImportPatch"),
  951             self.tr('Import Patch...'),
  952             0, 0, self, 'mercurial_import')
  953         self.hgImportAct.setStatusTip(self.tr(
  954             'Import a patch from a patch file'
  955         ))
  956         self.hgImportAct.setWhatsThis(self.tr(
  957             """<b>Import Patch</b>"""
  958             """<p>This imports a patch from a patch file into the"""
  959             """ project.</p>"""
  960         ))
  961         self.hgImportAct.triggered.connect(self.__hgImport)
  962         self.actions.append(self.hgImportAct)
  963         
  964         self.hgExportAct = E5Action(
  965             self.tr('Export Patches'),
  966             UI.PixmapCache.getIcon("vcsExportPatch"),
  967             self.tr('Export Patches...'),
  968             0, 0, self, 'mercurial_export')
  969         self.hgExportAct.setStatusTip(self.tr(
  970             'Export revisions to patch files'
  971         ))
  972         self.hgExportAct.setWhatsThis(self.tr(
  973             """<b>Export Patches</b>"""
  974             """<p>This exports revisions of the project to patch files.</p>"""
  975         ))
  976         self.hgExportAct.triggered.connect(self.__hgExport)
  977         self.actions.append(self.hgExportAct)
  978         
  979         self.hgPhaseAct = E5Action(
  980             self.tr('Change Phase'),
  981             self.tr('Change Phase...'),
  982             0, 0, self, 'mercurial_change_phase')
  983         self.hgPhaseAct.setStatusTip(self.tr(
  984             'Change the phase of revisions'
  985         ))
  986         self.hgPhaseAct.setWhatsThis(self.tr(
  987             """<b>Change Phase</b>"""
  988             """<p>This changes the phase of revisions.</p>"""
  989         ))
  990         self.hgPhaseAct.triggered.connect(self.__hgPhase)
  991         self.actions.append(self.hgPhaseAct)
  992         
  993         self.hgGraftAct = E5Action(
  994             self.tr('Copy Changesets'),
  995             UI.PixmapCache.getIcon("vcsGraft"),
  996             self.tr('Copy Changesets'),
  997             0, 0, self, 'mercurial_graft')
  998         self.hgGraftAct.setStatusTip(self.tr(
  999             'Copies changesets from another branch'
 1000         ))
 1001         self.hgGraftAct.setWhatsThis(self.tr(
 1002             """<b>Copy Changesets</b>"""
 1003             """<p>This copies changesets from another branch on top of the"""
 1004             """ current working directory with the user, date and"""
 1005             """ description of the original changeset.</p>"""
 1006         ))
 1007         self.hgGraftAct.triggered.connect(self.__hgGraft)
 1008         self.actions.append(self.hgGraftAct)
 1009         
 1010         self.hgGraftContinueAct = E5Action(
 1011             self.tr('Continue Copying Session'),
 1012             self.tr('Continue Copying Session'),
 1013             0, 0, self, 'mercurial_graft_continue')
 1014         self.hgGraftContinueAct.setStatusTip(self.tr(
 1015             'Continue the last copying session after conflicts were resolved'
 1016         ))
 1017         self.hgGraftContinueAct.setWhatsThis(self.tr(
 1018             """<b>Continue Copying Session</b>"""
 1019             """<p>This continues the last copying session after conflicts"""
 1020             """ were resolved.</p>"""
 1021         ))
 1022         self.hgGraftContinueAct.triggered.connect(self.__hgGraftContinue)
 1023         self.actions.append(self.hgGraftContinueAct)
 1024         
 1025         self.hgGraftStopAct = E5Action(
 1026             self.tr('Stop Copying Session'),
 1027             self.tr('Stop Copying Session'),
 1028             0, 0, self, 'mercurial_graft_stop')
 1029         self.hgGraftStopAct.setStatusTip(self.tr(
 1030             'Stop the interrupted copying session'
 1031         ))
 1032         self.hgGraftStopAct.setWhatsThis(self.tr(
 1033             """<b>Stop Copying Session</b>"""
 1034             """<p>This stops the interrupted copying session.</p>"""
 1035         ))
 1036         self.hgGraftStopAct.triggered.connect(self.__hgGraftStop)
 1037         self.actions.append(self.hgGraftStopAct)
 1038         
 1039         self.hgGraftAbortAct = E5Action(
 1040             self.tr('Abort Copying Session'),
 1041             self.tr('Abort Copying Session'),
 1042             0, 0, self, 'mercurial_graft_abort')
 1043         self.hgGraftAbortAct.setStatusTip(self.tr(
 1044             'Abort the interrupted copying session and rollback'
 1045         ))
 1046         self.hgGraftAbortAct.setWhatsThis(self.tr(
 1047             """<b>Abort Copying Session</b>"""
 1048             """<p>This aborts the interrupted copying session and"""
 1049             """ rollbacks to the state before the copy.</p>"""
 1050         ))
 1051         self.hgGraftAbortAct.triggered.connect(self.__hgGraftAbort)
 1052         self.actions.append(self.hgGraftAbortAct)
 1053         
 1054         self.hgAddSubrepoAct = E5Action(
 1055             self.tr('Add'),
 1056             UI.PixmapCache.getIcon("vcsAdd"),
 1057             self.tr('Add...'),
 1058             0, 0, self, 'mercurial_add_subrepo')
 1059         self.hgAddSubrepoAct.setStatusTip(self.tr(
 1060             'Add a sub-repository'
 1061         ))
 1062         self.hgAddSubrepoAct.setWhatsThis(self.tr(
 1063             """<b>Add...</b>"""
 1064             """<p>Add a sub-repository to the project.</p>"""
 1065         ))
 1066         self.hgAddSubrepoAct.triggered.connect(self.__hgAddSubrepository)
 1067         self.actions.append(self.hgAddSubrepoAct)
 1068         
 1069         self.hgRemoveSubreposAct = E5Action(
 1070             self.tr('Remove'),
 1071             UI.PixmapCache.getIcon("vcsRemove"),
 1072             self.tr('Remove...'),
 1073             0, 0, self, 'mercurial_remove_subrepos')
 1074         self.hgRemoveSubreposAct.setStatusTip(self.tr(
 1075             'Remove sub-repositories'
 1076         ))
 1077         self.hgRemoveSubreposAct.setWhatsThis(self.tr(
 1078             """<b>Remove...</b>"""
 1079             """<p>Remove sub-repositories from the project.</p>"""
 1080         ))
 1081         self.hgRemoveSubreposAct.triggered.connect(
 1082             self.__hgRemoveSubrepositories)
 1083         self.actions.append(self.hgRemoveSubreposAct)
 1084         
 1085         self.hgArchiveAct = E5Action(
 1086             self.tr('Create unversioned archive'),
 1087             UI.PixmapCache.getIcon("vcsExport"),
 1088             self.tr('Create unversioned archive...'),
 1089             0, 0, self, 'mercurial_archive')
 1090         self.hgArchiveAct.setStatusTip(self.tr(
 1091             'Create an unversioned archive from the repository'
 1092         ))
 1093         self.hgArchiveAct.setWhatsThis(self.tr(
 1094             """<b>Create unversioned archive...</b>"""
 1095             """<p>This creates an unversioned archive from the"""
 1096             """ repository.</p>"""
 1097         ))
 1098         self.hgArchiveAct.triggered.connect(self.__hgArchive)
 1099         self.actions.append(self.hgArchiveAct)
 1100         
 1101         self.hgBookmarksListAct = E5Action(
 1102             self.tr('List bookmarks'),
 1103             UI.PixmapCache.getIcon("listBookmarks"),
 1104             self.tr('List bookmarks...'),
 1105             0, 0, self, 'mercurial_list_bookmarks')
 1106         self.hgBookmarksListAct.setStatusTip(self.tr(
 1107             'List bookmarks of the project'
 1108         ))
 1109         self.hgBookmarksListAct.setWhatsThis(self.tr(
 1110             """<b>List bookmarks</b>"""
 1111             """<p>This lists the bookmarks of the project.</p>"""
 1112         ))
 1113         self.hgBookmarksListAct.triggered.connect(self.__hgBookmarksList)
 1114         self.actions.append(self.hgBookmarksListAct)
 1115     
 1116         self.hgBookmarkDefineAct = E5Action(
 1117             self.tr('Define bookmark'),
 1118             UI.PixmapCache.getIcon("addBookmark"),
 1119             self.tr('Define bookmark...'),
 1120             0, 0, self, 'mercurial_define_bookmark')
 1121         self.hgBookmarkDefineAct.setStatusTip(self.tr(
 1122             'Define a bookmark for the project'
 1123         ))
 1124         self.hgBookmarkDefineAct.setWhatsThis(self.tr(
 1125             """<b>Define bookmark</b>"""
 1126             """<p>This defines a bookmark for the project.</p>"""
 1127         ))
 1128         self.hgBookmarkDefineAct.triggered.connect(self.__hgBookmarkDefine)
 1129         self.actions.append(self.hgBookmarkDefineAct)
 1130     
 1131         self.hgBookmarkDeleteAct = E5Action(
 1132             self.tr('Delete bookmark'),
 1133             UI.PixmapCache.getIcon("deleteBookmark"),
 1134             self.tr('Delete bookmark...'),
 1135             0, 0, self, 'mercurial_delete_bookmark')
 1136         self.hgBookmarkDeleteAct.setStatusTip(self.tr(
 1137             'Delete a bookmark of the project'
 1138         ))
 1139         self.hgBookmarkDeleteAct.setWhatsThis(self.tr(
 1140             """<b>Delete bookmark</b>"""
 1141             """<p>This deletes a bookmark of the project.</p>"""
 1142         ))
 1143         self.hgBookmarkDeleteAct.triggered.connect(self.__hgBookmarkDelete)
 1144         self.actions.append(self.hgBookmarkDeleteAct)
 1145     
 1146         self.hgBookmarkRenameAct = E5Action(
 1147             self.tr('Rename bookmark'),
 1148             UI.PixmapCache.getIcon("renameBookmark"),
 1149             self.tr('Rename bookmark...'),
 1150             0, 0, self, 'mercurial_rename_bookmark')
 1151         self.hgBookmarkRenameAct.setStatusTip(self.tr(
 1152             'Rename a bookmark of the project'
 1153         ))
 1154         self.hgBookmarkRenameAct.setWhatsThis(self.tr(
 1155             """<b>Rename bookmark</b>"""
 1156             """<p>This renames a bookmark of the project.</p>"""
 1157         ))
 1158         self.hgBookmarkRenameAct.triggered.connect(self.__hgBookmarkRename)
 1159         self.actions.append(self.hgBookmarkRenameAct)
 1160     
 1161         self.hgBookmarkMoveAct = E5Action(
 1162             self.tr('Move bookmark'),
 1163             UI.PixmapCache.getIcon("moveBookmark"),
 1164             self.tr('Move bookmark...'),
 1165             0, 0, self, 'mercurial_move_bookmark')
 1166         self.hgBookmarkMoveAct.setStatusTip(self.tr(
 1167             'Move a bookmark of the project'
 1168         ))
 1169         self.hgBookmarkMoveAct.setWhatsThis(self.tr(
 1170             """<b>Move bookmark</b>"""
 1171             """<p>This moves a bookmark of the project to another"""
 1172             """ changeset.</p>"""
 1173         ))
 1174         self.hgBookmarkMoveAct.triggered.connect(self.__hgBookmarkMove)
 1175         self.actions.append(self.hgBookmarkMoveAct)
 1176         
 1177         self.hgBookmarkIncomingAct = E5Action(
 1178             self.tr('Show incoming bookmarks'),
 1179             UI.PixmapCache.getIcon("incomingBookmark"),
 1180             self.tr('Show incoming bookmarks'),
 1181             0, 0, self, 'mercurial_incoming_bookmarks')
 1182         self.hgBookmarkIncomingAct.setStatusTip(self.tr(
 1183             'Show a list of incoming bookmarks'
 1184         ))
 1185         self.hgBookmarkIncomingAct.setWhatsThis(self.tr(
 1186             """<b>Show incoming bookmarks</b>"""
 1187             """<p>This shows a list of new bookmarks available at the remote"""
 1188             """ repository.</p>"""
 1189         ))
 1190         self.hgBookmarkIncomingAct.triggered.connect(
 1191             self.__hgBookmarkIncoming)
 1192         self.actions.append(self.hgBookmarkIncomingAct)
 1193         
 1194         self.hgBookmarkPullAct = E5Action(
 1195             self.tr('Pull bookmark'),
 1196             UI.PixmapCache.getIcon("pullBookmark"),
 1197             self.tr('Pull bookmark'),
 1198             0, 0, self, 'mercurial_pull_bookmark')
 1199         self.hgBookmarkPullAct.setStatusTip(self.tr(
 1200             'Pull a bookmark from a remote repository'
 1201         ))
 1202         self.hgBookmarkPullAct.setWhatsThis(self.tr(
 1203             """<b>Pull bookmark</b>"""
 1204             """<p>This pulls a bookmark from a remote repository into the """
 1205             """local repository.</p>"""
 1206         ))
 1207         self.hgBookmarkPullAct.triggered.connect(self.__hgBookmarkPull)
 1208         self.actions.append(self.hgBookmarkPullAct)
 1209         
 1210         self.hgBookmarkPullCurrentAct = E5Action(
 1211             self.tr('Pull current bookmark'),
 1212             UI.PixmapCache.getIcon("pullBookmark"),
 1213             self.tr('Pull current bookmark'),
 1214             0, 0, self, 'mercurial_pull_current_bookmark')
 1215         self.hgBookmarkPullCurrentAct.setStatusTip(self.tr(
 1216             'Pull the current bookmark from a remote repository'
 1217         ))
 1218         self.hgBookmarkPullCurrentAct.setWhatsThis(self.tr(
 1219             """<b>Pull current bookmark</b>"""
 1220             """<p>This pulls the current bookmark from a remote"""
 1221             """ repository into the local repository.</p>"""
 1222         ))
 1223         self.hgBookmarkPullCurrentAct.triggered.connect(
 1224             self.__hgBookmarkPullCurrent)
 1225         
 1226         self.hgBookmarkOutgoingAct = E5Action(
 1227             self.tr('Show outgoing bookmarks'),
 1228             UI.PixmapCache.getIcon("outgoingBookmark"),
 1229             self.tr('Show outgoing bookmarks'),
 1230             0, 0, self, 'mercurial_outgoing_bookmarks')
 1231         self.hgBookmarkOutgoingAct.setStatusTip(self.tr(
 1232             'Show a list of outgoing bookmarks'
 1233         ))
 1234         self.hgBookmarkOutgoingAct.setWhatsThis(self.tr(
 1235             """<b>Show outgoing bookmarks</b>"""
 1236             """<p>This shows a list of new bookmarks available at the local"""
 1237             """ repository.</p>"""
 1238         ))
 1239         self.hgBookmarkOutgoingAct.triggered.connect(
 1240             self.__hgBookmarkOutgoing)
 1241         self.actions.append(self.hgBookmarkOutgoingAct)
 1242         
 1243         self.hgBookmarkPushAct = E5Action(
 1244             self.tr('Push bookmark'),
 1245             UI.PixmapCache.getIcon("pushBookmark"),
 1246             self.tr('Push bookmark'),
 1247             0, 0, self, 'mercurial_push_bookmark')
 1248         self.hgBookmarkPushAct.setStatusTip(self.tr(
 1249             'Push a bookmark to a remote repository'
 1250         ))
 1251         self.hgBookmarkPushAct.setWhatsThis(self.tr(
 1252             """<b>Push bookmark</b>"""
 1253             """<p>This pushes a bookmark from the local repository to a """
 1254             """remote repository.</p>"""
 1255         ))
 1256         self.hgBookmarkPushAct.triggered.connect(self.__hgBookmarkPush)
 1257         self.actions.append(self.hgBookmarkPushAct)
 1258     
 1259         self.hgBookmarkPushCurrentAct = E5Action(
 1260             self.tr('Push current bookmark'),
 1261             UI.PixmapCache.getIcon("pushBookmark"),
 1262             self.tr('Push current bookmark'),
 1263             0, 0, self, 'mercurial_push_current_bookmark')
 1264         self.hgBookmarkPushCurrentAct.setStatusTip(self.tr(
 1265             'Push the current bookmark to a remote repository'
 1266         ))
 1267         self.hgBookmarkPushCurrentAct.setWhatsThis(self.tr(
 1268             """<b>Push current bookmark</b>"""
 1269             """<p>This pushes the current bookmark from the local"""
 1270             """ repository to a remote repository.</p>"""
 1271         ))
 1272         self.hgBookmarkPushCurrentAct.triggered.connect(
 1273             self.__hgBookmarkPushCurrent)
 1274         self.actions.append(self.hgBookmarkPushCurrentAct)
 1275     
 1276         self.hgDeleteBackupsAct = E5Action(
 1277             self.tr('Delete all backups'),
 1278             UI.PixmapCache.getIcon("clearPrivateData"),
 1279             self.tr('Delete all backups'),
 1280             0, 0, self, 'mercurial_delete_all_backups')
 1281         self.hgDeleteBackupsAct.setStatusTip(self.tr(
 1282             'Delete all backup bundles stored in the backup area'
 1283         ))
 1284         self.hgDeleteBackupsAct.setWhatsThis(self.tr(
 1285             """<b>Delete all backups</b>"""
 1286             """<p>This deletes all backup bundles stored in the backup"""
 1287             """ area of the repository.</p>"""
 1288         ))
 1289         self.hgDeleteBackupsAct.triggered.connect(
 1290             self.__hgDeleteBackups)
 1291         self.actions.append(self.hgDeleteBackupsAct)
 1292     
 1293     def __checkActions(self):
 1294         """
 1295         Private slot to set the enabled status of actions.
 1296         """
 1297         self.hgPullAct.setEnabled(self.vcs.canPull())
 1298         self.hgIncomingAct.setEnabled(self.vcs.canPull())
 1299         self.hgBookmarkPullAct.setEnabled(self.vcs.canPull())
 1300         self.hgBookmarkIncomingAct.setEnabled(self.vcs.canPull())
 1301         if self.vcs.version >= (3, 9):
 1302             self.hgBookmarkPullCurrentAct.setEnabled(self.vcs.canPull())
 1303         
 1304         self.hgPushAct.setEnabled(self.vcs.canPush())
 1305         self.hgPushBranchAct.setEnabled(self.vcs.canPush())
 1306         self.hgPushForcedAct.setEnabled(self.vcs.canPush())
 1307         self.hgOutgoingAct.setEnabled(self.vcs.canPush())
 1308         self.hgBookmarkPushAct.setEnabled(self.vcs.canPush())
 1309         self.hgBookmarkOutgoingAct.setEnabled(self.vcs.canPush())
 1310         if self.vcs.version >= (3, 8):
 1311             self.hgBookmarkPushCurrentAct.setEnabled(self.vcs.canPull())
 1312         self.hgCommitMergeAct.setEnabled(
 1313             self.vcs.canCommitMerge(self.project.ppath))
 1314     
 1315     def initMenu(self, menu):
 1316         """
 1317         Public method to generate the VCS menu.
 1318         
 1319         @param menu reference to the menu to be populated (QMenu)
 1320         """
 1321         menu.clear()
 1322         
 1323         self.subMenus = []
 1324         
 1325         adminMenu = QMenu(self.tr("Administration"), menu)
 1326         adminMenu.setTearOffEnabled(True)
 1327         adminMenu.addAction(self.hgHeadsAct)
 1328         adminMenu.addAction(self.hgParentsAct)
 1329         adminMenu.addAction(self.hgTipAct)
 1330         adminMenu.addAction(self.hgShowBranchAct)
 1331         adminMenu.addAction(self.hgIdentifyAct)
 1332         adminMenu.addSeparator()
 1333         adminMenu.addAction(self.hgShowPathsAct)
 1334         adminMenu.addSeparator()
 1335         adminMenu.addAction(self.hgShowConfigAct)
 1336         adminMenu.addAction(self.hgRepoConfigAct)
 1337         adminMenu.addSeparator()
 1338         adminMenu.addAction(self.hgCreateIgnoreAct)
 1339         adminMenu.addSeparator()
 1340         adminMenu.addAction(self.hgRecoverAct)
 1341         adminMenu.addSeparator()
 1342         adminMenu.addAction(self.hgBackoutAct)
 1343         adminMenu.addAction(self.hgRollbackAct)
 1344         adminMenu.addSeparator()
 1345         adminMenu.addAction(self.hgVerifyAct)
 1346         adminMenu.addSeparator()
 1347         adminMenu.addAction(self.hgDeleteBackupsAct)
 1348         self.subMenus.append(adminMenu)
 1349         
 1350         specialsMenu = QMenu(self.tr("Specials"), menu)
 1351         specialsMenu.setTearOffEnabled(True)
 1352         specialsMenu.addAction(self.hgArchiveAct)
 1353         specialsMenu.addSeparator()
 1354         specialsMenu.addAction(self.hgPushForcedAct)
 1355         specialsMenu.addSeparator()
 1356         specialsMenu.addAction(self.hgServeAct)
 1357         self.subMenus.append(specialsMenu)
 1358         
 1359         bundleMenu = QMenu(self.tr("Changegroup Management"), menu)
 1360         bundleMenu.setTearOffEnabled(True)
 1361         bundleMenu.addAction(self.hgBundleAct)
 1362         bundleMenu.addAction(self.hgPreviewBundleAct)
 1363         bundleMenu.addAction(self.hgUnbundleAct)
 1364         self.subMenus.append(bundleMenu)
 1365         
 1366         patchMenu = QMenu(self.tr("Patch Management"), menu)
 1367         patchMenu.setTearOffEnabled(True)
 1368         patchMenu.addAction(self.hgImportAct)
 1369         patchMenu.addAction(self.hgExportAct)
 1370         self.subMenus.append(patchMenu)
 1371         
 1372         bisectMenu = QMenu(self.tr("Bisect"), menu)
 1373         bisectMenu.setTearOffEnabled(True)
 1374         bisectMenu.addAction(self.hgBisectGoodAct)
 1375         bisectMenu.addAction(self.hgBisectBadAct)
 1376         bisectMenu.addAction(self.hgBisectSkipAct)
 1377         bisectMenu.addAction(self.hgBisectResetAct)
 1378         self.subMenus.append(bisectMenu)
 1379         
 1380         tagsMenu = QMenu(self.tr("Tags"), menu)
 1381         tagsMenu.setIcon(UI.PixmapCache.getIcon("vcsTag"))
 1382         tagsMenu.setTearOffEnabled(True)
 1383         tagsMenu.addAction(self.vcsTagAct)
 1384         tagsMenu.addAction(self.hgTagListAct)
 1385         self.subMenus.append(tagsMenu)
 1386         
 1387         branchesMenu = QMenu(self.tr("Branches"), menu)
 1388         branchesMenu.setIcon(UI.PixmapCache.getIcon("vcsBranch"))
 1389         branchesMenu.setTearOffEnabled(True)
 1390         branchesMenu.addAction(self.hgBranchAct)
 1391         branchesMenu.addAction(self.hgPushBranchAct)
 1392         branchesMenu.addAction(self.hgCloseBranchAct)
 1393         branchesMenu.addAction(self.hgBranchListAct)
 1394         self.subMenus.append(branchesMenu)
 1395         
 1396         bookmarksMenu = QMenu(self.tr("Bookmarks"), menu)
 1397         bookmarksMenu.setIcon(UI.PixmapCache.getIcon("bookmark22"))
 1398         bookmarksMenu.setTearOffEnabled(True)
 1399         bookmarksMenu.addAction(self.hgBookmarkDefineAct)
 1400         bookmarksMenu.addAction(self.hgBookmarkDeleteAct)
 1401         bookmarksMenu.addAction(self.hgBookmarkRenameAct)
 1402         bookmarksMenu.addAction(self.hgBookmarkMoveAct)
 1403         bookmarksMenu.addSeparator()
 1404         bookmarksMenu.addAction(self.hgBookmarksListAct)
 1405         bookmarksMenu.addSeparator()
 1406         bookmarksMenu.addAction(self.hgBookmarkIncomingAct)
 1407         bookmarksMenu.addAction(self.hgBookmarkPullAct)
 1408         if self.vcs.version >= (3, 9):
 1409             bookmarksMenu.addAction(self.hgBookmarkPullCurrentAct)
 1410         bookmarksMenu.addSeparator()
 1411         bookmarksMenu.addAction(self.hgBookmarkOutgoingAct)
 1412         bookmarksMenu.addAction(self.hgBookmarkPushAct)
 1413         if self.vcs.version >= (3, 8):
 1414             bookmarksMenu.addAction(self.hgBookmarkPushCurrentAct)
 1415         self.subMenus.append(bookmarksMenu)
 1416         
 1417         self.__extensionsMenu = QMenu(self.tr("Extensions"), menu)
 1418         self.__extensionsMenu.setTearOffEnabled(True)
 1419         self.__extensionsMenu.aboutToShow.connect(self.__showExtensionMenu)
 1420         self.extensionMenus = {}
 1421         for extensionMenuTitle in sorted(self.__extensionMenuTitles):
 1422             extensionName = self.__extensionMenuTitles[extensionMenuTitle]
 1423             self.extensionMenus[extensionName] = self.__extensionsMenu.addMenu(
 1424                 self.__extensions[extensionName].initMenu(
 1425                     self.__extensionsMenu))
 1426         self.vcs.activeExtensionsChanged.connect(self.__showExtensionMenu)
 1427         
 1428         graftMenu = QMenu(self.tr("Copy Changesets"), menu)
 1429         graftMenu.setIcon(UI.PixmapCache.getIcon("vcsGraft"))
 1430         graftMenu.setTearOffEnabled(True)
 1431         graftMenu.addAction(self.hgGraftAct)
 1432         graftMenu.addAction(self.hgGraftContinueAct)
 1433         if self.vcs.version >= (4, 7, 0):
 1434             graftMenu.addAction(self.hgGraftStopAct)
 1435             graftMenu.addAction(self.hgGraftAbortAct)
 1436         
 1437         subrepoMenu = QMenu(self.tr("Sub-Repository"), menu)
 1438         subrepoMenu.setTearOffEnabled(True)
 1439         subrepoMenu.addAction(self.hgAddSubrepoAct)
 1440         subrepoMenu.addAction(self.hgRemoveSubreposAct)
 1441         
 1442         mergeMenu = QMenu(self.tr("Merge Changesets"), menu)
 1443         mergeMenu.setIcon(UI.PixmapCache.getIcon("vcsMerge"))
 1444         mergeMenu.setTearOffEnabled(True)
 1445         mergeMenu.addAction(self.vcsMergeAct)
 1446         mergeMenu.addAction(self.hgShowConflictsAct)
 1447         mergeMenu.addAction(self.vcsResolveAct)
 1448         mergeMenu.addAction(self.hgUnresolveAct)
 1449         mergeMenu.addAction(self.hgReMergeAct)
 1450         mergeMenu.addAction(self.hgCommitMergeAct)
 1451         mergeMenu.addAction(self.hgAbortMergeAct)
 1452         
 1453         act = menu.addAction(
 1454             UI.PixmapCache.getIcon(
 1455                 os.path.join("VcsPlugins", "vcsMercurial", "icons",
 1456                              "mercurial.svg")),
 1457             self.vcs.vcsName(), self._vcsInfoDisplay)
 1458         font = act.font()
 1459         font.setBold(True)
 1460         act.setFont(font)
 1461         menu.addSeparator()
 1462         
 1463         menu.addAction(self.hgIncomingAct)
 1464         menu.addAction(self.hgPullAct)
 1465         menu.addAction(self.vcsUpdateAct)
 1466         menu.addSeparator()
 1467         menu.addAction(self.vcsCommitAct)
 1468         menu.addAction(self.hgOutgoingAct)
 1469         menu.addAction(self.hgPushAct)
 1470         menu.addSeparator()
 1471         menu.addAction(self.vcsRevertAct)
 1472         menu.addMenu(mergeMenu)
 1473         menu.addMenu(graftMenu)
 1474         menu.addAction(self.hgPhaseAct)
 1475         menu.addSeparator()
 1476         menu.addMenu(bundleMenu)
 1477         menu.addMenu(patchMenu)
 1478         menu.addSeparator()
 1479         menu.addMenu(tagsMenu)
 1480         menu.addMenu(branchesMenu)
 1481         menu.addMenu(bookmarksMenu)
 1482         menu.addSeparator()
 1483         menu.addAction(self.hgLogBrowserAct)
 1484         menu.addSeparator()
 1485         menu.addAction(self.vcsStatusAct)
 1486         menu.addAction(self.hgSummaryAct)
 1487         menu.addSeparator()
 1488         menu.addAction(self.vcsDiffAct)
 1489         menu.addAction(self.hgExtDiffAct)
 1490         menu.addSeparator()
 1491         menu.addMenu(self.__extensionsMenu)
 1492         menu.addSeparator()
 1493         menu.addAction(self.vcsSwitchAct)
 1494         menu.addSeparator()
 1495         menu.addMenu(subrepoMenu)
 1496         menu.addSeparator()
 1497         menu.addMenu(bisectMenu)
 1498         menu.addSeparator()
 1499         menu.addAction(self.vcsCleanupAct)
 1500         menu.addSeparator()
 1501         menu.addAction(self.vcsCommandAct)
 1502         menu.addSeparator()
 1503         menu.addMenu(adminMenu)
 1504         menu.addMenu(specialsMenu)
 1505         menu.addSeparator()
 1506         menu.addAction(self.hgEditUserConfigAct)
 1507         menu.addAction(self.hgConfigAct)
 1508         menu.addSeparator()
 1509         menu.addAction(self.vcsNewAct)
 1510         menu.addAction(self.vcsExportAct)
 1511     
 1512     def initToolbar(self, ui, toolbarManager):
 1513         """
 1514         Public slot to initialize the VCS toolbar.
 1515         
 1516         @param ui reference to the main window (UserInterface)
 1517         @param toolbarManager reference to a toolbar manager object
 1518             (E5ToolBarManager)
 1519         """
 1520         self.__toolbarManager = toolbarManager
 1521         
 1522         self.__toolbar = QToolBar(self.tr("Mercurial"), ui)
 1523         self.__toolbar.setIconSize(UI.Config.ToolBarIconSize)
 1524         self.__toolbar.setObjectName("MercurialToolbar")
 1525         self.__toolbar.setToolTip(self.tr('Mercurial'))
 1526         
 1527         self.__toolbar.addAction(self.hgLogBrowserAct)
 1528         self.__toolbar.addAction(self.vcsStatusAct)
 1529         self.__toolbar.addSeparator()
 1530         self.__toolbar.addAction(self.vcsDiffAct)
 1531         self.__toolbar.addSeparator()
 1532         self.__toolbar.addAction(self.vcsNewAct)
 1533         self.__toolbar.addAction(self.vcsExportAct)
 1534         self.__toolbar.addSeparator()
 1535         
 1536         title = self.__toolbar.windowTitle()
 1537         toolbarManager.addToolBar(self.__toolbar, title)
 1538         toolbarManager.addAction(self.hgIncomingAct, title)
 1539         toolbarManager.addAction(self.hgPullAct, title)
 1540         toolbarManager.addAction(self.vcsUpdateAct, title)
 1541         toolbarManager.addAction(self.vcsCommitAct, title)
 1542         toolbarManager.addAction(self.hgOutgoingAct, title)
 1543         toolbarManager.addAction(self.hgPushAct, title)
 1544         toolbarManager.addAction(self.hgPushForcedAct, title)
 1545         toolbarManager.addAction(self.hgExtDiffAct, title)
 1546         toolbarManager.addAction(self.hgSummaryAct, title)
 1547         toolbarManager.addAction(self.vcsRevertAct, title)
 1548         toolbarManager.addAction(self.vcsMergeAct, title)
 1549         toolbarManager.addAction(self.hgReMergeAct, title)
 1550         toolbarManager.addAction(self.hgCommitMergeAct, title)
 1551         toolbarManager.addAction(self.vcsTagAct, title)
 1552         toolbarManager.addAction(self.hgBranchAct, title)
 1553         toolbarManager.addAction(self.vcsSwitchAct, title)
 1554         toolbarManager.addAction(self.hgGraftAct, title)
 1555         toolbarManager.addAction(self.hgAddSubrepoAct, title)
 1556         toolbarManager.addAction(self.hgRemoveSubreposAct, title)
 1557         toolbarManager.addAction(self.hgArchiveAct, title)
 1558         toolbarManager.addAction(self.hgBookmarksListAct, title)
 1559         toolbarManager.addAction(self.hgBookmarkDefineAct, title)
 1560         toolbarManager.addAction(self.hgBookmarkDeleteAct, title)
 1561         toolbarManager.addAction(self.hgBookmarkRenameAct, title)
 1562         toolbarManager.addAction(self.hgBookmarkMoveAct, title)
 1563         toolbarManager.addAction(self.hgBookmarkIncomingAct, title)
 1564         toolbarManager.addAction(self.hgBookmarkPullAct, title)
 1565         toolbarManager.addAction(self.hgBookmarkPullCurrentAct, title)
 1566         toolbarManager.addAction(self.hgBookmarkOutgoingAct, title)
 1567         toolbarManager.addAction(self.hgBookmarkPushAct, title)
 1568         toolbarManager.addAction(self.hgBookmarkPushCurrentAct, title)
 1569         toolbarManager.addAction(self.hgImportAct, title)
 1570         toolbarManager.addAction(self.hgExportAct, title)
 1571         toolbarManager.addAction(self.hgBundleAct, title)
 1572         toolbarManager.addAction(self.hgPreviewBundleAct, title)
 1573         toolbarManager.addAction(self.hgUnbundleAct, title)
 1574         toolbarManager.addAction(self.hgDeleteBackupsAct, title)
 1575         
 1576         self.__toolbar.setEnabled(False)
 1577         self.__toolbar.setVisible(False)
 1578         
 1579         ui.registerToolbar("mercurial", self.__toolbar.windowTitle(),
 1580                            self.__toolbar, "vcs")
 1581         ui.addToolBar(self.__toolbar)
 1582     
 1583     def removeToolbar(self, ui, toolbarManager):
 1584         """
 1585         Public method to remove a toolbar created by initToolbar().
 1586         
 1587         @param ui reference to the main window (UserInterface)
 1588         @param toolbarManager reference to a toolbar manager object
 1589             (E5ToolBarManager)
 1590         """
 1591         ui.removeToolBar(self.__toolbar)
 1592         ui.unregisterToolbar("mercurial")
 1593         
 1594         title = self.__toolbar.windowTitle()
 1595         toolbarManager.removeCategoryActions(title)
 1596         toolbarManager.removeToolBar(self.__toolbar)
 1597         
 1598         self.__toolbar.deleteLater()
 1599         self.__toolbar = None
 1600     
 1601     def showMenu(self):
 1602         """
 1603         Public slot called before the vcs menu is shown.
 1604         """
 1605         super(HgProjectHelper, self).showMenu()
 1606         
 1607         self.__checkActions()
 1608     
 1609     def shutdown(self):
 1610         """
 1611         Public method to perform shutdown actions.
 1612         """
 1613         self.vcs.activeExtensionsChanged.disconnect(self.__showExtensionMenu)
 1614         self.vcs.iniFileChanged.disconnect(self.__checkActions)
 1615         
 1616         # close torn off sub menus
 1617         for menu in self.subMenus:
 1618             if menu.isTearOffMenuVisible():
 1619                 menu.hideTearOffMenu()
 1620         
 1621         # close torn off extension menus
 1622         for extensionName in self.extensionMenus:
 1623             self.__extensions[extensionName].shutdown()
 1624             menu = self.extensionMenus[extensionName].menu()
 1625             if menu.isTearOffMenuVisible():
 1626                 menu.hideTearOffMenu()
 1627         
 1628         if self.__extensionsMenu.isTearOffMenuVisible():
 1629             self.__extensionsMenu.hideTearOffMenu()
 1630     
 1631     def __showExtensionMenu(self):
 1632         """
 1633         Private slot showing the extensions menu.
 1634         """
 1635         for extensionName in self.extensionMenus:
 1636             self.extensionMenus[extensionName].setEnabled(
 1637                 self.vcs.isExtensionActive(extensionName))
 1638             if (
 1639                 not self.extensionMenus[extensionName].isEnabled() and
 1640                 self.extensionMenus[extensionName].menu()
 1641                 .isTearOffMenuVisible()
 1642             ):
 1643                 self.extensionMenus[extensionName].menu().hideTearOffMenu()
 1644         if self.vcs.version < (4, 8, 0):
 1645             self.extensionMenus["closehead"].setEnabled(False)
 1646     
 1647     def __hgExtendedDiff(self):
 1648         """
 1649         Private slot used to perform a hg diff with the selection of revisions.
 1650         """
 1651         self.vcs.hgExtendedDiff(self.project.ppath)
 1652     
 1653     def __hgIncoming(self):
 1654         """
 1655         Private slot used to show the log of changes coming into the
 1656         repository.
 1657         """
 1658         self.vcs.hgIncoming(self.project.ppath)
 1659     
 1660     def __hgOutgoing(self):
 1661         """
 1662         Private slot used to show the log of changes going out of the
 1663         repository.
 1664         """
 1665         self.vcs.hgOutgoing(self.project.ppath)
 1666     
 1667     def __hgPull(self):
 1668         """
 1669         Private slot used to pull changes from a remote repository.
 1670         """
 1671         shouldReopen = self.vcs.hgPull(self.project.ppath)
 1672         if shouldReopen:
 1673             res = E5MessageBox.yesNo(
 1674                 self.parent(),
 1675                 self.tr("Pull"),
 1676                 self.tr("""The project should be reread. Do this now?"""),
 1677                 yesDefault=True)
 1678             if res:
 1679                 self.project.reopenProject()
 1680     
 1681     def __hgPush(self):
 1682         """
 1683         Private slot used to push changes to a remote repository.
 1684         """
 1685         self.vcs.hgPush(self.project.ppath)
 1686     
 1687     def __hgPushForced(self):
 1688         """
 1689         Private slot used to push changes to a remote repository using
 1690         the force option.
 1691         """
 1692         self.vcs.hgPush(self.project.ppath, force=True)
 1693     
 1694     def __hgHeads(self):
 1695         """
 1696         Private slot used to show the heads of the repository.
 1697         """
 1698         self.vcs.hgInfo(self.project.ppath, mode="heads")
 1699     
 1700     def __hgParents(self):
 1701         """
 1702         Private slot used to show the parents of the repository.
 1703         """
 1704         self.vcs.hgInfo(self.project.ppath, mode="parents")
 1705     
 1706     def __hgTip(self):
 1707         """
 1708         Private slot used to show the tip of the repository.
 1709         """
 1710         self.vcs.hgInfo(self.project.ppath, mode="tip")
 1711     
 1712     def __hgResolved(self):
 1713         """
 1714         Private slot used to mark conflicts of the local project as being
 1715         resolved.
 1716         """
 1717         self.vcs.hgResolved(self.project.ppath)
 1718     
 1719     def __hgUnresolved(self):
 1720         """
 1721         Private slot used to mark conflicts of the local project as being
 1722         unresolved.
 1723         """
 1724         self.vcs.hgResolved(self.project.ppath, unresolve=True)
 1725 
 1726     def __hgCommitMerge(self):
 1727         """
 1728         Private slot used to commit a merge.
 1729         """
 1730         self.vcs.vcsCommit(self.project.ppath, self.tr('Merge'), merge=True)
 1731     
 1732     def __hgAbortMerge(self):
 1733         """
 1734         Private slot used to abort an uncommitted merge.
 1735         """
 1736         self.vcs.hgAbortMerge(self.project.ppath)
 1737     
 1738     def __hgShowConflicts(self):
 1739         """
 1740         Private slot used to list all files with conflicts.
 1741         """
 1742         self.vcs.hgConflicts(self.project.ppath)
 1743     
 1744     def __hgReMerge(self):
 1745         """
 1746         Private slot used to list all files with conflicts.
 1747         """
 1748         self.vcs.hgReMerge(self.project.ppath)
 1749     
 1750     def __hgTagList(self):
 1751         """
 1752         Private slot used to list the tags of the project.
 1753         """
 1754         self.vcs.hgListTagBranch(self.project.ppath, True)
 1755     
 1756     def __hgBranchList(self):
 1757         """
 1758         Private slot used to list the branches of the project.
 1759         """
 1760         self.vcs.hgListTagBranch(self.project.ppath, False)
 1761     
 1762     def __hgBranch(self):
 1763         """
 1764         Private slot used to create a new branch for the project.
 1765         """
 1766         self.vcs.hgBranch(self.project.ppath)
 1767     
 1768     def __hgShowBranch(self):
 1769         """
 1770         Private slot used to show the current branch for the project.
 1771         """
 1772         self.vcs.hgShowBranch(self.project.ppath)
 1773     
 1774     def __hgConfigure(self):
 1775         """
 1776         Private method to open the configuration dialog.
 1777         """
 1778         e5App().getObject("UserInterface").showPreferences("zzz_mercurialPage")
 1779     
 1780     def __hgCloseBranch(self):
 1781         """
 1782         Private slot used to close the current branch of the local project.
 1783         """
 1784         if Preferences.getVCS("AutoSaveProject"):
 1785             self.project.saveProject()
 1786         if Preferences.getVCS("AutoSaveFiles"):
 1787             self.project.saveAllScripts()
 1788         self.vcs.vcsCommit(self.project.ppath, '', closeBranch=True)
 1789     
 1790     def __hgPushNewBranch(self):
 1791         """
 1792         Private slot to push a new named branch.
 1793         """
 1794         self.vcs.hgPush(self.project.ppath, newBranch=True)
 1795     
 1796     def __hgEditUserConfig(self):
 1797         """
 1798         Private slot used to edit the user configuration file.
 1799         """
 1800         self.vcs.hgEditUserConfig()
 1801     
 1802     def __hgEditRepoConfig(self):
 1803         """
 1804         Private slot used to edit the repository configuration file.
 1805         """
 1806         self.vcs.hgEditConfig(self.project.ppath)
 1807     
 1808     def __hgShowConfig(self):
 1809         """
 1810         Private slot used to show the combined configuration.
 1811         """
 1812         self.vcs.hgShowConfig(self.project.ppath)
 1813     
 1814     def __hgVerify(self):
 1815         """
 1816         Private slot used to verify the integrity of the repository.
 1817         """
 1818         self.vcs.hgVerify(self.project.ppath)
 1819     
 1820     def __hgShowPaths(self):
 1821         """
 1822         Private slot used to show the aliases for remote repositories.
 1823         """
 1824         self.vcs.hgShowPaths(self.project.ppath)
 1825     
 1826     def __hgRecover(self):
 1827         """
 1828         Private slot used to recover from an interrupted transaction.
 1829         """
 1830         self.vcs.hgRecover(self.project.ppath)
 1831     
 1832     def __hgIdentify(self):
 1833         """
 1834         Private slot used to identify the project directory.
 1835         """
 1836         self.vcs.hgIdentify(self.project.ppath)
 1837     
 1838     def __hgCreateIgnore(self):
 1839         """
 1840         Private slot used to create a .hgignore file for the project.
 1841         """
 1842         self.vcs.hgCreateIgnoreFile(self.project.ppath, autoAdd=True)
 1843     
 1844     def __hgBundle(self):
 1845         """
 1846         Private slot used to create a changegroup file.
 1847         """
 1848         self.vcs.hgBundle(self.project.ppath)
 1849     
 1850     def __hgPreviewBundle(self):
 1851         """
 1852         Private slot used to preview a changegroup file.
 1853         """
 1854         self.vcs.hgPreviewBundle(self.project.ppath)
 1855     
 1856     def __hgUnbundle(self):
 1857         """
 1858         Private slot used to apply changegroup files.
 1859         """
 1860         shouldReopen = self.vcs.hgUnbundle(self.project.ppath)
 1861         if shouldReopen:
 1862             res = E5MessageBox.yesNo(
 1863                 self.parent(),
 1864                 self.tr("Apply changegroups"),
 1865                 self.tr("""The project should be reread. Do this now?"""),
 1866                 yesDefault=True)
 1867             if res:
 1868                 self.project.reopenProject()
 1869     
 1870     def __hgBisectGood(self):
 1871         """
 1872         Private slot used to execute the bisect --good command.
 1873         """
 1874         self.vcs.hgBisect(self.project.ppath, "good")
 1875     
 1876     def __hgBisectBad(self):
 1877         """
 1878         Private slot used to execute the bisect --bad command.
 1879         """
 1880         self.vcs.hgBisect(self.project.ppath, "bad")
 1881     
 1882     def __hgBisectSkip(self):
 1883         """
 1884         Private slot used to execute the bisect --skip command.
 1885         """
 1886         self.vcs.hgBisect(self.project.ppath, "skip")
 1887     
 1888     def __hgBisectReset(self):
 1889         """
 1890         Private slot used to execute the bisect --reset command.
 1891         """
 1892         self.vcs.hgBisect(self.project.ppath, "reset")
 1893     
 1894     def __hgBackout(self):
 1895         """
 1896         Private slot used to back out changes of a changeset.
 1897         """
 1898         self.vcs.hgBackout(self.project.ppath)
 1899     
 1900     def __hgRollback(self):
 1901         """
 1902         Private slot used to rollback the last transaction.
 1903         """
 1904         self.vcs.hgRollback(self.project.ppath)
 1905     
 1906     def __hgServe(self):
 1907         """
 1908         Private slot used to serve the project.
 1909         """
 1910         self.vcs.hgServe(self.project.ppath)
 1911     
 1912     def __hgImport(self):
 1913         """
 1914         Private slot used to import a patch file.
 1915         """
 1916         shouldReopen = self.vcs.hgImport(self.project.ppath)
 1917         if shouldReopen:
 1918             res = E5MessageBox.yesNo(
 1919                 self.parent(),
 1920                 self.tr("Import Patch"),
 1921                 self.tr("""The project should be reread. Do this now?"""),
 1922                 yesDefault=True)
 1923             if res:
 1924                 self.project.reopenProject()
 1925     
 1926     def __hgExport(self):
 1927         """
 1928         Private slot used to export revisions to patch files.
 1929         """
 1930         self.vcs.hgExport(self.project.ppath)
 1931     
 1932     def __hgRevert(self):
 1933         """
 1934         Private slot used to revert changes made to the local project.
 1935         """
 1936         shouldReopen = self.vcs.hgRevert(self.project.ppath)
 1937         if shouldReopen:
 1938             res = E5MessageBox.yesNo(
 1939                 self.parent(),
 1940                 self.tr("Revert Changes"),
 1941                 self.tr("""The project should be reread. Do this now?"""),
 1942                 yesDefault=True)
 1943             if res:
 1944                 self.project.reopenProject()
 1945     
 1946     def __hgPhase(self):
 1947         """
 1948         Private slot used to change the phase of revisions.
 1949         """
 1950         self.vcs.hgPhase(self.project.ppath)
 1951     
 1952     def __hgGraft(self):
 1953         """
 1954         Private slot used to copy changesets from another branch.
 1955         """
 1956         shouldReopen = self.vcs.hgGraft(self.project.getProjectPath())
 1957         if shouldReopen:
 1958             res = E5MessageBox.yesNo(
 1959                 None,
 1960                 self.tr("Copy Changesets"),
 1961                 self.tr("""The project should be reread. Do this now?"""),
 1962                 yesDefault=True)
 1963             if res:
 1964                 self.project.reopenProject()
 1965     
 1966     def __hgGraftContinue(self):
 1967         """
 1968         Private slot used to continue the last copying session after conflicts
 1969         were resolved.
 1970         """
 1971         shouldReopen = self.vcs.hgGraftContinue(self.project.getProjectPath())
 1972         if shouldReopen:
 1973             res = E5MessageBox.yesNo(
 1974                 None,
 1975                 self.tr("Copy Changesets (Continue)"),
 1976                 self.tr("""The project should be reread. Do this now?"""),
 1977                 yesDefault=True)
 1978             if res:
 1979                 self.project.reopenProject()
 1980     
 1981     def __hgGraftStop(self):
 1982         """
 1983         Private slot used to stop an interrupted copying session.
 1984         """
 1985         shouldReopen = self.vcs.hgGraftStop(self.project.getProjectPath())
 1986         if shouldReopen:
 1987             res = E5MessageBox.yesNo(
 1988                 None,
 1989                 self.tr("Copy Changesets (Stop)"),
 1990                 self.tr("""The project should be reread. Do this now?"""),
 1991                 yesDefault=True)
 1992             if res:
 1993                 self.project.reopenProject()
 1994     
 1995     def __hgGraftAbort(self):
 1996         """
 1997         Private slot used to abort an interrupted copying session and perform
 1998         a rollback.
 1999         """
 2000         shouldReopen = self.vcs.hgGraftAbort(self.project.getProjectPath())
 2001         if shouldReopen:
 2002             res = E5MessageBox.yesNo(
 2003                 None,
 2004                 self.tr("Copy Changesets (Abort)"),
 2005                 self.tr("""The project should be reread. Do this now?"""),
 2006                 yesDefault=True)
 2007             if res:
 2008                 self.project.reopenProject()
 2009     
 2010     def __hgAddSubrepository(self):
 2011         """
 2012         Private slot used to add a sub-repository.
 2013         """
 2014         self.vcs.hgAddSubrepository()
 2015     
 2016     def __hgRemoveSubrepositories(self):
 2017         """
 2018         Private slot used to remove sub-repositories.
 2019         """
 2020         self.vcs.hgRemoveSubrepositories()
 2021     
 2022     def __hgSummary(self):
 2023         """
 2024         Private slot to show a working directory summary.
 2025         """
 2026         self.vcs.hgSummary()
 2027     
 2028     def __hgArchive(self):
 2029         """
 2030         Private slot to create an unversioned archive from the repository.
 2031         """
 2032         self.vcs.hgArchive()
 2033     
 2034     def __hgBookmarksList(self):
 2035         """
 2036         Private slot used to list the bookmarks.
 2037         """
 2038         self.vcs.hgListBookmarks(self.project.getProjectPath())
 2039     
 2040     def __hgBookmarkDefine(self):
 2041         """
 2042         Private slot used to define a bookmark.
 2043         """
 2044         self.vcs.hgBookmarkDefine(self.project.getProjectPath())
 2045     
 2046     def __hgBookmarkDelete(self):
 2047         """
 2048         Private slot used to delete a bookmark.
 2049         """
 2050         self.vcs.hgBookmarkDelete(self.project.getProjectPath())
 2051     
 2052     def __hgBookmarkRename(self):
 2053         """
 2054         Private slot used to rename a bookmark.
 2055         """
 2056         self.vcs.hgBookmarkRename(self.project.getProjectPath())
 2057     
 2058     def __hgBookmarkMove(self):
 2059         """
 2060         Private slot used to move a bookmark.
 2061         """
 2062         self.vcs.hgBookmarkMove(self.project.getProjectPath())
 2063     
 2064     def __hgBookmarkIncoming(self):
 2065         """
 2066         Private slot used to show a list of incoming bookmarks.
 2067         """
 2068         self.vcs.hgBookmarkIncoming(self.project.getProjectPath())
 2069     
 2070     def __hgBookmarkOutgoing(self):
 2071         """
 2072         Private slot used to show a list of outgoing bookmarks.
 2073         """
 2074         self.vcs.hgBookmarkOutgoing(self.project.getProjectPath())
 2075     
 2076     def __hgBookmarkPull(self):
 2077         """
 2078         Private slot used to pull a bookmark from a remote repository.
 2079         """
 2080         self.vcs.hgBookmarkPull(self.project.getProjectPath())
 2081     
 2082     def __hgBookmarkPullCurrent(self):
 2083         """
 2084         Private slot used to pull the current bookmark from a remote
 2085         repository.
 2086         """
 2087         self.vcs.hgBookmarkPull(self.project.getProjectPath(), current=True)
 2088     
 2089     def __hgBookmarkPush(self):
 2090         """
 2091         Private slot used to push a bookmark to a remote repository.
 2092         """
 2093         self.vcs.hgBookmarkPush(self.project.getProjectPath())
 2094     
 2095     def __hgBookmarkPushCurrent(self):
 2096         """
 2097         Private slot used to push the current bookmark to a remote repository.
 2098         """
 2099         self.vcs.hgBookmarkPush(self.project.getProjectPath(), current=True)
 2100     
 2101     def __hgDeleteBackups(self):
 2102         """
 2103         Private slot used to delete all backup bundles.
 2104         """
 2105         self.vcs.hgDeleteBackups()