33 QLineEdit, |
33 QLineEdit, |
34 QMenu, |
34 QMenu, |
35 QInputDialog, |
35 QInputDialog, |
36 ) |
36 ) |
37 |
37 |
38 from EricWidgets.EricApplication import ericApp |
38 from eric7.EricWidgets.EricApplication import ericApp |
39 from EricWidgets import EricMessageBox, EricFileDialog |
39 from eric7.EricWidgets import EricMessageBox, EricFileDialog |
40 from EricGui.EricOverrideCursor import EricOverrideCursor |
40 from eric7.EricGui.EricOverrideCursor import EricOverrideCursor |
41 |
41 |
42 from .Ui_HgLogBrowserDialog import Ui_HgLogBrowserDialog |
42 from .Ui_HgLogBrowserDialog import Ui_HgLogBrowserDialog |
43 |
43 |
44 from .HgDiffHighlighter import HgDiffHighlighter |
44 from .HgDiffHighlighter import HgDiffHighlighter |
45 from .HgDiffGenerator import HgDiffGenerator |
45 from .HgDiffGenerator import HgDiffGenerator |
46 |
46 |
47 import UI.PixmapCache |
47 from eric7.EricGui import EricPixmapCache |
48 import Preferences |
48 from eric7 import Preferences, Utilities |
49 import Utilities |
|
50 |
49 |
51 COLORNAMES = [ |
50 COLORNAMES = [ |
52 "blue", |
51 "blue", |
53 "darkgreen", |
52 "darkgreen", |
54 "red", |
53 "red", |
151 self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setDefault(True) |
150 self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setDefault(True) |
152 |
151 |
153 self.filesTree.headerItem().setText(self.filesTree.columnCount(), "") |
152 self.filesTree.headerItem().setText(self.filesTree.columnCount(), "") |
154 self.filesTree.header().setSortIndicator(0, Qt.SortOrder.AscendingOrder) |
153 self.filesTree.header().setSortIndicator(0, Qt.SortOrder.AscendingOrder) |
155 |
154 |
156 self.upButton.setIcon(UI.PixmapCache.getIcon("1uparrow")) |
155 self.upButton.setIcon(EricPixmapCache.getIcon("1uparrow")) |
157 self.downButton.setIcon(UI.PixmapCache.getIcon("1downarrow")) |
156 self.downButton.setIcon(EricPixmapCache.getIcon("1downarrow")) |
158 |
157 |
159 self.refreshButton = self.buttonBox.addButton( |
158 self.refreshButton = self.buttonBox.addButton( |
160 self.tr("&Refresh"), QDialogButtonBox.ButtonRole.ActionRole |
159 self.tr("&Refresh"), QDialogButtonBox.ButtonRole.ActionRole |
161 ) |
160 ) |
162 self.refreshButton.setToolTip( |
161 self.refreshButton.setToolTip( |
163 self.tr("Press to refresh the list of changesets") |
162 self.tr("Press to refresh the list of changesets") |
164 ) |
163 ) |
165 self.refreshButton.setEnabled(False) |
164 self.refreshButton.setEnabled(False) |
166 |
165 |
167 self.findPrevButton.setIcon(UI.PixmapCache.getIcon("1leftarrow")) |
166 self.findPrevButton.setIcon(EricPixmapCache.getIcon("1leftarrow")) |
168 self.findNextButton.setIcon(UI.PixmapCache.getIcon("1rightarrow")) |
167 self.findNextButton.setIcon(EricPixmapCache.getIcon("1rightarrow")) |
169 self.__findBackwards = False |
168 self.__findBackwards = False |
170 |
169 |
171 self.modeComboBox.addItem(self.tr("Find"), "find") |
170 self.modeComboBox.addItem(self.tr("Find"), "find") |
172 self.modeComboBox.addItem(self.tr("Filter"), "filter") |
171 self.modeComboBox.addItem(self.tr("Filter"), "filter") |
173 |
172 |
296 self.__actionsMenu = QMenu() |
295 self.__actionsMenu = QMenu() |
297 self.__actionsMenu.setTearOffEnabled(True) |
296 self.__actionsMenu.setTearOffEnabled(True) |
298 self.__actionsMenu.setToolTipsVisible(True) |
297 self.__actionsMenu.setToolTipsVisible(True) |
299 |
298 |
300 self.__graftAct = self.__actionsMenu.addAction( |
299 self.__graftAct = self.__actionsMenu.addAction( |
301 UI.PixmapCache.getIcon("vcsGraft"), |
300 EricPixmapCache.getIcon("vcsGraft"), |
302 self.tr("Copy Changesets"), |
301 self.tr("Copy Changesets"), |
303 self.__graftActTriggered, |
302 self.__graftActTriggered, |
304 ) |
303 ) |
305 self.__graftAct.setToolTip( |
304 self.__graftAct.setToolTip( |
306 self.tr("Copy the selected changesets to the current branch") |
305 self.tr("Copy the selected changesets to the current branch") |
307 ) |
306 ) |
308 |
307 |
309 self.__mergeAct = self.__actionsMenu.addAction( |
308 self.__mergeAct = self.__actionsMenu.addAction( |
310 UI.PixmapCache.getIcon("vcsMerge"), |
309 EricPixmapCache.getIcon("vcsMerge"), |
311 self.tr("Merge with Changeset"), |
310 self.tr("Merge with Changeset"), |
312 self.__mergeActTriggered, |
311 self.__mergeActTriggered, |
313 ) |
312 ) |
314 self.__mergeAct.setToolTip( |
313 self.__mergeAct.setToolTip( |
315 self.tr("Merge the working directory with the selected changeset") |
314 self.tr("Merge the working directory with the selected changeset") |
328 """ the same current phase.</p>""" |
327 """ the same current phase.</p>""" |
329 ) |
328 ) |
330 ) |
329 ) |
331 |
330 |
332 self.__tagAct = self.__actionsMenu.addAction( |
331 self.__tagAct = self.__actionsMenu.addAction( |
333 UI.PixmapCache.getIcon("vcsTag"), self.tr("Tag"), self.__tagActTriggered |
332 EricPixmapCache.getIcon("vcsTag"), self.tr("Tag"), self.__tagActTriggered |
334 ) |
333 ) |
335 self.__tagAct.setToolTip(self.tr("Tag the selected revision")) |
334 self.__tagAct.setToolTip(self.tr("Tag the selected revision")) |
336 |
335 |
337 self.__closeHeadsAct = self.__actionsMenu.addAction( |
336 self.__closeHeadsAct = self.__actionsMenu.addAction( |
338 UI.PixmapCache.getIcon("closehead"), |
337 EricPixmapCache.getIcon("closehead"), |
339 self.tr("Close Heads"), |
338 self.tr("Close Heads"), |
340 self.__closeHeadsActTriggered, |
339 self.__closeHeadsActTriggered, |
341 ) |
340 ) |
342 self.__closeHeadsAct.setToolTip(self.tr("Close the selected heads")) |
341 self.__closeHeadsAct.setToolTip(self.tr("Close the selected heads")) |
343 |
342 |
344 self.__switchAct = self.__actionsMenu.addAction( |
343 self.__switchAct = self.__actionsMenu.addAction( |
345 UI.PixmapCache.getIcon("vcsSwitch"), |
344 EricPixmapCache.getIcon("vcsSwitch"), |
346 self.tr("Switch"), |
345 self.tr("Switch"), |
347 self.__switchActTriggered, |
346 self.__switchActTriggered, |
348 ) |
347 ) |
349 self.__switchAct.setToolTip( |
348 self.__switchAct.setToolTip( |
350 self.tr("Switch the working directory to the selected revision") |
349 self.tr("Switch the working directory to the selected revision") |
351 ) |
350 ) |
352 |
351 |
353 self.__actionsMenu.addSeparator() |
352 self.__actionsMenu.addSeparator() |
354 |
353 |
355 self.__bookmarkAct = self.__actionsMenu.addAction( |
354 self.__bookmarkAct = self.__actionsMenu.addAction( |
356 UI.PixmapCache.getIcon("addBookmark"), |
355 EricPixmapCache.getIcon("addBookmark"), |
357 self.tr("Define Bookmark..."), |
356 self.tr("Define Bookmark..."), |
358 self.__bookmarkActTriggered, |
357 self.__bookmarkActTriggered, |
359 ) |
358 ) |
360 self.__bookmarkAct.setToolTip(self.tr("Bookmark the selected revision")) |
359 self.__bookmarkAct.setToolTip(self.tr("Bookmark the selected revision")) |
361 self.__bookmarkMoveAct = self.__actionsMenu.addAction( |
360 self.__bookmarkMoveAct = self.__actionsMenu.addAction( |
362 UI.PixmapCache.getIcon("moveBookmark"), |
361 EricPixmapCache.getIcon("moveBookmark"), |
363 self.tr("Move Bookmark..."), |
362 self.tr("Move Bookmark..."), |
364 self.__bookmarkMoveActTriggered, |
363 self.__bookmarkMoveActTriggered, |
365 ) |
364 ) |
366 self.__bookmarkMoveAct.setToolTip( |
365 self.__bookmarkMoveAct.setToolTip( |
367 self.tr("Move bookmark to the selected revision") |
366 self.tr("Move bookmark to the selected revision") |
368 ) |
367 ) |
369 |
368 |
370 self.__actionsMenu.addSeparator() |
369 self.__actionsMenu.addSeparator() |
371 |
370 |
372 self.__pullAct = self.__actionsMenu.addAction( |
371 self.__pullAct = self.__actionsMenu.addAction( |
373 UI.PixmapCache.getIcon("vcsUpdate"), |
372 EricPixmapCache.getIcon("vcsUpdate"), |
374 self.tr("Pull Changes"), |
373 self.tr("Pull Changes"), |
375 self.__pullActTriggered, |
374 self.__pullActTriggered, |
376 ) |
375 ) |
377 self.__pullAct.setToolTip(self.tr("Pull changes from a remote repository")) |
376 self.__pullAct.setToolTip(self.tr("Pull changes from a remote repository")) |
378 self.__lfPullAct = self.__actionsMenu.addAction( |
377 self.__lfPullAct = self.__actionsMenu.addAction( |
381 self.__lfPullAct.setToolTip(self.tr("Pull large files for selected revisions")) |
380 self.__lfPullAct.setToolTip(self.tr("Pull large files for selected revisions")) |
382 |
381 |
383 self.__actionsMenu.addSeparator() |
382 self.__actionsMenu.addSeparator() |
384 |
383 |
385 self.__pushAct = self.__actionsMenu.addAction( |
384 self.__pushAct = self.__actionsMenu.addAction( |
386 UI.PixmapCache.getIcon("vcsCommit"), |
385 EricPixmapCache.getIcon("vcsCommit"), |
387 self.tr("Push Selected Changes"), |
386 self.tr("Push Selected Changes"), |
388 self.__pushActTriggered, |
387 self.__pushActTriggered, |
389 ) |
388 ) |
390 self.__pushAct.setToolTip( |
389 self.__pushAct.setToolTip( |
391 self.tr( |
390 self.tr( |
392 "Push changes of the selected changeset and its ancestors" |
391 "Push changes of the selected changeset and its ancestors" |
393 " to a remote repository" |
392 " to a remote repository" |
394 ) |
393 ) |
395 ) |
394 ) |
396 self.__pushAllAct = self.__actionsMenu.addAction( |
395 self.__pushAllAct = self.__actionsMenu.addAction( |
397 UI.PixmapCache.getIcon("vcsCommit"), |
396 EricPixmapCache.getIcon("vcsCommit"), |
398 self.tr("Push All Changes"), |
397 self.tr("Push All Changes"), |
399 self.__pushAllActTriggered, |
398 self.__pushAllActTriggered, |
400 ) |
399 ) |
401 self.__pushAllAct.setToolTip(self.tr("Push all changes to a remote repository")) |
400 self.__pushAllAct.setToolTip(self.tr("Push all changes to a remote repository")) |
402 |
401 |
403 self.__actionsMenu.addSeparator() |
402 self.__actionsMenu.addSeparator() |
404 |
403 |
405 self.__bundleAct = self.__actionsMenu.addAction( |
404 self.__bundleAct = self.__actionsMenu.addAction( |
406 UI.PixmapCache.getIcon("vcsCreateChangegroup"), |
405 EricPixmapCache.getIcon("vcsCreateChangegroup"), |
407 self.tr("Create Changegroup"), |
406 self.tr("Create Changegroup"), |
408 self.__bundleActTriggered, |
407 self.__bundleActTriggered, |
409 ) |
408 ) |
410 self.__bundleAct.setToolTip( |
409 self.__bundleAct.setToolTip( |
411 self.tr("Create a changegroup file containing the selected changesets") |
410 self.tr("Create a changegroup file containing the selected changesets") |
421 """ If the dialog is showing outgoing changesets, all""" |
420 """ If the dialog is showing outgoing changesets, all""" |
422 """ selected changesets will be bundled.</p>""" |
421 """ selected changesets will be bundled.</p>""" |
423 ) |
422 ) |
424 ) |
423 ) |
425 self.__unbundleAct = self.__actionsMenu.addAction( |
424 self.__unbundleAct = self.__actionsMenu.addAction( |
426 UI.PixmapCache.getIcon("vcsApplyChangegroup"), |
425 EricPixmapCache.getIcon("vcsApplyChangegroup"), |
427 self.tr("Apply Changegroup"), |
426 self.tr("Apply Changegroup"), |
428 self.__unbundleActTriggered, |
427 self.__unbundleActTriggered, |
429 ) |
428 ) |
430 self.__unbundleAct.setToolTip( |
429 self.__unbundleAct.setToolTip( |
431 self.tr("Apply the currently viewed changegroup file") |
430 self.tr("Apply the currently viewed changegroup file") |
432 ) |
431 ) |
433 |
432 |
434 self.__actionsMenu.addSeparator() |
433 self.__actionsMenu.addSeparator() |
435 |
434 |
436 self.__gpgSignAct = self.__actionsMenu.addAction( |
435 self.__gpgSignAct = self.__actionsMenu.addAction( |
437 UI.PixmapCache.getIcon("changesetSign"), |
436 EricPixmapCache.getIcon("changesetSign"), |
438 self.tr("Sign Revisions"), |
437 self.tr("Sign Revisions"), |
439 self.__gpgSignActTriggered, |
438 self.__gpgSignActTriggered, |
440 ) |
439 ) |
441 self.__gpgSignAct.setToolTip( |
440 self.__gpgSignAct.setToolTip( |
442 self.tr("Add a signature for the selected revisions") |
441 self.tr("Add a signature for the selected revisions") |
443 ) |
442 ) |
444 self.__gpgVerifyAct = self.__actionsMenu.addAction( |
443 self.__gpgVerifyAct = self.__actionsMenu.addAction( |
445 UI.PixmapCache.getIcon("changesetSignVerify"), |
444 EricPixmapCache.getIcon("changesetSignVerify"), |
446 self.tr("Verify Signatures"), |
445 self.tr("Verify Signatures"), |
447 self.__gpgVerifyActTriggered, |
446 self.__gpgVerifyActTriggered, |
448 ) |
447 ) |
449 self.__gpgVerifyAct.setToolTip( |
448 self.__gpgVerifyAct.setToolTip( |
450 self.tr("Verify all signatures there may be for the selected revision") |
449 self.tr("Verify all signatures there may be for the selected revision") |
451 ) |
450 ) |
452 |
451 |
453 self.__actionsMenu.addSeparator() |
452 self.__actionsMenu.addSeparator() |
454 |
453 |
455 self.__stripAct = self.__actionsMenu.addAction( |
454 self.__stripAct = self.__actionsMenu.addAction( |
456 UI.PixmapCache.getIcon("fileDelete"), |
455 EricPixmapCache.getIcon("fileDelete"), |
457 self.tr("Strip Changesets"), |
456 self.tr("Strip Changesets"), |
458 self.__stripActTriggered, |
457 self.__stripActTriggered, |
459 ) |
458 ) |
460 self.__stripAct.setToolTip(self.tr("Strip changesets from a repository")) |
459 self.__stripAct.setToolTip(self.tr("Strip changesets from a repository")) |
461 |
460 |