"Fossies" - the Fresh Open Source Software Archive

Member "eric6-20.9/eric/eric6/Plugins/VcsPlugins/vcsGit/ProjectHelper.py" (2 Sep 2020, 95461 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) 2014 - 2020 Detlev Offenbach <detlev@die-offenbachs.de>
    4 #
    5 
    6 """
    7 Module implementing the VCS project helper for Git.
    8 """
    9 
   10 
   11 import os
   12 
   13 from PyQt5.QtCore import QFileInfo
   14 from PyQt5.QtWidgets import QMenu, QInputDialog, QToolBar
   15 
   16 from E5Gui import E5MessageBox
   17 from E5Gui.E5Application import e5App
   18 
   19 from VCS.ProjectHelper import VcsProjectHelper
   20 
   21 from E5Gui.E5Action import E5Action
   22 
   23 import UI.PixmapCache
   24 
   25 
   26 class GitProjectHelper(VcsProjectHelper):
   27     """
   28     Class implementing the VCS project helper for Git.
   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     def setObjects(self, vcsObject, projectObject):
   42         """
   43         Public method to set references to the vcs and project objects.
   44         
   45         @param vcsObject reference to the vcs object
   46         @param projectObject reference to the project object
   47         """
   48         self.vcs = vcsObject
   49         self.project = projectObject
   50     
   51     def getProject(self):
   52         """
   53         Public method to get a reference to the project object.
   54         
   55         @return reference to the project object (Project)
   56         """
   57         return self.project
   58     
   59     def getActions(self):
   60         """
   61         Public method to get a list of all actions.
   62         
   63         @return list of all actions (list of E5Action)
   64         """
   65         actions = self.actions[:]
   66         return actions
   67     
   68     def initActions(self):
   69         """
   70         Public method to generate the action objects.
   71         """
   72         self.vcsNewAct = E5Action(
   73             self.tr('New from repository'),
   74             UI.PixmapCache.getIcon("vcsCheckout"),
   75             self.tr('&New from repository...'), 0, 0,
   76             self, 'git_new')
   77         self.vcsNewAct.setStatusTip(self.tr(
   78             'Create (clone) a new project from a Git repository'
   79         ))
   80         self.vcsNewAct.setWhatsThis(self.tr(
   81             """<b>New from repository</b>"""
   82             """<p>This creates (clones) a new local project from """
   83             """a Git repository.</p>"""
   84         ))
   85         self.vcsNewAct.triggered.connect(self._vcsCheckout)
   86         self.actions.append(self.vcsNewAct)
   87         
   88         self.gitFetchAct = E5Action(
   89             self.tr('Fetch changes'),
   90             UI.PixmapCache.getIcon("vcsUpdate"),
   91             self.tr('Fetch changes'),
   92             0, 0, self, 'git_fetch')
   93         self.gitFetchAct.setStatusTip(self.tr(
   94             'Fetch changes from a remote repository'
   95         ))
   96         self.gitFetchAct.setWhatsThis(self.tr(
   97             """<b>Fetch changes</b>"""
   98             """<p>This fetches changes from a remote repository into the """
   99             """local repository.</p>"""
  100         ))
  101         self.gitFetchAct.triggered.connect(self.__gitFetch)
  102         self.actions.append(self.gitFetchAct)
  103         
  104         self.gitPullAct = E5Action(
  105             self.tr('Pull changes'),
  106             UI.PixmapCache.getIcon("vcsUpdate"),
  107             self.tr('Pull changes'),
  108             0, 0, self, 'git_pull')
  109         self.gitPullAct.setStatusTip(self.tr(
  110             'Pull changes from a remote repository and update the work area'
  111         ))
  112         self.gitPullAct.setWhatsThis(self.tr(
  113             """<b>Pull changes</b>"""
  114             """<p>This pulls changes from a remote repository into the """
  115             """local repository and updates the work area.</p>"""
  116         ))
  117         self.gitPullAct.triggered.connect(self.__gitPull)
  118         self.actions.append(self.gitPullAct)
  119         
  120         self.vcsCommitAct = E5Action(
  121             self.tr('Commit changes to repository'),
  122             UI.PixmapCache.getIcon("vcsCommit"),
  123             self.tr('Commit changes to repository...'), 0, 0, self,
  124             'git_commit')
  125         self.vcsCommitAct.setStatusTip(self.tr(
  126             'Commit changes of the local project to the Git repository'
  127         ))
  128         self.vcsCommitAct.setWhatsThis(self.tr(
  129             """<b>Commit changes to repository</b>"""
  130             """<p>This commits changes of the local project to the """
  131             """Git repository.</p>"""
  132         ))
  133         self.vcsCommitAct.triggered.connect(self._vcsCommit)
  134         self.actions.append(self.vcsCommitAct)
  135         
  136         self.gitPushAct = E5Action(
  137             self.tr('Push changes'),
  138             UI.PixmapCache.getIcon("vcsCommit"),
  139             self.tr('Push changes'),
  140             0, 0, self, 'git_push')
  141         self.gitPushAct.setStatusTip(self.tr(
  142             'Push changes to a remote repository'
  143         ))
  144         self.gitPushAct.setWhatsThis(self.tr(
  145             """<b>Push changes</b>"""
  146             """<p>This pushes changes from the local repository to a """
  147             """remote repository.</p>"""
  148         ))
  149         self.gitPushAct.triggered.connect(self.__gitPush)
  150         self.actions.append(self.gitPushAct)
  151         
  152         self.vcsExportAct = E5Action(
  153             self.tr('Export from repository'),
  154             UI.PixmapCache.getIcon("vcsExport"),
  155             self.tr('&Export from repository...'),
  156             0, 0, self, 'git_export_repo')
  157         self.vcsExportAct.setStatusTip(self.tr(
  158             'Export a project from the repository'
  159         ))
  160         self.vcsExportAct.setWhatsThis(self.tr(
  161             """<b>Export from repository</b>"""
  162             """<p>This exports a project from the repository.</p>"""
  163         ))
  164         self.vcsExportAct.triggered.connect(self._vcsExport)
  165         self.actions.append(self.vcsExportAct)
  166         
  167         self.gitLogBrowserAct = E5Action(
  168             self.tr('Show log browser'),
  169             UI.PixmapCache.getIcon("vcsLog"),
  170             self.tr('Show log browser'),
  171             0, 0, self, 'git_log_browser')
  172         self.gitLogBrowserAct.setStatusTip(self.tr(
  173             'Show a dialog to browse the log of the local project'
  174         ))
  175         self.gitLogBrowserAct.setWhatsThis(self.tr(
  176             """<b>Show log browser</b>"""
  177             """<p>This shows a dialog to browse the log of the local"""
  178             """ project. A limited number of entries is shown first."""
  179             """ More can be retrieved later on.</p>"""
  180         ))
  181         self.gitLogBrowserAct.triggered.connect(self._vcsLogBrowser)
  182         self.actions.append(self.gitLogBrowserAct)
  183         
  184         self.gitReflogBrowserAct = E5Action(
  185             self.tr('Show reflog browser'),
  186             UI.PixmapCache.getIcon("vcsLog"),
  187             self.tr('Show reflog browser'),
  188             0, 0, self, 'git_reflog_browser')
  189         self.gitReflogBrowserAct.setStatusTip(self.tr(
  190             'Show a dialog to browse the reflog of the local project'
  191         ))
  192         self.gitReflogBrowserAct.setWhatsThis(self.tr(
  193             """<b>Show reflog browser</b>"""
  194             """<p>This shows a dialog to browse the reflog of the local"""
  195             """ project. A limited number of entries is shown first."""
  196             """ More can be retrieved later on.</p>"""
  197         ))
  198         self.gitReflogBrowserAct.triggered.connect(self.__gitReflogBrowser)
  199         self.actions.append(self.gitReflogBrowserAct)
  200         
  201         self.vcsDiffAct = E5Action(
  202             self.tr('Show differences'),
  203             UI.PixmapCache.getIcon("vcsDiff"),
  204             self.tr('Show &differences...'),
  205             0, 0, self, 'git_diff')
  206         self.vcsDiffAct.setStatusTip(self.tr(
  207             'Show the differences of the local project to the repository'
  208         ))
  209         self.vcsDiffAct.setWhatsThis(self.tr(
  210             """<b>Show differences</b>"""
  211             """<p>This shows differences of the local project to the"""
  212             """ repository.</p>"""
  213         ))
  214         self.vcsDiffAct.triggered.connect(self._vcsDiff)
  215         self.actions.append(self.vcsDiffAct)
  216         
  217         self.gitExtDiffAct = E5Action(
  218             self.tr('Show differences (extended)'),
  219             UI.PixmapCache.getIcon("vcsDiff"),
  220             self.tr('Show differences (extended) ...'),
  221             0, 0, self, 'git_extendeddiff')
  222         self.gitExtDiffAct.setStatusTip(self.tr(
  223             'Show the difference of revisions of the project to the repository'
  224         ))
  225         self.gitExtDiffAct.setWhatsThis(self.tr(
  226             """<b>Show differences (extended)</b>"""
  227             """<p>This shows differences of selectable revisions of the"""
  228             """ project.</p>"""
  229         ))
  230         self.gitExtDiffAct.triggered.connect(self.__gitExtendedDiff)
  231         self.actions.append(self.gitExtDiffAct)
  232         
  233         self.vcsStatusAct = E5Action(
  234             self.tr('Show status'),
  235             UI.PixmapCache.getIcon("vcsStatus"),
  236             self.tr('Show &status...'),
  237             0, 0, self, 'git_status')
  238         self.vcsStatusAct.setStatusTip(self.tr(
  239             'Show the status of the local project'
  240         ))
  241         self.vcsStatusAct.setWhatsThis(self.tr(
  242             """<b>Show status</b>"""
  243             """<p>This shows the status of the local project.</p>"""
  244         ))
  245         self.vcsStatusAct.triggered.connect(self._vcsStatus)
  246         self.actions.append(self.vcsStatusAct)
  247         
  248         self.vcsSwitchAct = E5Action(
  249             self.tr('Switch'),
  250             UI.PixmapCache.getIcon("vcsSwitch"),
  251             self.tr('S&witch...'),
  252             0, 0, self, 'git_switch')
  253         self.vcsSwitchAct.setStatusTip(self.tr(
  254             'Switch the working directory to another revision'
  255         ))
  256         self.vcsSwitchAct.setWhatsThis(self.tr(
  257             """<b>Switch</b>"""
  258             """<p>This switches the working directory to another"""
  259             """ revision.</p>"""
  260         ))
  261         self.vcsSwitchAct.triggered.connect(self._vcsSwitch)
  262         self.actions.append(self.vcsSwitchAct)
  263         
  264         self.vcsTagAct = E5Action(
  265             self.tr('Tag in repository'),
  266             UI.PixmapCache.getIcon("vcsTag"),
  267             self.tr('&Tag in repository...'),
  268             0, 0, self, 'git_tag')
  269         self.vcsTagAct.setStatusTip(self.tr(
  270             'Perform tag operations for the local project'
  271         ))
  272         self.vcsTagAct.setWhatsThis(self.tr(
  273             """<b>Tag in repository</b>"""
  274             """<p>This performs selectable tag operations for the local"""
  275             """ project.</p>"""
  276         ))
  277         self.vcsTagAct.triggered.connect(self._vcsTag)
  278         self.actions.append(self.vcsTagAct)
  279         
  280         self.gitTagListAct = E5Action(
  281             self.tr('List tags'),
  282             self.tr('&List tags...'),
  283             0, 0, self, 'git_list_tags')
  284         self.gitTagListAct.setStatusTip(self.tr(
  285             'List tags of the project'
  286         ))
  287         self.gitTagListAct.setWhatsThis(self.tr(
  288             """<b>List tags</b>"""
  289             """<p>This lists the tags of the project.</p>"""
  290         ))
  291         self.gitTagListAct.triggered.connect(self.__gitTagList)
  292         self.actions.append(self.gitTagListAct)
  293         
  294         self.gitDescribeTagAct = E5Action(
  295             self.tr('Show most recent tag'),
  296             self.tr('Show most recent tag'),
  297             0, 0, self, 'git_describe_tag')
  298         self.gitDescribeTagAct.setStatusTip(self.tr(
  299             'Show the most recent tag reachable from the work tree'
  300         ))
  301         self.gitDescribeTagAct.setWhatsThis(self.tr(
  302             """<b>Show most recent tag</b>"""
  303             """<p>This shows the most recent tag reachable from the work"""
  304             """ tree.</p>"""
  305         ))
  306         self.gitDescribeTagAct.triggered.connect(self.__gitDescribeTag)
  307         self.actions.append(self.gitDescribeTagAct)
  308         
  309         self.gitBranchListAct = E5Action(
  310             self.tr('List branches'),
  311             self.tr('&List branches...'),
  312             0, 0, self, 'git_list_branches')
  313         self.gitBranchListAct.setStatusTip(self.tr(
  314             'List branches of the project'
  315         ))
  316         self.gitBranchListAct.setWhatsThis(self.tr(
  317             """<b>List branches</b>"""
  318             """<p>This lists the branches of the project.</p>"""
  319         ))
  320         self.gitBranchListAct.triggered.connect(self.__gitBranchList)
  321         self.actions.append(self.gitBranchListAct)
  322         
  323         self.gitMergedBranchListAct = E5Action(
  324             self.tr('List merged branches'),
  325             self.tr('List &merged branches...'),
  326             0, 0, self, 'git_list_merged_branches')
  327         self.gitMergedBranchListAct.setStatusTip(self.tr(
  328             'List merged branches of the project'
  329         ))
  330         self.gitMergedBranchListAct.setWhatsThis(self.tr(
  331             """<b>List merged branches</b>"""
  332             """<p>This lists the merged branches of the project.</p>"""
  333         ))
  334         self.gitMergedBranchListAct.triggered.connect(
  335             self.__gitMergedBranchList)
  336         self.actions.append(self.gitMergedBranchListAct)
  337         
  338         self.gitNotMergedBranchListAct = E5Action(
  339             self.tr('List non-merged branches'),
  340             self.tr('List &non-merged branches...'),
  341             0, 0, self, 'git_list_non_merged_branches')
  342         self.gitNotMergedBranchListAct.setStatusTip(self.tr(
  343             'List non-merged branches of the project'
  344         ))
  345         self.gitNotMergedBranchListAct.setWhatsThis(self.tr(
  346             """<b>List non-merged branches</b>"""
  347             """<p>This lists the non-merged branches of the project.</p>"""
  348         ))
  349         self.gitNotMergedBranchListAct.triggered.connect(
  350             self.__gitNotMergedBranchList)
  351         self.actions.append(self.gitNotMergedBranchListAct)
  352         
  353         self.gitBranchAct = E5Action(
  354             self.tr('Branch in repository'),
  355             UI.PixmapCache.getIcon("vcsBranch"),
  356             self.tr('&Branch in repository...'),
  357             0, 0, self, 'git_branch')
  358         self.gitBranchAct.setStatusTip(self.tr(
  359             'Perform branch operations for the local project'
  360         ))
  361         self.gitBranchAct.setWhatsThis(self.tr(
  362             """<b>Branch in repository</b>"""
  363             """<p>This performs selectable branch operations for the local"""
  364             """ project.</p>"""
  365         ))
  366         self.gitBranchAct.triggered.connect(self.__gitBranch)
  367         self.actions.append(self.gitBranchAct)
  368         
  369         self.gitDeleteRemoteBranchAct = E5Action(
  370             self.tr('Delete Remote Branch'),
  371             self.tr('&Delete Remote Branch...'),
  372             0, 0, self, 'git_delete_remote_branch')
  373         self.gitDeleteRemoteBranchAct.setStatusTip(self.tr(
  374             'Delete a branch from a remote repository'
  375         ))
  376         self.gitDeleteRemoteBranchAct.setWhatsThis(self.tr(
  377             """<b>Delete Remote Branch</b>"""
  378             """<p>This deletes a branch from a remote repository.</p>"""
  379         ))
  380         self.gitDeleteRemoteBranchAct.triggered.connect(self.__gitDeleteBranch)
  381         self.actions.append(self.gitDeleteRemoteBranchAct)
  382         
  383         self.gitShowBranchAct = E5Action(
  384             self.tr('Show current branch'),
  385             self.tr('Show current branch'),
  386             0, 0, self, 'git_show_branch')
  387         self.gitShowBranchAct.setStatusTip(self.tr(
  388             'Show the current branch of the project'
  389         ))
  390         self.gitShowBranchAct.setWhatsThis(self.tr(
  391             """<b>Show current branch</b>"""
  392             """<p>This shows the current branch of the project.</p>"""
  393         ))
  394         self.gitShowBranchAct.triggered.connect(self.__gitShowBranch)
  395         self.actions.append(self.gitShowBranchAct)
  396         
  397         self.vcsRevertAct = E5Action(
  398             self.tr('Revert changes'),
  399             UI.PixmapCache.getIcon("vcsRevert"),
  400             self.tr('Re&vert changes'),
  401             0, 0, self, 'git_revert')
  402         self.vcsRevertAct.setStatusTip(self.tr(
  403             'Revert all changes made to the local project'
  404         ))
  405         self.vcsRevertAct.setWhatsThis(self.tr(
  406             """<b>Revert changes</b>"""
  407             """<p>This reverts all changes made to the local project.</p>"""
  408         ))
  409         self.vcsRevertAct.triggered.connect(self.__gitRevert)
  410         self.actions.append(self.vcsRevertAct)
  411         
  412         self.gitUnstageAct = E5Action(
  413             self.tr('Unstage changes'),
  414             UI.PixmapCache.getIcon("vcsRevert"),
  415             self.tr('&Unstage changes'),
  416             0, 0, self, 'git_revert')
  417         self.gitUnstageAct.setStatusTip(self.tr(
  418             'Unstage all changes made to the local project'
  419         ))
  420         self.gitUnstageAct.setWhatsThis(self.tr(
  421             """<b>Unstage changes</b>"""
  422             """<p>This unstages all changes made to the local project.</p>"""
  423         ))
  424         self.gitUnstageAct.triggered.connect(self.__gitUnstage)
  425         self.actions.append(self.gitUnstageAct)
  426         
  427         self.vcsMergeAct = E5Action(
  428             self.tr('Merge'),
  429             UI.PixmapCache.getIcon("vcsMerge"),
  430             self.tr('Mer&ge changes...'),
  431             0, 0, self, 'git_merge')
  432         self.vcsMergeAct.setStatusTip(self.tr(
  433             'Merge changes into the local project'
  434         ))
  435         self.vcsMergeAct.setWhatsThis(self.tr(
  436             """<b>Merge</b>"""
  437             """<p>This merges changes into the local project.</p>"""
  438         ))
  439         self.vcsMergeAct.triggered.connect(self._vcsMerge)
  440         self.actions.append(self.vcsMergeAct)
  441         
  442         self.gitCancelMergeAct = E5Action(
  443             self.tr('Cancel uncommitted/failed merge'),
  444             self.tr('Cancel uncommitted/failed merge'),
  445             0, 0, self, 'git_cancel_merge')
  446         self.gitCancelMergeAct.setStatusTip(self.tr(
  447             'Cancel an uncommitted or failed merge and lose all changes'
  448         ))
  449         self.gitCancelMergeAct.setWhatsThis(self.tr(
  450             """<b>Cancel uncommitted/failed merge</b>"""
  451             """<p>This cancels an uncommitted or failed merge causing all"""
  452             """ changes to be lost.</p>"""
  453         ))
  454         self.gitCancelMergeAct.triggered.connect(self.__gitCancelMerge)
  455         self.actions.append(self.gitCancelMergeAct)
  456         
  457         self.gitCommitMergeAct = E5Action(
  458             self.tr('Commit failed merge'),
  459             self.tr('Commit failed merge'),
  460             0, 0, self, 'git_commit_merge')
  461         self.gitCommitMergeAct.setStatusTip(self.tr(
  462             'Commit a failed merge after conflicts have been resolved'
  463         ))
  464         self.gitCommitMergeAct.setWhatsThis(self.tr(
  465             """<b>Commit failed merge</b>"""
  466             """<p>This commits a failed merge after conflicts have been"""
  467             """ resolved.</p>"""
  468         ))
  469         self.gitCommitMergeAct.triggered.connect(self.__gitCommitMerge)
  470         self.actions.append(self.gitCommitMergeAct)
  471         
  472         self.vcsCleanupAct = E5Action(
  473             self.tr('Cleanup'),
  474             self.tr('Cleanu&p'),
  475             0, 0, self, 'git_cleanup')
  476         self.vcsCleanupAct.setStatusTip(self.tr(
  477             'Cleanup the local project'
  478         ))
  479         self.vcsCleanupAct.setWhatsThis(self.tr(
  480             """<b>Cleanup</b>"""
  481             """<p>This performs a cleanup of the local project.</p>"""
  482         ))
  483         self.vcsCleanupAct.triggered.connect(self._vcsCleanup)
  484         self.actions.append(self.vcsCleanupAct)
  485         
  486         self.vcsCommandAct = E5Action(
  487             self.tr('Execute command'),
  488             self.tr('E&xecute command...'),
  489             0, 0, self, 'git_command')
  490         self.vcsCommandAct.setStatusTip(self.tr(
  491             'Execute an arbitrary Git command'
  492         ))
  493         self.vcsCommandAct.setWhatsThis(self.tr(
  494             """<b>Execute command</b>"""
  495             """<p>This opens a dialog to enter an arbitrary Git"""
  496             """ command.</p>"""
  497         ))
  498         self.vcsCommandAct.triggered.connect(self._vcsCommand)
  499         self.actions.append(self.vcsCommandAct)
  500         
  501         self.gitConfigAct = E5Action(
  502             self.tr('Configure'),
  503             self.tr('Configure...'),
  504             0, 0, self, 'git_configure')
  505         self.gitConfigAct.setStatusTip(self.tr(
  506             'Show the configuration dialog with the Git page selected'
  507         ))
  508         self.gitConfigAct.setWhatsThis(self.tr(
  509             """<b>Configure</b>"""
  510             """<p>Show the configuration dialog with the Git page"""
  511             """ selected.</p>"""
  512         ))
  513         self.gitConfigAct.triggered.connect(self.__gitConfigure)
  514         self.actions.append(self.gitConfigAct)
  515         
  516         self.gitRemotesShowAct = E5Action(
  517             self.tr('Show Remotes'),
  518             self.tr('Show Remotes...'),
  519             0, 0, self, 'git_show_remotes')
  520         self.gitRemotesShowAct.setStatusTip(self.tr(
  521             'Show the available remote repositories'
  522         ))
  523         self.gitRemotesShowAct.setWhatsThis(self.tr(
  524             """<b>Show Remotes</b>"""
  525             """<p>This shows the remote repositories available for"""
  526             """ pulling, fetching and pushing.</p>"""
  527         ))
  528         self.gitRemotesShowAct.triggered.connect(self.__gitShowRemotes)
  529         self.actions.append(self.gitRemotesShowAct)
  530         
  531         self.gitRemoteShowAct = E5Action(
  532             self.tr('Show Remote Info'),
  533             self.tr('Show Remote Info...'),
  534             0, 0, self, 'git_show_remote_info')
  535         self.gitRemoteShowAct.setStatusTip(self.tr(
  536             'Show information about a remote repository'
  537         ))
  538         self.gitRemoteShowAct.setWhatsThis(self.tr(
  539             """<b>Show Remotes</b>"""
  540             """<p>This shows the remote repositories available for"""
  541             """ pulling, fetching and pushing.</p>"""
  542         ))
  543         self.gitRemoteShowAct.triggered.connect(self.__gitShowRemote)
  544         self.actions.append(self.gitRemoteShowAct)
  545         
  546         self.gitRemoteAddAct = E5Action(
  547             self.tr('Add'),
  548             self.tr('Add...'),
  549             0, 0, self, 'git_add_remote')
  550         self.gitRemoteAddAct.setStatusTip(self.tr(
  551             'Add a remote repository'
  552         ))
  553         self.gitRemoteAddAct.setWhatsThis(self.tr(
  554             """<b>Add</b>"""
  555             """<p>This adds a remote repository.</p>"""
  556         ))
  557         self.gitRemoteAddAct.triggered.connect(self.__gitAddRemote)
  558         self.actions.append(self.gitRemoteAddAct)
  559         
  560         self.gitRemoteRemoveAct = E5Action(
  561             self.tr('Remove'),
  562             self.tr('Remove...'),
  563             0, 0, self, 'git_remove_remote')
  564         self.gitRemoteRemoveAct.setStatusTip(self.tr(
  565             'Remove a remote repository'
  566         ))
  567         self.gitRemoteRemoveAct.setWhatsThis(self.tr(
  568             """<b>Remove</b>"""
  569             """<p>This removes a remote repository.</p>"""
  570         ))
  571         self.gitRemoteRemoveAct.triggered.connect(self.__gitRemoveRemote)
  572         self.actions.append(self.gitRemoteRemoveAct)
  573         
  574         self.gitRemotePruneAct = E5Action(
  575             self.tr('Prune'),
  576             self.tr('Prune...'),
  577             0, 0, self, 'git_prune_remote')
  578         self.gitRemotePruneAct.setStatusTip(self.tr(
  579             'Prune stale remote-tracking branches of a remote repository'
  580         ))
  581         self.gitRemotePruneAct.setWhatsThis(self.tr(
  582             """<b>Prune</b>"""
  583             """<p>This prunes stale remote-tracking branches of a remote"""
  584             """ repository.</p>"""
  585         ))
  586         self.gitRemotePruneAct.triggered.connect(self.__gitPruneRemote)
  587         self.actions.append(self.gitRemotePruneAct)
  588         
  589         self.gitRemoteRenameAct = E5Action(
  590             self.tr('Rename'),
  591             self.tr('Rename...'),
  592             0, 0, self, 'git_rename_remote')
  593         self.gitRemoteRenameAct.setStatusTip(self.tr(
  594             'Rename a remote repository'
  595         ))
  596         self.gitRemoteRenameAct.setWhatsThis(self.tr(
  597             """<b>Rename</b>"""
  598             """<p>This renames a remote repository.</p>"""
  599         ))
  600         self.gitRemoteRenameAct.triggered.connect(self.__gitRenameRemote)
  601         self.actions.append(self.gitRemoteRenameAct)
  602         
  603         self.gitRemoteChangeUrlAct = E5Action(
  604             self.tr('Change URL'),
  605             self.tr('Change URL...'),
  606             0, 0, self, 'git_change_remote_url')
  607         self.gitRemoteChangeUrlAct.setStatusTip(self.tr(
  608             'Change the URL of a remote repository'
  609         ))
  610         self.gitRemoteChangeUrlAct.setWhatsThis(self.tr(
  611             """<b>Change URL</b>"""
  612             """<p>This changes the URL of a remote repository.</p>"""
  613         ))
  614         self.gitRemoteChangeUrlAct.triggered.connect(self.__gitChangeRemoteUrl)
  615         self.actions.append(self.gitRemoteChangeUrlAct)
  616         
  617         self.gitRemoteCredentialsAct = E5Action(
  618             self.tr('Credentials'),
  619             self.tr('Credentials...'),
  620             0, 0, self, 'git_remote_credentials')
  621         self.gitRemoteCredentialsAct.setStatusTip(self.tr(
  622             'Change or set the user credentials of a remote repository'
  623         ))
  624         self.gitRemoteCredentialsAct.setWhatsThis(self.tr(
  625             """<b>Credentials</b>"""
  626             """<p>This changes or sets the user credentials of a"""
  627             """ remote repository.</p>"""
  628         ))
  629         self.gitRemoteCredentialsAct.triggered.connect(
  630             self.__gitRemoteCredentials)
  631         self.actions.append(self.gitRemoteCredentialsAct)
  632         
  633         self.gitCherryPickAct = E5Action(
  634             self.tr('Copy Commits'),
  635             UI.PixmapCache.getIcon("vcsGraft"),
  636             self.tr('Copy Commits'),
  637             0, 0, self, 'git_cherrypick')
  638         self.gitCherryPickAct.setStatusTip(self.tr(
  639             'Copies commits into the current branch'
  640         ))
  641         self.gitCherryPickAct.setWhatsThis(self.tr(
  642             """<b>Copy Commits</b>"""
  643             """<p>This copies commits on top of the current branch.</p>"""
  644         ))
  645         self.gitCherryPickAct.triggered.connect(self.__gitCherryPick)
  646         self.actions.append(self.gitCherryPickAct)
  647         
  648         self.gitCherryPickContinueAct = E5Action(
  649             self.tr('Continue Copying Session'),
  650             self.tr('Continue Copying Session'),
  651             0, 0, self, 'git_cherrypick_continue')
  652         self.gitCherryPickContinueAct.setStatusTip(self.tr(
  653             'Continue the last copying session after conflicts were resolved'
  654         ))
  655         self.gitCherryPickContinueAct.setWhatsThis(self.tr(
  656             """<b>Continue Copying Session</b>"""
  657             """<p>This continues the last copying session after conflicts"""
  658             """ were resolved.</p>"""
  659         ))
  660         self.gitCherryPickContinueAct.triggered.connect(
  661             self.__gitCherryPickContinue)
  662         self.actions.append(self.gitCherryPickContinueAct)
  663         
  664         self.gitCherryPickQuitAct = E5Action(
  665             self.tr('Quit Copying Session'),
  666             self.tr('Quit Copying Session'),
  667             0, 0, self, 'git_cherrypick_quit')
  668         self.gitCherryPickQuitAct.setStatusTip(self.tr(
  669             'Quit the current copying session'
  670         ))
  671         self.gitCherryPickQuitAct.setWhatsThis(self.tr(
  672             """<b>Quit Copying Session</b>"""
  673             """<p>This quits the current copying session.</p>"""
  674         ))
  675         self.gitCherryPickQuitAct.triggered.connect(self.__gitCherryPickQuit)
  676         self.actions.append(self.gitCherryPickQuitAct)
  677         
  678         self.gitCherryPickAbortAct = E5Action(
  679             self.tr('Cancel Copying Session'),
  680             self.tr('Cancel Copying Session'),
  681             0, 0, self, 'git_cherrypick_abort')
  682         self.gitCherryPickAbortAct.setStatusTip(self.tr(
  683             'Cancel the current copying session and return to the'
  684             ' previous state'
  685         ))
  686         self.gitCherryPickAbortAct.setWhatsThis(self.tr(
  687             """<b>Cancel Copying Session</b>"""
  688             """<p>This cancels the current copying session and returns to"""
  689             """ the previous state.</p>"""
  690         ))
  691         self.gitCherryPickAbortAct.triggered.connect(self.__gitCherryPickAbort)
  692         self.actions.append(self.gitCherryPickAbortAct)
  693         
  694         self.gitStashAct = E5Action(
  695             self.tr('Stash changes'),
  696             self.tr('Stash changes...'),
  697             0, 0, self, 'git_stash')
  698         self.gitStashAct.setStatusTip(self.tr(
  699             'Stash all current changes of the project'
  700         ))
  701         self.gitStashAct.setWhatsThis(self.tr(
  702             """<b>Stash changes</b>"""
  703             """<p>This stashes all current changes of the project.</p>"""
  704         ))
  705         self.gitStashAct.triggered.connect(self.__gitStashSave)
  706         self.actions.append(self.gitStashAct)
  707         
  708         self.gitStashBrowserAct = E5Action(
  709             self.tr('Show stash browser'),
  710             self.tr('Show stash browser...'),
  711             0, 0, self, 'git_stash_browser')
  712         self.gitStashBrowserAct.setStatusTip(self.tr(
  713             'Show a dialog with all stashes'
  714         ))
  715         self.gitStashBrowserAct.setWhatsThis(self.tr(
  716             """<b>Show stash browser...</b>"""
  717             """<p>This shows a dialog listing all available stashes."""
  718             """ Actions on these stashes may be executed via the"""
  719             """ context menu.</p>"""
  720         ))
  721         self.gitStashBrowserAct.triggered.connect(self.__gitStashBrowser)
  722         self.actions.append(self.gitStashBrowserAct)
  723         
  724         self.gitStashShowAct = E5Action(
  725             self.tr('Show stash'),
  726             self.tr('Show stash...'),
  727             0, 0, self, 'git_stash_show')
  728         self.gitStashShowAct.setStatusTip(self.tr(
  729             'Show a dialog with a patch of a stash'
  730         ))
  731         self.gitStashShowAct.setWhatsThis(self.tr(
  732             """<b>Show stash...</b>"""
  733             """<p>This shows a dialog with a patch of a selectable"""
  734             """ stash.</p>"""
  735         ))
  736         self.gitStashShowAct.triggered.connect(self.__gitStashShow)
  737         self.actions.append(self.gitStashShowAct)
  738         
  739         self.gitStashApplyAct = E5Action(
  740             self.tr('Restore && Keep'),
  741             self.tr('Restore && Keep'),
  742             0, 0, self, 'git_stash_apply')
  743         self.gitStashApplyAct.setStatusTip(self.tr(
  744             'Restore a stash but keep it'
  745         ))
  746         self.gitStashApplyAct.setWhatsThis(self.tr(
  747             """<b>Restore &amp; Keep</b>"""
  748             """<p>This restores a selectable stash and keeps it.</p>"""
  749         ))
  750         self.gitStashApplyAct.triggered.connect(self.__gitStashApply)
  751         self.actions.append(self.gitStashApplyAct)
  752         
  753         self.gitStashPopAct = E5Action(
  754             self.tr('Restore && Delete'),
  755             self.tr('Restore && Delete'),
  756             0, 0, self, 'git_stash_pop')
  757         self.gitStashPopAct.setStatusTip(self.tr(
  758             'Restore a stash and delete it'
  759         ))
  760         self.gitStashPopAct.setWhatsThis(self.tr(
  761             """<b>Restore &amp; Delete</b>"""
  762             """<p>This restores a selectable stash and deletes it.</p>"""
  763         ))
  764         self.gitStashPopAct.triggered.connect(self.__gitStashPop)
  765         self.actions.append(self.gitStashPopAct)
  766         
  767         self.gitStashBranchAct = E5Action(
  768             self.tr('Create Branch'),
  769             self.tr('Create Branch'),
  770             0, 0, self, 'git_stash_branch')
  771         self.gitStashBranchAct.setStatusTip(self.tr(
  772             'Create a new branch and restore a stash into it'
  773         ))
  774         self.gitStashBranchAct.setWhatsThis(self.tr(
  775             """<b>Create Branch</b>"""
  776             """<p>This creates a new branch and restores a stash into"""
  777             """ it.</p>"""
  778         ))
  779         self.gitStashBranchAct.triggered.connect(self.__gitStashBranch)
  780         self.actions.append(self.gitStashBranchAct)
  781         
  782         self.gitStashDropAct = E5Action(
  783             self.tr('Delete'),
  784             self.tr('Delete'),
  785             0, 0, self, 'git_stash_delete')
  786         self.gitStashDropAct.setStatusTip(self.tr(
  787             'Delete a stash'
  788         ))
  789         self.gitStashDropAct.setWhatsThis(self.tr(
  790             """<b>Delete</b>"""
  791             """<p>This deletes a stash.</p>"""
  792         ))
  793         self.gitStashDropAct.triggered.connect(self.__gitStashDrop)
  794         self.actions.append(self.gitStashDropAct)
  795         
  796         self.gitStashClearAct = E5Action(
  797             self.tr('Delete All'),
  798             self.tr('Delete All'),
  799             0, 0, self, 'git_stash_delete_all')
  800         self.gitStashClearAct.setStatusTip(self.tr(
  801             'Delete all stashes'
  802         ))
  803         self.gitStashClearAct.setWhatsThis(self.tr(
  804             """<b>Delete All</b>"""
  805             """<p>This deletes all stashes.</p>"""
  806         ))
  807         self.gitStashClearAct.triggered.connect(self.__gitStashClear)
  808         self.actions.append(self.gitStashClearAct)
  809         
  810         self.gitEditUserConfigAct = E5Action(
  811             self.tr('Edit user configuration'),
  812             self.tr('Edit user configuration...'),
  813             0, 0, self, 'git_user_configure')
  814         self.gitEditUserConfigAct.setStatusTip(self.tr(
  815             'Show an editor to edit the user configuration file'
  816         ))
  817         self.gitEditUserConfigAct.setWhatsThis(self.tr(
  818             """<b>Edit user configuration</b>"""
  819             """<p>Show an editor to edit the user configuration file.</p>"""
  820         ))
  821         self.gitEditUserConfigAct.triggered.connect(self.__gitEditUserConfig)
  822         self.actions.append(self.gitEditUserConfigAct)
  823         
  824         self.gitRepoConfigAct = E5Action(
  825             self.tr('Edit repository configuration'),
  826             self.tr('Edit repository configuration...'),
  827             0, 0, self, 'git_repo_configure')
  828         self.gitRepoConfigAct.setStatusTip(self.tr(
  829             'Show an editor to edit the repository configuration file'
  830         ))
  831         self.gitRepoConfigAct.setWhatsThis(self.tr(
  832             """<b>Edit repository configuration</b>"""
  833             """<p>Show an editor to edit the repository configuration"""
  834             """ file.</p>"""
  835         ))
  836         self.gitRepoConfigAct.triggered.connect(self.__gitEditRepoConfig)
  837         self.actions.append(self.gitRepoConfigAct)
  838         
  839         self.gitCreateIgnoreAct = E5Action(
  840             self.tr('Create .gitignore'),
  841             self.tr('Create .gitignore'),
  842             0, 0, self, 'git_create_ignore')
  843         self.gitCreateIgnoreAct.setStatusTip(self.tr(
  844             'Create a .gitignore file with default values'
  845         ))
  846         self.gitCreateIgnoreAct.setWhatsThis(self.tr(
  847             """<b>Create .gitignore</b>"""
  848             """<p>This creates a .gitignore file with default values.</p>"""
  849         ))
  850         self.gitCreateIgnoreAct.triggered.connect(self.__gitCreateIgnore)
  851         self.actions.append(self.gitCreateIgnoreAct)
  852         
  853         self.gitShowConfigAct = E5Action(
  854             self.tr('Show combined configuration settings'),
  855             self.tr('Show combined configuration settings...'),
  856             0, 0, self, 'git_show_config')
  857         self.gitShowConfigAct.setStatusTip(self.tr(
  858             'Show the combined configuration settings from all configuration'
  859             ' files'
  860         ))
  861         self.gitShowConfigAct.setWhatsThis(self.tr(
  862             """<b>Show combined configuration settings</b>"""
  863             """<p>This shows the combined configuration settings"""
  864             """ from all configuration files.</p>"""
  865         ))
  866         self.gitShowConfigAct.triggered.connect(self.__gitShowConfig)
  867         self.actions.append(self.gitShowConfigAct)
  868         
  869         self.gitVerifyAct = E5Action(
  870             self.tr('Verify repository'),
  871             self.tr('Verify repository...'),
  872             0, 0, self, 'git_verify')
  873         self.gitVerifyAct.setStatusTip(self.tr(
  874             'Verify the connectivity and validity of objects of the database'
  875         ))
  876         self.gitVerifyAct.setWhatsThis(self.tr(
  877             """<b>Verify repository</b>"""
  878             """<p>This verifies the connectivity and validity of objects"""
  879             """ of the database.</p>"""
  880         ))
  881         self.gitVerifyAct.triggered.connect(self.__gitVerify)
  882         self.actions.append(self.gitVerifyAct)
  883         
  884         self.gitHouseKeepingAct = E5Action(
  885             self.tr('Optimize repository'),
  886             self.tr('Optimize repository...'),
  887             0, 0, self, 'git_housekeeping')
  888         self.gitHouseKeepingAct.setStatusTip(self.tr(
  889             'Cleanup and optimize the local repository'
  890         ))
  891         self.gitHouseKeepingAct.setWhatsThis(self.tr(
  892             """<b>Optimize repository</b>"""
  893             """<p>This cleans up and optimizes the local repository.</p>"""
  894         ))
  895         self.gitHouseKeepingAct.triggered.connect(self.__gitHouseKeeping)
  896         self.actions.append(self.gitHouseKeepingAct)
  897         
  898         self.gitStatisticsAct = E5Action(
  899             self.tr('Repository Statistics'),
  900             self.tr('Repository Statistics...'),
  901             0, 0, self, 'git_statistics')
  902         self.gitStatisticsAct.setStatusTip(self.tr(
  903             'Show some statistics of the local repository'
  904         ))
  905         self.gitStatisticsAct.setWhatsThis(self.tr(
  906             """<b>Repository Statistics</b>"""
  907             """<p>This show some statistics of the local repository.</p>"""
  908         ))
  909         self.gitStatisticsAct.triggered.connect(self.__gitStatistics)
  910         self.actions.append(self.gitStatisticsAct)
  911         
  912         self.gitCreateArchiveAct = E5Action(
  913             self.tr('Create Archive'),
  914             self.tr('Create Archive'),
  915             0, 0, self, 'git_create_archive')
  916         self.gitCreateArchiveAct.setStatusTip(self.tr(
  917             'Create an archive from the local repository'
  918         ))
  919         self.gitCreateArchiveAct.setWhatsThis(self.tr(
  920             """<b>Create Archive</b>"""
  921             """<p>This creates an archive from the local repository.</p>"""
  922         ))
  923         self.gitCreateArchiveAct.triggered.connect(self.__gitCreateArchive)
  924         self.actions.append(self.gitCreateArchiveAct)
  925         
  926         self.gitBundleAct = E5Action(
  927             self.tr('Create bundle'),
  928             self.tr('Create bundle...'),
  929             0, 0, self, 'mercurial_bundle_create')
  930         self.gitBundleAct.setStatusTip(self.tr(
  931             'Create bundle file collecting changesets'
  932         ))
  933         self.gitBundleAct.setWhatsThis(self.tr(
  934             """<b>Create bundle</b>"""
  935             """<p>This creates a bundle file collecting selected"""
  936             """ changesets (git bundle create).</p>"""
  937         ))
  938         self.gitBundleAct.triggered.connect(self.__gitBundle)
  939         self.actions.append(self.gitBundleAct)
  940         
  941         self.gitBundleVerifyAct = E5Action(
  942             self.tr('Verify bundle'),
  943             self.tr('Verify bundle...'),
  944             0, 0, self, 'mercurial_bundle_verify')
  945         self.gitBundleVerifyAct.setStatusTip(self.tr(
  946             'Verify the validity and applicability of a bundle file'
  947         ))
  948         self.gitBundleVerifyAct.setWhatsThis(self.tr(
  949             """<b>Verify bundle</b>"""
  950             """<p>This verifies that a bundle file is valid and will"""
  951             """ apply cleanly.</p>"""
  952         ))
  953         self.gitBundleVerifyAct.triggered.connect(self.__gitVerifyBundle)
  954         self.actions.append(self.gitBundleVerifyAct)
  955         
  956         self.gitBundleListHeadsAct = E5Action(
  957             self.tr('List bundle heads'),
  958             self.tr('List bundle heads...'),
  959             0, 0, self, 'mercurial_bundle_list_heads')
  960         self.gitBundleListHeadsAct.setStatusTip(self.tr(
  961             'List all heads contained in a bundle file'
  962         ))
  963         self.gitBundleListHeadsAct.setWhatsThis(self.tr(
  964             """<b>List bundle heads</b>"""
  965             """<p>This lists all heads contained in a bundle file.</p>"""
  966         ))
  967         self.gitBundleListHeadsAct.triggered.connect(self.__gitBundleListHeads)
  968         self.actions.append(self.gitBundleListHeadsAct)
  969         
  970         self.gitBundleApplyFetchAct = E5Action(
  971             self.tr('Apply Bundle (fetch)'),
  972             self.tr('Apply Bundle (fetch)...'),
  973             0, 0, self, 'mercurial_bundle_apply_fetch')
  974         self.gitBundleApplyFetchAct.setStatusTip(self.tr(
  975             'Apply a head of a bundle file using fetch'
  976         ))
  977         self.gitBundleApplyFetchAct.setWhatsThis(self.tr(
  978             """<b>Apply Bundle (fetch)</b>"""
  979             """<p>This applies a head of a bundle file using fetch.</p>"""
  980         ))
  981         self.gitBundleApplyFetchAct.triggered.connect(self.__gitBundleFetch)
  982         self.actions.append(self.gitBundleApplyFetchAct)
  983         
  984         self.gitBundleApplyPullAct = E5Action(
  985             self.tr('Apply Bundle (pull)'),
  986             self.tr('Apply Bundle (pull)...'),
  987             0, 0, self, 'mercurial_bundle_apply_pull')
  988         self.gitBundleApplyPullAct.setStatusTip(self.tr(
  989             'Apply a head of a bundle file using pull'
  990         ))
  991         self.gitBundleApplyPullAct.setWhatsThis(self.tr(
  992             """<b>Apply Bundle (pull)</b>"""
  993             """<p>This applies a head of a bundle file using pull.</p>"""
  994         ))
  995         self.gitBundleApplyPullAct.triggered.connect(self.__gitBundlePull)
  996         self.actions.append(self.gitBundleApplyPullAct)
  997         
  998         self.gitBisectStartAct = E5Action(
  999             self.tr('Start'),
 1000             self.tr('Start'),
 1001             0, 0, self, 'git_bisect_start')
 1002         self.gitBisectStartAct.setStatusTip(self.tr(
 1003             'Start a bisect session'
 1004         ))
 1005         self.gitBisectStartAct.setWhatsThis(self.tr(
 1006             """<b>Start</b>"""
 1007             """<p>This starts a bisect session.</p>"""
 1008         ))
 1009         self.gitBisectStartAct.triggered.connect(self.__gitBisectStart)
 1010         self.actions.append(self.gitBisectStartAct)
 1011         
 1012         self.gitBisectStartExtendedAct = E5Action(
 1013             self.tr('Start (Extended)'),
 1014             self.tr('Start (Extended)'),
 1015             0, 0, self, 'git_bisect_start_extended')
 1016         self.gitBisectStartExtendedAct.setStatusTip(self.tr(
 1017             'Start a bisect session giving a bad and optionally good commits'
 1018         ))
 1019         self.gitBisectStartExtendedAct.setWhatsThis(self.tr(
 1020             """<b>Start (Extended)</b>"""
 1021             """<p>This starts a bisect session giving a bad and optionally"""
 1022             """ good commits.</p>"""
 1023         ))
 1024         self.gitBisectStartExtendedAct.triggered.connect(
 1025             self.__gitBisectStartExtended)
 1026         self.actions.append(self.gitBisectStartExtendedAct)
 1027         
 1028         self.gitBisectGoodAct = E5Action(
 1029             self.tr('Mark as "good"'),
 1030             self.tr('Mark as "good"...'),
 1031             0, 0, self, 'git_bisect_good')
 1032         self.gitBisectGoodAct.setStatusTip(self.tr(
 1033             'Mark a selectable revision as good'
 1034         ))
 1035         self.gitBisectGoodAct.setWhatsThis(self.tr(
 1036             """<b>Mark as "good"</b>"""
 1037             """<p>This marks a selectable revision as good.</p>"""
 1038         ))
 1039         self.gitBisectGoodAct.triggered.connect(self.__gitBisectGood)
 1040         self.actions.append(self.gitBisectGoodAct)
 1041         
 1042         self.gitBisectBadAct = E5Action(
 1043             self.tr('Mark as "bad"'),
 1044             self.tr('Mark as "bad"...'),
 1045             0, 0, self, 'git_bisect_bad')
 1046         self.gitBisectBadAct.setStatusTip(self.tr(
 1047             'Mark a selectable revision as bad'
 1048         ))
 1049         self.gitBisectBadAct.setWhatsThis(self.tr(
 1050             """<b>Mark as "bad"</b>"""
 1051             """<p>This marks a selectable revision as bad.</p>"""
 1052         ))
 1053         self.gitBisectBadAct.triggered.connect(self.__gitBisectBad)
 1054         self.actions.append(self.gitBisectBadAct)
 1055         
 1056         self.gitBisectSkipAct = E5Action(
 1057             self.tr('Skip'),
 1058             self.tr('Skip...'),
 1059             0, 0, self, 'git_bisect_skip')
 1060         self.gitBisectSkipAct.setStatusTip(self.tr(
 1061             'Skip a selectable revision'
 1062         ))
 1063         self.gitBisectSkipAct.setWhatsThis(self.tr(
 1064             """<b>Skip</b>"""
 1065             """<p>This skips a selectable revision.</p>"""
 1066         ))
 1067         self.gitBisectSkipAct.triggered.connect(self.__gitBisectSkip)
 1068         self.actions.append(self.gitBisectSkipAct)
 1069         
 1070         self.gitBisectResetAct = E5Action(
 1071             self.tr('Reset'),
 1072             self.tr('Reset...'),
 1073             0, 0, self, 'git_bisect_reset')
 1074         self.gitBisectResetAct.setStatusTip(self.tr(
 1075             'Reset the bisect session'
 1076         ))
 1077         self.gitBisectResetAct.setWhatsThis(self.tr(
 1078             """<b>Reset</b>"""
 1079             """<p>This resets the bisect session.</p>"""
 1080         ))
 1081         self.gitBisectResetAct.triggered.connect(self.__gitBisectReset)
 1082         self.actions.append(self.gitBisectResetAct)
 1083         
 1084         self.gitBisectLogBrowserAct = E5Action(
 1085             self.tr('Show bisect log browser'),
 1086             UI.PixmapCache.getIcon("vcsLog"),
 1087             self.tr('Show bisect log browser'),
 1088             0, 0, self, 'git_bisect_log_browser')
 1089         self.gitBisectLogBrowserAct.setStatusTip(self.tr(
 1090             'Show a dialog to browse the bisect log of the local project'
 1091         ))
 1092         self.gitBisectLogBrowserAct.setWhatsThis(self.tr(
 1093             """<b>Show bisect log browser</b>"""
 1094             """<p>This shows a dialog to browse the bisect log of the local"""
 1095             """ project.</p>"""
 1096         ))
 1097         self.gitBisectLogBrowserAct.triggered.connect(
 1098             self.__gitBisectLogBrowser)
 1099         self.actions.append(self.gitBisectLogBrowserAct)
 1100         
 1101         self.gitBisectCreateReplayAct = E5Action(
 1102             self.tr('Create replay file'),
 1103             self.tr('Create replay file'),
 1104             0, 0, self, 'git_bisect_create_replay')
 1105         self.gitBisectCreateReplayAct.setStatusTip(self.tr(
 1106             'Create a replay file to repeat the current bisect session'
 1107         ))
 1108         self.gitBisectCreateReplayAct.setWhatsThis(self.tr(
 1109             """<b>Create replay file</b>"""
 1110             """<p>This creates a replay file to repeat the current bisect"""
 1111             """ session.</p>"""
 1112         ))
 1113         self.gitBisectCreateReplayAct.triggered.connect(
 1114             self.__gitBisectCreateReplay)
 1115         self.actions.append(self.gitBisectCreateReplayAct)
 1116         
 1117         self.gitBisectEditReplayAct = E5Action(
 1118             self.tr('Edit replay file'),
 1119             self.tr('Edit replay file'),
 1120             0, 0, self, 'git_bisect_edit_replay')
 1121         self.gitBisectEditReplayAct.setStatusTip(self.tr(
 1122             'Edit a bisect replay file'
 1123         ))
 1124         self.gitBisectEditReplayAct.setWhatsThis(self.tr(
 1125             """<b>Edit replay file</b>"""
 1126             """<p>This edits a bisect replay file.</p>"""
 1127         ))
 1128         self.gitBisectEditReplayAct.triggered.connect(
 1129             self.__gitBisectEditReplay)
 1130         self.actions.append(self.gitBisectEditReplayAct)
 1131         
 1132         self.gitBisectReplayAct = E5Action(
 1133             self.tr('Replay session'),
 1134             self.tr('Replay session'),
 1135             0, 0, self, 'git_bisect_replay')
 1136         self.gitBisectReplayAct.setStatusTip(self.tr(
 1137             'Replay a bisect session from file'
 1138         ))
 1139         self.gitBisectReplayAct.setWhatsThis(self.tr(
 1140             """<b>Replay session</b>"""
 1141             """<p>This replays a bisect session from file.</p>"""
 1142         ))
 1143         self.gitBisectReplayAct.triggered.connect(self.__gitBisectReplay)
 1144         self.actions.append(self.gitBisectReplayAct)
 1145         
 1146         self.gitCheckPatchesAct = E5Action(
 1147             self.tr('Check patch files'),
 1148             self.tr('Check patch files'),
 1149             0, 0, self, 'git_check_patches')
 1150         self.gitCheckPatchesAct.setStatusTip(self.tr(
 1151             'Check a list of patch files, if they would apply cleanly'
 1152         ))
 1153         self.gitCheckPatchesAct.setWhatsThis(self.tr(
 1154             """<b>Check patch files</b>"""
 1155             """<p>This checks a list of patch files, if they would apply"""
 1156             """ cleanly.</p>"""
 1157         ))
 1158         self.gitCheckPatchesAct.triggered.connect(self.__gitCheckPatches)
 1159         self.actions.append(self.gitCheckPatchesAct)
 1160         
 1161         self.gitApplyPatchesAct = E5Action(
 1162             self.tr('Apply patch files'),
 1163             self.tr('Apply patch files'),
 1164             0, 0, self, 'git_apply_patches')
 1165         self.gitApplyPatchesAct.setStatusTip(self.tr(
 1166             'Apply a list of patch files'
 1167         ))
 1168         self.gitApplyPatchesAct.setWhatsThis(self.tr(
 1169             """<b>Apply patch files</b>"""
 1170             """<p>This applies a list of patch files.</p>"""
 1171         ))
 1172         self.gitApplyPatchesAct.triggered.connect(self.__gitApplyPatches)
 1173         self.actions.append(self.gitApplyPatchesAct)
 1174         
 1175         self.gitShowPatcheStatisticsAct = E5Action(
 1176             self.tr('Show patch statistics'),
 1177             self.tr('Show patch statistics'),
 1178             0, 0, self, 'git_show_patches_statistics')
 1179         self.gitShowPatcheStatisticsAct.setStatusTip(self.tr(
 1180             'Show some statistics for a list of patch files'
 1181         ))
 1182         self.gitShowPatcheStatisticsAct.setWhatsThis(self.tr(
 1183             """<b>Show patch statistics</b>"""
 1184             """<p>This shows some statistics for a list of patch files.</p>"""
 1185         ))
 1186         self.gitShowPatcheStatisticsAct.triggered.connect(
 1187             self.__gitShowPatchStatistics)
 1188         self.actions.append(self.gitShowPatcheStatisticsAct)
 1189         
 1190         self.gitSubmoduleAddAct = E5Action(
 1191             self.tr('Add'),
 1192             self.tr('Add'),
 1193             0, 0, self, 'git_submodule_add')
 1194         self.gitSubmoduleAddAct.setStatusTip(self.tr(
 1195             'Add a submodule to the current project'
 1196         ))
 1197         self.gitSubmoduleAddAct.setWhatsThis(self.tr(
 1198             """<b>Add</b>"""
 1199             """<p>This adds a submodule to the current project.</p>"""
 1200         ))
 1201         self.gitSubmoduleAddAct.triggered.connect(
 1202             self.__gitSubmoduleAdd)
 1203         self.actions.append(self.gitSubmoduleAddAct)
 1204         
 1205         self.gitSubmodulesListAct = E5Action(
 1206             self.tr('List'),
 1207             self.tr('List'),
 1208             0, 0, self, 'git_submodules_list')
 1209         self.gitSubmodulesListAct.setStatusTip(self.tr(
 1210             'List the submodule of the current project'
 1211         ))
 1212         self.gitSubmodulesListAct.setWhatsThis(self.tr(
 1213             """<b>List</b>"""
 1214             """<p>This lists the submodules of the current project.</p>"""
 1215         ))
 1216         self.gitSubmodulesListAct.triggered.connect(
 1217             self.__gitSubmodulesList)
 1218         self.actions.append(self.gitSubmodulesListAct)
 1219         
 1220         self.gitSubmodulesInitAct = E5Action(
 1221             self.tr('Initialize'),
 1222             self.tr('Initialize'),
 1223             0, 0, self, 'git_submodules_init')
 1224         self.gitSubmodulesInitAct.setStatusTip(self.tr(
 1225             'Initialize the submodules of the current project'
 1226         ))
 1227         self.gitSubmodulesInitAct.setWhatsThis(self.tr(
 1228             """<b>Initialize</b>"""
 1229             """<p>This initializes the submodules of the current"""
 1230             """ project.</p>"""
 1231         ))
 1232         self.gitSubmodulesInitAct.triggered.connect(
 1233             self.__gitSubmodulesInit)
 1234         self.actions.append(self.gitSubmodulesInitAct)
 1235         
 1236         self.gitSubmodulesDeinitAct = E5Action(
 1237             self.tr('Unregister'),
 1238             self.tr('Unregister'),
 1239             0, 0, self, 'git_submodules_deinit')
 1240         self.gitSubmodulesDeinitAct.setStatusTip(self.tr(
 1241             'Unregister submodules of the current project'
 1242         ))
 1243         self.gitSubmodulesDeinitAct.setWhatsThis(self.tr(
 1244             """<b>Unregister</b>"""
 1245             """<p>This unregisters submodules of the current project.</p>"""
 1246         ))
 1247         self.gitSubmodulesDeinitAct.triggered.connect(
 1248             self.__gitSubmodulesDeinit)
 1249         self.actions.append(self.gitSubmodulesDeinitAct)
 1250         
 1251         self.gitSubmodulesUpdateAct = E5Action(
 1252             self.tr('Update'),
 1253             self.tr('Update'),
 1254             0, 0, self, 'git_submodules_update')
 1255         self.gitSubmodulesUpdateAct.setStatusTip(self.tr(
 1256             'Update submodules of the current project'
 1257         ))
 1258         self.gitSubmodulesUpdateAct.setWhatsThis(self.tr(
 1259             """<b>Update</b>"""
 1260             """<p>This updates submodules of the current project.</p>"""
 1261         ))
 1262         self.gitSubmodulesUpdateAct.triggered.connect(
 1263             self.__gitSubmodulesUpdate)
 1264         self.actions.append(self.gitSubmodulesUpdateAct)
 1265         
 1266         self.gitSubmodulesUpdateInitAct = E5Action(
 1267             self.tr('Initialize and Update'),
 1268             self.tr('Initialize and Update'),
 1269             0, 0, self, 'git_submodules_update_init')
 1270         self.gitSubmodulesUpdateInitAct.setStatusTip(self.tr(
 1271             'Initialize and update submodules of the current project'
 1272         ))
 1273         self.gitSubmodulesUpdateInitAct.setWhatsThis(self.tr(
 1274             """<b>Initialize and Update</b>"""
 1275             """<p>This initializes and updates submodules of the current"""
 1276             """ project.</p>"""
 1277         ))
 1278         self.gitSubmodulesUpdateInitAct.triggered.connect(
 1279             self.__gitSubmodulesUpdateInit)
 1280         self.actions.append(self.gitSubmodulesUpdateInitAct)
 1281         
 1282         self.gitSubmodulesUpdateRemoteAct = E5Action(
 1283             self.tr('Fetch and Update'),
 1284             self.tr('Fetch and Update'),
 1285             0, 0, self, 'git_submodules_update_remote')
 1286         self.gitSubmodulesUpdateRemoteAct.setStatusTip(self.tr(
 1287             'Fetch and update submodules of the current project'
 1288         ))
 1289         self.gitSubmodulesUpdateRemoteAct.setWhatsThis(self.tr(
 1290             """<b>Fetch and Update</b>"""
 1291             """<p>This fetches and updates submodules of the current"""
 1292             """ project.</p>"""
 1293         ))
 1294         self.gitSubmodulesUpdateRemoteAct.triggered.connect(
 1295             self.__gitSubmodulesUpdateRemote)
 1296         self.actions.append(self.gitSubmodulesUpdateRemoteAct)
 1297         
 1298         self.gitSubmodulesUpdateOptionsAct = E5Action(
 1299             self.tr('Update with Options'),
 1300             self.tr('Update with Options'),
 1301             0, 0, self, 'git_submodules_update_options')
 1302         self.gitSubmodulesUpdateOptionsAct.setStatusTip(self.tr(
 1303             'Update submodules of the current project offering a dialog'
 1304             ' to enter options'
 1305         ))
 1306         self.gitSubmodulesUpdateOptionsAct.setWhatsThis(self.tr(
 1307             """<b>Update with Options</b>"""
 1308             """<p>This updates submodules of the current project"""
 1309             """ offering a dialog to enter update options.</p>"""
 1310         ))
 1311         self.gitSubmodulesUpdateOptionsAct.triggered.connect(
 1312             self.__gitSubmodulesUpdateOptions)
 1313         self.actions.append(self.gitSubmodulesUpdateOptionsAct)
 1314         
 1315         self.gitSubmodulesSyncAct = E5Action(
 1316             self.tr('Synchronize URLs'),
 1317             self.tr('Synchronize URLs'),
 1318             0, 0, self, 'git_submodules_sync')
 1319         self.gitSubmodulesSyncAct.setStatusTip(self.tr(
 1320             'Synchronize URLs of submodules of the current project'
 1321         ))
 1322         self.gitSubmodulesSyncAct.setWhatsThis(self.tr(
 1323             """<b>Synchronize URLs</b>"""
 1324             """<p>This synchronizes URLs of submodules of the current"""
 1325             """ project.</p>"""
 1326         ))
 1327         self.gitSubmodulesSyncAct.triggered.connect(
 1328             self.__gitSubmodulesSync)
 1329         self.actions.append(self.gitSubmodulesSyncAct)
 1330         
 1331         self.gitSubmodulesStatusAct = E5Action(
 1332             self.tr('Show Status'),
 1333             self.tr('Show Status'),
 1334             0, 0, self, 'git_submodules_status')
 1335         self.gitSubmodulesStatusAct.setStatusTip(self.tr(
 1336             'Show the status of submodules of the current project'
 1337         ))
 1338         self.gitSubmodulesStatusAct.setWhatsThis(self.tr(
 1339             """<b>Show Status</b>"""
 1340             """<p>This shows a dialog with the status of submodules of the"""
 1341             """ current project.</p>"""
 1342         ))
 1343         self.gitSubmodulesStatusAct.triggered.connect(
 1344             self.__gitSubmodulesStatus)
 1345         self.actions.append(self.gitSubmodulesStatusAct)
 1346         
 1347         self.gitSubmodulesSummaryAct = E5Action(
 1348             self.tr('Show Summary'),
 1349             self.tr('Show Summary'),
 1350             0, 0, self, 'git_submodules_summary')
 1351         self.gitSubmodulesSummaryAct.setStatusTip(self.tr(
 1352             'Show summary information for submodules of the current project'
 1353         ))
 1354         self.gitSubmodulesSummaryAct.setWhatsThis(self.tr(
 1355             """<b>Show Summary</b>"""
 1356             """<p>This shows some summary information for submodules of the"""
 1357             """ current project.</p>"""
 1358         ))
 1359         self.gitSubmodulesSummaryAct.triggered.connect(
 1360             self.__gitSubmodulesSummary)
 1361         self.actions.append(self.gitSubmodulesSummaryAct)
 1362     
 1363     def initMenu(self, menu):
 1364         """
 1365         Public method to generate the VCS menu.
 1366         
 1367         @param menu reference to the menu to be populated (QMenu)
 1368         """
 1369         menu.clear()
 1370         
 1371         self.subMenus = []
 1372         
 1373         adminMenu = QMenu(self.tr("Administration"), menu)
 1374         adminMenu.setTearOffEnabled(True)
 1375         adminMenu.addAction(self.gitShowConfigAct)
 1376         adminMenu.addAction(self.gitRepoConfigAct)
 1377         adminMenu.addSeparator()
 1378         adminMenu.addAction(self.gitReflogBrowserAct)
 1379         adminMenu.addSeparator()
 1380         adminMenu.addAction(self.gitCreateIgnoreAct)
 1381         adminMenu.addSeparator()
 1382         adminMenu.addAction(self.gitCreateArchiveAct)
 1383         adminMenu.addSeparator()
 1384         adminMenu.addAction(self.gitStatisticsAct)
 1385         adminMenu.addAction(self.gitVerifyAct)
 1386         adminMenu.addAction(self.gitHouseKeepingAct)
 1387         self.subMenus.append(adminMenu)
 1388         
 1389         bundleMenu = QMenu(self.tr("Bundle Management"), menu)
 1390         bundleMenu.setTearOffEnabled(True)
 1391         bundleMenu.addAction(self.gitBundleAct)
 1392         bundleMenu.addSeparator()
 1393         bundleMenu.addAction(self.gitBundleVerifyAct)
 1394         bundleMenu.addAction(self.gitBundleListHeadsAct)
 1395         bundleMenu.addSeparator()
 1396         bundleMenu.addAction(self.gitBundleApplyFetchAct)
 1397         bundleMenu.addAction(self.gitBundleApplyPullAct)
 1398         self.subMenus.append(bundleMenu)
 1399         
 1400         patchMenu = QMenu(self.tr("Patch Management"), menu)
 1401         patchMenu.setTearOffEnabled(True)
 1402         patchMenu.addAction(self.gitCheckPatchesAct)
 1403         patchMenu.addAction(self.gitApplyPatchesAct)
 1404         patchMenu.addSeparator()
 1405         patchMenu.addAction(self.gitShowPatcheStatisticsAct)
 1406         self.subMenus.append(patchMenu)
 1407         
 1408         bisectMenu = QMenu(self.tr("Bisect"), menu)
 1409         bisectMenu.setTearOffEnabled(True)
 1410         bisectMenu.addAction(self.gitBisectStartAct)
 1411         bisectMenu.addAction(self.gitBisectStartExtendedAct)
 1412         bisectMenu.addSeparator()
 1413         bisectMenu.addAction(self.gitBisectGoodAct)
 1414         bisectMenu.addAction(self.gitBisectBadAct)
 1415         bisectMenu.addAction(self.gitBisectSkipAct)
 1416         bisectMenu.addSeparator()
 1417         bisectMenu.addAction(self.gitBisectResetAct)
 1418         bisectMenu.addSeparator()
 1419         bisectMenu.addAction(self.gitBisectLogBrowserAct)
 1420         bisectMenu.addSeparator()
 1421         bisectMenu.addAction(self.gitBisectCreateReplayAct)
 1422         bisectMenu.addAction(self.gitBisectEditReplayAct)
 1423         bisectMenu.addAction(self.gitBisectReplayAct)
 1424         self.subMenus.append(bisectMenu)
 1425         
 1426         tagsMenu = QMenu(self.tr("Tags"), menu)
 1427         tagsMenu.setIcon(UI.PixmapCache.getIcon("vcsTag"))
 1428         tagsMenu.setTearOffEnabled(True)
 1429         tagsMenu.addAction(self.vcsTagAct)
 1430         tagsMenu.addAction(self.gitTagListAct)
 1431         tagsMenu.addAction(self.gitDescribeTagAct)
 1432         self.subMenus.append(tagsMenu)
 1433         
 1434         branchesMenu = QMenu(self.tr("Branches"), menu)
 1435         branchesMenu.setIcon(UI.PixmapCache.getIcon("vcsBranch"))
 1436         branchesMenu.setTearOffEnabled(True)
 1437         branchesMenu.addAction(self.gitBranchAct)
 1438         branchesMenu.addSeparator()
 1439         branchesMenu.addAction(self.gitBranchListAct)
 1440         branchesMenu.addAction(self.gitMergedBranchListAct)
 1441         branchesMenu.addAction(self.gitNotMergedBranchListAct)
 1442         branchesMenu.addAction(self.gitShowBranchAct)
 1443         branchesMenu.addSeparator()
 1444         branchesMenu.addAction(self.gitDeleteRemoteBranchAct)
 1445         self.subMenus.append(branchesMenu)
 1446         
 1447         changesMenu = QMenu(self.tr("Manage Changes"), menu)
 1448         changesMenu.setTearOffEnabled(True)
 1449         changesMenu.addAction(self.gitUnstageAct)
 1450         changesMenu.addAction(self.vcsRevertAct)
 1451         changesMenu.addAction(self.vcsMergeAct)
 1452         changesMenu.addAction(self.gitCommitMergeAct)
 1453         changesMenu.addAction(self.gitCancelMergeAct)
 1454         
 1455         remotesMenu = QMenu(self.tr("Remote Repositories"), menu)
 1456         remotesMenu.setTearOffEnabled(True)
 1457         remotesMenu.addAction(self.gitRemotesShowAct)
 1458         remotesMenu.addAction(self.gitRemoteShowAct)
 1459         remotesMenu.addSeparator()
 1460         remotesMenu.addAction(self.gitRemoteAddAct)
 1461         remotesMenu.addAction(self.gitRemoteRenameAct)
 1462         remotesMenu.addAction(self.gitRemoteChangeUrlAct)
 1463         remotesMenu.addAction(self.gitRemoteCredentialsAct)
 1464         remotesMenu.addAction(self.gitRemoteRemoveAct)
 1465         remotesMenu.addAction(self.gitRemotePruneAct)
 1466         
 1467         cherrypickMenu = QMenu(self.tr("Cherry-pick"), menu)
 1468         cherrypickMenu.setIcon(UI.PixmapCache.getIcon("vcsGraft"))
 1469         cherrypickMenu.setTearOffEnabled(True)
 1470         cherrypickMenu.addAction(self.gitCherryPickAct)
 1471         cherrypickMenu.addAction(self.gitCherryPickContinueAct)
 1472         cherrypickMenu.addAction(self.gitCherryPickQuitAct)
 1473         cherrypickMenu.addAction(self.gitCherryPickAbortAct)
 1474         
 1475         stashMenu = QMenu(self.tr("Stash"), menu)
 1476         stashMenu.setTearOffEnabled(True)
 1477         stashMenu.addAction(self.gitStashAct)
 1478         stashMenu.addSeparator()
 1479         stashMenu.addAction(self.gitStashBrowserAct)
 1480         stashMenu.addAction(self.gitStashShowAct)
 1481         stashMenu.addSeparator()
 1482         stashMenu.addAction(self.gitStashApplyAct)
 1483         stashMenu.addAction(self.gitStashPopAct)
 1484         stashMenu.addSeparator()
 1485         stashMenu.addAction(self.gitStashBranchAct)
 1486         stashMenu.addSeparator()
 1487         stashMenu.addAction(self.gitStashDropAct)
 1488         stashMenu.addAction(self.gitStashClearAct)
 1489         
 1490         submodulesMenu = QMenu(self.tr("Submodules"), menu)
 1491         submodulesMenu.setTearOffEnabled(True)
 1492         submodulesMenu.addAction(self.gitSubmoduleAddAct)
 1493         submodulesMenu.addSeparator()
 1494         submodulesMenu.addAction(self.gitSubmodulesInitAct)
 1495         submodulesMenu.addAction(self.gitSubmodulesUpdateInitAct)
 1496         submodulesMenu.addAction(self.gitSubmodulesDeinitAct)
 1497         submodulesMenu.addSeparator()
 1498         submodulesMenu.addAction(self.gitSubmodulesUpdateAct)
 1499         submodulesMenu.addAction(self.gitSubmodulesUpdateRemoteAct)
 1500         submodulesMenu.addAction(self.gitSubmodulesUpdateOptionsAct)
 1501         submodulesMenu.addSeparator()
 1502         submodulesMenu.addAction(self.gitSubmodulesSyncAct)
 1503         submodulesMenu.addSeparator()
 1504         submodulesMenu.addAction(self.gitSubmodulesListAct)
 1505         submodulesMenu.addSeparator()
 1506         submodulesMenu.addAction(self.gitSubmodulesStatusAct)
 1507         submodulesMenu.addAction(self.gitSubmodulesSummaryAct)
 1508         
 1509         act = menu.addAction(
 1510             UI.PixmapCache.getIcon(
 1511                 os.path.join("VcsPlugins", "vcsGit", "icons", "git.svg")),
 1512             self.vcs.vcsName(), self._vcsInfoDisplay)
 1513         font = act.font()
 1514         font.setBold(True)
 1515         act.setFont(font)
 1516         menu.addSeparator()
 1517         
 1518         menu.addAction(self.gitFetchAct)
 1519         menu.addAction(self.gitPullAct)
 1520         menu.addSeparator()
 1521         menu.addAction(self.vcsCommitAct)
 1522         menu.addAction(self.gitPushAct)
 1523         menu.addSeparator()
 1524         menu.addMenu(changesMenu)
 1525         menu.addMenu(stashMenu)
 1526         menu.addSeparator()
 1527         menu.addMenu(cherrypickMenu)
 1528         menu.addSeparator()
 1529         menu.addMenu(bundleMenu)
 1530         menu.addMenu(patchMenu)
 1531         menu.addSeparator()
 1532         menu.addMenu(remotesMenu)
 1533         menu.addMenu(submodulesMenu)
 1534         menu.addSeparator()
 1535         menu.addMenu(tagsMenu)
 1536         menu.addMenu(branchesMenu)
 1537         menu.addSeparator()
 1538         menu.addAction(self.gitLogBrowserAct)
 1539         menu.addSeparator()
 1540         menu.addAction(self.vcsStatusAct)
 1541         menu.addSeparator()
 1542         menu.addAction(self.vcsDiffAct)
 1543         menu.addAction(self.gitExtDiffAct)
 1544         menu.addSeparator()
 1545         menu.addAction(self.vcsSwitchAct)
 1546         menu.addSeparator()
 1547         menu.addMenu(bisectMenu)
 1548         menu.addSeparator()
 1549         menu.addAction(self.vcsCleanupAct)
 1550         menu.addSeparator()
 1551         menu.addAction(self.vcsCommandAct)
 1552         menu.addSeparator()
 1553         menu.addMenu(adminMenu)
 1554         menu.addSeparator()
 1555         menu.addAction(self.gitEditUserConfigAct)
 1556         menu.addAction(self.gitConfigAct)
 1557         menu.addSeparator()
 1558         menu.addAction(self.vcsNewAct)
 1559         menu.addAction(self.vcsExportAct)
 1560     
 1561     def initToolbar(self, ui, toolbarManager):
 1562         """
 1563         Public slot to initialize the VCS toolbar.
 1564         
 1565         @param ui reference to the main window (UserInterface)
 1566         @param toolbarManager reference to a toolbar manager object
 1567             (E5ToolBarManager)
 1568         """
 1569         self.__toolbar = QToolBar(self.tr("Git"), ui)
 1570         self.__toolbar.setIconSize(UI.Config.ToolBarIconSize)
 1571         self.__toolbar.setObjectName("GitToolbar")
 1572         self.__toolbar.setToolTip(self.tr('Git'))
 1573         
 1574         self.__toolbar.addAction(self.gitLogBrowserAct)
 1575         self.__toolbar.addAction(self.vcsStatusAct)
 1576         self.__toolbar.addSeparator()
 1577         self.__toolbar.addAction(self.vcsDiffAct)
 1578         self.__toolbar.addSeparator()
 1579         self.__toolbar.addAction(self.vcsNewAct)
 1580         self.__toolbar.addAction(self.vcsExportAct)
 1581         self.__toolbar.addSeparator()
 1582         
 1583         title = self.__toolbar.windowTitle()
 1584         toolbarManager.addToolBar(self.__toolbar, title)
 1585         toolbarManager.addAction(self.gitFetchAct, title)
 1586         toolbarManager.addAction(self.gitPullAct, title)
 1587         toolbarManager.addAction(self.vcsCommitAct, title)
 1588         toolbarManager.addAction(self.gitPushAct, title)
 1589         toolbarManager.addAction(self.gitReflogBrowserAct, title)
 1590         toolbarManager.addAction(self.gitExtDiffAct, title)
 1591         toolbarManager.addAction(self.vcsSwitchAct, title)
 1592         toolbarManager.addAction(self.vcsTagAct, title)
 1593         toolbarManager.addAction(self.gitBranchAct, title)
 1594         toolbarManager.addAction(self.vcsRevertAct, title)
 1595         toolbarManager.addAction(self.gitUnstageAct, title)
 1596         toolbarManager.addAction(self.vcsMergeAct, title)
 1597         toolbarManager.addAction(self.gitCherryPickAct, title)
 1598         toolbarManager.addAction(self.gitBisectLogBrowserAct, title)
 1599         
 1600         self.__toolbar.setEnabled(False)
 1601         self.__toolbar.setVisible(False)
 1602         
 1603         ui.registerToolbar("git", self.__toolbar.windowTitle(),
 1604                            self.__toolbar, "vcs")
 1605         ui.addToolBar(self.__toolbar)
 1606     
 1607     def removeToolbar(self, ui, toolbarManager):
 1608         """
 1609         Public method to remove a toolbar created by initToolbar().
 1610         
 1611         @param ui reference to the main window (UserInterface)
 1612         @param toolbarManager reference to a toolbar manager object
 1613             (E5ToolBarManager)
 1614         """
 1615         ui.removeToolBar(self.__toolbar)
 1616         ui.unregisterToolbar("git")
 1617         
 1618         title = self.__toolbar.windowTitle()
 1619         toolbarManager.removeCategoryActions(title)
 1620         toolbarManager.removeToolBar(self.__toolbar)
 1621         
 1622         self.__toolbar.deleteLater()
 1623         self.__toolbar = None
 1624     
 1625     def shutdown(self):
 1626         """
 1627         Public method to perform shutdown actions.
 1628         """
 1629         # close torn off sub menus
 1630         for menu in self.subMenus:
 1631             if menu.isTearOffMenuVisible():
 1632                 menu.hideTearOffMenu()
 1633     
 1634     def __gitTagList(self):
 1635         """
 1636         Private slot used to list the tags of the project.
 1637         """
 1638         self.vcs.gitListTagBranch(self.project.getProjectPath(), True)
 1639     
 1640     def __gitDescribeTag(self):
 1641         """
 1642         Private slot to show the most recent tag.
 1643         """
 1644         self.vcs.gitDescribe(self.project.getProjectPath(), [])
 1645     
 1646     def __gitBranchList(self):
 1647         """
 1648         Private slot used to list the branches of the project.
 1649         """
 1650         self.vcs.gitListTagBranch(self.project.getProjectPath(), False)
 1651     
 1652     def __gitMergedBranchList(self):
 1653         """
 1654         Private slot used to list the merged branches of the project.
 1655         """
 1656         self.vcs.gitListTagBranch(self.project.getProjectPath(), False,
 1657                                   listAll=False, merged=True)
 1658     
 1659     def __gitNotMergedBranchList(self):
 1660         """
 1661         Private slot used to list the not merged branches of the project.
 1662         """
 1663         self.vcs.gitListTagBranch(self.project.getProjectPath(), False,
 1664                                   listAll=False, merged=False)
 1665     
 1666     def __gitBranch(self):
 1667         """
 1668         Private slot used to perform branch operations for the project.
 1669         """
 1670         pfile = self.project.getProjectFile()
 1671         lastModified = QFileInfo(pfile).lastModified().toString()
 1672         shouldReopen = (
 1673             self.vcs.gitBranch(self.project.getProjectPath())[1] or
 1674             QFileInfo(pfile).lastModified().toString() != lastModified
 1675         )
 1676         if shouldReopen:
 1677             res = E5MessageBox.yesNo(
 1678                 self.parent(),
 1679                 self.tr("Branch"),
 1680                 self.tr("""The project should be reread. Do this now?"""),
 1681                 yesDefault=True)
 1682             if res:
 1683                 self.project.reopenProject()
 1684     
 1685     def __gitDeleteBranch(self):
 1686         """
 1687         Private slot used to delete a branch from a remote repository.
 1688         """
 1689         self.vcs.gitDeleteRemoteBranch(self.project.getProjectPath())
 1690     
 1691     def __gitShowBranch(self):
 1692         """
 1693         Private slot used to show the current branch for the project.
 1694         """
 1695         self.vcs.gitShowBranch(self.project.getProjectPath())
 1696     
 1697     def __gitExtendedDiff(self):
 1698         """
 1699         Private slot used to perform a git diff with the selection of
 1700         revisions.
 1701         """
 1702         self.vcs.gitExtendedDiff(self.project.getProjectPath())
 1703     
 1704     def __gitFetch(self):
 1705         """
 1706         Private slot used to fetch changes from a remote repository.
 1707         """
 1708         self.vcs.gitFetch(self.project.getProjectPath())
 1709     
 1710     def __gitPull(self):
 1711         """
 1712         Private slot used to pull changes from a remote repository.
 1713         """
 1714         pfile = self.project.getProjectFile()
 1715         lastModified = QFileInfo(pfile).lastModified().toString()
 1716         shouldReopen = (
 1717             self.vcs.gitPull(self.project.getProjectPath()) or
 1718             QFileInfo(pfile).lastModified().toString() != lastModified
 1719         )
 1720         if shouldReopen:
 1721             res = E5MessageBox.yesNo(
 1722                 self.parent(),
 1723                 self.tr("Pull"),
 1724                 self.tr("""The project should be reread. Do this now?"""),
 1725                 yesDefault=True)
 1726             if res:
 1727                 self.project.reopenProject()
 1728     
 1729     def __gitPush(self):
 1730         """
 1731         Private slot used to push changes to a remote repository.
 1732         """
 1733         self.vcs.gitPush(self.project.getProjectPath())
 1734     
 1735     def __gitRevert(self):
 1736         """
 1737         Private slot used to revert changes made to the local project.
 1738         """
 1739         pfile = self.project.getProjectFile()
 1740         lastModified = QFileInfo(pfile).lastModified().toString()
 1741         shouldReopen = (
 1742             self.vcs.gitRevert(self.project.getProjectPath()) or
 1743             QFileInfo(pfile).lastModified().toString() != lastModified
 1744         )
 1745         if shouldReopen:
 1746             res = E5MessageBox.yesNo(
 1747                 self.parent(),
 1748                 self.tr("Revert Changes"),
 1749                 self.tr("""The project should be reread. Do this now?"""),
 1750                 yesDefault=True)
 1751             if res:
 1752                 self.project.reopenProject()
 1753     
 1754     def __gitUnstage(self):
 1755         """
 1756         Private slot used to unstage changes made to the local project.
 1757         """
 1758         pfile = self.project.getProjectFile()
 1759         lastModified = QFileInfo(pfile).lastModified().toString()
 1760         shouldReopen = (
 1761             self.vcs.gitUnstage(self.project.getProjectPath()) or
 1762             QFileInfo(pfile).lastModified().toString() != lastModified
 1763         )
 1764         if shouldReopen:
 1765             res = E5MessageBox.yesNo(
 1766                 self.parent(),
 1767                 self.tr("Unstage Changes"),
 1768                 self.tr("""The project should be reread. Do this now?"""),
 1769                 yesDefault=True)
 1770             if res:
 1771                 self.project.reopenProject()
 1772     
 1773     def __gitCancelMerge(self):
 1774         """
 1775         Private slot used to cancel an uncommitted or failed merge.
 1776         """
 1777         self.vcs.gitCancelMerge(self.project.getProjectPath())
 1778     
 1779     def __gitCommitMerge(self):
 1780         """
 1781         Private slot used to commit the ongoing merge.
 1782         """
 1783         self.vcs.gitCommitMerge(self.project.getProjectPath())
 1784     
 1785     def __gitShowRemotes(self):
 1786         """
 1787         Private slot used to show the available remote repositories.
 1788         """
 1789         self.vcs.gitShowRemotes(self.project.getProjectPath())
 1790     
 1791     def __gitShowRemote(self):
 1792         """
 1793         Private slot used to show information about a remote repository.
 1794         """
 1795         remotes = self.vcs.gitGetRemotesList(self.project.getProjectPath())
 1796         remote, ok = QInputDialog.getItem(
 1797             None,
 1798             self.tr("Show Remote Info"),
 1799             self.tr("Select a remote repository:"),
 1800             remotes,
 1801             0, False)
 1802         if ok:
 1803             self.vcs.gitShowRemote(self.project.getProjectPath(), remote)
 1804     
 1805     def __gitAddRemote(self):
 1806         """
 1807         Private slot to add a remote repository.
 1808         """
 1809         self.vcs.gitAddRemote(self.project.getProjectPath())
 1810     
 1811     def __gitRemoveRemote(self):
 1812         """
 1813         Private slot to remove a remote repository.
 1814         """
 1815         remotes = self.vcs.gitGetRemotesList(self.project.getProjectPath())
 1816         remote, ok = QInputDialog.getItem(
 1817             None,
 1818             self.tr("Remove"),
 1819             self.tr("Select a remote repository:"),
 1820             remotes,
 1821             0, False)
 1822         if ok:
 1823             self.vcs.gitRemoveRemote(self.project.getProjectPath(), remote)
 1824     
 1825     def __gitPruneRemote(self):
 1826         """
 1827         Private slot to prune stale tracking branches of a remote repository.
 1828         """
 1829         remotes = self.vcs.gitGetRemotesList(self.project.getProjectPath())
 1830         remote, ok = QInputDialog.getItem(
 1831             None,
 1832             self.tr("Prune"),
 1833             self.tr("Select a remote repository:"),
 1834             remotes,
 1835             0, False)
 1836         if ok:
 1837             self.vcs.gitPruneRemote(self.project.getProjectPath(), remote)
 1838     
 1839     def __gitRenameRemote(self):
 1840         """
 1841         Private slot to rename a remote repository.
 1842         """
 1843         remotes = self.vcs.gitGetRemotesList(self.project.getProjectPath())
 1844         remote, ok = QInputDialog.getItem(
 1845             None,
 1846             self.tr("Rename"),
 1847             self.tr("Select a remote repository:"),
 1848             remotes,
 1849             0, False)
 1850         if ok:
 1851             self.vcs.gitRenameRemote(self.project.getProjectPath(), remote)
 1852     
 1853     def __gitChangeRemoteUrl(self):
 1854         """
 1855         Private slot to change the URL of a remote repository.
 1856         """
 1857         remotes = self.vcs.gitGetRemotesList(self.project.getProjectPath())
 1858         remote, ok = QInputDialog.getItem(
 1859             None,
 1860             self.tr("Rename"),
 1861             self.tr("Select a remote repository:"),
 1862             remotes,
 1863             0, False)
 1864         if ok:
 1865             self.vcs.gitChangeRemoteUrl(self.project.getProjectPath(), remote)
 1866     
 1867     def __gitRemoteCredentials(self):
 1868         """
 1869         Private slot to change or set the user credentials for a remote
 1870         repository.
 1871         """
 1872         remotes = self.vcs.gitGetRemotesList(self.project.getProjectPath())
 1873         remote, ok = QInputDialog.getItem(
 1874             None,
 1875             self.tr("Rename"),
 1876             self.tr("Select a remote repository:"),
 1877             remotes,
 1878             0, False)
 1879         if ok:
 1880             self.vcs.gitChangeRemoteCredentials(self.project.getProjectPath(),
 1881                                                 remote)
 1882     
 1883     def __gitCherryPick(self):
 1884         """
 1885         Private slot used to copy commits into the current branch.
 1886         """
 1887         pfile = self.project.getProjectFile()
 1888         lastModified = QFileInfo(pfile).lastModified().toString()
 1889         shouldReopen = (
 1890             self.vcs.gitCherryPick(self.project.getProjectPath()) or
 1891             QFileInfo(pfile).lastModified().toString() != lastModified
 1892         )
 1893         if shouldReopen:
 1894             res = E5MessageBox.yesNo(
 1895                 None,
 1896                 self.tr("Copy Commits"),
 1897                 self.tr("""The project should be reread. Do this now?"""),
 1898                 yesDefault=True)
 1899             if res:
 1900                 self.project.reopenProject()
 1901     
 1902     def __gitCherryPickContinue(self):
 1903         """
 1904         Private slot used to continue the last copying session after conflicts
 1905         were resolved.
 1906         """
 1907         pfile = self.project.getProjectFile()
 1908         lastModified = QFileInfo(pfile).lastModified().toString()
 1909         shouldReopen = (
 1910             self.vcs.gitCherryPickContinue(self.project.getProjectPath()) or
 1911             QFileInfo(pfile).lastModified().toString() != lastModified
 1912         )
 1913         if shouldReopen:
 1914             res = E5MessageBox.yesNo(
 1915                 None,
 1916                 self.tr("Copy Commits (Continue)"),
 1917                 self.tr("""The project should be reread. Do this now?"""),
 1918                 yesDefault=True)
 1919             if res:
 1920                 self.project.reopenProject()
 1921     
 1922     def __gitCherryPickQuit(self):
 1923         """
 1924         Private slot used to quit the current copying operation.
 1925         """
 1926         pfile = self.project.getProjectFile()
 1927         lastModified = QFileInfo(pfile).lastModified().toString()
 1928         shouldReopen = (
 1929             self.vcs.gitCherryPickQuit(self.project.getProjectPath()) or
 1930             QFileInfo(pfile).lastModified().toString() != lastModified
 1931         )
 1932         if shouldReopen:
 1933             res = E5MessageBox.yesNo(
 1934                 None,
 1935                 self.tr("Copy Commits (Quit)"),
 1936                 self.tr("""The project should be reread. Do this now?"""),
 1937                 yesDefault=True)
 1938             if res:
 1939                 self.project.reopenProject()
 1940     
 1941     def __gitCherryPickAbort(self):
 1942         """
 1943         Private slot used to cancel the last copying session and return to
 1944         the previous state.
 1945         """
 1946         pfile = self.project.getProjectFile()
 1947         lastModified = QFileInfo(pfile).lastModified().toString()
 1948         shouldReopen = (
 1949             self.vcs.gitCherryPickAbort(self.project.getProjectPath()) or
 1950             QFileInfo(pfile).lastModified().toString() != lastModified
 1951         )
 1952         if shouldReopen:
 1953             res = E5MessageBox.yesNo(
 1954                 None,
 1955                 self.tr("Copy Commits (Cancel)"),
 1956                 self.tr("""The project should be reread. Do this now?"""),
 1957                 yesDefault=True)
 1958             if res:
 1959                 self.project.reopenProject()
 1960     
 1961     def __gitStashSave(self):
 1962         """
 1963         Private slot to stash all current changes.
 1964         """
 1965         pfile = self.project.getProjectFile()
 1966         lastModified = QFileInfo(pfile).lastModified().toString()
 1967         shouldReopen = (
 1968             self.vcs.gitStashSave(self.project.getProjectPath()) or
 1969             QFileInfo(pfile).lastModified().toString() != lastModified
 1970         )
 1971         if shouldReopen:
 1972             res = E5MessageBox.yesNo(
 1973                 self.parent(),
 1974                 self.tr("Save Stash"),
 1975                 self.tr("""The project should be reread. Do this now?"""),
 1976                 yesDefault=True)
 1977             if res:
 1978                 self.project.reopenProject()
 1979     
 1980     def __gitStashBrowser(self):
 1981         """
 1982         Private slot used to show the stash browser dialog.
 1983         """
 1984         self.vcs.gitStashBrowser(self.project.getProjectPath())
 1985     
 1986     def __gitStashShow(self):
 1987         """
 1988         Private slot to show the contents of the selected stash.
 1989         """
 1990         self.vcs.gitStashShowPatch(self.project.getProjectPath())
 1991     
 1992     def __gitStashApply(self):
 1993         """
 1994         Private slot to restore a stash and keep it.
 1995         """
 1996         pfile = self.project.getProjectFile()
 1997         lastModified = QFileInfo(pfile).lastModified().toString()
 1998         shouldReopen = (
 1999             self.vcs.gitStashApply(self.project.getProjectPath()) or
 2000             QFileInfo(pfile).lastModified().toString() != lastModified
 2001         )
 2002         if shouldReopen:
 2003             res = E5MessageBox.yesNo(
 2004                 self.parent(),
 2005                 self.tr("Restore Stash"),
 2006                 self.tr("""The project should be reread. Do this now?"""),
 2007                 yesDefault=True)
 2008             if res:
 2009                 self.project.reopenProject()
 2010     
 2011     def __gitStashPop(self):
 2012         """
 2013         Private slot to restore a stash and delete it.
 2014         """
 2015         pfile = self.project.getProjectFile()
 2016         lastModified = QFileInfo(pfile).lastModified().toString()
 2017         shouldReopen = (
 2018             self.vcs.gitStashPop(self.project.getProjectPath()) or
 2019             QFileInfo(pfile).lastModified().toString() != lastModified
 2020         )
 2021         if shouldReopen:
 2022             res = E5MessageBox.yesNo(
 2023                 self.parent(),
 2024                 self.tr("Restore Stash"),
 2025                 self.tr("""The project should be reread. Do this now?"""),
 2026                 yesDefault=True)
 2027             if res:
 2028                 self.project.reopenProject()
 2029     
 2030     def __gitStashBranch(self):
 2031         """
 2032         Private slot to create a new branch and restore a stash into it.
 2033         """
 2034         pfile = self.project.getProjectFile()
 2035         lastModified = QFileInfo(pfile).lastModified().toString()
 2036         shouldReopen = (
 2037             self.vcs.gitStashBranch(self.project.getProjectPath()) or
 2038             QFileInfo(pfile).lastModified().toString() != lastModified
 2039         )
 2040         if shouldReopen:
 2041             res = E5MessageBox.yesNo(
 2042                 self.parent(),
 2043                 self.tr("Create Branch"),
 2044                 self.tr("""The project should be reread. Do this now?"""),
 2045                 yesDefault=True)
 2046             if res:
 2047                 self.project.reopenProject()
 2048     
 2049     def __gitStashDrop(self):
 2050         """
 2051         Private slot to drop a stash.
 2052         """
 2053         self.vcs.gitStashDrop(self.project.getProjectPath())
 2054     
 2055     def __gitStashClear(self):
 2056         """
 2057         Private slot to clear all stashes.
 2058         """
 2059         self.vcs.gitStashClear(self.project.getProjectPath())
 2060     
 2061     def __gitConfigure(self):
 2062         """
 2063         Private method to open the configuration dialog.
 2064         """
 2065         e5App().getObject("UserInterface").showPreferences("zzz_gitPage")
 2066     
 2067     def __gitEditUserConfig(self):
 2068         """
 2069         Private slot used to edit the user configuration file.
 2070         """
 2071         self.vcs.gitEditUserConfig()
 2072     
 2073     def __gitEditRepoConfig(self):
 2074         """
 2075         Private slot used to edit the repository configuration file.
 2076         """
 2077         self.vcs.gitEditConfig(self.project.getProjectPath())
 2078     
 2079     def __gitCreateIgnore(self):
 2080         """
 2081         Private slot used to create a .gitignore file for the project.
 2082         """
 2083         self.vcs.gitCreateIgnoreFile(self.project.getProjectPath(),
 2084                                      autoAdd=True)
 2085     
 2086     def __gitShowConfig(self):
 2087         """
 2088         Private slot used to show the combined configuration.
 2089         """
 2090         self.vcs.gitShowConfig(self.project.getProjectPath())
 2091     
 2092     def __gitVerify(self):
 2093         """
 2094         Private slot used to verify the connectivity and validity of objects
 2095         of the database.
 2096         """
 2097         self.vcs.gitVerify(self.project.getProjectPath())
 2098     
 2099     def __gitHouseKeeping(self):
 2100         """
 2101         Private slot used to cleanup and optimize the local repository.
 2102         """
 2103         self.vcs.gitHouseKeeping(self.project.getProjectPath())
 2104     
 2105     def __gitStatistics(self):
 2106         """
 2107         Private slot used to show some statistics of the local repository.
 2108         """
 2109         self.vcs.gitStatistics(self.project.getProjectPath())
 2110     
 2111     def __gitCreateArchive(self):
 2112         """
 2113         Private slot used to create an archive from the local repository.
 2114         """
 2115         self.vcs.gitCreateArchive(self.project.getProjectPath())
 2116     
 2117     def __gitReflogBrowser(self):
 2118         """
 2119         Private slot to show the reflog of the current project.
 2120         """
 2121         self.vcs.gitReflogBrowser(self.project.getProjectPath())
 2122     
 2123     def __gitBundle(self):
 2124         """
 2125         Private slot used to create a bundle file.
 2126         """
 2127         self.vcs.gitBundle(self.project.getProjectPath())
 2128     
 2129     def __gitVerifyBundle(self):
 2130         """
 2131         Private slot used to verify a bundle file.
 2132         """
 2133         self.vcs.gitVerifyBundle(self.project.getProjectPath())
 2134     
 2135     def __gitBundleListHeads(self):
 2136         """
 2137         Private slot used to list the heads contained in a bundle file.
 2138         """
 2139         self.vcs.gitBundleListHeads(self.project.getProjectPath())
 2140     
 2141     def __gitBundleFetch(self):
 2142         """
 2143         Private slot to apply a head of a bundle file using the fetch method.
 2144         """
 2145         self.vcs.gitBundleFetch(self.project.getProjectPath())
 2146     
 2147     def __gitBundlePull(self):
 2148         """
 2149         Private slot to apply a head of a bundle file using the pull method.
 2150         """
 2151         pfile = self.project.getProjectFile()
 2152         lastModified = QFileInfo(pfile).lastModified().toString()
 2153         shouldReopen = (
 2154             self.vcs.gitBundlePull(self.project.getProjectPath()) or
 2155             QFileInfo(pfile).lastModified().toString() != lastModified
 2156         )
 2157         if shouldReopen:
 2158             res = E5MessageBox.yesNo(
 2159                 self.parent(),
 2160                 self.tr("Apply Bundle (pull)"),
 2161                 self.tr("""The project should be reread. Do this now?"""),
 2162                 yesDefault=True)
 2163             if res:
 2164                 self.project.reopenProject()
 2165     
 2166     def __gitBisectStart(self):
 2167         """
 2168         Private slot used to execute the bisect start command.
 2169         """
 2170         self.vcs.gitBisect(self.project.getProjectPath(), "start")
 2171     
 2172     def __gitBisectStartExtended(self):
 2173         """
 2174         Private slot used to execute the bisect start command with options.
 2175         """
 2176         pfile = self.project.getProjectFile()
 2177         lastModified = QFileInfo(pfile).lastModified().toString()
 2178         shouldReopen = (
 2179             self.vcs.gitBisect(self.project.getProjectPath(),
 2180                                "start_extended") or
 2181             QFileInfo(pfile).lastModified().toString() != lastModified
 2182         )
 2183         if shouldReopen:
 2184             res = E5MessageBox.yesNo(
 2185                 self.parent(),
 2186                 self.tr("Bisect"),
 2187                 self.tr("""The project should be reread. Do this now?"""),
 2188                 yesDefault=True)
 2189             if res:
 2190                 self.project.reopenProject()
 2191     
 2192     def __gitBisectGood(self):
 2193         """
 2194         Private slot used to execute the bisect good command.
 2195         """
 2196         pfile = self.project.getProjectFile()
 2197         lastModified = QFileInfo(pfile).lastModified().toString()
 2198         shouldReopen = (
 2199             self.vcs.gitBisect(self.project.getProjectPath(), "good") or
 2200             QFileInfo(pfile).lastModified().toString() != lastModified
 2201         )
 2202         if shouldReopen:
 2203             res = E5MessageBox.yesNo(
 2204                 self.parent(),
 2205                 self.tr("Bisect"),
 2206                 self.tr("""The project should be reread. Do this now?"""),
 2207                 yesDefault=True)
 2208             if res:
 2209                 self.project.reopenProject()
 2210     
 2211     def __gitBisectBad(self):
 2212         """
 2213         Private slot used to execute the bisect bad command.
 2214         """
 2215         pfile = self.project.getProjectFile()
 2216         lastModified = QFileInfo(pfile).lastModified().toString()
 2217         shouldReopen = (
 2218             self.vcs.gitBisect(self.project.getProjectPath(), "bad") or
 2219             QFileInfo(pfile).lastModified().toString() != lastModified
 2220         )
 2221         if shouldReopen:
 2222             res = E5MessageBox.yesNo(
 2223                 self.parent(),
 2224                 self.tr("Bisect"),
 2225                 self.tr("""The project should be reread. Do this now?"""),
 2226                 yesDefault=True)
 2227             if res:
 2228                 self.project.reopenProject()
 2229     
 2230     def __gitBisectSkip(self):
 2231         """
 2232         Private slot used to execute the bisect skip command.
 2233         """
 2234         pfile = self.project.getProjectFile()
 2235         lastModified = QFileInfo(pfile).lastModified().toString()
 2236         shouldReopen = (
 2237             self.vcs.gitBisect(self.project.getProjectPath(), "skip") or
 2238             QFileInfo(pfile).lastModified().toString() != lastModified
 2239         )
 2240         if shouldReopen:
 2241             res = E5MessageBox.yesNo(
 2242                 self.parent(),
 2243                 self.tr("Bisect"),
 2244                 self.tr("""The project should be reread. Do this now?"""),
 2245                 yesDefault=True)
 2246             if res:
 2247                 self.project.reopenProject()
 2248     
 2249     def __gitBisectReset(self):
 2250         """
 2251         Private slot used to execute the bisect reset command.
 2252         """
 2253         pfile = self.project.getProjectFile()
 2254         lastModified = QFileInfo(pfile).lastModified().toString()
 2255         shouldReopen = (
 2256             self.vcs.gitBisect(self.project.getProjectPath(), "reset") or
 2257             QFileInfo(pfile).lastModified().toString() != lastModified
 2258         )
 2259         if shouldReopen:
 2260             res = E5MessageBox.yesNo(
 2261                 self.parent(),
 2262                 self.tr("Bisect"),
 2263                 self.tr("""The project should be reread. Do this now?"""),
 2264                 yesDefault=True)
 2265             if res:
 2266                 self.project.reopenProject()
 2267     
 2268     def __gitBisectLogBrowser(self):
 2269         """
 2270         Private slot used to show the bisect log browser window.
 2271         """
 2272         self.vcs.gitBisectLogBrowser(self.project.getProjectPath())
 2273     
 2274     def __gitBisectCreateReplay(self):
 2275         """
 2276         Private slot used to create a replay file for the current bisect
 2277         session.
 2278         """
 2279         self.vcs.gitBisectCreateReplayFile(self.project.getProjectPath())
 2280     
 2281     def __gitBisectEditReplay(self):
 2282         """
 2283         Private slot used to edit a bisect replay file.
 2284         """
 2285         self.vcs.gitBisectEditReplayFile(self.project.getProjectPath())
 2286     
 2287     def __gitBisectReplay(self):
 2288         """
 2289         Private slot used to replay a bisect session.
 2290         """
 2291         pfile = self.project.getProjectFile()
 2292         lastModified = QFileInfo(pfile).lastModified().toString()
 2293         shouldReopen = (
 2294             self.vcs.gitBisectReplay(self.project.getProjectPath()) or
 2295             QFileInfo(pfile).lastModified().toString() != lastModified
 2296         )
 2297         if shouldReopen:
 2298             res = E5MessageBox.yesNo(
 2299                 self.parent(),
 2300                 self.tr("Bisect"),
 2301                 self.tr("""The project should be reread. Do this now?"""),
 2302                 yesDefault=True)
 2303             if res:
 2304                 self.project.reopenProject()
 2305     
 2306     def __gitCheckPatches(self):
 2307         """
 2308         Private slot to check a list of patch files, if they would apply
 2309         cleanly.
 2310         """
 2311         self.vcs.gitApplyCheckPatches(self.project.getProjectPath(),
 2312                                       check=True)
 2313     
 2314     def __gitApplyPatches(self):
 2315         """
 2316         Private slot to apply a list of patch files.
 2317         """
 2318         pfile = self.project.getProjectFile()
 2319         lastModified = QFileInfo(pfile).lastModified().toString()
 2320         self.vcs.gitApplyCheckPatches(self.project.getProjectPath())
 2321         if QFileInfo(pfile).lastModified().toString() != lastModified:
 2322             res = E5MessageBox.yesNo(
 2323                 self.parent(),
 2324                 self.tr("Apply patch files"),
 2325                 self.tr("""The project should be reread. Do this now?"""),
 2326                 yesDefault=True)
 2327             if res:
 2328                 self.project.reopenProject()
 2329     
 2330     def __gitShowPatchStatistics(self):
 2331         """
 2332         Private slot to show some patch statistics.
 2333         """
 2334         self.vcs.gitShowPatchesStatistics(self.project.getProjectPath())
 2335     
 2336     def __gitSubmoduleAdd(self):
 2337         """
 2338         Private slot to add a submodule to the current project.
 2339         """
 2340         self.vcs.gitSubmoduleAdd(self.project.getProjectPath())
 2341     
 2342     def __gitSubmodulesList(self):
 2343         """
 2344         Private slot to list the submodules defined for the current project.
 2345         """
 2346         self.vcs.gitSubmoduleList(self.project.getProjectPath())
 2347     
 2348     def __gitSubmodulesInit(self):
 2349         """
 2350         Private slot to initialize submodules of the project.
 2351         """
 2352         self.vcs.gitSubmoduleInit(self.project.getProjectPath())
 2353     
 2354     def __gitSubmodulesDeinit(self):
 2355         """
 2356         Private slot to unregister submodules of the project.
 2357         """
 2358         self.vcs.gitSubmoduleDeinit(self.project.getProjectPath())
 2359     
 2360     def __gitSubmodulesUpdate(self):
 2361         """
 2362         Private slot to update submodules of the project.
 2363         """
 2364         self.vcs.gitSubmoduleUpdate(self.project.getProjectPath())
 2365     
 2366     def __gitSubmodulesUpdateInit(self):
 2367         """
 2368         Private slot to initialize and update submodules of the project.
 2369         """
 2370         self.vcs.gitSubmoduleUpdate(self.project.getProjectPath(),
 2371                                     initialize=True)
 2372     
 2373     def __gitSubmodulesUpdateRemote(self):
 2374         """
 2375         Private slot to fetch and update submodules of the project.
 2376         """
 2377         self.vcs.gitSubmoduleUpdate(self.project.getProjectPath(),
 2378                                     remote=True)
 2379     
 2380     def __gitSubmodulesUpdateOptions(self):
 2381         """
 2382         Private slot to update submodules of the project with options.
 2383         """
 2384         self.vcs.gitSubmoduleUpdateWithOptions(self.project.getProjectPath())
 2385     
 2386     def __gitSubmodulesSync(self):
 2387         """
 2388         Private slot to synchronize URLs of submodules of the project.
 2389         """
 2390         self.vcs.gitSubmoduleSync(self.project.getProjectPath())
 2391     
 2392     def __gitSubmodulesStatus(self):
 2393         """
 2394         Private slot to show the status of submodules of the project.
 2395         """
 2396         self.vcs.gitSubmoduleStatus(self.project.getProjectPath())
 2397     
 2398     def __gitSubmodulesSummary(self):
 2399         """
 2400         Private slot to show summary information for submodules of the project.
 2401         """
 2402         self.vcs.gitSubmoduleSummary(self.project.getProjectPath())