Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2847
1843ef6e2656
parent 3008
7848489bcb92
child 3058
0a02c433f52d
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
57 "rebase": RebaseProjectHelper(), 57 "rebase": RebaseProjectHelper(),
58 } 58 }
59 59
60 self.__extensionMenuTitles = {} 60 self.__extensionMenuTitles = {}
61 for extension in self.__extensions: 61 for extension in self.__extensions:
62 self.__extensionMenuTitles[self.__extensions[extension].menuTitle()] = \ 62 self.__extensionMenuTitles[
63 extension 63 self.__extensions[extension].menuTitle()] = extension
64 64
65 def setObjects(self, vcsObject, projectObject): 65 def setObjects(self, vcsObject, projectObject):
66 """ 66 """
67 Public method to set references to the vcs and project objects. 67 Public method to set references to the vcs and project objects.
68 68
98 """ 98 """
99 Public method to generate the action objects. 99 Public method to generate the action objects.
100 """ 100 """
101 self.vcsNewAct = E5Action(self.trUtf8('New from repository'), 101 self.vcsNewAct = E5Action(self.trUtf8('New from repository'),
102 UI.PixmapCache.getIcon("vcsCheckout.png"), 102 UI.PixmapCache.getIcon("vcsCheckout.png"),
103 self.trUtf8('&New from repository...'), 0, 0, self, 'mercurial_new') 103 self.trUtf8('&New from repository...'), 0, 0,
104 self, 'mercurial_new')
104 self.vcsNewAct.setStatusTip(self.trUtf8( 105 self.vcsNewAct.setStatusTip(self.trUtf8(
105 'Create (clone) a new project from a Mercurial repository' 106 'Create (clone) a new project from a Mercurial repository'
106 )) 107 ))
107 self.vcsNewAct.setWhatsThis(self.trUtf8( 108 self.vcsNewAct.setWhatsThis(self.trUtf8(
108 """<b>New from repository</b>""" 109 """<b>New from repository</b>"""
119 self.hgIncomingAct.setStatusTip(self.trUtf8( 120 self.hgIncomingAct.setStatusTip(self.trUtf8(
120 'Show the log of incoming changes' 121 'Show the log of incoming changes'
121 )) 122 ))
122 self.hgIncomingAct.setWhatsThis(self.trUtf8( 123 self.hgIncomingAct.setWhatsThis(self.trUtf8(
123 """<b>Show incoming log</b>""" 124 """<b>Show incoming log</b>"""
124 """<p>This shows the log of changes coming into the repository.</p>""" 125 """<p>This shows the log of changes coming into the"""
126 """ repository.</p>"""
125 )) 127 ))
126 self.hgIncomingAct.triggered[()].connect(self.__hgIncoming) 128 self.hgIncomingAct.triggered[()].connect(self.__hgIncoming)
127 self.actions.append(self.hgIncomingAct) 129 self.actions.append(self.hgIncomingAct)
128 130
129 self.hgPullAct = E5Action(self.trUtf8('Pull changes'), 131 self.hgPullAct = E5Action(self.trUtf8('Pull changes'),
148 self.vcsUpdateAct.setStatusTip(self.trUtf8( 150 self.vcsUpdateAct.setStatusTip(self.trUtf8(
149 'Update the local project from the Mercurial repository' 151 'Update the local project from the Mercurial repository'
150 )) 152 ))
151 self.vcsUpdateAct.setWhatsThis(self.trUtf8( 153 self.vcsUpdateAct.setWhatsThis(self.trUtf8(
152 """<b>Update from repository</b>""" 154 """<b>Update from repository</b>"""
153 """<p>This updates the local project from the Mercurial repository.</p>""" 155 """<p>This updates the local project from the Mercurial"""
156 """ repository.</p>"""
154 )) 157 ))
155 self.vcsUpdateAct.triggered[()].connect(self._vcsUpdate) 158 self.vcsUpdateAct.triggered[()].connect(self._vcsUpdate)
156 self.actions.append(self.vcsUpdateAct) 159 self.actions.append(self.vcsUpdateAct)
157 160
158 self.vcsCommitAct = E5Action(self.trUtf8('Commit changes to repository'), 161 self.vcsCommitAct = E5Action(
159 UI.PixmapCache.getIcon("vcsCommit.png"), 162 self.trUtf8('Commit changes to repository'),
160 self.trUtf8('&Commit changes to repository...'), 0, 0, self, 163 UI.PixmapCache.getIcon("vcsCommit.png"),
161 'mercurial_commit') 164 self.trUtf8('&Commit changes to repository...'), 0, 0, self,
165 'mercurial_commit')
162 self.vcsCommitAct.setStatusTip(self.trUtf8( 166 self.vcsCommitAct.setStatusTip(self.trUtf8(
163 'Commit changes to the local project to the Mercurial repository' 167 'Commit changes to the local project to the Mercurial repository'
164 )) 168 ))
165 self.vcsCommitAct.setWhatsThis(self.trUtf8( 169 self.vcsCommitAct.setWhatsThis(self.trUtf8(
166 """<b>Commit changes to repository</b>""" 170 """<b>Commit changes to repository</b>"""
177 self.hgOutgoingAct.setStatusTip(self.trUtf8( 181 self.hgOutgoingAct.setStatusTip(self.trUtf8(
178 'Show the log of outgoing changes' 182 'Show the log of outgoing changes'
179 )) 183 ))
180 self.hgOutgoingAct.setWhatsThis(self.trUtf8( 184 self.hgOutgoingAct.setWhatsThis(self.trUtf8(
181 """<b>Show outgoing log</b>""" 185 """<b>Show outgoing log</b>"""
182 """<p>This shows the log of changes outgoing out of the repository.</p>""" 186 """<p>This shows the log of changes outgoing out of the"""
187 """ repository.</p>"""
183 )) 188 ))
184 self.hgOutgoingAct.triggered[()].connect(self.__hgOutgoing) 189 self.hgOutgoingAct.triggered[()].connect(self.__hgOutgoing)
185 self.actions.append(self.hgOutgoingAct) 190 self.actions.append(self.hgOutgoingAct)
186 191
187 self.hgPushAct = E5Action(self.trUtf8('Push changes'), 192 self.hgPushAct = E5Action(self.trUtf8('Push changes'),
249 self.hgLogBrowserAct.setStatusTip(self.trUtf8( 254 self.hgLogBrowserAct.setStatusTip(self.trUtf8(
250 'Show a dialog to browse the log of the local project' 255 'Show a dialog to browse the log of the local project'
251 )) 256 ))
252 self.hgLogBrowserAct.setWhatsThis(self.trUtf8( 257 self.hgLogBrowserAct.setWhatsThis(self.trUtf8(
253 """<b>Show log browser</b>""" 258 """<b>Show log browser</b>"""
254 """<p>This shows a dialog to browse the log of the local project.""" 259 """<p>This shows a dialog to browse the log of the local"""
255 """ A limited number of entries is shown first. More can be""" 260 """ project. A limited number of entries is shown first."""
256 """ retrieved later on.</p>""" 261 """ More can be retrieved later on.</p>"""
257 )) 262 ))
258 self.hgLogBrowserAct.triggered[()].connect(self.__hgLogBrowser) 263 self.hgLogBrowserAct.triggered[()].connect(self.__hgLogBrowser)
259 self.actions.append(self.hgLogBrowserAct) 264 self.actions.append(self.hgLogBrowserAct)
260 265
261 self.vcsDiffAct = E5Action(self.trUtf8('Show difference'), 266 self.vcsDiffAct = E5Action(self.trUtf8('Show difference'),
265 self.vcsDiffAct.setStatusTip(self.trUtf8( 270 self.vcsDiffAct.setStatusTip(self.trUtf8(
266 'Show the difference of the local project to the repository' 271 'Show the difference of the local project to the repository'
267 )) 272 ))
268 self.vcsDiffAct.setWhatsThis(self.trUtf8( 273 self.vcsDiffAct.setWhatsThis(self.trUtf8(
269 """<b>Show difference</b>""" 274 """<b>Show difference</b>"""
270 """<p>This shows the difference of the local project to the repository.</p>""" 275 """<p>This shows the difference of the local project to the"""
276 """ repository.</p>"""
271 )) 277 ))
272 self.vcsDiffAct.triggered[()].connect(self._vcsDiff) 278 self.vcsDiffAct.triggered[()].connect(self._vcsDiff)
273 self.actions.append(self.vcsDiffAct) 279 self.actions.append(self.vcsDiffAct)
274 280
275 self.hgExtDiffAct = E5Action(self.trUtf8('Show difference (extended)'), 281 self.hgExtDiffAct = E5Action(self.trUtf8('Show difference (extended)'),
279 self.hgExtDiffAct.setStatusTip(self.trUtf8( 285 self.hgExtDiffAct.setStatusTip(self.trUtf8(
280 'Show the difference of revisions of the project to the repository' 286 'Show the difference of revisions of the project to the repository'
281 )) 287 ))
282 self.hgExtDiffAct.setWhatsThis(self.trUtf8( 288 self.hgExtDiffAct.setWhatsThis(self.trUtf8(
283 """<b>Show difference (extended)</b>""" 289 """<b>Show difference (extended)</b>"""
284 """<p>This shows the difference of selectable revisions of the project.</p>""" 290 """<p>This shows the difference of selectable revisions of the"""
291 """ project.</p>"""
285 )) 292 ))
286 self.hgExtDiffAct.triggered[()].connect(self.__hgExtendedDiff) 293 self.hgExtDiffAct.triggered[()].connect(self.__hgExtendedDiff)
287 self.actions.append(self.hgExtDiffAct) 294 self.actions.append(self.hgExtDiffAct)
288 295
289 self.vcsStatusAct = E5Action(self.trUtf8('Show status'), 296 self.vcsStatusAct = E5Action(self.trUtf8('Show status'),
376 self.vcsMergeAct.setStatusTip(self.trUtf8( 383 self.vcsMergeAct.setStatusTip(self.trUtf8(
377 'Merge changes of a revision into the local project' 384 'Merge changes of a revision into the local project'
378 )) 385 ))
379 self.vcsMergeAct.setWhatsThis(self.trUtf8( 386 self.vcsMergeAct.setWhatsThis(self.trUtf8(
380 """<b>Merge</b>""" 387 """<b>Merge</b>"""
381 """<p>This merges changes of a revision into the local project.</p>""" 388 """<p>This merges changes of a revision into the local"""
389 """ project.</p>"""
382 )) 390 ))
383 self.vcsMergeAct.triggered[()].connect(self._vcsMerge) 391 self.vcsMergeAct.triggered[()].connect(self._vcsMerge)
384 self.actions.append(self.vcsMergeAct) 392 self.actions.append(self.vcsMergeAct)
385 393
386 self.vcsResolveAct = E5Action(self.trUtf8('Conflicts resolved'), 394 self.vcsResolveAct = E5Action(self.trUtf8('Conflicts resolved'),
389 self.vcsResolveAct.setStatusTip(self.trUtf8( 397 self.vcsResolveAct.setStatusTip(self.trUtf8(
390 'Mark all conflicts of the local project as resolved' 398 'Mark all conflicts of the local project as resolved'
391 )) 399 ))
392 self.vcsResolveAct.setWhatsThis(self.trUtf8( 400 self.vcsResolveAct.setWhatsThis(self.trUtf8(
393 """<b>Conflicts resolved</b>""" 401 """<b>Conflicts resolved</b>"""
394 """<p>This marks all conflicts of the local project as resolved.</p>""" 402 """<p>This marks all conflicts of the local project as"""
403 """ resolved.</p>"""
395 )) 404 ))
396 self.vcsResolveAct.triggered[()].connect(self.__hgResolve) 405 self.vcsResolveAct.triggered[()].connect(self.__hgResolve)
397 self.actions.append(self.vcsResolveAct) 406 self.actions.append(self.vcsResolveAct)
398 407
399 self.vcsTagAct = E5Action(self.trUtf8('Tag in repository'), 408 self.vcsTagAct = E5Action(self.trUtf8('Tag in repository'),
453 462
454 self.hgPushBranchAct = E5Action(self.trUtf8('Push new branch'), 463 self.hgPushBranchAct = E5Action(self.trUtf8('Push new branch'),
455 self.trUtf8('Push new branch'), 464 self.trUtf8('Push new branch'),
456 0, 0, self, 'mercurial_push_branch') 465 0, 0, self, 'mercurial_push_branch')
457 self.hgPushBranchAct.setStatusTip(self.trUtf8( 466 self.hgPushBranchAct.setStatusTip(self.trUtf8(
458 'Push the current branch of the local project as a new named branch' 467 'Push the current branch of the local project as a new named'
468 ' branch'
459 )) 469 ))
460 self.hgPushBranchAct.setWhatsThis(self.trUtf8( 470 self.hgPushBranchAct.setWhatsThis(self.trUtf8(
461 """<b>Push new branch</b>""" 471 """<b>Push new branch</b>"""
462 """<p>This pushes the current branch of the local project""" 472 """<p>This pushes the current branch of the local project"""
463 """ as a new named branch.</p>""" 473 """ as a new named branch.</p>"""
498 self.vcsSwitchAct.setStatusTip(self.trUtf8( 508 self.vcsSwitchAct.setStatusTip(self.trUtf8(
499 'Switch the working directory to another revision' 509 'Switch the working directory to another revision'
500 )) 510 ))
501 self.vcsSwitchAct.setWhatsThis(self.trUtf8( 511 self.vcsSwitchAct.setWhatsThis(self.trUtf8(
502 """<b>Switch</b>""" 512 """<b>Switch</b>"""
503 """<p>This switches the working directory to another revision.</p>""" 513 """<p>This switches the working directory to another"""
514 """ revision.</p>"""
504 )) 515 ))
505 self.vcsSwitchAct.triggered[()].connect(self._vcsSwitch) 516 self.vcsSwitchAct.triggered[()].connect(self._vcsSwitch)
506 self.actions.append(self.vcsSwitchAct) 517 self.actions.append(self.vcsSwitchAct)
507 518
508 self.vcsCleanupAct = E5Action(self.trUtf8('Cleanup'), 519 self.vcsCleanupAct = E5Action(self.trUtf8('Cleanup'),
524 self.vcsCommandAct.setStatusTip(self.trUtf8( 535 self.vcsCommandAct.setStatusTip(self.trUtf8(
525 'Execute an arbitrary Mercurial command' 536 'Execute an arbitrary Mercurial command'
526 )) 537 ))
527 self.vcsCommandAct.setWhatsThis(self.trUtf8( 538 self.vcsCommandAct.setWhatsThis(self.trUtf8(
528 """<b>Execute command</b>""" 539 """<b>Execute command</b>"""
529 """<p>This opens a dialog to enter an arbitrary Mercurial command.</p>""" 540 """<p>This opens a dialog to enter an arbitrary Mercurial"""
541 """ command.</p>"""
530 )) 542 ))
531 self.vcsCommandAct.triggered[()].connect(self._vcsCommand) 543 self.vcsCommandAct.triggered[()].connect(self._vcsCommand)
532 self.actions.append(self.vcsCommandAct) 544 self.actions.append(self.vcsCommandAct)
533 545
534 self.vcsPropsAct = E5Action(self.trUtf8('Command options'), 546 self.vcsPropsAct = E5Action(self.trUtf8('Command options'),
535 self.trUtf8('Command &options...'), 0, 0, self, 547 self.trUtf8('Command &options...'), 0, 0, self,
536 'mercurial_options') 548 'mercurial_options')
537 self.vcsPropsAct.setStatusTip(self.trUtf8('Show the Mercurial command options')) 549 self.vcsPropsAct.setStatusTip(self.trUtf8(
550 'Show the Mercurial command options'))
538 self.vcsPropsAct.setWhatsThis(self.trUtf8( 551 self.vcsPropsAct.setWhatsThis(self.trUtf8(
539 """<b>Command options...</b>""" 552 """<b>Command options...</b>"""
540 """<p>This shows a dialog to edit the Mercurial command options.</p>""" 553 """<p>This shows a dialog to edit the Mercurial command"""
554 """ options.</p>"""
541 )) 555 ))
542 self.vcsPropsAct.triggered[()].connect(self._vcsCommandOptions) 556 self.vcsPropsAct.triggered[()].connect(self._vcsCommandOptions)
543 self.actions.append(self.vcsPropsAct) 557 self.actions.append(self.vcsPropsAct)
544 558
545 self.hgConfigAct = E5Action(self.trUtf8('Configure'), 559 self.hgConfigAct = E5Action(self.trUtf8('Configure'),
548 self.hgConfigAct.setStatusTip(self.trUtf8( 562 self.hgConfigAct.setStatusTip(self.trUtf8(
549 'Show the configuration dialog with the Mercurial page selected' 563 'Show the configuration dialog with the Mercurial page selected'
550 )) 564 ))
551 self.hgConfigAct.setWhatsThis(self.trUtf8( 565 self.hgConfigAct.setWhatsThis(self.trUtf8(
552 """<b>Configure</b>""" 566 """<b>Configure</b>"""
553 """<p>Show the configuration dialog with the Mercurial page selected.</p>""" 567 """<p>Show the configuration dialog with the Mercurial page"""
568 """ selected.</p>"""
554 )) 569 ))
555 self.hgConfigAct.triggered[()].connect(self.__hgConfigure) 570 self.hgConfigAct.triggered[()].connect(self.__hgConfigure)
556 self.actions.append(self.hgConfigAct) 571 self.actions.append(self.hgConfigAct)
557 572
558 self.hgEditUserConfigAct = E5Action(self.trUtf8('Edit user configuration'), 573 self.hgEditUserConfigAct = E5Action(
559 self.trUtf8('Edit user configuration...'), 574 self.trUtf8('Edit user configuration'),
560 0, 0, self, 'mercurial_user_configure') 575 self.trUtf8('Edit user configuration...'),
576 0, 0, self, 'mercurial_user_configure')
561 self.hgEditUserConfigAct.setStatusTip(self.trUtf8( 577 self.hgEditUserConfigAct.setStatusTip(self.trUtf8(
562 'Show an editor to edit the user configuration file' 578 'Show an editor to edit the user configuration file'
563 )) 579 ))
564 self.hgEditUserConfigAct.setWhatsThis(self.trUtf8( 580 self.hgEditUserConfigAct.setWhatsThis(self.trUtf8(
565 """<b>Edit user configuration</b>""" 581 """<b>Edit user configuration</b>"""
566 """<p>Show an editor to edit the user configuration file.</p>""" 582 """<p>Show an editor to edit the user configuration file.</p>"""
567 )) 583 ))
568 self.hgEditUserConfigAct.triggered[()].connect(self.__hgEditUserConfig) 584 self.hgEditUserConfigAct.triggered[()].connect(self.__hgEditUserConfig)
569 self.actions.append(self.hgEditUserConfigAct) 585 self.actions.append(self.hgEditUserConfigAct)
570 586
571 self.hgRepoConfigAct = E5Action(self.trUtf8('Edit repository configuration'), 587 self.hgRepoConfigAct = E5Action(
572 self.trUtf8('Edit repository configuration...'), 588 self.trUtf8('Edit repository configuration'),
573 0, 0, self, 'mercurial_repo_configure') 589 self.trUtf8('Edit repository configuration...'),
590 0, 0, self, 'mercurial_repo_configure')
574 self.hgRepoConfigAct.setStatusTip(self.trUtf8( 591 self.hgRepoConfigAct.setStatusTip(self.trUtf8(
575 'Show an editor to edit the repository configuration file' 592 'Show an editor to edit the repository configuration file'
576 )) 593 ))
577 self.hgRepoConfigAct.setWhatsThis(self.trUtf8( 594 self.hgRepoConfigAct.setWhatsThis(self.trUtf8(
578 """<b>Edit repository configuration</b>""" 595 """<b>Edit repository configuration</b>"""
579 """<p>Show an editor to edit the repository configuration file.</p>""" 596 """<p>Show an editor to edit the repository configuration"""
597 """ file.</p>"""
580 )) 598 ))
581 self.hgRepoConfigAct.triggered[()].connect(self.__hgEditRepoConfig) 599 self.hgRepoConfigAct.triggered[()].connect(self.__hgEditRepoConfig)
582 self.actions.append(self.hgRepoConfigAct) 600 self.actions.append(self.hgRepoConfigAct)
583 601
584 self.hgShowConfigAct = E5Action( 602 self.hgShowConfigAct = E5Action(
585 self.trUtf8('Show combined configuration settings'), 603 self.trUtf8('Show combined configuration settings'),
586 self.trUtf8('Show combined configuration settings...'), 604 self.trUtf8('Show combined configuration settings...'),
587 0, 0, self, 'mercurial_show_config') 605 0, 0, self, 'mercurial_show_config')
588 self.hgShowConfigAct.setStatusTip(self.trUtf8( 606 self.hgShowConfigAct.setStatusTip(self.trUtf8(
589 'Show the combined configuration settings from all configuration files' 607 'Show the combined configuration settings from all configuration'
608 ' files'
590 )) 609 ))
591 self.hgShowConfigAct.setWhatsThis(self.trUtf8( 610 self.hgShowConfigAct.setWhatsThis(self.trUtf8(
592 """<b>Show combined configuration settings</b>""" 611 """<b>Show combined configuration settings</b>"""
593 """<p>This shows the combined configuration settings""" 612 """<p>This shows the combined configuration settings"""
594 """ from all configuration files.</p>""" 613 """ from all configuration files.</p>"""
667 self.hgBundleAct.setStatusTip(self.trUtf8( 686 self.hgBundleAct.setStatusTip(self.trUtf8(
668 'Create changegroup file collecting changesets' 687 'Create changegroup file collecting changesets'
669 )) 688 ))
670 self.hgBundleAct.setWhatsThis(self.trUtf8( 689 self.hgBundleAct.setWhatsThis(self.trUtf8(
671 """<b>Create changegroup</b>""" 690 """<b>Create changegroup</b>"""
672 """<p>This creates a changegroup file collecting selected changesets""" 691 """<p>This creates a changegroup file collecting selected"""
673 """ (hg bundle).</p>""" 692 """ changesets (hg bundle).</p>"""
674 )) 693 ))
675 self.hgBundleAct.triggered[()].connect(self.__hgBundle) 694 self.hgBundleAct.triggered[()].connect(self.__hgBundle)
676 self.actions.append(self.hgBundleAct) 695 self.actions.append(self.hgBundleAct)
677 696
678 self.hgPreviewBundleAct = E5Action(self.trUtf8('Preview changegroup'), 697 self.hgPreviewBundleAct = E5Action(self.trUtf8('Preview changegroup'),
681 self.hgPreviewBundleAct.setStatusTip(self.trUtf8( 700 self.hgPreviewBundleAct.setStatusTip(self.trUtf8(
682 'Preview a changegroup file containing a collection of changesets' 701 'Preview a changegroup file containing a collection of changesets'
683 )) 702 ))
684 self.hgPreviewBundleAct.setWhatsThis(self.trUtf8( 703 self.hgPreviewBundleAct.setWhatsThis(self.trUtf8(
685 """<b>Preview changegroup</b>""" 704 """<b>Preview changegroup</b>"""
686 """<p>This previews a changegroup file containing a collection of""" 705 """<p>This previews a changegroup file containing a collection"""
687 """ changesets.</p>""" 706 """ of changesets.</p>"""
688 )) 707 ))
689 self.hgPreviewBundleAct.triggered[()].connect(self.__hgPreviewBundle) 708 self.hgPreviewBundleAct.triggered[()].connect(self.__hgPreviewBundle)
690 self.actions.append(self.hgPreviewBundleAct) 709 self.actions.append(self.hgPreviewBundleAct)
691 710
692 self.hgIdentifyBundleAct = E5Action(self.trUtf8('Identify changegroup'), 711 self.hgIdentifyBundleAct = E5Action(
693 self.trUtf8('Identify changegroup...'), 712 self.trUtf8('Identify changegroup'),
694 0, 0, self, 'mercurial_identify_bundle') 713 self.trUtf8('Identify changegroup...'),
714 0, 0, self, 'mercurial_identify_bundle')
695 self.hgIdentifyBundleAct.setStatusTip(self.trUtf8( 715 self.hgIdentifyBundleAct.setStatusTip(self.trUtf8(
696 'Identify a changegroup file containing a collection of changesets' 716 'Identify a changegroup file containing a collection of changesets'
697 )) 717 ))
698 self.hgIdentifyBundleAct.setWhatsThis(self.trUtf8( 718 self.hgIdentifyBundleAct.setWhatsThis(self.trUtf8(
699 """<b>Identify changegroup</b>""" 719 """<b>Identify changegroup</b>"""
700 """<p>This identifies a changegroup file containing a collection of""" 720 """<p>This identifies a changegroup file containing a"""
701 """ changesets.</p>""" 721 """ collection of changesets.</p>"""
702 )) 722 ))
703 self.hgIdentifyBundleAct.triggered[()].connect(self.__hgIdentifyBundle) 723 self.hgIdentifyBundleAct.triggered[()].connect(self.__hgIdentifyBundle)
704 self.actions.append(self.hgIdentifyBundleAct) 724 self.actions.append(self.hgIdentifyBundleAct)
705 725
706 self.hgUnbundleAct = E5Action(self.trUtf8('Apply changegroups'), 726 self.hgUnbundleAct = E5Action(self.trUtf8('Apply changegroups'),
788 self.hgRollbackAct.setStatusTip(self.trUtf8( 808 self.hgRollbackAct.setStatusTip(self.trUtf8(
789 'Rollback the last transaction' 809 'Rollback the last transaction'
790 )) 810 ))
791 self.hgRollbackAct.setWhatsThis(self.trUtf8( 811 self.hgRollbackAct.setWhatsThis(self.trUtf8(
792 """<b>Rollback last transaction</b>""" 812 """<b>Rollback last transaction</b>"""
793 """<p>This performs a rollback of the last transaction. Transactions""" 813 """<p>This performs a rollback of the last transaction."""
794 """ are used to encapsulate the effects of all commands that create new""" 814 """ Transactions are used to encapsulate the effects of all"""
795 """ changesets or propagate existing changesets into a repository.""" 815 """ commands that create new changesets or propagate existing"""
796 """ For example, the following commands are transactional, and""" 816 """ changesets into a repository. For example, the following"""
797 """ their effects can be rolled back:<ul>""" 817 """ commands are transactional, and their effects can be"""
818 """ rolled back:<ul>"""
798 """<li>commit</li>""" 819 """<li>commit</li>"""
799 """<li>import</li>""" 820 """<li>import</li>"""
800 """<li>pull</li>""" 821 """<li>pull</li>"""
801 """<li>push (with this repository as the destination)</li>""" 822 """<li>push (with this repository as the destination)</li>"""
802 """<li>unbundle</li>""" 823 """<li>unbundle</li>"""
803 """</ul>""" 824 """</ul>"""
804 """</p><p><strong>This command is dangerous. Please use with care.""" 825 """</p><p><strong>This command is dangerous. Please use with"""
805 """</strong></p>""" 826 """ care. </strong></p>"""
806 )) 827 ))
807 self.hgRollbackAct.triggered[()].connect(self.__hgRollback) 828 self.hgRollbackAct.triggered[()].connect(self.__hgRollback)
808 self.actions.append(self.hgRollbackAct) 829 self.actions.append(self.hgRollbackAct)
809 830
810 self.hgServeAct = E5Action(self.trUtf8('Serve project repository'), 831 self.hgServeAct = E5Action(self.trUtf8('Serve project repository'),
826 self.hgImportAct.setStatusTip(self.trUtf8( 847 self.hgImportAct.setStatusTip(self.trUtf8(
827 'Import a patch from a patch file' 848 'Import a patch from a patch file'
828 )) 849 ))
829 self.hgImportAct.setWhatsThis(self.trUtf8( 850 self.hgImportAct.setWhatsThis(self.trUtf8(
830 """<b>Import Patch</b>""" 851 """<b>Import Patch</b>"""
831 """<p>This imports a patch from a patch file into the project.</p>""" 852 """<p>This imports a patch from a patch file into the"""
853 """ project.</p>"""
832 )) 854 ))
833 self.hgImportAct.triggered[()].connect(self.__hgImport) 855 self.hgImportAct.triggered[()].connect(self.__hgImport)
834 self.actions.append(self.hgImportAct) 856 self.actions.append(self.hgImportAct)
835 857
836 self.hgExportAct = E5Action(self.trUtf8('Export Patches'), 858 self.hgExportAct = E5Action(self.trUtf8('Export Patches'),
867 'Copies changesets from another branch' 889 'Copies changesets from another branch'
868 )) 890 ))
869 self.hgGraftAct.setWhatsThis(self.trUtf8( 891 self.hgGraftAct.setWhatsThis(self.trUtf8(
870 """<b>Copy Changesets</b>""" 892 """<b>Copy Changesets</b>"""
871 """<p>This copies changesets from another branch on top of the""" 893 """<p>This copies changesets from another branch on top of the"""
872 """ current working directory with the user, date and description""" 894 """ current working directory with the user, date and"""
873 """ of the original changeset.</p>""" 895 """ description of the original changeset.</p>"""
874 )) 896 ))
875 self.hgGraftAct.triggered[()].connect(self.__hgGraft) 897 self.hgGraftAct.triggered[()].connect(self.__hgGraft)
876 self.actions.append(self.hgGraftAct) 898 self.actions.append(self.hgGraftAct)
877 899
878 self.hgGraftContinueAct = E5Action( 900 self.hgGraftContinueAct = E5Action(
882 self.hgGraftContinueAct.setStatusTip(self.trUtf8( 904 self.hgGraftContinueAct.setStatusTip(self.trUtf8(
883 'Continue the last copying session after conflicts were resolved' 905 'Continue the last copying session after conflicts were resolved'
884 )) 906 ))
885 self.hgGraftContinueAct.setWhatsThis(self.trUtf8( 907 self.hgGraftContinueAct.setWhatsThis(self.trUtf8(
886 """<b>Continue Copying Session</b>""" 908 """<b>Continue Copying Session</b>"""
887 """<p>This continues the last copying session after conflicts were""" 909 """<p>This continues the last copying session after conflicts"""
888 """ resolved.</p>""" 910 """ were resolved.</p>"""
889 )) 911 ))
890 self.hgGraftContinueAct.triggered[()].connect(self.__hgGraftContinue) 912 self.hgGraftContinueAct.triggered[()].connect(self.__hgGraftContinue)
891 self.actions.append(self.hgGraftContinueAct) 913 self.actions.append(self.hgGraftContinueAct)
892 914
893 self.hgAddSubrepoAct = E5Action( 915 self.hgAddSubrepoAct = E5Action(
915 )) 937 ))
916 self.hgRemoveSubreposAct.setWhatsThis(self.trUtf8( 938 self.hgRemoveSubreposAct.setWhatsThis(self.trUtf8(
917 """<b>Remove...</b>""" 939 """<b>Remove...</b>"""
918 """<p>Remove sub-repositories from the project.</p>""" 940 """<p>Remove sub-repositories from the project.</p>"""
919 )) 941 ))
920 self.hgRemoveSubreposAct.triggered[()].connect(self.__hgRemoveSubrepositories) 942 self.hgRemoveSubreposAct.triggered[()].connect(
943 self.__hgRemoveSubrepositories)
921 self.actions.append(self.hgRemoveSubreposAct) 944 self.actions.append(self.hgRemoveSubreposAct)
922 945
923 self.hgArchiveAct = E5Action(self.trUtf8('Create unversioned archive'), 946 self.hgArchiveAct = E5Action(self.trUtf8('Create unversioned archive'),
924 UI.PixmapCache.getIcon("vcsExport.png"), 947 UI.PixmapCache.getIcon("vcsExport.png"),
925 self.trUtf8('Create unversioned archive...'), 948 self.trUtf8('Create unversioned archive...'),
927 self.hgArchiveAct.setStatusTip(self.trUtf8( 950 self.hgArchiveAct.setStatusTip(self.trUtf8(
928 'Create an unversioned archive from the repository' 951 'Create an unversioned archive from the repository'
929 )) 952 ))
930 self.hgArchiveAct.setWhatsThis(self.trUtf8( 953 self.hgArchiveAct.setWhatsThis(self.trUtf8(
931 """<b>Create unversioned archive...</b>""" 954 """<b>Create unversioned archive...</b>"""
932 """<p>This creates an unversioned archive from the repository.</p>""" 955 """<p>This creates an unversioned archive from the"""
956 """ repository.</p>"""
933 )) 957 ))
934 self.hgArchiveAct.triggered[()].connect(self.__hgArchive) 958 self.hgArchiveAct.triggered[()].connect(self.__hgArchive)
935 self.actions.append(self.hgArchiveAct) 959 self.actions.append(self.hgArchiveAct)
936 960
937 def initMenu(self, menu): 961 def initMenu(self, menu):
1003 self.__extensionsMenu.aboutToShow.connect(self.__showExtensionMenu) 1027 self.__extensionsMenu.aboutToShow.connect(self.__showExtensionMenu)
1004 self.extensionMenus = {} 1028 self.extensionMenus = {}
1005 for extensionMenuTitle in sorted(self.__extensionMenuTitles): 1029 for extensionMenuTitle in sorted(self.__extensionMenuTitles):
1006 extensionName = self.__extensionMenuTitles[extensionMenuTitle] 1030 extensionName = self.__extensionMenuTitles[extensionMenuTitle]
1007 self.extensionMenus[extensionName] = self.__extensionsMenu.addMenu( 1031 self.extensionMenus[extensionName] = self.__extensionsMenu.addMenu(
1008 self.__extensions[extensionName].initMenu(self.__extensionsMenu)) 1032 self.__extensions[extensionName].initMenu(
1033 self.__extensionsMenu))
1009 self.vcs.activeExtensionsChanged.connect(self.__showExtensionMenu) 1034 self.vcs.activeExtensionsChanged.connect(self.__showExtensionMenu)
1010 1035
1011 if self.vcs.version >= (2, 0): 1036 if self.vcs.version >= (2, 0):
1012 graftMenu = QMenu(self.trUtf8("Graft"), menu) 1037 graftMenu = QMenu(self.trUtf8("Graft"), menu)
1013 graftMenu.setIcon(UI.PixmapCache.getIcon("vcsGraft.png")) 1038 graftMenu.setIcon(UI.PixmapCache.getIcon("vcsGraft.png"))
1025 else: 1050 else:
1026 subrepoMenu = None 1051 subrepoMenu = None
1027 1052
1028 act = menu.addAction( 1053 act = menu.addAction(
1029 UI.PixmapCache.getIcon( 1054 UI.PixmapCache.getIcon(
1030 os.path.join("VcsPlugins", "vcsMercurial", "icons", "mercurial.png")), 1055 os.path.join("VcsPlugins", "vcsMercurial", "icons",
1056 "mercurial.png")),
1031 self.vcs.vcsName(), self._vcsInfoDisplay) 1057 self.vcs.vcsName(), self._vcsInfoDisplay)
1032 font = act.font() 1058 font = act.font()
1033 font.setBold(True) 1059 font.setBold(True)
1034 act.setFont(font) 1060 act.setFont(font)
1035 menu.addSeparator() 1061 menu.addSeparator()
1122 """ 1148 """
1123 for extensionName in self.extensionMenus: 1149 for extensionName in self.extensionMenus:
1124 self.extensionMenus[extensionName].setEnabled( 1150 self.extensionMenus[extensionName].setEnabled(
1125 self.vcs.isExtensionActive(extensionName)) 1151 self.vcs.isExtensionActive(extensionName))
1126 if not self.extensionMenus[extensionName].isEnabled() and \ 1152 if not self.extensionMenus[extensionName].isEnabled() and \
1127 self.extensionMenus[extensionName].menu().isTearOffMenuVisible(): 1153 self.extensionMenus[extensionName].menu()\
1154 .isTearOffMenuVisible():
1128 self.extensionMenus[extensionName].menu().hideTearOffMenu() 1155 self.extensionMenus[extensionName].menu().hideTearOffMenu()
1129 1156
1130 def __hgExtendedDiff(self): 1157 def __hgExtendedDiff(self):
1131 """ 1158 """
1132 Private slot used to perform a hg diff with the selection of revisions. 1159 Private slot used to perform a hg diff with the selection of revisions.
1139 """ 1166 """
1140 self.vcs.hgLogBrowser(self.project.ppath) 1167 self.vcs.hgLogBrowser(self.project.ppath)
1141 1168
1142 def __hgIncoming(self): 1169 def __hgIncoming(self):
1143 """ 1170 """
1144 Private slot used to show the log of changes coming into the repository. 1171 Private slot used to show the log of changes coming into the
1172 repository.
1145 """ 1173 """
1146 self.vcs.hgIncoming(self.project.ppath) 1174 self.vcs.hgIncoming(self.project.ppath)
1147 1175
1148 def __hgOutgoing(self): 1176 def __hgOutgoing(self):
1149 """ 1177 """
1150 Private slot used to show the log of changes going out of the repository. 1178 Private slot used to show the log of changes going out of the
1179 repository.
1151 """ 1180 """
1152 self.vcs.hgOutgoing(self.project.ppath) 1181 self.vcs.hgOutgoing(self.project.ppath)
1153 1182
1154 def __hgPull(self): 1183 def __hgPull(self):
1155 """ 1184 """

eric ide

mercurial