Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py

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

eric ide

mercurial