|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2010 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing the VCS project helper for Mercurial. |
|
8 """ |
|
9 |
|
10 import os |
|
11 |
|
12 from PyQt4.QtCore import SIGNAL |
|
13 |
|
14 from E5Gui.E5Application import e5App |
|
15 |
|
16 from VCS.ProjectHelper import VcsProjectHelper |
|
17 |
|
18 from E5Gui.E5Action import E5Action |
|
19 |
|
20 import UI.PixmapCache |
|
21 import Preferences |
|
22 |
|
23 class HgProjectHelper(VcsProjectHelper): |
|
24 """ |
|
25 Class implementing the VCS project helper for Mercurial. |
|
26 """ |
|
27 def __init__(self, vcsObject, projectObject, parent = None, name = None): |
|
28 """ |
|
29 Constructor |
|
30 |
|
31 @param vcsObject reference to the vcs object |
|
32 @param projectObject reference to the project object |
|
33 @param parent parent widget (QWidget) |
|
34 @param name name of this object (string) |
|
35 """ |
|
36 VcsProjectHelper.__init__(self, vcsObject, projectObject, parent, name) |
|
37 |
|
38 def getActions(self): |
|
39 """ |
|
40 Public method to get a list of all actions. |
|
41 |
|
42 @return list of all actions (list of E5Action) |
|
43 """ |
|
44 return self.actions[:] |
|
45 |
|
46 def initActions(self): |
|
47 """ |
|
48 Public method to generate the action objects. |
|
49 """ |
|
50 self.vcsNewAct = E5Action(self.trUtf8('New from repository'), |
|
51 UI.PixmapCache.getIcon("vcsCheckout.png"), |
|
52 self.trUtf8('&New from repository...'), 0, 0, self, 'mercurial_new') |
|
53 self.vcsNewAct.setStatusTip(self.trUtf8( |
|
54 'Create (clone) a new project from a Mercurial repository' |
|
55 )) |
|
56 self.vcsNewAct.setWhatsThis(self.trUtf8( |
|
57 """<b>New from repository</b>""" |
|
58 """<p>This creates (clones) a new local project from """ |
|
59 """a Mercurial repository.</p>""" |
|
60 )) |
|
61 self.connect(self.vcsNewAct, SIGNAL('triggered()'), self._vcsCheckout) |
|
62 self.actions.append(self.vcsNewAct) |
|
63 |
|
64 self.hgIncomingAct = E5Action(self.trUtf8('Show incoming log'), |
|
65 UI.PixmapCache.getIcon("vcsUpdate.png"), |
|
66 self.trUtf8('Show incoming log'), |
|
67 0, 0, self, 'mercurial_incoming') |
|
68 self.hgIncomingAct.setStatusTip(self.trUtf8( |
|
69 'Show the log of incoming changes' |
|
70 )) |
|
71 self.hgIncomingAct.setWhatsThis(self.trUtf8( |
|
72 """<b>Show incoming log</b>""" |
|
73 """<p>This shows the log of changes coming into the repository.</p>""" |
|
74 )) |
|
75 self.connect(self.hgIncomingAct, SIGNAL('triggered()'), self.__hgIncoming) |
|
76 self.actions.append(self.hgIncomingAct) |
|
77 |
|
78 self.hgPullAct = E5Action(self.trUtf8('Pull changes'), |
|
79 UI.PixmapCache.getIcon("vcsUpdate.png"), |
|
80 self.trUtf8('Pull changes'), |
|
81 0, 0, self, 'mercurial_pull') |
|
82 self.hgPullAct.setStatusTip(self.trUtf8( |
|
83 'Pull changes from a remote repository' |
|
84 )) |
|
85 self.hgPullAct.setWhatsThis(self.trUtf8( |
|
86 """<b>Pull changes</b>""" |
|
87 """<p>This pulls changes from a remote repository into the """ |
|
88 """local repository.</p>""" |
|
89 )) |
|
90 self.connect(self.hgPullAct, SIGNAL('triggered()'), self.__hgPull) |
|
91 self.actions.append(self.hgPullAct) |
|
92 |
|
93 self.vcsUpdateAct = E5Action(self.trUtf8('Update from repository'), |
|
94 UI.PixmapCache.getIcon("vcsUpdate.png"), |
|
95 self.trUtf8('&Update from repository'), 0, 0, self, |
|
96 'mercurial_update') |
|
97 self.vcsUpdateAct.setStatusTip(self.trUtf8( |
|
98 'Update the local project from the Mercurial repository' |
|
99 )) |
|
100 self.vcsUpdateAct.setWhatsThis(self.trUtf8( |
|
101 """<b>Update from repository</b>""" |
|
102 """<p>This updates the local project from the Mercurial repository.</p>""" |
|
103 )) |
|
104 self.connect(self.vcsUpdateAct, SIGNAL('triggered()'), self._vcsUpdate) |
|
105 self.actions.append(self.vcsUpdateAct) |
|
106 |
|
107 self.vcsCommitAct = E5Action(self.trUtf8('Commit changes to repository'), |
|
108 UI.PixmapCache.getIcon("vcsCommit.png"), |
|
109 self.trUtf8('&Commit changes to repository...'), 0, 0, self, |
|
110 'mercurial_commit') |
|
111 self.vcsCommitAct.setStatusTip(self.trUtf8( |
|
112 'Commit changes to the local project to the Mercurial repository' |
|
113 )) |
|
114 self.vcsCommitAct.setWhatsThis(self.trUtf8( |
|
115 """<b>Commit changes to repository</b>""" |
|
116 """<p>This commits changes to the local project to the """ |
|
117 """Mercurial repository.</p>""" |
|
118 )) |
|
119 self.connect(self.vcsCommitAct, SIGNAL('triggered()'), self._vcsCommit) |
|
120 self.actions.append(self.vcsCommitAct) |
|
121 |
|
122 self.hgOutgoingAct = E5Action(self.trUtf8('Show outgoing log'), |
|
123 UI.PixmapCache.getIcon("vcsCommit.png"), |
|
124 self.trUtf8('Show outgoing log'), |
|
125 0, 0, self, 'mercurial_outgoing') |
|
126 self.hgOutgoingAct.setStatusTip(self.trUtf8( |
|
127 'Show the log of outgoing changes' |
|
128 )) |
|
129 self.hgOutgoingAct.setWhatsThis(self.trUtf8( |
|
130 """<b>Show outgoing log</b>""" |
|
131 """<p>This shows the log of changes outgoing out of the repository.</p>""" |
|
132 )) |
|
133 self.connect(self.hgOutgoingAct, SIGNAL('triggered()'), self.__hgOutgoing) |
|
134 self.actions.append(self.hgOutgoingAct) |
|
135 |
|
136 self.hgPushAct = E5Action(self.trUtf8('Push changes'), |
|
137 UI.PixmapCache.getIcon("vcsCommit.png"), |
|
138 self.trUtf8('Push changes'), |
|
139 0, 0, self, 'mercurial_push') |
|
140 self.hgPushAct.setStatusTip(self.trUtf8( |
|
141 'Push changes to a remote repository' |
|
142 )) |
|
143 self.hgPushAct.setWhatsThis(self.trUtf8( |
|
144 """<b>Push changes</b>""" |
|
145 """<p>This pushes changes from the local repository to a """ |
|
146 """remote repository.</p>""" |
|
147 )) |
|
148 self.connect(self.hgPushAct, SIGNAL('triggered()'), self.__hgPush) |
|
149 self.actions.append(self.hgPushAct) |
|
150 |
|
151 self.vcsExportAct = E5Action(self.trUtf8('Export from repository'), |
|
152 UI.PixmapCache.getIcon("vcsExport.png"), |
|
153 self.trUtf8('&Export from repository...'), |
|
154 0, 0, self, 'subversion_export') |
|
155 self.vcsExportAct.setStatusTip(self.trUtf8( |
|
156 'Export a project from the repository' |
|
157 )) |
|
158 self.vcsExportAct.setWhatsThis(self.trUtf8( |
|
159 """<b>Export from repository</b>""" |
|
160 """<p>This exports a project from the repository.</p>""" |
|
161 )) |
|
162 self.connect(self.vcsExportAct, SIGNAL('triggered()'), self._vcsExport) |
|
163 self.actions.append(self.vcsExportAct) |
|
164 |
|
165 self.vcsAddAct = E5Action(self.trUtf8('Add to repository'), |
|
166 UI.PixmapCache.getIcon("vcsAdd.png"), |
|
167 self.trUtf8('&Add to repository...'), 0, 0, self, 'mercurial_add') |
|
168 self.vcsAddAct.setStatusTip(self.trUtf8( |
|
169 'Add the local project to the repository' |
|
170 )) |
|
171 self.vcsAddAct.setWhatsThis(self.trUtf8( |
|
172 """<b>Add to repository</b>""" |
|
173 """<p>This adds (imports) the local project to the repository.</p>""" |
|
174 )) |
|
175 self.connect(self.vcsAddAct, SIGNAL('triggered()'), self._vcsImport) |
|
176 self.actions.append(self.vcsAddAct) |
|
177 |
|
178 self.vcsRemoveAct = E5Action(self.trUtf8('Remove from repository (and disk)'), |
|
179 UI.PixmapCache.getIcon("vcsRemove.png"), |
|
180 self.trUtf8('&Remove from repository (and disk)'), |
|
181 0, 0, self, 'mercurial_remove') |
|
182 self.vcsRemoveAct.setStatusTip(self.trUtf8( |
|
183 'Remove the local project from the repository (and disk)' |
|
184 )) |
|
185 self.vcsRemoveAct.setWhatsThis(self.trUtf8( |
|
186 """<b>Remove from repository</b>""" |
|
187 """<p>This removes the local project from the repository""" |
|
188 """ (and disk).</p>""" |
|
189 )) |
|
190 self.connect(self.vcsRemoveAct, SIGNAL('triggered()'), self._vcsRemove) |
|
191 self.actions.append(self.vcsRemoveAct) |
|
192 |
|
193 self.vcsLogAct = E5Action(self.trUtf8('Show log'), |
|
194 UI.PixmapCache.getIcon("vcsLog.png"), |
|
195 self.trUtf8('Show &log'), |
|
196 0, 0, self, 'mercurial_log') |
|
197 self.vcsLogAct.setStatusTip(self.trUtf8( |
|
198 'Show the log of the local project' |
|
199 )) |
|
200 self.vcsLogAct.setWhatsThis(self.trUtf8( |
|
201 """<b>Show log</b>""" |
|
202 """<p>This shows the log of the local project.</p>""" |
|
203 )) |
|
204 self.connect(self.vcsLogAct, SIGNAL('triggered()'), self._vcsLog) |
|
205 self.actions.append(self.vcsLogAct) |
|
206 |
|
207 self.hgLogLimitedAct = E5Action(self.trUtf8('Show limited log'), |
|
208 UI.PixmapCache.getIcon("vcsLog.png"), |
|
209 self.trUtf8('Show limited log'), |
|
210 0, 0, self, 'mercurial_log_limited') |
|
211 self.hgLogLimitedAct.setStatusTip(self.trUtf8( |
|
212 'Show a limited log of the local project' |
|
213 )) |
|
214 self.hgLogLimitedAct.setWhatsThis(self.trUtf8( |
|
215 """<b>Show limited log</b>""" |
|
216 """<p>This shows the log of the local project limited to a selectable""" |
|
217 """ number of entries.</p>""" |
|
218 )) |
|
219 self.connect(self.hgLogLimitedAct, SIGNAL('triggered()'), self.__hgLogLimited) |
|
220 self.actions.append(self.hgLogLimitedAct) |
|
221 |
|
222 self.hgLogBrowserAct = E5Action(self.trUtf8('Show log browser'), |
|
223 UI.PixmapCache.getIcon("vcsLog.png"), |
|
224 self.trUtf8('Show log browser'), |
|
225 0, 0, self, 'mercurial_log_browser') |
|
226 self.hgLogBrowserAct.setStatusTip(self.trUtf8( |
|
227 'Show a dialog to browse the log of the local project' |
|
228 )) |
|
229 self.hgLogBrowserAct.setWhatsThis(self.trUtf8( |
|
230 """<b>Show log browser</b>""" |
|
231 """<p>This shows a dialog to browse the log of the local project.""" |
|
232 """ A limited number of entries is shown first. More can be""" |
|
233 """ retrieved later on.</p>""" |
|
234 )) |
|
235 self.connect(self.hgLogBrowserAct, SIGNAL('triggered()'), self.__hgLogBrowser) |
|
236 self.actions.append(self.hgLogBrowserAct) |
|
237 |
|
238 self.vcsDiffAct = E5Action(self.trUtf8('Show difference'), |
|
239 UI.PixmapCache.getIcon("vcsDiff.png"), |
|
240 self.trUtf8('Show &difference'), |
|
241 0, 0, self, 'mercurial_diff') |
|
242 self.vcsDiffAct.setStatusTip(self.trUtf8( |
|
243 'Show the difference of the local project to the repository' |
|
244 )) |
|
245 self.vcsDiffAct.setWhatsThis(self.trUtf8( |
|
246 """<b>Show difference</b>""" |
|
247 """<p>This shows the difference of the local project to the repository.</p>""" |
|
248 )) |
|
249 self.connect(self.vcsDiffAct, SIGNAL('triggered()'), self._vcsDiff) |
|
250 self.actions.append(self.vcsDiffAct) |
|
251 |
|
252 self.hgExtDiffAct = E5Action(self.trUtf8('Show difference (extended)'), |
|
253 UI.PixmapCache.getIcon("vcsDiff.png"), |
|
254 self.trUtf8('Show difference (extended)'), |
|
255 0, 0, self, 'mercurial_extendeddiff') |
|
256 self.hgExtDiffAct.setStatusTip(self.trUtf8( |
|
257 'Show the difference of revisions of the project to the repository' |
|
258 )) |
|
259 self.hgExtDiffAct.setWhatsThis(self.trUtf8( |
|
260 """<b>Show difference (extended)</b>""" |
|
261 """<p>This shows the difference of selectable revisions of the project.</p>""" |
|
262 )) |
|
263 self.connect(self.hgExtDiffAct, SIGNAL('triggered()'), self.__hgExtendedDiff) |
|
264 self.actions.append(self.hgExtDiffAct) |
|
265 |
|
266 self.vcsStatusAct = E5Action(self.trUtf8('Show status'), |
|
267 UI.PixmapCache.getIcon("vcsStatus.png"), |
|
268 self.trUtf8('Show &status'), |
|
269 0, 0, self, 'mercurial_status') |
|
270 self.vcsStatusAct.setStatusTip(self.trUtf8( |
|
271 'Show the status of the local project' |
|
272 )) |
|
273 self.vcsStatusAct.setWhatsThis(self.trUtf8( |
|
274 """<b>Show status</b>""" |
|
275 """<p>This shows the status of the local project.</p>""" |
|
276 )) |
|
277 self.connect(self.vcsStatusAct, SIGNAL('triggered()'), self._vcsStatus) |
|
278 self.actions.append(self.vcsStatusAct) |
|
279 |
|
280 self.hgHeadsAct = E5Action(self.trUtf8('Show heads'), |
|
281 self.trUtf8('Show heads'), |
|
282 0, 0, self, 'mercurial_heads') |
|
283 self.hgHeadsAct.setStatusTip(self.trUtf8( |
|
284 'Show the heads of the repository' |
|
285 )) |
|
286 self.hgHeadsAct.setWhatsThis(self.trUtf8( |
|
287 """<b>Show heads</b>""" |
|
288 """<p>This shows the heads of the repository.</p>""" |
|
289 )) |
|
290 self.connect(self.hgHeadsAct, SIGNAL('triggered()'), self.__hgHeads) |
|
291 self.actions.append(self.hgHeadsAct) |
|
292 |
|
293 self.hgParentsAct = E5Action(self.trUtf8('Show parents'), |
|
294 self.trUtf8('Show parents'), |
|
295 0, 0, self, 'mercurial_parents') |
|
296 self.hgParentsAct.setStatusTip(self.trUtf8( |
|
297 'Show the parents of the repository' |
|
298 )) |
|
299 self.hgParentsAct.setWhatsThis(self.trUtf8( |
|
300 """<b>Show parents</b>""" |
|
301 """<p>This shows the parents of the repository.</p>""" |
|
302 )) |
|
303 self.connect(self.hgParentsAct, SIGNAL('triggered()'), self.__hgParents) |
|
304 self.actions.append(self.hgParentsAct) |
|
305 |
|
306 self.hgTipAct = E5Action(self.trUtf8('Show tip'), |
|
307 self.trUtf8('Show tip'), |
|
308 0, 0, self, 'mercurial_tip') |
|
309 self.hgTipAct.setStatusTip(self.trUtf8( |
|
310 'Show the tip of the repository' |
|
311 )) |
|
312 self.hgTipAct.setWhatsThis(self.trUtf8( |
|
313 """<b>Show tip</b>""" |
|
314 """<p>This shows the tip of the repository.</p>""" |
|
315 )) |
|
316 self.connect(self.hgTipAct, SIGNAL('triggered()'), self.__hgTip) |
|
317 self.actions.append(self.hgTipAct) |
|
318 |
|
319 self.vcsRevertAct = E5Action(self.trUtf8('Revert changes'), |
|
320 UI.PixmapCache.getIcon("vcsRevert.png"), |
|
321 self.trUtf8('Re&vert changes'), |
|
322 0, 0, self, 'mercurial_revert') |
|
323 self.vcsRevertAct.setStatusTip(self.trUtf8( |
|
324 'Revert all changes made to the local project' |
|
325 )) |
|
326 self.vcsRevertAct.setWhatsThis(self.trUtf8( |
|
327 """<b>Revert changes</b>""" |
|
328 """<p>This reverts all changes made to the local project.</p>""" |
|
329 )) |
|
330 self.connect(self.vcsRevertAct, SIGNAL('triggered()'), self._vcsRevert) |
|
331 self.actions.append(self.vcsRevertAct) |
|
332 |
|
333 self.vcsMergeAct = E5Action(self.trUtf8('Merge'), |
|
334 UI.PixmapCache.getIcon("vcsMerge.png"), |
|
335 self.trUtf8('Mer&ge changes...'), |
|
336 0, 0, self, 'mercurial_merge') |
|
337 self.vcsMergeAct.setStatusTip(self.trUtf8( |
|
338 'Merge changes of a revision into the local project' |
|
339 )) |
|
340 self.vcsMergeAct.setWhatsThis(self.trUtf8( |
|
341 """<b>Merge</b>""" |
|
342 """<p>This merges changes of a revision into the local project.</p>""" |
|
343 )) |
|
344 self.connect(self.vcsMergeAct, SIGNAL('triggered()'), self._vcsMerge) |
|
345 self.actions.append(self.vcsMergeAct) |
|
346 |
|
347 self.vcsResolveAct = E5Action(self.trUtf8('Resolve conflicts'), |
|
348 self.trUtf8('Resolve con&flicts'), |
|
349 0, 0, self, 'mercurial_resolve') |
|
350 self.vcsResolveAct.setStatusTip(self.trUtf8( |
|
351 'Resolve all conflicts of the local project' |
|
352 )) |
|
353 self.vcsResolveAct.setWhatsThis(self.trUtf8( |
|
354 """<b>Resolve conflicts</b>""" |
|
355 """<p>This resolves all conflicts of the local project.</p>""" |
|
356 )) |
|
357 self.connect(self.vcsResolveAct, SIGNAL('triggered()'), self.__hgResolve) |
|
358 self.actions.append(self.vcsResolveAct) |
|
359 |
|
360 self.vcsTagAct = E5Action(self.trUtf8('Tag in repository'), |
|
361 UI.PixmapCache.getIcon("vcsTag.png"), |
|
362 self.trUtf8('&Tag in repository...'), |
|
363 0, 0, self, 'mercurial_tag') |
|
364 self.vcsTagAct.setStatusTip(self.trUtf8( |
|
365 'Tag the local project in the repository' |
|
366 )) |
|
367 self.vcsTagAct.setWhatsThis(self.trUtf8( |
|
368 """<b>Tag in repository</b>""" |
|
369 """<p>This tags the local project in the repository.</p>""" |
|
370 )) |
|
371 self.connect(self.vcsTagAct, SIGNAL('triggered()'), self._vcsTag) |
|
372 self.actions.append(self.vcsTagAct) |
|
373 |
|
374 self.hgTagListAct = E5Action(self.trUtf8('List tags'), |
|
375 self.trUtf8('List tags...'), |
|
376 0, 0, self, 'mercurial_list_tags') |
|
377 self.hgTagListAct.setStatusTip(self.trUtf8( |
|
378 'List tags of the project' |
|
379 )) |
|
380 self.hgTagListAct.setWhatsThis(self.trUtf8( |
|
381 """<b>List tags</b>""" |
|
382 """<p>This lists the tags of the project.</p>""" |
|
383 )) |
|
384 self.connect(self.hgTagListAct, SIGNAL('triggered()'), self.__hgTagList) |
|
385 self.actions.append(self.hgTagListAct) |
|
386 |
|
387 self.hgBranchListAct = E5Action(self.trUtf8('List branches'), |
|
388 self.trUtf8('List branches...'), |
|
389 0, 0, self, 'mercurial_list_branches') |
|
390 self.hgBranchListAct.setStatusTip(self.trUtf8( |
|
391 'List branches of the project' |
|
392 )) |
|
393 self.hgBranchListAct.setWhatsThis(self.trUtf8( |
|
394 """<b>List branches</b>""" |
|
395 """<p>This lists the branches of the project.</p>""" |
|
396 )) |
|
397 self.connect(self.hgBranchListAct, SIGNAL('triggered()'), self.__hgBranchList) |
|
398 self.actions.append(self.hgBranchListAct) |
|
399 |
|
400 self.hgBranchAct = E5Action(self.trUtf8('Create branch'), |
|
401 UI.PixmapCache.getIcon("vcsBranch.png"), |
|
402 self.trUtf8('Create &branch...'), |
|
403 0, 0, self, 'mercurial_branch') |
|
404 self.hgBranchAct.setStatusTip(self.trUtf8( |
|
405 'Create a new branch for the local project in the repository' |
|
406 )) |
|
407 self.hgBranchAct.setWhatsThis(self.trUtf8( |
|
408 """<b>Create branch</b>""" |
|
409 """<p>This creates a new branch for the local project """ |
|
410 """in the repository.</p>""" |
|
411 )) |
|
412 self.connect(self.hgBranchAct, SIGNAL('triggered()'), self.__hgBranch) |
|
413 self.actions.append(self.hgBranchAct) |
|
414 |
|
415 self.hgCloseBranchAct = E5Action(self.trUtf8('Close branch'), |
|
416 self.trUtf8('Close branch'), |
|
417 0, 0, self, 'mercurial_close_branch') |
|
418 self.hgCloseBranchAct.setStatusTip(self.trUtf8( |
|
419 'Close the current branch of the local project' |
|
420 )) |
|
421 self.hgCloseBranchAct.setWhatsThis(self.trUtf8( |
|
422 """<b>Close branch</b>""" |
|
423 """<p>This closes the current branch of the local project.</p>""" |
|
424 )) |
|
425 self.connect(self.hgCloseBranchAct, SIGNAL('triggered()'), self.__hgCloseBranch) |
|
426 self.actions.append(self.hgCloseBranchAct) |
|
427 |
|
428 self.vcsSwitchAct = E5Action(self.trUtf8('Switch'), |
|
429 UI.PixmapCache.getIcon("vcsSwitch.png"), |
|
430 self.trUtf8('S&witch...'), |
|
431 0, 0, self, 'mercurial_switch') |
|
432 self.vcsSwitchAct.setStatusTip(self.trUtf8( |
|
433 'Switch the working directory to another revision' |
|
434 )) |
|
435 self.vcsSwitchAct.setWhatsThis(self.trUtf8( |
|
436 """<b>Switch</b>""" |
|
437 """<p>This switches the working directory to another revision.</p>""" |
|
438 )) |
|
439 self.connect(self.vcsSwitchAct, SIGNAL('triggered()'), self._vcsSwitch) |
|
440 self.actions.append(self.vcsSwitchAct) |
|
441 |
|
442 self.vcsCleanupAct = E5Action(self.trUtf8('Cleanup'), |
|
443 self.trUtf8('Cleanu&p'), |
|
444 0, 0, self, 'mercurial_cleanup') |
|
445 self.vcsCleanupAct.setStatusTip(self.trUtf8( |
|
446 'Cleanup the local project' |
|
447 )) |
|
448 self.vcsCleanupAct.setWhatsThis(self.trUtf8( |
|
449 """<b>Cleanup</b>""" |
|
450 """<p>This performs a cleanup of the local project.</p>""" |
|
451 )) |
|
452 self.connect(self.vcsCleanupAct, SIGNAL('triggered()'), self._vcsCleanup) |
|
453 self.actions.append(self.vcsCleanupAct) |
|
454 |
|
455 self.vcsCommandAct = E5Action(self.trUtf8('Execute command'), |
|
456 self.trUtf8('E&xecute command...'), |
|
457 0, 0, self, 'mercurial_command') |
|
458 self.vcsCommandAct.setStatusTip(self.trUtf8( |
|
459 'Execute an arbitrary Mercurial command' |
|
460 )) |
|
461 self.vcsCommandAct.setWhatsThis(self.trUtf8( |
|
462 """<b>Execute command</b>""" |
|
463 """<p>This opens a dialog to enter an arbitrary Mercurial command.</p>""" |
|
464 )) |
|
465 self.connect(self.vcsCommandAct, SIGNAL('triggered()'), self._vcsCommand) |
|
466 self.actions.append(self.vcsCommandAct) |
|
467 |
|
468 self.vcsPropsAct = E5Action(self.trUtf8('Command options'), |
|
469 self.trUtf8('Command &options...'),0,0,self, |
|
470 'mercurial_options') |
|
471 self.vcsPropsAct.setStatusTip(self.trUtf8('Show the Mercurial command options')) |
|
472 self.vcsPropsAct.setWhatsThis(self.trUtf8( |
|
473 """<b>Command options...</b>""" |
|
474 """<p>This shows a dialog to edit the Mercurial command options.</p>""" |
|
475 )) |
|
476 self.connect(self.vcsPropsAct, SIGNAL('triggered()'), self._vcsCommandOptions) |
|
477 self.actions.append(self.vcsPropsAct) |
|
478 |
|
479 self.hgConfigAct = E5Action(self.trUtf8('Configure'), |
|
480 self.trUtf8('Configure...'), |
|
481 0, 0, self, 'mercurial_configure') |
|
482 self.hgConfigAct.setStatusTip(self.trUtf8( |
|
483 'Show the configuration dialog with the Mercurial page selected' |
|
484 )) |
|
485 self.hgConfigAct.setWhatsThis(self.trUtf8( |
|
486 """<b>Configure</b>""" |
|
487 """<p>Show the configuration dialog with the Mercurial page selected.</p>""" |
|
488 )) |
|
489 self.connect(self.hgConfigAct, SIGNAL('triggered()'), self.__hgConfigure) |
|
490 self.actions.append(self.hgConfigAct) |
|
491 |
|
492 def initMenu(self, menu): |
|
493 """ |
|
494 Public method to generate the VCS menu. |
|
495 |
|
496 @param menu reference to the menu to be populated (QMenu) |
|
497 """ |
|
498 menu.clear() |
|
499 |
|
500 act = menu.addAction( |
|
501 UI.PixmapCache.getIcon( |
|
502 os.path.join("VcsPlugins", "vcsMercurial", "icons", "mercurial.png")), |
|
503 self.vcs.vcsName(), self._vcsInfoDisplay) |
|
504 font = act.font() |
|
505 font.setBold(True) |
|
506 act.setFont(font) |
|
507 menu.addSeparator() |
|
508 |
|
509 menu.addAction(self.hgIncomingAct) |
|
510 menu.addAction(self.hgPullAct) |
|
511 menu.addAction(self.vcsUpdateAct) |
|
512 menu.addSeparator() |
|
513 menu.addAction(self.vcsCommitAct) |
|
514 menu.addAction(self.hgOutgoingAct) |
|
515 menu.addAction(self.hgPushAct) |
|
516 menu.addSeparator() |
|
517 menu.addAction(self.vcsNewAct) |
|
518 menu.addAction(self.vcsExportAct) |
|
519 menu.addSeparator() |
|
520 menu.addAction(self.vcsAddAct) |
|
521 menu.addAction(self.vcsRemoveAct) |
|
522 menu.addSeparator() |
|
523 menu.addAction(self.vcsTagAct) |
|
524 menu.addAction(self.hgTagListAct) |
|
525 menu.addAction(self.hgBranchAct) |
|
526 menu.addAction(self.hgCloseBranchAct) |
|
527 menu.addAction(self.hgBranchListAct) |
|
528 menu.addSeparator() |
|
529 menu.addAction(self.hgHeadsAct) |
|
530 menu.addAction(self.hgParentsAct) |
|
531 menu.addAction(self.hgTipAct) |
|
532 menu.addSeparator() |
|
533 menu.addAction(self.vcsLogAct) |
|
534 menu.addAction(self.hgLogLimitedAct) |
|
535 menu.addAction(self.hgLogBrowserAct) |
|
536 menu.addSeparator() |
|
537 menu.addAction(self.vcsStatusAct) |
|
538 menu.addSeparator() |
|
539 menu.addAction(self.vcsDiffAct) |
|
540 menu.addAction(self.hgExtDiffAct) |
|
541 menu.addSeparator() |
|
542 menu.addAction(self.vcsRevertAct) |
|
543 menu.addAction(self.vcsMergeAct) |
|
544 menu.addAction(self.vcsResolveAct) |
|
545 menu.addSeparator() |
|
546 menu.addAction(self.vcsSwitchAct) |
|
547 menu.addSeparator() |
|
548 menu.addAction(self.vcsCleanupAct) |
|
549 menu.addSeparator() |
|
550 menu.addAction(self.vcsCommandAct) |
|
551 menu.addSeparator() |
|
552 menu.addAction(self.vcsPropsAct) |
|
553 menu.addSeparator() |
|
554 menu.addAction(self.hgConfigAct) |
|
555 |
|
556 def __hgExtendedDiff(self): |
|
557 """ |
|
558 Private slot used to perform a svn diff with the selection of revisions. |
|
559 """ |
|
560 self.vcs.hgExtendedDiff(self.project.ppath) |
|
561 |
|
562 def __hgLogLimited(self): |
|
563 """ |
|
564 Private slot used to perform a hg log --limit. |
|
565 """ |
|
566 self.vcs.hgLogLimited(self.project.ppath) |
|
567 |
|
568 def __hgLogBrowser(self): |
|
569 """ |
|
570 Private slot used to browse the log of the current project. |
|
571 """ |
|
572 self.vcs.hgLogBrowser(self.project.ppath) |
|
573 |
|
574 def __hgIncoming(self): |
|
575 """ |
|
576 Private slot used to show the log of changes coming into the repository. |
|
577 """ |
|
578 self.vcs.hgIncoming(self.project.ppath) |
|
579 |
|
580 def __hgOutgoing(self): |
|
581 """ |
|
582 Private slot used to show the log of changes going out of the repository. |
|
583 """ |
|
584 self.vcs.hgOutgoing(self.project.ppath) |
|
585 |
|
586 def __hgPull(self): |
|
587 """ |
|
588 Private slot used to pull changes from a remote repository. |
|
589 """ |
|
590 self.vcs.hgPull(self.project.ppath) |
|
591 |
|
592 def __hgPush(self): |
|
593 """ |
|
594 Private slot used to push changes to a remote repository. |
|
595 """ |
|
596 self.vcs.hgPush(self.project.ppath) |
|
597 |
|
598 def __hgHeads(self): |
|
599 """ |
|
600 Private slot used to show the heads of the repository. |
|
601 """ |
|
602 self.vcs.hgInfo(self.project.ppath, mode = "heads") |
|
603 |
|
604 def __hgParents(self): |
|
605 """ |
|
606 Private slot used to show the parents of the repository. |
|
607 """ |
|
608 self.vcs.hgInfo(self.project.ppath, mode = "parents") |
|
609 |
|
610 def __hgTip(self): |
|
611 """ |
|
612 Private slot used to show the tip of the repository. |
|
613 """ |
|
614 self.vcs.hgInfo(self.project.ppath, mode = "tip") |
|
615 |
|
616 def __hgResolve(self): |
|
617 """ |
|
618 Private slot used to resolve conflicts of the local project. |
|
619 """ |
|
620 self.vcs.hgResolve(self.project.ppath) |
|
621 |
|
622 def __hgTagList(self): |
|
623 """ |
|
624 Private slot used to list the tags of the project. |
|
625 """ |
|
626 self.vcs.hgListTagBranch(self.project.ppath, True) |
|
627 |
|
628 def __hgBranchList(self): |
|
629 """ |
|
630 Private slot used to list the branches of the project. |
|
631 """ |
|
632 self.vcs.hgListTagBranch(self.project.ppath, False) |
|
633 |
|
634 def __hgBranch(self): |
|
635 """ |
|
636 Private slot used to create a new branch for the project. |
|
637 """ |
|
638 self.vcs.hgBranch(self.project.ppath) |
|
639 |
|
640 def __hgConfigure(self): |
|
641 """ |
|
642 Private method to open the configuration dialog. |
|
643 """ |
|
644 e5App().getObject("UserInterface").showPreferences("zzz_mercurialPage") |
|
645 |
|
646 def __hgCloseBranch(self): |
|
647 """ |
|
648 Protected slot used to close the current branch of the local project. |
|
649 """ |
|
650 if Preferences.getVCS("AutoSaveProject"): |
|
651 self.project.saveProject() |
|
652 if Preferences.getVCS("AutoSaveFiles"): |
|
653 self.project.saveAllScripts() |
|
654 self.vcs.vcsCommit(self.project.ppath, '', closeBranch = True) |