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