eric6/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py

Wed, 30 Dec 2020 11:00:44 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 30 Dec 2020 11:00:44 +0100
branch
maintenance
changeset 7924
8a96736d465e
parent 7836
2f0d208b8137
child 8043
0acf98cd089a
permissions
-rw-r--r--

Updated copyright for 2021.

178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7924
8a96736d465e Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7836
diff changeset
3 # Copyright (c) 2010 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to browse the log history.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 import os
3317
d7639a86e90f Added support for Mercurial outgoing with largefiles by looking for a .hglf path prefix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3315
diff changeset
11 import re
5445
b24720037f1f Added clickable links to the Mercurial log browser details pane.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5444
diff changeset
12 import collections
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
7775
4a1db75550bd Changed code to not use deprecated 'QRegExp' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7771
diff changeset
14 from PyQt5.QtCore import pyqtSlot, Qt, QDate, QSize, QPoint, QFileInfo
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
15 from PyQt5.QtGui import (
7771
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7679
diff changeset
16 QColor, QPixmap, QPainter, QPen, QBrush, QIcon, QTextCursor, QPalette
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
17 )
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
18 from PyQt5.QtWidgets import (
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
19 QWidget, QDialogButtonBox, QHeaderView, QTreeWidgetItem, QApplication,
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
20 QLineEdit, QMenu, QInputDialog
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
21 )
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22
207
3f889378dede Added some code to inspect incoming patches as well.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 204
diff changeset
23 from E5Gui.E5Application import e5App
5477
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
24 from E5Gui import E5MessageBox, E5FileDialog
7771
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7679
diff changeset
25 from E5Gui.E5OverrideCursor import E5OverrideCursor
207
3f889378dede Added some code to inspect incoming patches as well.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 204
diff changeset
26
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 from .Ui_HgLogBrowserDialog import Ui_HgLogBrowserDialog
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28
5477
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
29 from .HgDiffHighlighter import HgDiffHighlighter
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
30 from .HgDiffGenerator import HgDiffGenerator
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
31
3185
d4fa462547bc Enhanced the Mercurial tag dialog and extended the Mercurial log browser to allow tagging of a specific revision
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
32 import UI.PixmapCache
5477
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
33 import Preferences
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
34 import Utilities
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
36 COLORNAMES = ["blue", "darkgreen", "red", "green", "darkblue", "purple",
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
37 "cyan", "olive", "magenta", "darkred", "darkmagenta",
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
38 "darkcyan", "gray", "yellow"]
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
39 COLORS = [str(QColor(x).name()) for x in COLORNAMES]
7455
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
40
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
41 LIGHTCOLORS = ["#aaaaff", "#7faa7f", "#ffaaaa", "#aaffaa", "#7f7faa",
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
42 "#ffaaff", "#aaffff", "#d5d579", "#ffaaff", "#d57979",
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
43 "#d579d5", "#79d5d5", "#d5d5d5", "#d5d500",
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
44 ]
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
45
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
46
3279
8df9706ef7f4 Extended the Mercurial log browser by an action to switch to the selected revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3273
diff changeset
47 class HgLogBrowserDialog(QWidget, Ui_HgLogBrowserDialog):
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 Class implementing a dialog to browse the log history.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 """
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
51 IconColumn = 0
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
52 BranchColumn = 1
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
53 RevisionColumn = 2
1605
899cb1241de5 Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1532
diff changeset
54 PhaseColumn = 3
899cb1241de5 Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1532
diff changeset
55 AuthorColumn = 4
899cb1241de5 Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1532
diff changeset
56 DateColumn = 5
899cb1241de5 Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1532
diff changeset
57 MessageColumn = 6
899cb1241de5 Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1532
diff changeset
58 TagsColumn = 7
5324
337c27027c66 Fixed the handling of the switch action of the Mercurial log browser dialog context menu in the presence of a bookmark.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5322
diff changeset
59 BookmarksColumn = 8
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
60
3317
d7639a86e90f Added support for Mercurial outgoing with largefiles by looking for a .hglf path prefix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3315
diff changeset
61 LargefilesCacheL = ".hglf/"
d7639a86e90f Added support for Mercurial outgoing with largefiles by looking for a .hglf path prefix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3315
diff changeset
62 LargefilesCacheW = ".hglf\\"
d7639a86e90f Added support for Mercurial outgoing with largefiles by looking for a .hglf path prefix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3315
diff changeset
63 PathSeparatorRe = re.compile(r"/|\\")
d7639a86e90f Added support for Mercurial outgoing with largefiles by looking for a .hglf path prefix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3315
diff changeset
64
3554
9ca56a89aec5 A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3546
diff changeset
65 ClosedIndicator = " \u2612"
9ca56a89aec5 A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3546
diff changeset
66
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
67 def __init__(self, vcs, mode="", parent=None):
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 Constructor
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 @param vcs reference to the vcs object
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
72 @type Hg
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
73 @param mode mode of the dialog
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
74 @type str (one of log, full_log, incoming, outgoing)
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
75 @param parent parent widget
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
76 @type QWidget
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 """
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2444
diff changeset
78 super(HgLogBrowserDialog, self).__init__(parent)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 self.setupUi(self)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80
5506
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
81 windowFlags = self.windowFlags()
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
82 windowFlags |= Qt.WindowContextHelpButtonHint
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
83 self.setWindowFlags(windowFlags)
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
84
5486
a74fafdb67e0 Refined the layout of the Mercurial log browser dialog by introducing a splitter between the log and details part.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5477
diff changeset
85 self.mainSplitter.setSizes([300, 400])
a74fafdb67e0 Refined the layout of the Mercurial log browser dialog by introducing a splitter between the log and details part.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5477
diff changeset
86 self.mainSplitter.setStretchFactor(0, 1)
a74fafdb67e0 Refined the layout of the Mercurial log browser dialog by introducing a splitter between the log and details part.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5477
diff changeset
87 self.mainSplitter.setStretchFactor(1, 2)
5477
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
88 self.diffSplitter.setStretchFactor(0, 1)
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
89 self.diffSplitter.setStretchFactor(1, 2)
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
90
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
91 if not mode:
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
92 if vcs.getPlugin().getPreferences("LogBrowserShowFullLog"):
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
93 mode = "full_log"
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
94 else:
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
95 mode = "log"
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
96
782
2c567a5ceade Added different window titles to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 781
diff changeset
97 if mode == "log":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
98 self.setWindowTitle(self.tr("Mercurial Log"))
782
2c567a5ceade Added different window titles to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 781
diff changeset
99 elif mode == "incoming":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
100 self.setWindowTitle(self.tr("Mercurial Log (Incoming)"))
782
2c567a5ceade Added different window titles to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 781
diff changeset
101 elif mode == "outgoing":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
102 self.setWindowTitle(self.tr("Mercurial Log (Outgoing)"))
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
103 elif mode == "full_log":
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
104 self.setWindowTitle(self.tr("Mercurial Full Log"))
782
2c567a5ceade Added different window titles to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 781
diff changeset
105
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 self.filesTree.headerItem().setText(self.filesTree.columnCount(), "")
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 self.filesTree.header().setSortIndicator(0, Qt.AscendingOrder)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7493
diff changeset
112 self.upButton.setIcon(UI.PixmapCache.getIcon("1uparrow"))
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7493
diff changeset
113 self.downButton.setIcon(UI.PixmapCache.getIcon("1downarrow"))
5449
7679d1d3671a Added up and down buttons to move the current entry to the Mercurial and Subversion log browsers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5448
diff changeset
114
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
115 self.refreshButton = self.buttonBox.addButton(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
116 self.tr("&Refresh"), QDialogButtonBox.ActionRole)
1086
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
117 self.refreshButton.setToolTip(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
118 self.tr("Press to refresh the list of changesets"))
1086
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
119 self.refreshButton.setEnabled(False)
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
120
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7493
diff changeset
121 self.findPrevButton.setIcon(UI.PixmapCache.getIcon("1leftarrow"))
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7493
diff changeset
122 self.findNextButton.setIcon(UI.PixmapCache.getIcon("1rightarrow"))
4059
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
123 self.__findBackwards = False
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
124
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
125 self.modeComboBox.addItem(self.tr("Find"), "find")
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
126 self.modeComboBox.addItem(self.tr("Filter"), "filter")
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
127
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
128 self.fieldCombo.addItem(self.tr("Revision"), "revision")
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
129 self.fieldCombo.addItem(self.tr("Author"), "author")
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
130 self.fieldCombo.addItem(self.tr("Message"), "message")
4060
6dc9821fc9c8 Extended the Mercurial log browser search and filter functions to the list of changed files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4059
diff changeset
131 self.fieldCombo.addItem(self.tr("File"), "file")
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
132 self.fieldCombo.addItem(self.tr("Phase"), "phase")
4059
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
133
5477
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
134 font = Preferences.getEditorOtherFonts("MonospacedFont")
7779
757334671130 Optimized the various diff panes by using QPlainTextEdit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7775
diff changeset
135 self.diffEdit.document().setDefaultFont(font)
5477
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
136
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
137 self.diffHighlighter = HgDiffHighlighter(self.diffEdit.document())
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
138 self.__diffGenerator = HgDiffGenerator(vcs, self)
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
139 self.__diffGenerator.finished.connect(self.__generatorFinished)
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
140
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141 self.vcs = vcs
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
142 if mode in ("log", "incoming", "outgoing", "full_log"):
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
143 if mode == "full_log":
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
144 self.commandMode = "incoming"
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
145 else:
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
146 self.commandMode = mode
1264
da42fd833a66 Fixed a little bug in the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1263
diff changeset
147 self.initialCommandMode = mode
181
4af57f97c1bc Added code to choose the way incoming and outgoing logs are shown.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 180
diff changeset
148 else:
215
e8978dca44af Fixed issues with non-existing bundle caches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 213
diff changeset
149 self.commandMode = "log"
3287
c3d784c057b3 Changed the Subversion Log Browser dialogs to maintain its position after being closed and fixed a few issues in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3283
diff changeset
150 self.initialCommandMode = "log"
3518
1d681235c1b4 Fixed the Mercurial command server client handling large data chunks on slow machines.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3516
diff changeset
151 self.__hgClient = vcs.getClient()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152
3562
ef3f13a2c599 Moved the Mercurial bookmarks to the Mercurial core because they are no extension since Mercurial 1.8 anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3554
diff changeset
153 self.__detailsTemplate = self.tr(
ef3f13a2c599 Moved the Mercurial bookmarks to the Mercurial core because they are no extension since Mercurial 1.8 anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3554
diff changeset
154 "<table>"
ef3f13a2c599 Moved the Mercurial bookmarks to the Mercurial core because they are no extension since Mercurial 1.8 anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3554
diff changeset
155 "<tr><td><b>Revision</b></td><td>{0}</td></tr>"
ef3f13a2c599 Moved the Mercurial bookmarks to the Mercurial core because they are no extension since Mercurial 1.8 anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3554
diff changeset
156 "<tr><td><b>Date</b></td><td>{1}</td></tr>"
ef3f13a2c599 Moved the Mercurial bookmarks to the Mercurial core because they are no extension since Mercurial 1.8 anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3554
diff changeset
157 "<tr><td><b>Author</b></td><td>{2}</td></tr>"
ef3f13a2c599 Moved the Mercurial bookmarks to the Mercurial core because they are no extension since Mercurial 1.8 anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3554
diff changeset
158 "<tr><td><b>Branch</b></td><td>{3}</td></tr>"
5477
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
159 "{4}"
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
160 "<tr><td><b>Message</b></td><td>{5}</td></tr>"
3562
ef3f13a2c599 Moved the Mercurial bookmarks to the Mercurial core because they are no extension since Mercurial 1.8 anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3554
diff changeset
161 "</table>"
ef3f13a2c599 Moved the Mercurial bookmarks to the Mercurial core because they are no extension since Mercurial 1.8 anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3554
diff changeset
162 )
5477
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
163 self.__parentsTemplate = self.tr(
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
164 "<tr><td><b>Parents</b></td><td>{0}</td></tr>"
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
165 )
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
166 self.__childrenTemplate = self.tr(
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
167 "<tr><td><b>Children</b></td><td>{0}</td></tr>"
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
168 )
4059
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
169 self.__tagsTemplate = self.tr(
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
170 "<tr><td><b>Tags</b></td><td>{0}</td></tr>"
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
171 )
5459
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
172 self.__latestTagTemplate = self.tr(
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
173 "<tr><td><b>Latest Tag</b></td><td>{0}</td></tr>"
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
174 )
4059
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
175 self.__bookmarksTemplate = self.tr(
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
176 "<tr><td><b>Bookmarks</b></td><td>{0}</td></tr>"
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
177 )
3536
c06338ca892b Enhanced the Mercurial log browser dialog to show a summary of the data of the selected changeset in a text edit pane.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3534
diff changeset
178
3287
c3d784c057b3 Changed the Subversion Log Browser dialogs to maintain its position after being closed and fixed a few issues in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3283
diff changeset
179 self.__bundle = ""
c3d784c057b3 Changed the Subversion Log Browser dialogs to maintain its position after being closed and fixed a few issues in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3283
diff changeset
180 self.__filename = ""
c3d784c057b3 Changed the Subversion Log Browser dialogs to maintain its position after being closed and fixed a few issues in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3283
diff changeset
181 self.__isFile = False
5477
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
182 self.__selectedRevisions = []
4250
d3bd7c3dcb80 Fixed issues in the Subversion and Mercurial log browser windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4080
diff changeset
183 self.intercept = False
3287
c3d784c057b3 Changed the Subversion Log Browser dialogs to maintain its position after being closed and fixed a few issues in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3283
diff changeset
184
1086
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
185 self.__initData()
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
186
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
187 self.__allBranchesFilter = self.tr("All")
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 self.fromDate.setDisplayFormat("yyyy-MM-dd")
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190 self.toDate.setDisplayFormat("yyyy-MM-dd")
3287
c3d784c057b3 Changed the Subversion Log Browser dialogs to maintain its position after being closed and fixed a few issues in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3283
diff changeset
191 self.__resetUI()
779
04c3a6026543 Fixed an issue where long incoming patchsets were not shown completely.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 537
diff changeset
192
5477
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
193 # roles used in the log tree
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 self.__messageRole = Qt.UserRole
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
195 self.__changesRole = Qt.UserRole + 1
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
196 self.__edgesRole = Qt.UserRole + 2
208
26ed553ad4fb Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 207
diff changeset
197 self.__parentsRole = Qt.UserRole + 3
5459
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
198 self.__latestTagRole = Qt.UserRole + 4
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
199 self.__incomingRole = Qt.UserRole + 5
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200
5477
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
201 # roles used in the file tree
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
202 self.__diffFileLineRole = Qt.UserRole
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
203
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 self.flags = {
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
205 'A': self.tr('Added'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
206 'D': self.tr('Deleted'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
207 'M': self.tr('Modified'),
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208 }
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209
4409
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
210 self.phases = {
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
211 'draft': self.tr("Draft"),
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
212 'public': self.tr("Public"),
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
213 'secret': self.tr("Secret"),
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
214 }
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
215
1086
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
216 self.__dotRadius = 8
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
217 self.__rowHeight = 20
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
218
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
219 self.logTree.setIconSize(
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
220 QSize(100 * self.__rowHeight, self.__rowHeight))
3562
ef3f13a2c599 Moved the Mercurial bookmarks to the Mercurial core because they are no extension since Mercurial 1.8 anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3554
diff changeset
221 self.BookmarksColumn = self.logTree.columnCount()
ef3f13a2c599 Moved the Mercurial bookmarks to the Mercurial core because they are no extension since Mercurial 1.8 anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3554
diff changeset
222 self.logTree.headerItem().setText(
ef3f13a2c599 Moved the Mercurial bookmarks to the Mercurial core because they are no extension since Mercurial 1.8 anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3554
diff changeset
223 self.BookmarksColumn, self.tr("Bookmarks"))
3185
d4fa462547bc Enhanced the Mercurial tag dialog and extended the Mercurial log browser to allow tagging of a specific revision
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
224
5448
1a86766ed19a Change the Mercurial log browser such, that the current log entry is highlighted with a bold font.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5445
diff changeset
225 self.__logTreeNormalFont = self.logTree.font()
1a86766ed19a Change the Mercurial log browser such, that the current log entry is highlighted with a bold font.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5445
diff changeset
226 self.__logTreeNormalFont.setBold(False)
1a86766ed19a Change the Mercurial log browser such, that the current log entry is highlighted with a bold font.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5445
diff changeset
227 self.__logTreeBoldFont = self.logTree.font()
1a86766ed19a Change the Mercurial log browser such, that the current log entry is highlighted with a bold font.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5445
diff changeset
228 self.__logTreeBoldFont.setBold(True)
7493
1696e91a5393 Added vector icons for the mercurial and subversion plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7489
diff changeset
229 self.__logTreeHasDarkBackground = e5App().usesDarkPalette()
5448
1a86766ed19a Change the Mercurial log browser such, that the current log entry is highlighted with a bold font.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5445
diff changeset
230
5445
b24720037f1f Added clickable links to the Mercurial log browser details pane.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5444
diff changeset
231 self.detailsEdit.anchorClicked.connect(self.__revisionClicked)
b24720037f1f Added clickable links to the Mercurial log browser details pane.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5444
diff changeset
232
4409
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
233 self.__initActionsMenu()
5450
a5d5e757efcf Fixed a bug in the log browser dialogs causing an endless loop.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5449
diff changeset
234
a5d5e757efcf Fixed a bug in the log browser dialogs causing an endless loop.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5449
diff changeset
235 self.__finishCallbacks = []
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
236 if self.initialCommandMode == "full_log":
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
237 self.__addFinishCallback(self.on_nextButton_clicked)
5450
a5d5e757efcf Fixed a bug in the log browser dialogs causing an endless loop.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5449
diff changeset
238
a5d5e757efcf Fixed a bug in the log browser dialogs causing an endless loop.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5449
diff changeset
239 def __addFinishCallback(self, callback):
a5d5e757efcf Fixed a bug in the log browser dialogs causing an endless loop.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5449
diff changeset
240 """
a5d5e757efcf Fixed a bug in the log browser dialogs causing an endless loop.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5449
diff changeset
241 Private method to add a method to be called once the process finished.
a5d5e757efcf Fixed a bug in the log browser dialogs causing an endless loop.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5449
diff changeset
242
a5d5e757efcf Fixed a bug in the log browser dialogs causing an endless loop.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5449
diff changeset
243 The callback methods are invoke in a FIFO style and are consumed. If
a5d5e757efcf Fixed a bug in the log browser dialogs causing an endless loop.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5449
diff changeset
244 a callback method needs to be called again, it must be added again.
a5d5e757efcf Fixed a bug in the log browser dialogs causing an endless loop.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5449
diff changeset
245
a5d5e757efcf Fixed a bug in the log browser dialogs causing an endless loop.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5449
diff changeset
246 @param callback callback method
a5d5e757efcf Fixed a bug in the log browser dialogs causing an endless loop.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5449
diff changeset
247 @type function
a5d5e757efcf Fixed a bug in the log browser dialogs causing an endless loop.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5449
diff changeset
248 """
a5d5e757efcf Fixed a bug in the log browser dialogs causing an endless loop.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5449
diff changeset
249 if callback not in self.__finishCallbacks:
a5d5e757efcf Fixed a bug in the log browser dialogs causing an endless loop.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5449
diff changeset
250 self.__finishCallbacks.append(callback)
4409
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
251
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
252 def __initActionsMenu(self):
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
253 """
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
254 Private method to initialize the actions menu.
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
255 """
3185
d4fa462547bc Enhanced the Mercurial tag dialog and extended the Mercurial log browser to allow tagging of a specific revision
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
256 self.__actionsMenu = QMenu()
5506
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
257 self.__actionsMenu.setTearOffEnabled(True)
7201
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7200
diff changeset
258 self.__actionsMenu.setToolTipsVisible(True)
5496
d157a2319073 Added a 'Merge' action to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5494
diff changeset
259
5104
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
260 self.__graftAct = self.__actionsMenu.addAction(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7493
diff changeset
261 UI.PixmapCache.getIcon("vcsGraft"),
5104
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
262 self.tr("Copy Changesets"), self.__graftActTriggered)
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
263 self.__graftAct.setToolTip(self.tr(
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
264 "Copy the selected changesets to the current branch"))
3279
8df9706ef7f4 Extended the Mercurial log browser by an action to switch to the selected revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3273
diff changeset
265
5496
d157a2319073 Added a 'Merge' action to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5494
diff changeset
266 self.__mergeAct = self.__actionsMenu.addAction(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7493
diff changeset
267 UI.PixmapCache.getIcon("vcsMerge"),
5496
d157a2319073 Added a 'Merge' action to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5494
diff changeset
268 self.tr("Merge with Changeset"), self.__mergeActTriggered)
d157a2319073 Added a 'Merge' action to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5494
diff changeset
269 self.__mergeAct.setToolTip(self.tr(
d157a2319073 Added a 'Merge' action to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5494
diff changeset
270 "Merge the working directory with the selected changeset"))
d157a2319073 Added a 'Merge' action to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5494
diff changeset
271
5104
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
272 self.__phaseAct = self.__actionsMenu.addAction(
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
273 self.tr("Change Phase"), self.__phaseActTriggered)
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
274 self.__phaseAct.setToolTip(self.tr(
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
275 "Change the phase of the selected revisions"))
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
276 self.__phaseAct.setWhatsThis(self.tr(
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
277 """<b>Change Phase</b>\n<p>This changes the phase of the"""
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
278 """ selected revisions. The selected revisions have to have"""
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
279 """ the same current phase.</p>"""))
3279
8df9706ef7f4 Extended the Mercurial log browser by an action to switch to the selected revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3273
diff changeset
280
3185
d4fa462547bc Enhanced the Mercurial tag dialog and extended the Mercurial log browser to allow tagging of a specific revision
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
281 self.__tagAct = self.__actionsMenu.addAction(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7493
diff changeset
282 UI.PixmapCache.getIcon("vcsTag"), self.tr("Tag"),
5324
337c27027c66 Fixed the handling of the switch action of the Mercurial log browser dialog context menu in the presence of a bookmark.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5322
diff changeset
283 self.__tagActTriggered)
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
284 self.__tagAct.setToolTip(self.tr("Tag the selected revision"))
3279
8df9706ef7f4 Extended the Mercurial log browser by an action to switch to the selected revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3273
diff changeset
285
7010
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
286 self.__closeHeadsAct = self.__actionsMenu.addAction(
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
287 UI.PixmapCache.getIcon("closehead"), self.tr("Close Heads"),
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
288 self.__closeHeadsActTriggered)
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
289 self.__closeHeadsAct.setToolTip(self.tr("Close the selected heads"))
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
290
3279
8df9706ef7f4 Extended the Mercurial log browser by an action to switch to the selected revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3273
diff changeset
291 self.__switchAct = self.__actionsMenu.addAction(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7493
diff changeset
292 UI.PixmapCache.getIcon("vcsSwitch"), self.tr("Switch"),
5324
337c27027c66 Fixed the handling of the switch action of the Mercurial log browser dialog context menu in the presence of a bookmark.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5322
diff changeset
293 self.__switchActTriggered)
3279
8df9706ef7f4 Extended the Mercurial log browser by an action to switch to the selected revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3273
diff changeset
294 self.__switchAct.setToolTip(self.tr(
8df9706ef7f4 Extended the Mercurial log browser by an action to switch to the selected revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3273
diff changeset
295 "Switch the working directory to the selected revision"))
8df9706ef7f4 Extended the Mercurial log browser by an action to switch to the selected revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3273
diff changeset
296
4409
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
297 self.__actionsMenu.addSeparator()
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
298
5322
c2cabdca0734 Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5276
diff changeset
299 self.__bookmarkAct = self.__actionsMenu.addAction(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7493
diff changeset
300 UI.PixmapCache.getIcon("addBookmark"),
5322
c2cabdca0734 Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5276
diff changeset
301 self.tr("Define Bookmark..."), self.__bookmarkActTriggered)
c2cabdca0734 Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5276
diff changeset
302 self.__bookmarkAct.setToolTip(
c2cabdca0734 Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5276
diff changeset
303 self.tr("Bookmark the selected revision"))
c2cabdca0734 Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5276
diff changeset
304 self.__bookmarkMoveAct = self.__actionsMenu.addAction(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7493
diff changeset
305 UI.PixmapCache.getIcon("moveBookmark"),
5322
c2cabdca0734 Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5276
diff changeset
306 self.tr("Move Bookmark..."), self.__bookmarkMoveActTriggered)
c2cabdca0734 Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5276
diff changeset
307 self.__bookmarkMoveAct.setToolTip(
c2cabdca0734 Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5276
diff changeset
308 self.tr("Move bookmark to the selected revision"))
c2cabdca0734 Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5276
diff changeset
309
c2cabdca0734 Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5276
diff changeset
310 self.__actionsMenu.addSeparator()
c2cabdca0734 Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5276
diff changeset
311
4409
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
312 self.__pullAct = self.__actionsMenu.addAction(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7493
diff changeset
313 UI.PixmapCache.getIcon("vcsUpdate"), self.tr("Pull Changes"),
5324
337c27027c66 Fixed the handling of the switch action of the Mercurial log browser dialog context menu in the presence of a bookmark.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5322
diff changeset
314 self.__pullActTriggered)
4409
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
315 self.__pullAct.setToolTip(self.tr(
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
316 "Pull changes from a remote repository"))
5104
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
317 self.__lfPullAct = self.__actionsMenu.addAction(
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
318 self.tr("Pull Large Files"), self.__lfPullActTriggered)
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
319 self.__lfPullAct.setToolTip(self.tr(
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
320 "Pull large files for selected revisions"))
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
321
4409
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
322 self.__actionsMenu.addSeparator()
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
323
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
324 self.__pushAct = self.__actionsMenu.addAction(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7493
diff changeset
325 UI.PixmapCache.getIcon("vcsCommit"),
4409
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
326 self.tr("Push Selected Changes"), self.__pushActTriggered)
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
327 self.__pushAct.setToolTip(self.tr(
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
328 "Push changes of the selected changeset and its ancestors"
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
329 " to a remote repository"))
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
330 self.__pushAllAct = self.__actionsMenu.addAction(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7493
diff changeset
331 UI.PixmapCache.getIcon("vcsCommit"),
4409
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
332 self.tr("Push All Changes"), self.__pushAllActTriggered)
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
333 self.__pushAllAct.setToolTip(self.tr(
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
334 "Push all changes to a remote repository"))
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
335
5270
7758f0c7d9f6 Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5104
diff changeset
336 self.__actionsMenu.addSeparator()
7758f0c7d9f6 Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5104
diff changeset
337
5501
59ed7b2dd952 Started to add a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5496
diff changeset
338 self.__bundleAct = self.__actionsMenu.addAction(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7493
diff changeset
339 UI.PixmapCache.getIcon("vcsCreateChangegroup"),
5501
59ed7b2dd952 Started to add a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5496
diff changeset
340 self.tr("Create Changegroup"), self.__bundleActTriggered)
59ed7b2dd952 Started to add a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5496
diff changeset
341 self.__bundleAct.setToolTip(self.tr(
59ed7b2dd952 Started to add a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5496
diff changeset
342 "Create a changegroup file containing the selected changesets"))
59ed7b2dd952 Started to add a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5496
diff changeset
343 self.__bundleAct.setWhatsThis(self.tr(
59ed7b2dd952 Started to add a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5496
diff changeset
344 """<b>Create Changegroup</b>\n<p>This creates a changegroup"""
59ed7b2dd952 Started to add a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5496
diff changeset
345 """ file containing the selected revisions. If no revisions"""
59ed7b2dd952 Started to add a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5496
diff changeset
346 """ are selected, all changesets will be bundled. If one"""
59ed7b2dd952 Started to add a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5496
diff changeset
347 """ revision is selected, it will be interpreted as the base"""
59ed7b2dd952 Started to add a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5496
diff changeset
348 """ revision. Otherwise the lowest revision will be used as"""
59ed7b2dd952 Started to add a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5496
diff changeset
349 """ the base revision and all other revision will be bundled."""
59ed7b2dd952 Started to add a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5496
diff changeset
350 """ If the dialog is showing outgoing changesets, all"""
59ed7b2dd952 Started to add a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5496
diff changeset
351 """ selected changesets will be bundled.</p>"""))
5514
1aa13333eb9f Added a an entry to apply the currently previewed changegroup file to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5513
diff changeset
352 self.__unbundleAct = self.__actionsMenu.addAction(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7493
diff changeset
353 UI.PixmapCache.getIcon("vcsApplyChangegroup"),
5514
1aa13333eb9f Added a an entry to apply the currently previewed changegroup file to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5513
diff changeset
354 self.tr("Apply Changegroup"), self.__unbundleActTriggered)
1aa13333eb9f Added a an entry to apply the currently previewed changegroup file to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5513
diff changeset
355 self.__unbundleAct.setToolTip(self.tr(
1aa13333eb9f Added a an entry to apply the currently previewed changegroup file to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5513
diff changeset
356 "Apply the currently viewed changegroup file"))
5501
59ed7b2dd952 Started to add a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5496
diff changeset
357
59ed7b2dd952 Started to add a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5496
diff changeset
358 self.__actionsMenu.addSeparator()
59ed7b2dd952 Started to add a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5496
diff changeset
359
5506
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
360 self.__gpgSignAct = self.__actionsMenu.addAction(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7493
diff changeset
361 UI.PixmapCache.getIcon("changesetSign"),
5506
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
362 self.tr("Sign Revisions"), self.__gpgSignActTriggered)
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
363 self.__gpgSignAct.setToolTip(self.tr(
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
364 "Add a signature for the selected revisions"))
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
365 self.__gpgVerifyAct = self.__actionsMenu.addAction(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7493
diff changeset
366 UI.PixmapCache.getIcon("changesetSignVerify"),
5506
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
367 self.tr("Verify Signatures"), self.__gpgVerifyActTriggered)
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
368 self.__gpgVerifyAct.setToolTip(self.tr(
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
369 "Verify all signatures there may be for the selected revision"))
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
370
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
371 self.__actionsMenu.addSeparator()
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
372
5270
7758f0c7d9f6 Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5104
diff changeset
373 self.__stripAct = self.__actionsMenu.addAction(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7493
diff changeset
374 UI.PixmapCache.getIcon("fileDelete"),
5270
7758f0c7d9f6 Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5104
diff changeset
375 self.tr("Strip Changesets"), self.__stripActTriggered)
5276
c8055cb37262 Improved the handling of Mercurial log browser actions, that potentially modify the project file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5270
diff changeset
376 self.__stripAct.setToolTip(self.tr(
c8055cb37262 Improved the handling of Mercurial log browser actions, that potentially modify the project file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5270
diff changeset
377 "Strip changesets from a repository"))
5270
7758f0c7d9f6 Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5104
diff changeset
378
5503
20dd5c1e43ec Finished adding a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5501
diff changeset
379 self.__actionsMenu.addSeparator()
20dd5c1e43ec Finished adding a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5501
diff changeset
380
20dd5c1e43ec Finished adding a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5501
diff changeset
381 self.__selectAllAct = self.__actionsMenu.addAction(
20dd5c1e43ec Finished adding a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5501
diff changeset
382 self.tr("Select All Entries"), self.__selectAllActTriggered)
20dd5c1e43ec Finished adding a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5501
diff changeset
383 self.__unselectAllAct = self.__actionsMenu.addAction(
20dd5c1e43ec Finished adding a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5501
diff changeset
384 self.tr("Deselect All Entries"),
20dd5c1e43ec Finished adding a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5501
diff changeset
385 lambda: self.__selectAllActTriggered(False))
20dd5c1e43ec Finished adding a 'Create Changegroup' action to the Mercurial log browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5501
diff changeset
386
3185
d4fa462547bc Enhanced the Mercurial tag dialog and extended the Mercurial log browser to allow tagging of a specific revision
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
387 self.actionsButton.setIcon(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7493
diff changeset
388 UI.PixmapCache.getIcon("actionsToolButton"))
3185
d4fa462547bc Enhanced the Mercurial tag dialog and extended the Mercurial log browser to allow tagging of a specific revision
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
389 self.actionsButton.setMenu(self.__actionsMenu)
1086
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
390
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
391 def __initData(self):
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
392 """
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
393 Private method to (re-)initialize some data.
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
394 """
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
395 self.__maxDate = QDate()
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
396 self.__minDate = QDate()
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
397 self.__filterLogsEnabled = True
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
398
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
399 self.buf = [] # buffer for stdout
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
400 self.diff = None
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
401 self.__started = False
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
402 self.__lastRev = 0
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
403 self.projectMode = False
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
404
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
405 # attributes to store log graph data
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
406 self.__revs = []
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
407 self.__revColors = {}
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
408 self.__revColor = 0
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
409
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
410 self.__branchColors = {}
241
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
411
7183
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 7142
diff changeset
412 self.__projectWorkingDirParents = []
2543
eb9472947653 Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2444
diff changeset
413 self.__projectBranch = ""
5445
b24720037f1f Added clickable links to the Mercurial log browser details pane.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5444
diff changeset
414
b24720037f1f Added clickable links to the Mercurial log browser details pane.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5444
diff changeset
415 self.__childrenInfo = collections.defaultdict(list)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
416
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
417 def closeEvent(self, e):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
418 """
3591
2f2a4a76dd22 Corrected a bunch of source docu issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3562
diff changeset
419 Protected slot implementing a close event handler.
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
420
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
421 @param e close event (QCloseEvent)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
422 """
7370
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
423 if self.__hgClient.isExecuting():
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
424 self.__hgClient.cancel()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
425
5488
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
426 self.vcs.getPlugin().setPreferences(
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
427 "LogBrowserGeometry", self.saveGeometry())
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
428 self.vcs.getPlugin().setPreferences(
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
429 "LogBrowserSplitterStates", [
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
430 self.mainSplitter.saveState(),
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
431 self.detailsSplitter.saveState(),
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
432 self.diffSplitter.saveState(),
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
433 ]
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
434 )
3283
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
435
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
436 e.accept()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
437
3283
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
438 def show(self):
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
439 """
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
440 Public slot to show the dialog.
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
441 """
5488
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
442 self.__reloadGeometry()
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
443 self.__restoreSplitterStates()
3283
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
444 self.__resetUI()
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
445
3484
645c12de6b0c Merge with default branch.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3178 3359
diff changeset
446 super(HgLogBrowserDialog, self).show()
5488
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
447
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
448 def __reloadGeometry(self):
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
449 """
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
450 Private method to restore the geometry.
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
451 """
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
452 geom = self.vcs.getPlugin().getPreferences("LogBrowserGeometry")
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
453 if geom.isEmpty():
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
454 s = QSize(1000, 800)
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
455 self.resize(s)
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
456 else:
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
457 self.restoreGeometry(geom)
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
458
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
459 def __restoreSplitterStates(self):
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
460 """
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
461 Private method to restore the state of the various splitters.
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
462 """
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
463 states = self.vcs.getPlugin().getPreferences(
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
464 "LogBrowserSplitterStates")
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
465 if len(states) == 3:
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
466 # we have three splitters
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
467 self.mainSplitter.restoreState(states[0])
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
468 self.detailsSplitter.restoreState(states[1])
d3729abac667 Enhanced the Mercurial log browser window by saving and restoring the internal state (geometry and the three splitters).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5487
diff changeset
469 self.diffSplitter.restoreState(states[2])
3283
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
470
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
471 def __resetUI(self):
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
472 """
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
473 Private method to reset the user interface.
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
474 """
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
475 self.branchCombo.clear()
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
476 self.fromDate.setDate(QDate.currentDate())
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
477 self.toDate.setDate(QDate.currentDate())
4059
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
478 self.fieldCombo.setCurrentIndex(self.fieldCombo.findData("message"))
3283
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
479 self.limitSpinBox.setValue(self.vcs.getPlugin().getPreferences(
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
480 "LogLimit"))
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
481 self.stopCheckBox.setChecked(self.vcs.getPlugin().getPreferences(
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
482 "StopLogOnCopy"))
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
483
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
484 if self.initialCommandMode in ("incoming", "outgoing"):
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
485 self.nextButton.setEnabled(False)
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
486 self.limitSpinBox.setEnabled(False)
3287
c3d784c057b3 Changed the Subversion Log Browser dialogs to maintain its position after being closed and fixed a few issues in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3283
diff changeset
487 else:
c3d784c057b3 Changed the Subversion Log Browser dialogs to maintain its position after being closed and fixed a few issues in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3283
diff changeset
488 self.nextButton.setEnabled(True)
c3d784c057b3 Changed the Subversion Log Browser dialogs to maintain its position after being closed and fixed a few issues in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3283
diff changeset
489 self.limitSpinBox.setEnabled(True)
3283
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
490
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
491 self.logTree.clear()
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
492
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
493 if self.initialCommandMode == "full_log":
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
494 self.commandMode = "incoming"
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
495 else:
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
496 self.commandMode = self.initialCommandMode
3283
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
497
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
498 def __resizeColumnsLog(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
499 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
500 Private method to resize the log tree columns.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
501 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
502 self.logTree.header().resizeSections(QHeaderView.ResizeToContents)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
503 self.logTree.header().setStretchLastSection(True)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
504
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
505 def __resizeColumnsFiles(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
506 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
507 Private method to resize the changed files tree columns.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
508 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
509 self.filesTree.header().resizeSections(QHeaderView.ResizeToContents)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
510 self.filesTree.header().setStretchLastSection(True)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
511
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
512 def __resortFiles(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
513 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
514 Private method to resort the changed files tree.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
515 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
516 sortColumn = self.filesTree.sortColumn()
3023
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
517 self.filesTree.sortItems(
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
518 1, self.filesTree.header().sortIndicatorOrder())
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
519 self.filesTree.sortItems(
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
520 sortColumn, self.filesTree.header().sortIndicatorOrder())
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
521
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
522 def __getColor(self, n):
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
523 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
524 Private method to get the (rotating) name of the color given an index.
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
525
7455
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
526 @param n color index
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
527 @type int
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
528 @return color name
7489
6543bcd150fd Updated source docu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7455
diff changeset
529 @rtype str
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
530 """
7455
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
531 if self.__logTreeHasDarkBackground:
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
532 return LIGHTCOLORS[n % len(LIGHTCOLORS)]
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
533 else:
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
534 return COLORS[n % len(COLORS)]
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
535
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
536 def __branchColor(self, branchName):
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
537 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
538 Private method to calculate a color for a given branch name.
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
539
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
540 @param branchName name of the branch (string)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
541 @return name of the color to use (string)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
542 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
543 if branchName not in self.__branchColors:
932
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
544 self.__branchColors[branchName] = self.__getColor(
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
545 len(self.__branchColors))
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
546 return self.__branchColors[branchName]
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
547
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
548 def __generateEdges(self, rev, parents):
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
549 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
550 Private method to generate edge info for the give data.
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
551
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
552 @param rev revision to calculate edge info for (integer)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
553 @param parents list of parent revisions (list of integers)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
554 @return tuple containing the column and color index for
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
555 the given node and a list of tuples indicating the edges
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
556 between the given node and its parents
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
557 (integer, integer, [(integer, integer, integer), ...])
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
558 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
559 if rev not in self.__revs:
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
560 # new head
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
561 self.__revs.append(rev)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
562 self.__revColors[rev] = self.__revColor
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
563 self.__revColor += 1
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
564
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
565 col = self.__revs.index(rev)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
566 color = self.__revColors.pop(rev)
5588
6ba512d9f46a Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
567 nextRevs = self.__revs[:]
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
568
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
569 # add parents to next
5588
6ba512d9f46a Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
570 addparents = [p for p in parents if p not in nextRevs]
6ba512d9f46a Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
571 nextRevs[col:col + 1] = addparents
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
572
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
573 # set colors for the parents
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
574 for i, p in enumerate(addparents):
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
575 if not i:
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
576 self.__revColors[p] = color
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
577 else:
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
578 self.__revColors[p] = self.__revColor
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
579 self.__revColor += 1
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
580
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
581 # add edges to the graph
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
582 edges = []
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
583 if parents[0] != -1:
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
584 for ecol, erev in enumerate(self.__revs):
5588
6ba512d9f46a Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
585 if erev in nextRevs:
932
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
586 edges.append(
5588
6ba512d9f46a Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
587 (ecol, nextRevs.index(erev), self.__revColors[erev]))
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
588 elif erev == rev:
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
589 for p in parents:
932
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
590 edges.append(
5588
6ba512d9f46a Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
591 (ecol, nextRevs.index(p), self.__revColors[p]))
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
592
5588
6ba512d9f46a Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
593 self.__revs = nextRevs
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
594 return col, color, edges
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
595
932
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
596 def __generateIcon(self, column, color, bottomedges, topedges, dotColor,
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
597 currentRev, closed, isDraft):
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
598 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
599 Private method to generate an icon containing the revision tree for the
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
600 given data.
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
601
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
602 @param column column index of the revision
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
603 @type int
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
604 @param color color of the node
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
605 @type int
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
606 @param bottomedges list of edges for the bottom of the node
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
607 @type list of tuples of (int, int, int)
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
608 @param topedges list of edges for the top of the node
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
609 @type list of tuples of (int, int, int)
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
610 @param dotColor color to be used for the dot
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
611 @type QColor
241
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
612 @param currentRev flag indicating to draw the icon for the
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
613 current revision
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
614 @type bool
932
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
615 @param closed flag indicating to draw an icon for a closed
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
616 branch
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
617 @type bool
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
618 @param isDraft flag indicating an entry of phase 'draft'
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
619 @type bool
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
620 @return icon for the node
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
621 @rtype QIcon
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
622 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
623 def col2x(col, radius):
244
30be2b4a9721 Added a menu to the highlighting styles config page to change individual aspects of a font only.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 243
diff changeset
624 """
30be2b4a9721 Added a menu to the highlighting styles config page to change individual aspects of a font only.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 243
diff changeset
625 Local function to calculate a x-position for a column.
30be2b4a9721 Added a menu to the highlighting styles config page to change individual aspects of a font only.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 243
diff changeset
626
30be2b4a9721 Added a menu to the highlighting styles config page to change individual aspects of a font only.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 243
diff changeset
627 @param col column number (integer)
30be2b4a9721 Added a menu to the highlighting styles config page to change individual aspects of a font only.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 243
diff changeset
628 @param radius radius of the indicator circle (integer)
30be2b4a9721 Added a menu to the highlighting styles config page to change individual aspects of a font only.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 243
diff changeset
629 """
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
630 return int(1.2 * radius) * col + radius // 2 + 3
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
631
7455
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
632 textColor = self.logTree.palette().color(QPalette.Text)
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
633
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
634 radius = self.__dotRadius
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
635 w = len(bottomedges) * radius + 20
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
636 h = self.__rowHeight
241
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
637
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
638 dot_x = col2x(column, radius) - radius // 2
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
639 dot_y = h // 2
241
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
640
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
641 pix = QPixmap(w, h)
7455
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
642 pix.fill(QColor(0, 0, 0, 0)) # draw transparent background
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
643 painter = QPainter(pix)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
644 painter.setRenderHint(QPainter.Antialiasing)
241
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
645
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
646 # draw the revision history lines
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
647 for y1, y2, lines in ((0, h, bottomedges),
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
648 (-h, 0, topedges)):
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
649 if lines:
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
650 for start, end, ecolor in lines:
7455
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
651 lpen = QPen(QColor(self.__getColor(ecolor)))
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
652 lpen.setWidth(2)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
653 painter.setPen(lpen)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
654 x1 = col2x(start, radius)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
655 x2 = col2x(end, radius)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
656 painter.drawLine(x1, dot_y + y1, x2, dot_y + y2)
241
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
657
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
658 penradius = 1
7455
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
659 pencolor = textColor
241
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
660
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
661 dot_y = (h // 2) - radius // 2
241
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
662
7455
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
663 # draw an indicator for the revision
241
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
664 if currentRev:
7455
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
665 # enlarge for the current revision
1637
b60eb2fdbaea Improved the indication of the current branches head in the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1608
diff changeset
666 delta = 1
241
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
667 radius += 2 * delta
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
668 dot_y -= delta
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
669 dot_x -= delta
1637
b60eb2fdbaea Improved the indication of the current branches head in the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1608
diff changeset
670 penradius = 3
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
671 painter.setBrush(dotColor)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
672 pen = QPen(pencolor)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
673 pen.setWidth(penradius)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
674 painter.setPen(pen)
932
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
675 if closed:
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
676 painter.drawRect(dot_x - 2, dot_y + 1,
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
677 radius + 4, radius - 2)
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
678 elif self.commandMode in ("incoming", "outgoing"):
781
2f85b5573e62 Changed the Mercurial log browser to show incoming/outgoing changesets with the current log (by pressing the next button).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 537
diff changeset
679 offset = radius // 2
6986
23886c1dd3d0 HgLogBrowserDialog: changed the icon for incoming and outgoing changesets to make the changeset type more distinguishable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
680 if self.commandMode == "incoming":
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
681 # incoming: draw a down arrow
6986
23886c1dd3d0 HgLogBrowserDialog: changed the icon for incoming and outgoing changesets to make the changeset type more distinguishable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
682 painter.drawConvexPolygon(
23886c1dd3d0 HgLogBrowserDialog: changed the icon for incoming and outgoing changesets to make the changeset type more distinguishable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
683 QPoint(dot_x, dot_y),
23886c1dd3d0 HgLogBrowserDialog: changed the icon for incoming and outgoing changesets to make the changeset type more distinguishable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
684 QPoint(dot_x + 2 * offset, dot_y),
23886c1dd3d0 HgLogBrowserDialog: changed the icon for incoming and outgoing changesets to make the changeset type more distinguishable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
685 QPoint(dot_x + offset, dot_y + 2 * offset)
23886c1dd3d0 HgLogBrowserDialog: changed the icon for incoming and outgoing changesets to make the changeset type more distinguishable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
686 )
23886c1dd3d0 HgLogBrowserDialog: changed the icon for incoming and outgoing changesets to make the changeset type more distinguishable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
687 else:
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
688 # outgoing: draw an up arrow
6986
23886c1dd3d0 HgLogBrowserDialog: changed the icon for incoming and outgoing changesets to make the changeset type more distinguishable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
689 painter.drawConvexPolygon(
23886c1dd3d0 HgLogBrowserDialog: changed the icon for incoming and outgoing changesets to make the changeset type more distinguishable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
690 QPoint(dot_x + offset, dot_y),
23886c1dd3d0 HgLogBrowserDialog: changed the icon for incoming and outgoing changesets to make the changeset type more distinguishable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
691 QPoint(dot_x, dot_y + 2 * offset),
23886c1dd3d0 HgLogBrowserDialog: changed the icon for incoming and outgoing changesets to make the changeset type more distinguishable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
692 QPoint(dot_x + 2 * offset, dot_y + 2 * offset)
23886c1dd3d0 HgLogBrowserDialog: changed the icon for incoming and outgoing changesets to make the changeset type more distinguishable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
693 )
781
2f85b5573e62 Changed the Mercurial log browser to show incoming/outgoing changesets with the current log (by pressing the next button).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 537
diff changeset
694 else:
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
695 if isDraft:
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
696 # 'draft' phase: draw an up arrow like outgoing
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
697 offset = radius // 2
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
698 painter.drawConvexPolygon(
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
699 QPoint(dot_x + offset, dot_y),
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
700 QPoint(dot_x, dot_y + 2 * offset),
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
701 QPoint(dot_x + 2 * offset, dot_y + 2 * offset)
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
702 )
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
703 else:
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
704 painter.drawEllipse(dot_x, dot_y, radius, radius)
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
705 painter.end()
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
706 return QIcon(pix)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
707
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
708 def __getParents(self, rev):
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
709 """
932
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
710 Private method to get the parents of the currently viewed
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
711 file/directory.
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
712
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
713 @param rev revision number to get parents for (string)
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
714 @return list of parent revisions (list of integers)
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
715 """
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
716 errMsg = ""
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
717 parents = [-1]
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
718
2581
a3498dcc75cc Fixed an 'invalid' error message caused by the code trying to get the parents for revision 0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2570
diff changeset
719 if int(rev) > 0:
3302
e92f0dd51979 Removed the Mercurial support for a command options dialog and added useable global options to the Mercurial config page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3287
diff changeset
720 args = self.vcs.initCommand("parents")
2581
a3498dcc75cc Fixed an 'invalid' error message caused by the code trying to get the parents for revision 0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2570
diff changeset
721 if self.commandMode == "incoming":
3287
c3d784c057b3 Changed the Subversion Log Browser dialogs to maintain its position after being closed and fixed a few issues in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3283
diff changeset
722 if self.__bundle:
2581
a3498dcc75cc Fixed an 'invalid' error message caused by the code trying to get the parents for revision 0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2570
diff changeset
723 args.append("--repository")
3287
c3d784c057b3 Changed the Subversion Log Browser dialogs to maintain its position after being closed and fixed a few issues in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3283
diff changeset
724 args.append(self.__bundle)
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
725 elif (
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
726 self.vcs.bundleFile and
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
727 os.path.exists(self.vcs.bundleFile)
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
728 ):
2581
a3498dcc75cc Fixed an 'invalid' error message caused by the code trying to get the parents for revision 0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2570
diff changeset
729 args.append("--repository")
a3498dcc75cc Fixed an 'invalid' error message caused by the code trying to get the parents for revision 0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2570
diff changeset
730 args.append(self.vcs.bundleFile)
a3498dcc75cc Fixed an 'invalid' error message caused by the code trying to get the parents for revision 0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2570
diff changeset
731 args.append("--template")
a3498dcc75cc Fixed an 'invalid' error message caused by the code trying to get the parents for revision 0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2570
diff changeset
732 args.append("{rev}\n")
a3498dcc75cc Fixed an 'invalid' error message caused by the code trying to get the parents for revision 0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2570
diff changeset
733 args.append("-r")
a3498dcc75cc Fixed an 'invalid' error message caused by the code trying to get the parents for revision 0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2570
diff changeset
734 args.append(rev)
a3498dcc75cc Fixed an 'invalid' error message caused by the code trying to get the parents for revision 0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2570
diff changeset
735 if not self.projectMode:
3287
c3d784c057b3 Changed the Subversion Log Browser dialogs to maintain its position after being closed and fixed a few issues in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3283
diff changeset
736 args.append(self.__filename)
2581
a3498dcc75cc Fixed an 'invalid' error message caused by the code trying to get the parents for revision 0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2570
diff changeset
737
7370
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
738 output, errMsg = self.__hgClient.runcommand(args)
2581
a3498dcc75cc Fixed an 'invalid' error message caused by the code trying to get the parents for revision 0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2570
diff changeset
739
a3498dcc75cc Fixed an 'invalid' error message caused by the code trying to get the parents for revision 0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2570
diff changeset
740 if output:
a3498dcc75cc Fixed an 'invalid' error message caused by the code trying to get the parents for revision 0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2570
diff changeset
741 parents = [int(p) for p in output.strip().splitlines()]
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
742
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
743 return parents
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
744
241
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
745 def __identifyProject(self):
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
746 """
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
747 Private method to determine the revision of the project directory.
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
748 """
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
749 errMsg = ""
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
750
3302
e92f0dd51979 Removed the Mercurial support for a command options dialog and added useable global options to the Mercurial config page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3287
diff changeset
751 args = self.vcs.initCommand("identify")
2543
eb9472947653 Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2444
diff changeset
752 args.append("-nb")
241
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
753
7370
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
754 output, errMsg = self.__hgClient.runcommand(args)
241
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
755
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
756 if errMsg:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
757 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
758 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
759 self.tr("Mercurial Error"),
241
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
760 errMsg)
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
761
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
762 if output:
2544
3868561e3962 Fixed an issue introduced by the last changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2543
diff changeset
763 outputList = output.strip().split(None, 1)
2543
eb9472947653 Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2444
diff changeset
764 if len(outputList) == 2:
7183
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 7142
diff changeset
765 outputRevs = outputList[0].strip()
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 7142
diff changeset
766 if outputRevs.endswith("+"):
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 7142
diff changeset
767 outputRevs = outputRevs[:-1]
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 7142
diff changeset
768 self.__projectWorkingDirParents = outputRevs.split('+')
7187
11b0c7802a70 HgLogBrowserDialog: fixed the patch submitted by Christos.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7183
diff changeset
769 else:
11b0c7802a70 HgLogBrowserDialog: fixed the patch submitted by Christos.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7183
diff changeset
770 self.__projectWorkingDirParents = [outputRevs]
2642
c9f965bd21d2 Fixed an issue in the Mercurial log browser dialog causing the 'Copy Changeset' button not being updated correctly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2581
diff changeset
771 self.__projectBranch = outputList[1].strip()
241
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
772
921
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
773 def __getClosedBranches(self):
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
774 """
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
775 Private method to get the list of closed branches.
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
776 """
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
777 self.__closedBranchesRevs = []
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
778 errMsg = ""
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
779
3302
e92f0dd51979 Removed the Mercurial support for a command options dialog and added useable global options to the Mercurial config page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3287
diff changeset
780 args = self.vcs.initCommand("branches")
921
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
781 args.append("--closed")
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
782
7370
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
783 output, errMsg = self.__hgClient.runcommand(args)
921
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
784
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
785 if errMsg:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
786 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
787 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
788 self.tr("Mercurial Error"),
921
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
789 errMsg)
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
790
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
791 if output:
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
792 for line in output.splitlines():
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
793 if line.strip().endswith("(closed)"):
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
794 parts = line.split()
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
795 self.__closedBranchesRevs.append(
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
796 parts[-2].split(":", 1)[0])
921
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
797
7010
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
798 def __getHeads(self):
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
799 """
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
800 Private method to get the list of all heads.
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
801 """
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
802 self.__headRevisions = []
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
803 errMsg = ""
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
804
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
805 args = self.vcs.initCommand("heads")
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
806 args.append("--closed")
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
807 args.append("--template")
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
808 args.append("{rev}\n")
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
809
7370
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
810 output, errMsg = self.__hgClient.runcommand(args)
7010
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
811
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
812 if errMsg:
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
813 E5MessageBox.critical(
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
814 self,
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
815 self.tr("Mercurial Error"),
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
816 errMsg)
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
817
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
818 if output:
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
819 for line in output.splitlines():
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
820 line = line.strip()
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
821 if line:
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
822 self.__headRevisions.append(line)
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
823
5459
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
824 def __getRevisionOfTag(self, tag):
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
825 """
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
826 Private method to get the revision of a tag.
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
827
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
828 @param tag tag name
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
829 @type str
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
830 @return tuple containing the revision and changeset ID
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
831 @rtype tuple of (str, str)
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
832 """
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
833 errMsg = ""
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
834
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
835 args = self.vcs.initCommand("tags")
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
836
7370
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
837 output, errMsg = self.__hgClient.runcommand(args)
5459
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
838
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
839 if errMsg:
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
840 E5MessageBox.critical(
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
841 self,
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
842 self.tr("Mercurial Error"),
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
843 errMsg)
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
844
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
845 res = ("", "")
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
846 if output:
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
847 for line in output.splitlines():
5477
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
848 if line.strip():
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
849 try:
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
850 name, rev = line.strip().rsplit(None, 1)
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
851 if name == tag:
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
852 res = tuple(rev.split(":", 1))
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
853 break
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
854 except ValueError:
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
855 # ignore silently
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
856 pass
5459
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
857
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
858 return res
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
859
932
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
860 def __generateLogItem(self, author, date, message, revision, changedPaths,
5459
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
861 parents, branches, tags, phase, bookmarks,
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
862 latestTag):
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
863 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
864 Private method to generate a log tree entry.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
865
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
866 @param author author info (string)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
867 @param date date info (string)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
868 @param message text of the log message (list of strings)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
869 @param revision revision info (string)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
870 @param changedPaths list of dictionary objects containing
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
871 info about the changed files/directories
179
09260f69bf37 Included parents info in log browser items.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 178
diff changeset
872 @param parents list of parent revisions (list of integers)
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
873 @param branches list of branches (list of strings)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
874 @param tags list of tags (string)
2444
0fdd7f9ebd0b Fixed a source docu and regenerated them.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2405
diff changeset
875 @param phase phase of the entry (string)
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
876 @param bookmarks list of bookmarks (string)
5459
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
877 @param latestTag the latest tag(s) reachable from the changeset
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
878 (list of strings)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
879 @return reference to the generated item (QTreeWidgetItem)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
880 """
5451
8ee36e8a315f Added the capability to configure the length of the log message shown in the message column of the Mercurial log browser list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5450
diff changeset
881 logMessageColumnWidth = self.vcs.getPlugin().getPreferences(
8ee36e8a315f Added the capability to configure the length of the log message shown in the message column of the Mercurial log browser list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5450
diff changeset
882 "LogMessageColumnWidth")
8ee36e8a315f Added the capability to configure the length of the log message shown in the message column of the Mercurial log browser list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5450
diff changeset
883 msgtxt = ""
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
884 for line in message:
5451
8ee36e8a315f Added the capability to configure the length of the log message shown in the message column of the Mercurial log browser list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5450
diff changeset
885 if ". " in line:
8ee36e8a315f Added the capability to configure the length of the log message shown in the message column of the Mercurial log browser list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5450
diff changeset
886 msgtxt += " " + line.strip().split(". ", 1)[0] + "."
8ee36e8a315f Added the capability to configure the length of the log message shown in the message column of the Mercurial log browser list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5450
diff changeset
887 break
8ee36e8a315f Added the capability to configure the length of the log message shown in the message column of the Mercurial log browser list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5450
diff changeset
888 else:
8ee36e8a315f Added the capability to configure the length of the log message shown in the message column of the Mercurial log browser list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5450
diff changeset
889 msgtxt += " " + line.strip()
8ee36e8a315f Added the capability to configure the length of the log message shown in the message column of the Mercurial log browser list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5450
diff changeset
890 if len(msgtxt) > logMessageColumnWidth:
8ee36e8a315f Added the capability to configure the length of the log message shown in the message column of the Mercurial log browser list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5450
diff changeset
891 msgtxt = "{0}...".format(msgtxt[:logMessageColumnWidth])
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
892
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
893 rev, node = revision.split(":")
921
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
894 if rev in self.__closedBranchesRevs:
3554
9ca56a89aec5 A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3546
diff changeset
895 closedStr = self.ClosedIndicator
921
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
896 else:
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
897 closedStr = ""
4409
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
898 if phase in self.phases:
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
899 phaseStr = self.phases[phase]
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
900 else:
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
901 phaseStr = phase
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
902 columnLabels = [
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
903 "",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
904 branches[0] + closedStr,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
905 "{0:>7}:{1}".format(rev, node),
4409
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
906 phaseStr,
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
907 author,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
908 date,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
909 msgtxt,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
910 ", ".join(tags),
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
911 ]
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
912 if bookmarks is not None:
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
913 columnLabels.append(", ".join(bookmarks))
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
914 itm = QTreeWidgetItem(self.logTree, columnLabels)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
915
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
916 itm.setForeground(self.BranchColumn,
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
917 QBrush(QColor(self.__branchColor(branches[0]))))
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
918
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
919 if not self.projectMode:
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
920 parents = self.__getParents(rev)
208
26ed553ad4fb Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 207
diff changeset
921 if not parents:
26ed553ad4fb Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 207
diff changeset
922 parents = [int(rev) - 1]
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
923 column, color, edges = self.__generateEdges(int(rev), parents)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
924
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
925 itm.setData(0, self.__messageRole, message)
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
926 itm.setData(0, self.__changesRole, changedPaths)
210
b1a204f22291 Fixed a few issues with the Mercurial log dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 208
diff changeset
927 itm.setData(0, self.__edgesRole, edges)
5459
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
928 itm.setData(0, self.__latestTagRole, latestTag)
3242
a7e006073658 Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
929 if parents == [-1]:
a7e006073658 Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
930 itm.setData(0, self.__parentsRole, [])
a7e006073658 Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
931 else:
a7e006073658 Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
932 itm.setData(0, self.__parentsRole, parents)
5445
b24720037f1f Added clickable links to the Mercurial log browser details pane.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5444
diff changeset
933 for parent in parents:
b24720037f1f Added clickable links to the Mercurial log browser details pane.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5444
diff changeset
934 self.__childrenInfo[parent].append(int(rev))
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
935 itm.setData(0, self.__incomingRole, self.commandMode == "incoming")
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
936
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
937 if self.logTree.topLevelItemCount() > 1:
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
938 topedges = self.logTree.topLevelItem(
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
939 self.logTree.indexOfTopLevelItem(itm) - 1
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
940 ).data(0, self.__edgesRole)
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
941 else:
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
942 topedges = None
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
943
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
944 icon = self.__generateIcon(column, color, edges, topedges,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
<