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