|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2005 - 2022 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing the VCS project helper for Subversion. |
|
8 """ |
|
9 |
|
10 import os |
|
11 |
|
12 from PyQt6.QtWidgets import QToolBar |
|
13 |
|
14 from VCS.ProjectHelper import VcsProjectHelper |
|
15 |
|
16 from EricGui.EricAction import EricAction |
|
17 from EricWidgets.EricApplication import ericApp |
|
18 |
|
19 import UI.PixmapCache |
|
20 |
|
21 |
|
22 class SvnProjectHelper(VcsProjectHelper): |
|
23 """ |
|
24 Class implementing the VCS project helper for Subversion. |
|
25 """ |
|
26 def __init__(self, vcsObject, projectObject, parent=None, name=None): |
|
27 """ |
|
28 Constructor |
|
29 |
|
30 @param vcsObject reference to the vcs object |
|
31 @param projectObject reference to the project object |
|
32 @param parent parent widget (QWidget) |
|
33 @param name name of this object (string) |
|
34 """ |
|
35 VcsProjectHelper.__init__(self, vcsObject, projectObject, parent, name) |
|
36 |
|
37 def getActions(self): |
|
38 """ |
|
39 Public method to get a list of all actions. |
|
40 |
|
41 @return list of all actions (list of EricAction) |
|
42 """ |
|
43 return self.actions[:] |
|
44 |
|
45 def initActions(self): |
|
46 """ |
|
47 Public method to generate the action objects. |
|
48 """ |
|
49 self.vcsNewAct = EricAction( |
|
50 self.tr('New from repository'), |
|
51 UI.PixmapCache.getIcon("vcsCheckout"), |
|
52 self.tr('&New from repository...'), 0, 0, self, |
|
53 'subversion_new') |
|
54 self.vcsNewAct.setStatusTip(self.tr( |
|
55 'Create a new project from the VCS repository' |
|
56 )) |
|
57 self.vcsNewAct.setWhatsThis(self.tr( |
|
58 """<b>New from repository</b>""" |
|
59 """<p>This creates a new local project from the VCS""" |
|
60 """ repository.</p>""" |
|
61 )) |
|
62 self.vcsNewAct.triggered.connect(self._vcsCheckout) |
|
63 self.actions.append(self.vcsNewAct) |
|
64 |
|
65 self.vcsUpdateAct = EricAction( |
|
66 self.tr('Update from repository'), |
|
67 UI.PixmapCache.getIcon("vcsUpdate"), |
|
68 self.tr('&Update from repository'), 0, 0, self, |
|
69 'subversion_update') |
|
70 self.vcsUpdateAct.setStatusTip(self.tr( |
|
71 'Update the local project from the VCS repository' |
|
72 )) |
|
73 self.vcsUpdateAct.setWhatsThis(self.tr( |
|
74 """<b>Update from repository</b>""" |
|
75 """<p>This updates the local project from the VCS""" |
|
76 """ repository.</p>""" |
|
77 )) |
|
78 self.vcsUpdateAct.triggered.connect(self._vcsUpdate) |
|
79 self.actions.append(self.vcsUpdateAct) |
|
80 |
|
81 self.vcsCommitAct = EricAction( |
|
82 self.tr('Commit changes to repository'), |
|
83 UI.PixmapCache.getIcon("vcsCommit"), |
|
84 self.tr('&Commit changes to repository...'), 0, 0, self, |
|
85 'subversion_commit') |
|
86 self.vcsCommitAct.setStatusTip(self.tr( |
|
87 'Commit changes to the local project to the VCS repository' |
|
88 )) |
|
89 self.vcsCommitAct.setWhatsThis(self.tr( |
|
90 """<b>Commit changes to repository</b>""" |
|
91 """<p>This commits changes to the local project to the VCS""" |
|
92 """ repository.</p>""" |
|
93 )) |
|
94 self.vcsCommitAct.triggered.connect(self._vcsCommit) |
|
95 self.actions.append(self.vcsCommitAct) |
|
96 |
|
97 self.svnLogBrowserAct = EricAction( |
|
98 self.tr('Show log browser'), |
|
99 UI.PixmapCache.getIcon("vcsLog"), |
|
100 self.tr('Show log browser'), |
|
101 0, 0, self, 'subversion_log_browser') |
|
102 self.svnLogBrowserAct.setStatusTip(self.tr( |
|
103 'Show a dialog to browse the log of the local project' |
|
104 )) |
|
105 self.svnLogBrowserAct.setWhatsThis(self.tr( |
|
106 """<b>Show log browser</b>""" |
|
107 """<p>This shows a dialog to browse the log of the local""" |
|
108 """ project. A limited number of entries is shown first. More""" |
|
109 """ can be retrieved later on.</p>""" |
|
110 )) |
|
111 self.svnLogBrowserAct.triggered.connect(self._vcsLogBrowser) |
|
112 self.actions.append(self.svnLogBrowserAct) |
|
113 |
|
114 self.vcsDiffAct = EricAction( |
|
115 self.tr('Show differences'), |
|
116 UI.PixmapCache.getIcon("vcsDiff"), |
|
117 self.tr('Show &difference'), |
|
118 0, 0, self, 'subversion_diff') |
|
119 self.vcsDiffAct.setStatusTip(self.tr( |
|
120 'Show the difference of the local project to the repository' |
|
121 )) |
|
122 self.vcsDiffAct.setWhatsThis(self.tr( |
|
123 """<b>Show differences</b>""" |
|
124 """<p>This shows differences of the local project to the""" |
|
125 """ repository.</p>""" |
|
126 )) |
|
127 self.vcsDiffAct.triggered.connect(self._vcsDiff) |
|
128 self.actions.append(self.vcsDiffAct) |
|
129 |
|
130 self.svnExtDiffAct = EricAction( |
|
131 self.tr('Show differences (extended)'), |
|
132 UI.PixmapCache.getIcon("vcsDiff"), |
|
133 self.tr('Show differences (extended)'), |
|
134 0, 0, self, 'subversion_extendeddiff') |
|
135 self.svnExtDiffAct.setStatusTip(self.tr( |
|
136 'Show the difference of revisions of the project to the repository' |
|
137 )) |
|
138 self.svnExtDiffAct.setWhatsThis(self.tr( |
|
139 """<b>Show differences (extended)</b>""" |
|
140 """<p>This shows differences of selectable revisions of""" |
|
141 """ the project.</p>""" |
|
142 )) |
|
143 self.svnExtDiffAct.triggered.connect(self.__svnExtendedDiff) |
|
144 self.actions.append(self.svnExtDiffAct) |
|
145 |
|
146 self.svnUrlDiffAct = EricAction( |
|
147 self.tr('Show differences (URLs)'), |
|
148 UI.PixmapCache.getIcon("vcsDiff"), |
|
149 self.tr('Show differences (URLs)'), |
|
150 0, 0, self, 'subversion_urldiff') |
|
151 self.svnUrlDiffAct.setStatusTip(self.tr( |
|
152 'Show the difference of the project between two repository URLs' |
|
153 )) |
|
154 self.svnUrlDiffAct.setWhatsThis(self.tr( |
|
155 """<b>Show differences (URLs)</b>""" |
|
156 """<p>This shows differences of the project between""" |
|
157 """ two repository URLs.</p>""" |
|
158 )) |
|
159 self.svnUrlDiffAct.triggered.connect(self.__svnUrlDiff) |
|
160 self.actions.append(self.svnUrlDiffAct) |
|
161 |
|
162 self.vcsStatusAct = EricAction( |
|
163 self.tr('Show status'), |
|
164 UI.PixmapCache.getIcon("vcsStatus"), |
|
165 self.tr('Show &status'), |
|
166 0, 0, self, 'subversion_status') |
|
167 self.vcsStatusAct.setStatusTip(self.tr( |
|
168 'Show the status of the local project' |
|
169 )) |
|
170 self.vcsStatusAct.setWhatsThis(self.tr( |
|
171 """<b>Show status</b>""" |
|
172 """<p>This shows the status of the local project.</p>""" |
|
173 )) |
|
174 self.vcsStatusAct.triggered.connect(self._vcsStatus) |
|
175 self.actions.append(self.vcsStatusAct) |
|
176 |
|
177 self.svnChangeListsAct = EricAction( |
|
178 self.tr('Show change lists'), |
|
179 UI.PixmapCache.getIcon("vcsChangeLists"), |
|
180 self.tr('Show change lists'), |
|
181 0, 0, self, 'subversion_changelists') |
|
182 self.svnChangeListsAct.setStatusTip(self.tr( |
|
183 'Show the change lists and associated files of the local project' |
|
184 )) |
|
185 self.svnChangeListsAct.setWhatsThis(self.tr( |
|
186 """<b>Show change lists</b>""" |
|
187 """<p>This shows the change lists and associated files of the""" |
|
188 """ local project.</p>""" |
|
189 )) |
|
190 self.svnChangeListsAct.triggered.connect(self.__svnChangeLists) |
|
191 self.actions.append(self.svnChangeListsAct) |
|
192 |
|
193 self.vcsTagAct = EricAction( |
|
194 self.tr('Tag in repository'), |
|
195 UI.PixmapCache.getIcon("vcsTag"), |
|
196 self.tr('&Tag in repository...'), |
|
197 0, 0, self, 'subversion_tag') |
|
198 self.vcsTagAct.setStatusTip(self.tr( |
|
199 'Tag the local project in the repository' |
|
200 )) |
|
201 self.vcsTagAct.setWhatsThis(self.tr( |
|
202 """<b>Tag in repository</b>""" |
|
203 """<p>This tags the local project in the repository.</p>""" |
|
204 )) |
|
205 self.vcsTagAct.triggered.connect(self._vcsTag) |
|
206 self.actions.append(self.vcsTagAct) |
|
207 |
|
208 self.vcsExportAct = EricAction( |
|
209 self.tr('Export from repository'), |
|
210 UI.PixmapCache.getIcon("vcsExport"), |
|
211 self.tr('&Export from repository...'), |
|
212 0, 0, self, 'subversion_export') |
|
213 self.vcsExportAct.setStatusTip(self.tr( |
|
214 'Export a project from the repository' |
|
215 )) |
|
216 self.vcsExportAct.setWhatsThis(self.tr( |
|
217 """<b>Export from repository</b>""" |
|
218 """<p>This exports a project from the repository.</p>""" |
|
219 )) |
|
220 self.vcsExportAct.triggered.connect(self._vcsExport) |
|
221 self.actions.append(self.vcsExportAct) |
|
222 |
|
223 self.vcsPropsAct = EricAction( |
|
224 self.tr('Command options'), |
|
225 self.tr('Command &options...'), 0, 0, self, |
|
226 'subversion_options') |
|
227 self.vcsPropsAct.setStatusTip(self.tr( |
|
228 'Show the VCS command options')) |
|
229 self.vcsPropsAct.setWhatsThis(self.tr( |
|
230 """<b>Command options...</b>""" |
|
231 """<p>This shows a dialog to edit the VCS command options.</p>""" |
|
232 )) |
|
233 self.vcsPropsAct.triggered.connect(self._vcsCommandOptions) |
|
234 self.actions.append(self.vcsPropsAct) |
|
235 |
|
236 self.vcsRevertAct = EricAction( |
|
237 self.tr('Revert changes'), |
|
238 UI.PixmapCache.getIcon("vcsRevert"), |
|
239 self.tr('Re&vert changes'), |
|
240 0, 0, self, 'subversion_revert') |
|
241 self.vcsRevertAct.setStatusTip(self.tr( |
|
242 'Revert all changes made to the local project' |
|
243 )) |
|
244 self.vcsRevertAct.setWhatsThis(self.tr( |
|
245 """<b>Revert changes</b>""" |
|
246 """<p>This reverts all changes made to the local project.</p>""" |
|
247 )) |
|
248 self.vcsRevertAct.triggered.connect(self._vcsRevert) |
|
249 self.actions.append(self.vcsRevertAct) |
|
250 |
|
251 self.vcsMergeAct = EricAction( |
|
252 self.tr('Merge'), |
|
253 UI.PixmapCache.getIcon("vcsMerge"), |
|
254 self.tr('Mer&ge changes...'), |
|
255 0, 0, self, 'subversion_merge') |
|
256 self.vcsMergeAct.setStatusTip(self.tr( |
|
257 'Merge changes of a tag/revision into the local project' |
|
258 )) |
|
259 self.vcsMergeAct.setWhatsThis(self.tr( |
|
260 """<b>Merge</b>""" |
|
261 """<p>This merges changes of a tag/revision into the local""" |
|
262 """ project.</p>""" |
|
263 )) |
|
264 self.vcsMergeAct.triggered.connect(self._vcsMerge) |
|
265 self.actions.append(self.vcsMergeAct) |
|
266 |
|
267 self.vcsSwitchAct = EricAction( |
|
268 self.tr('Switch'), |
|
269 UI.PixmapCache.getIcon("vcsSwitch"), |
|
270 self.tr('S&witch...'), |
|
271 0, 0, self, 'subversion_switch') |
|
272 self.vcsSwitchAct.setStatusTip(self.tr( |
|
273 'Switch the local copy to another tag/branch' |
|
274 )) |
|
275 self.vcsSwitchAct.setWhatsThis(self.tr( |
|
276 """<b>Switch</b>""" |
|
277 """<p>This switches the local copy to another tag/branch.</p>""" |
|
278 )) |
|
279 self.vcsSwitchAct.triggered.connect(self._vcsSwitch) |
|
280 self.actions.append(self.vcsSwitchAct) |
|
281 |
|
282 self.vcsResolveAct = EricAction( |
|
283 self.tr('Conflicts resolved'), |
|
284 self.tr('Con&flicts resolved'), |
|
285 0, 0, self, 'subversion_resolve') |
|
286 self.vcsResolveAct.setStatusTip(self.tr( |
|
287 'Mark all conflicts of the local project as resolved' |
|
288 )) |
|
289 self.vcsResolveAct.setWhatsThis(self.tr( |
|
290 """<b>Conflicts resolved</b>""" |
|
291 """<p>This marks all conflicts of the local project as""" |
|
292 """ resolved.</p>""" |
|
293 )) |
|
294 self.vcsResolveAct.triggered.connect(self.__svnResolve) |
|
295 self.actions.append(self.vcsResolveAct) |
|
296 |
|
297 self.vcsCleanupAct = EricAction( |
|
298 self.tr('Cleanup'), |
|
299 self.tr('Cleanu&p'), |
|
300 0, 0, self, 'subversion_cleanup') |
|
301 self.vcsCleanupAct.setStatusTip(self.tr( |
|
302 'Cleanup the local project' |
|
303 )) |
|
304 self.vcsCleanupAct.setWhatsThis(self.tr( |
|
305 """<b>Cleanup</b>""" |
|
306 """<p>This performs a cleanup of the local project.</p>""" |
|
307 )) |
|
308 self.vcsCleanupAct.triggered.connect(self._vcsCleanup) |
|
309 self.actions.append(self.vcsCleanupAct) |
|
310 |
|
311 self.vcsCommandAct = EricAction( |
|
312 self.tr('Execute command'), |
|
313 self.tr('E&xecute command...'), |
|
314 0, 0, self, 'subversion_command') |
|
315 self.vcsCommandAct.setStatusTip(self.tr( |
|
316 'Execute an arbitrary VCS command' |
|
317 )) |
|
318 self.vcsCommandAct.setWhatsThis(self.tr( |
|
319 """<b>Execute command</b>""" |
|
320 """<p>This opens a dialog to enter an arbitrary VCS command.</p>""" |
|
321 )) |
|
322 self.vcsCommandAct.triggered.connect(self._vcsCommand) |
|
323 self.actions.append(self.vcsCommandAct) |
|
324 |
|
325 self.svnTagListAct = EricAction( |
|
326 self.tr('List tags'), |
|
327 self.tr('List tags...'), |
|
328 0, 0, self, 'subversion_list_tags') |
|
329 self.svnTagListAct.setStatusTip(self.tr( |
|
330 'List tags of the project' |
|
331 )) |
|
332 self.svnTagListAct.setWhatsThis(self.tr( |
|
333 """<b>List tags</b>""" |
|
334 """<p>This lists the tags of the project.</p>""" |
|
335 )) |
|
336 self.svnTagListAct.triggered.connect(self.__svnTagList) |
|
337 self.actions.append(self.svnTagListAct) |
|
338 |
|
339 self.svnBranchListAct = EricAction( |
|
340 self.tr('List branches'), |
|
341 self.tr('List branches...'), |
|
342 0, 0, self, 'subversion_list_branches') |
|
343 self.svnBranchListAct.setStatusTip(self.tr( |
|
344 'List branches of the project' |
|
345 )) |
|
346 self.svnBranchListAct.setWhatsThis(self.tr( |
|
347 """<b>List branches</b>""" |
|
348 """<p>This lists the branches of the project.</p>""" |
|
349 )) |
|
350 self.svnBranchListAct.triggered.connect(self.__svnBranchList) |
|
351 self.actions.append(self.svnBranchListAct) |
|
352 |
|
353 self.svnListAct = EricAction( |
|
354 self.tr('List repository contents'), |
|
355 self.tr('List repository contents...'), |
|
356 0, 0, self, 'subversion_contents') |
|
357 self.svnListAct.setStatusTip(self.tr( |
|
358 'Lists the contents of the repository' |
|
359 )) |
|
360 self.svnListAct.setWhatsThis(self.tr( |
|
361 """<b>List repository contents</b>""" |
|
362 """<p>This lists the contents of the repository.</p>""" |
|
363 )) |
|
364 self.svnListAct.triggered.connect(self.__svnTagList) |
|
365 self.actions.append(self.svnListAct) |
|
366 |
|
367 self.svnPropSetAct = EricAction( |
|
368 self.tr('Set Property'), |
|
369 self.tr('Set Property...'), |
|
370 0, 0, self, 'subversion_property_set') |
|
371 self.svnPropSetAct.setStatusTip(self.tr( |
|
372 'Set a property for the project files' |
|
373 )) |
|
374 self.svnPropSetAct.setWhatsThis(self.tr( |
|
375 """<b>Set Property</b>""" |
|
376 """<p>This sets a property for the project files.</p>""" |
|
377 )) |
|
378 self.svnPropSetAct.triggered.connect(self.__svnPropSet) |
|
379 self.actions.append(self.svnPropSetAct) |
|
380 |
|
381 self.svnPropListAct = EricAction( |
|
382 self.tr('List Properties'), |
|
383 self.tr('List Properties...'), |
|
384 0, 0, self, 'subversion_property_list') |
|
385 self.svnPropListAct.setStatusTip(self.tr( |
|
386 'List properties of the project files' |
|
387 )) |
|
388 self.svnPropListAct.setWhatsThis(self.tr( |
|
389 """<b>List Properties</b>""" |
|
390 """<p>This lists the properties of the project files.</p>""" |
|
391 )) |
|
392 self.svnPropListAct.triggered.connect(self.__svnPropList) |
|
393 self.actions.append(self.svnPropListAct) |
|
394 |
|
395 self.svnPropDelAct = EricAction( |
|
396 self.tr('Delete Property'), |
|
397 self.tr('Delete Property...'), |
|
398 0, 0, self, 'subversion_property_delete') |
|
399 self.svnPropDelAct.setStatusTip(self.tr( |
|
400 'Delete a property for the project files' |
|
401 )) |
|
402 self.svnPropDelAct.setWhatsThis(self.tr( |
|
403 """<b>Delete Property</b>""" |
|
404 """<p>This deletes a property for the project files.</p>""" |
|
405 )) |
|
406 self.svnPropDelAct.triggered.connect(self.__svnPropDel) |
|
407 self.actions.append(self.svnPropDelAct) |
|
408 |
|
409 self.svnRelocateAct = EricAction( |
|
410 self.tr('Relocate'), |
|
411 UI.PixmapCache.getIcon("vcsSwitch"), |
|
412 self.tr('Relocate...'), |
|
413 0, 0, self, 'subversion_relocate') |
|
414 self.svnRelocateAct.setStatusTip(self.tr( |
|
415 'Relocate the working copy to a new repository URL' |
|
416 )) |
|
417 self.svnRelocateAct.setWhatsThis(self.tr( |
|
418 """<b>Relocate</b>""" |
|
419 """<p>This relocates the working copy to a new repository""" |
|
420 """ URL.</p>""" |
|
421 )) |
|
422 self.svnRelocateAct.triggered.connect(self.__svnRelocate) |
|
423 self.actions.append(self.svnRelocateAct) |
|
424 |
|
425 self.svnRepoBrowserAct = EricAction( |
|
426 self.tr('Repository Browser'), |
|
427 UI.PixmapCache.getIcon("vcsRepoBrowser"), |
|
428 self.tr('Repository Browser...'), |
|
429 0, 0, self, 'subversion_repo_browser') |
|
430 self.svnRepoBrowserAct.setStatusTip(self.tr( |
|
431 'Show the Repository Browser dialog' |
|
432 )) |
|
433 self.svnRepoBrowserAct.setWhatsThis(self.tr( |
|
434 """<b>Repository Browser</b>""" |
|
435 """<p>This shows the Repository Browser dialog.</p>""" |
|
436 )) |
|
437 self.svnRepoBrowserAct.triggered.connect(self.__svnRepoBrowser) |
|
438 self.actions.append(self.svnRepoBrowserAct) |
|
439 |
|
440 self.svnConfigAct = EricAction( |
|
441 self.tr('Configure'), |
|
442 self.tr('Configure...'), |
|
443 0, 0, self, 'subversion_configure') |
|
444 self.svnConfigAct.setStatusTip(self.tr( |
|
445 'Show the configuration dialog with the Subversion page selected' |
|
446 )) |
|
447 self.svnConfigAct.setWhatsThis(self.tr( |
|
448 """<b>Configure</b>""" |
|
449 """<p>Show the configuration dialog with the Subversion page""" |
|
450 """ selected.</p>""" |
|
451 )) |
|
452 self.svnConfigAct.triggered.connect(self.__svnConfigure) |
|
453 self.actions.append(self.svnConfigAct) |
|
454 |
|
455 self.svnUpgradeAct = EricAction( |
|
456 self.tr('Upgrade'), |
|
457 self.tr('Upgrade...'), |
|
458 0, 0, self, 'subversion_upgrade') |
|
459 self.svnUpgradeAct.setStatusTip(self.tr( |
|
460 'Upgrade the working copy to the current format' |
|
461 )) |
|
462 self.svnUpgradeAct.setWhatsThis(self.tr( |
|
463 """<b>Upgrade</b>""" |
|
464 """<p>Upgrades the working copy to the current format.</p>""" |
|
465 )) |
|
466 self.svnUpgradeAct.triggered.connect(self.__svnUpgrade) |
|
467 self.actions.append(self.svnUpgradeAct) |
|
468 |
|
469 def initMenu(self, menu): |
|
470 """ |
|
471 Public method to generate the VCS menu. |
|
472 |
|
473 @param menu reference to the menu to be populated (QMenu) |
|
474 """ |
|
475 menu.clear() |
|
476 |
|
477 act = menu.addAction( |
|
478 UI.PixmapCache.getIcon( |
|
479 os.path.join("VcsPlugins", "vcsSubversion", "icons", |
|
480 "subversion.svg")), |
|
481 self.vcs.vcsName(), self._vcsInfoDisplay) |
|
482 font = act.font() |
|
483 font.setBold(True) |
|
484 act.setFont(font) |
|
485 menu.addSeparator() |
|
486 |
|
487 menu.addAction(self.vcsUpdateAct) |
|
488 menu.addAction(self.vcsCommitAct) |
|
489 menu.addSeparator() |
|
490 menu.addAction(self.vcsTagAct) |
|
491 if self.vcs.otherData["standardLayout"]: |
|
492 menu.addAction(self.svnTagListAct) |
|
493 menu.addAction(self.svnBranchListAct) |
|
494 else: |
|
495 menu.addAction(self.svnListAct) |
|
496 menu.addSeparator() |
|
497 menu.addAction(self.svnLogBrowserAct) |
|
498 menu.addSeparator() |
|
499 menu.addAction(self.vcsStatusAct) |
|
500 menu.addAction(self.svnChangeListsAct) |
|
501 menu.addSeparator() |
|
502 menu.addAction(self.vcsDiffAct) |
|
503 menu.addAction(self.svnExtDiffAct) |
|
504 menu.addAction(self.svnUrlDiffAct) |
|
505 menu.addSeparator() |
|
506 menu.addAction(self.vcsRevertAct) |
|
507 menu.addAction(self.vcsMergeAct) |
|
508 menu.addAction(self.vcsResolveAct) |
|
509 menu.addSeparator() |
|
510 menu.addAction(self.svnRelocateAct) |
|
511 menu.addAction(self.vcsSwitchAct) |
|
512 menu.addSeparator() |
|
513 menu.addAction(self.svnPropSetAct) |
|
514 menu.addAction(self.svnPropListAct) |
|
515 menu.addAction(self.svnPropDelAct) |
|
516 menu.addSeparator() |
|
517 menu.addAction(self.vcsCleanupAct) |
|
518 menu.addSeparator() |
|
519 menu.addAction(self.vcsCommandAct) |
|
520 menu.addAction(self.svnRepoBrowserAct) |
|
521 menu.addAction(self.svnUpgradeAct) |
|
522 menu.addSeparator() |
|
523 menu.addAction(self.vcsPropsAct) |
|
524 menu.addSeparator() |
|
525 menu.addAction(self.svnConfigAct) |
|
526 menu.addSeparator() |
|
527 menu.addAction(self.vcsNewAct) |
|
528 menu.addAction(self.vcsExportAct) |
|
529 |
|
530 def initToolbar(self, ui, toolbarManager): |
|
531 """ |
|
532 Public slot to initialize the VCS toolbar. |
|
533 |
|
534 @param ui reference to the main window (UserInterface) |
|
535 @param toolbarManager reference to a toolbar manager object |
|
536 (EricToolBarManager) |
|
537 """ |
|
538 self.__toolbar = QToolBar(self.tr("Subversion (svn)"), ui) |
|
539 self.__toolbar.setIconSize(UI.Config.ToolBarIconSize) |
|
540 self.__toolbar.setObjectName("SubversionToolbar") |
|
541 self.__toolbar.setToolTip(self.tr('Subversion (svn)')) |
|
542 |
|
543 self.__toolbar.addAction(self.svnLogBrowserAct) |
|
544 self.__toolbar.addAction(self.vcsStatusAct) |
|
545 self.__toolbar.addSeparator() |
|
546 self.__toolbar.addAction(self.vcsDiffAct) |
|
547 self.__toolbar.addSeparator() |
|
548 self.__toolbar.addAction(self.svnRepoBrowserAct) |
|
549 self.__toolbar.addAction(self.vcsNewAct) |
|
550 self.__toolbar.addAction(self.vcsExportAct) |
|
551 self.__toolbar.addSeparator() |
|
552 |
|
553 title = self.__toolbar.windowTitle() |
|
554 toolbarManager.addToolBar(self.__toolbar, title) |
|
555 toolbarManager.addAction(self.vcsUpdateAct, title) |
|
556 toolbarManager.addAction(self.vcsCommitAct, title) |
|
557 toolbarManager.addAction(self.svnExtDiffAct, title) |
|
558 toolbarManager.addAction(self.svnUrlDiffAct, title) |
|
559 toolbarManager.addAction(self.svnChangeListsAct, title) |
|
560 toolbarManager.addAction(self.vcsTagAct, title) |
|
561 toolbarManager.addAction(self.vcsRevertAct, title) |
|
562 toolbarManager.addAction(self.vcsMergeAct, title) |
|
563 toolbarManager.addAction(self.vcsSwitchAct, title) |
|
564 toolbarManager.addAction(self.svnRelocateAct, title) |
|
565 |
|
566 self.__toolbar.setEnabled(False) |
|
567 self.__toolbar.setVisible(False) |
|
568 |
|
569 ui.registerToolbar("subversion", self.__toolbar.windowTitle(), |
|
570 self.__toolbar, "vcs") |
|
571 ui.addToolBar(self.__toolbar) |
|
572 |
|
573 def removeToolbar(self, ui, toolbarManager): |
|
574 """ |
|
575 Public method to remove a toolbar created by initToolbar(). |
|
576 |
|
577 @param ui reference to the main window (UserInterface) |
|
578 @param toolbarManager reference to a toolbar manager object |
|
579 (EricToolBarManager) |
|
580 """ |
|
581 ui.removeToolBar(self.__toolbar) |
|
582 ui.unregisterToolbar("subversion") |
|
583 |
|
584 title = self.__toolbar.windowTitle() |
|
585 toolbarManager.removeCategoryActions(title) |
|
586 toolbarManager.removeToolBar(self.__toolbar) |
|
587 |
|
588 self.__toolbar.deleteLater() |
|
589 self.__toolbar = None |
|
590 |
|
591 def __svnResolve(self): |
|
592 """ |
|
593 Private slot used to resolve conflicts of the local project. |
|
594 """ |
|
595 self.vcs.vcsResolved(self.project.ppath) |
|
596 |
|
597 def __svnPropList(self): |
|
598 """ |
|
599 Private slot used to list the properties of the project files. |
|
600 """ |
|
601 self.vcs.svnListProps(self.project.ppath, True) |
|
602 |
|
603 def __svnPropSet(self): |
|
604 """ |
|
605 Private slot used to set a property for the project files. |
|
606 """ |
|
607 self.vcs.svnSetProp(self.project.ppath, True) |
|
608 |
|
609 def __svnPropDel(self): |
|
610 """ |
|
611 Private slot used to delete a property for the project files. |
|
612 """ |
|
613 self.vcs.svnDelProp(self.project.ppath, True) |
|
614 |
|
615 def __svnTagList(self): |
|
616 """ |
|
617 Private slot used to list the tags of the project. |
|
618 """ |
|
619 self.vcs.svnListTagBranch(self.project.ppath, True) |
|
620 |
|
621 def __svnBranchList(self): |
|
622 """ |
|
623 Private slot used to list the branches of the project. |
|
624 """ |
|
625 self.vcs.svnListTagBranch(self.project.ppath, False) |
|
626 |
|
627 def __svnExtendedDiff(self): |
|
628 """ |
|
629 Private slot used to perform a svn diff with the selection of |
|
630 revisions. |
|
631 """ |
|
632 self.vcs.svnExtendedDiff(self.project.ppath) |
|
633 |
|
634 def __svnUrlDiff(self): |
|
635 """ |
|
636 Private slot used to perform a svn diff with the selection of |
|
637 repository URLs. |
|
638 """ |
|
639 self.vcs.svnUrlDiff(self.project.ppath) |
|
640 |
|
641 def __svnRelocate(self): |
|
642 """ |
|
643 Private slot used to relocate the working copy to a new repository URL. |
|
644 """ |
|
645 self.vcs.svnRelocate(self.project.ppath) |
|
646 |
|
647 def __svnRepoBrowser(self): |
|
648 """ |
|
649 Private slot to open the repository browser. |
|
650 """ |
|
651 self.vcs.svnRepoBrowser(projectPath=self.project.ppath) |
|
652 |
|
653 def __svnConfigure(self): |
|
654 """ |
|
655 Private slot to open the configuration dialog. |
|
656 """ |
|
657 ericApp().getObject("UserInterface").showPreferences( |
|
658 "zzz_subversionPage") |
|
659 |
|
660 def __svnChangeLists(self): |
|
661 """ |
|
662 Private slot used to show a list of change lists. |
|
663 """ |
|
664 self.vcs.svnShowChangelists(self.project.ppath) |
|
665 |
|
666 def __svnUpgrade(self): |
|
667 """ |
|
668 Private slot used to upgrade the working copy format. |
|
669 """ |
|
670 self.vcs.svnUpgrade(self.project.ppath) |