eric7/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py

Sun, 16 May 2021 20:07:24 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 16 May 2021 20:07:24 +0200
branch
eric7
changeset 8318
962bce857696
parent 8312
800c432b34c8
child 8322
b422b4e77d19
permissions
-rw-r--r--

Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.

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
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7900
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
8240
93b8a353c4bf Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8234
diff changeset
13 import contextlib
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
15 from PyQt6.QtCore import pyqtSlot, Qt, QDate, QSize, QPoint, QFileInfo
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
16 from PyQt6.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
17 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
18 )
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
19 from PyQt6.QtWidgets import (
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
20 QWidget, QDialogButtonBox, QHeaderView, QTreeWidgetItem, QApplication,
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
21 QLineEdit, QMenu, QInputDialog
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
22 )
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
207
3f889378dede Added some code to inspect incoming patches as well.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 204
diff changeset
24 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
25 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
26 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
27
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 from .Ui_HgLogBrowserDialog import Ui_HgLogBrowserDialog
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29
5477
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
30 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
31 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
32
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
33 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
34 import Preferences
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
35 import Utilities
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
37 COLORNAMES = ["blue", "darkgreen", "red", "green", "darkblue", "purple",
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
38 "cyan", "olive", "magenta", "darkred", "darkmagenta",
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
39 "darkcyan", "gray", "yellow"]
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
40 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
41
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
42 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
43 "#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
44 "#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
45 ]
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
46
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
47
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
48 class HgLogBrowserDialog(QWidget, Ui_HgLogBrowserDialog):
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 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
51 """
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
52 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
53 BranchColumn = 1
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
54 RevisionColumn = 2
1605
899cb1241de5 Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1532
diff changeset
55 PhaseColumn = 3
899cb1241de5 Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1532
diff changeset
56 AuthorColumn = 4
899cb1241de5 Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1532
diff changeset
57 DateColumn = 5
899cb1241de5 Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1532
diff changeset
58 MessageColumn = 6
899cb1241de5 Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1532
diff changeset
59 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
60 BookmarksColumn = 8
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
61
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
62 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
63 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
64 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
65
3554
9ca56a89aec5 A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3546
diff changeset
66 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
67
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
68 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
69 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 Constructor
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 @param vcs reference to the vcs object
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
73 @type Hg
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
74 @param mode mode of the dialog
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
75 @type str (one of log, full_log, incoming, outgoing)
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
76 @param parent parent widget
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
77 @type QWidget
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 """
8218
7c09585bd960 Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8151
diff changeset
79 super().__init__(parent)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 self.setupUi(self)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81
5506
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
82 windowFlags = self.windowFlags()
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
83 windowFlags |= Qt.WindowType.WindowContextHelpButtonHint
5506
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
84 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
85
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
86 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
87 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
88 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
89 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
90 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
91
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
92 if not mode:
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
93 if vcs.getPlugin().getPreferences("LogBrowserShowFullLog"):
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
94 mode = "full_log"
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
95 else:
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
96 mode = "log"
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
97
782
2c567a5ceade Added different window titles to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 781
diff changeset
98 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
99 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
100 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
101 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
102 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
103 self.setWindowTitle(self.tr("Mercurial Log (Outgoing)"))
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
104 elif mode == "full_log":
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
105 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
106
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
107 self.buttonBox.button(
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
108 QDialogButtonBox.StandardButton.Close).setEnabled(False)
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
109 self.buttonBox.button(
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
110 QDialogButtonBox.StandardButton.Cancel).setDefault(True)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 self.filesTree.headerItem().setText(self.filesTree.columnCount(), "")
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
113 self.filesTree.header().setSortIndicator(
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
114 0, Qt.SortOrder.AscendingOrder)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115
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
116 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
117 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
118
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
119 self.refreshButton = self.buttonBox.addButton(
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
120 self.tr("&Refresh"), QDialogButtonBox.ButtonRole.ActionRole)
1086
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
121 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
122 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
123 self.refreshButton.setEnabled(False)
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
124
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
125 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
126 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
127 self.__findBackwards = False
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
128
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
129 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
130 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
131
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
132 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
133 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
134 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
135 self.fieldCombo.addItem(self.tr("File"), "file")
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
136 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
137
5477
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
138 font = Preferences.getEditorOtherFonts("MonospacedFont")
7779
757334671130 Optimized the various diff panes by using QPlainTextEdit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7775
diff changeset
139 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
140
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
141 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
142 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
143 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
144
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145 self.vcs = vcs
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
146 if mode in ("log", "incoming", "outgoing", "full_log"):
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
147 if mode == "full_log":
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
148 self.commandMode = "incoming"
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
149 else:
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
150 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
151 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
152 else:
215
e8978dca44af Fixed issues with non-existing bundle caches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 213
diff changeset
153 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
154 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
155 self.__hgClient = vcs.getClient()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156
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
157 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
158 "<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
159 "<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
160 "<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
161 "<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
162 "<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
163 "{4}"
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>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
165 "</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
166 )
5477
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
167 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
168 "<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
169 )
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
170 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
171 "<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
172 )
4059
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
173 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
174 "<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
175 )
5459
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
176 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
177 "<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
178 )
4059
15b78ac687fb Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
179 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
180 "<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
181 )
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
182
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
183 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
184 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
185 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
186 self.__selectedRevisions = []
4250
d3bd7c3dcb80 Fixed issues in the Subversion and Mercurial log browser windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4080
diff changeset
187 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
188
1086
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
189 self.__initData()
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
190
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
191 self.__allBranchesFilter = self.tr("All")
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193 self.fromDate.setDisplayFormat("yyyy-MM-dd")
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 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
195 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
196
5477
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
197 # roles used in the log tree
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
198 self.__messageRole = Qt.ItemDataRole.UserRole
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
199 self.__changesRole = Qt.ItemDataRole.UserRole + 1
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
200 self.__edgesRole = Qt.ItemDataRole.UserRole + 2
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
201 self.__parentsRole = Qt.ItemDataRole.UserRole + 3
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
202 self.__latestTagRole = Qt.ItemDataRole.UserRole + 4
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
203 self.__incomingRole = Qt.ItemDataRole.UserRole + 5
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204
5477
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
205 # roles used in the file tree
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
206 self.__diffFileLineRole = Qt.ItemDataRole.UserRole
5477
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
207
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208 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
209 '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
210 '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
211 'M': self.tr('Modified'),
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
212 }
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213
4409
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
214 self.phases = {
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
215 '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
216 '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
217 '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
218 }
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
219
1086
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
220 self.__dotRadius = 8
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
221 self.__rowHeight = 20
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
222
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
223 self.logTree.setIconSize(
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
224 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
225 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
226 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
227 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
228
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
229 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
230 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
231 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
232 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
233 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
234
5445
b24720037f1f Added clickable links to the Mercurial log browser details pane.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5444
diff changeset
235 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
236
4409
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
237 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
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 self.__finishCallbacks = []
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
240 if self.initialCommandMode == "full_log":
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
241 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
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 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
244 """
a5d5e757efcf Fixed a bug in the log browser dialogs causing an endless loop.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5449
diff changeset
245 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
246
a5d5e757efcf Fixed a bug in the log browser dialogs causing an endless loop.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5449
diff changeset
247 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
248 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
249
a5d5e757efcf Fixed a bug in the log browser dialogs causing an endless loop.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5449
diff changeset
250 @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
251 @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
252 """
a5d5e757efcf Fixed a bug in the log browser dialogs causing an endless loop.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5449
diff changeset
253 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
254 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
255
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
256 def __initActionsMenu(self):
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
257 """
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
258 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
259 """
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
260 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
261 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
262 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
263
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
264 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
265 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
266 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
267 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
268 "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
269
5496
d157a2319073 Added a 'Merge' action to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5494
diff changeset
270 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
271 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
272 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
273 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
274 "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
275
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
276 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
277 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
278 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
279 "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
280 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
281 """<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
282 """ 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
283 """ 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
284
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
285 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
286 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
287 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
288 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
289
7010
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
290 self.__closeHeadsAct = self.__actionsMenu.addAction(
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
291 UI.PixmapCache.getIcon("closehead"), self.tr("Close Heads"),
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
292 self.__closeHeadsActTriggered)
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
293 self.__closeHeadsAct.setToolTip(self.tr("Close the selected heads"))
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
294
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
295 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
296 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
297 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
298 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
299 "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
300
4409
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
301 self.__actionsMenu.addSeparator()
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
302
5322
c2cabdca0734 Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5276
diff changeset
303 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
304 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
305 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
306 self.__bookmarkAct.setToolTip(
c2cabdca0734 Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5276
diff changeset
307 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
308 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
309 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
310 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
311 self.__bookmarkMoveAct.setToolTip(
c2cabdca0734 Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5276
diff changeset
312 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
313
c2cabdca0734 Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5276
diff changeset
314 self.__actionsMenu.addSeparator()
c2cabdca0734 Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5276
diff changeset
315
4409
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
316 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
317 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
318 self.__pullActTriggered)
4409
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
319 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
320 "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
321 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
322 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
323 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
324 "Pull large files for selected revisions"))
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
325
4409
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
326 self.__actionsMenu.addSeparator()
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
327
ff1cb0107d40 Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4395
diff changeset
328 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
329 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
330 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
331 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
332 "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
333 " 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
334 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
335 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
336 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
337 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
338 "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
339
5270
7758f0c7d9f6 Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5104
diff changeset
340 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
341
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
342 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
343 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
344 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
345 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
346 "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
347 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
348 """<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
349 """ 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
350 """ 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
351 """ 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
352 """ 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
353 """ 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
354 """ 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
355 """ 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
356 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
357 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
358 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
359 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
360 "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
361
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
362 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
363
5506
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
364 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
365 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
366 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
367 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
368 "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
369 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
370 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
371 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
372 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
373 "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
374
9482a0ded319 Added a GPG actions to the Mercurial log browser action menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5503
diff changeset
375 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
376
5270
7758f0c7d9f6 Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5104
diff changeset
377 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
378 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
379 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
380 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
381 "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
382
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
383 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
384
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 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
386 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
387 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
388 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
389 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
390
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
391 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
392 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
393 self.actionsButton.setMenu(self.__actionsMenu)
1086
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 def __initData(self):
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
396 """
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
397 Private method to (re-)initialize some data.
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
398 """
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
399 self.__maxDate = QDate()
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
400 self.__minDate = QDate()
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
401 self.__filterLogsEnabled = True
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
402
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
403 self.buf = [] # buffer for stdout
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
404 self.diff = None
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
405 self.__started = False
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
406 self.__lastRev = 0
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
407 self.projectMode = False
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
408
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
409 # attributes to store log graph data
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
410 self.__revs = []
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
411 self.__revColors = {}
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
412 self.__revColor = 0
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
413
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
414 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
415
7183
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 7142
diff changeset
416 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
417 self.__projectBranch = ""
5445
b24720037f1f Added clickable links to the Mercurial log browser details pane.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5444
diff changeset
418
b24720037f1f Added clickable links to the Mercurial log browser details pane.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5444
diff changeset
419 self.__childrenInfo = collections.defaultdict(list)
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 def closeEvent(self, e):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
422 """
3591
2f2a4a76dd22 Corrected a bunch of source docu issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3562
diff changeset
423 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
424
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
425 @param e close event (QCloseEvent)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
426 """
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
427 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
428 self.__hgClient.cancel()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
429
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
430 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
431 "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
432 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
433 "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
434 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
435 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
436 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
437 ]
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
438 )
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
439
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
440 e.accept()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
441
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
442 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
443 """
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 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
445 """
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
446 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
447 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
448 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
449
8218
7c09585bd960 Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8151
diff changeset
450 super().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
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 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
453 """
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 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
455 """
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 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
457 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
458 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
459 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
460 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
461 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
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 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
464 """
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 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
466 """
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 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
468 "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
469 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
470 # 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
471 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
472 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
473 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
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 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
476 """
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 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
478 """
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.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
480 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
481 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
482 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
483 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
484 "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
485 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
486 "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
487
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
488 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
489 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
490 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
491 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
492 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
493 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
494
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
495 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
496
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
497 if self.initialCommandMode == "full_log":
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
498 self.commandMode = "incoming"
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
499 else:
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
500 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
501
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
502 def __resizeColumnsLog(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
503 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
504 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
505 """
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
506 self.logTree.header().resizeSections(
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
507 QHeaderView.ResizeMode.ResizeToContents)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
508 self.logTree.header().setStretchLastSection(True)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
509
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
510 def __resizeColumnsFiles(self):
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 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
513 """
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
514 self.filesTree.header().resizeSections(
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
515 QHeaderView.ResizeMode.ResizeToContents)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
516 self.filesTree.header().setStretchLastSection(True)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
517
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
518 def __resortFiles(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
519 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
520 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
521 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
522 sortColumn = self.filesTree.sortColumn()
3023
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
523 self.filesTree.sortItems(
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
524 1, self.filesTree.header().sortIndicatorOrder())
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
525 self.filesTree.sortItems(
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
526 sortColumn, self.filesTree.header().sortIndicatorOrder())
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
527
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
528 def __getColor(self, n):
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
529 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
530 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
531
7455
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
532 @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
533 @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
534 @return color name
7489
6543bcd150fd Updated source docu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7455
diff changeset
535 @rtype str
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
536 """
7455
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
537 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
538 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
539 else:
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
540 return COLORS[n % len(COLORS)]
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
541
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
542 def __branchColor(self, branchName):
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
543 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
544 Private method to calculate a color for a given branch name.
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
545
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
546 @param branchName name of the branch (string)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
547 @return name of the color to use (string)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
548 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
549 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
550 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
551 len(self.__branchColors))
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
552 return self.__branchColors[branchName]
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
553
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
554 def __generateEdges(self, rev, parents):
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
555 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
556 Private method to generate edge info for the give data.
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
557
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
558 @param rev revision to calculate edge info for (integer)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
559 @param parents list of parent revisions (list of integers)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
560 @return tuple containing the column and color index for
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
561 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
562 between the given node and its parents
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
563 (integer, integer, [(integer, integer, integer), ...])
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 if rev not in self.__revs:
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
566 # new head
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
567 self.__revs.append(rev)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
568 self.__revColors[rev] = self.__revColor
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
569 self.__revColor += 1
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
570
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
571 col = self.__revs.index(rev)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
572 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
573 nextRevs = self.__revs[:]
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
574
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
575 # 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
576 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
577 nextRevs[col:col + 1] = addparents
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
578
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
579 # set colors for the parents
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
580 for i, p in enumerate(addparents):
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
581 if not i:
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
582 self.__revColors[p] = color
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
583 else:
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
584 self.__revColors[p] = self.__revColor
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
585 self.__revColor += 1
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
586
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
587 # add edges to the graph
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
588 edges = []
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
589 if parents[0] != -1:
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
590 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
591 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
592 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
593 (ecol, nextRevs.index(erev), self.__revColors[erev]))
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
594 elif erev == rev:
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
595 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
596 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
597 (ecol, nextRevs.index(p), self.__revColors[p]))
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
598
5588
6ba512d9f46a Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
599 self.__revs = nextRevs
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
600 return col, color, edges
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
601
932
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
602 def __generateIcon(self, column, color, bottomedges, topedges, dotColor,
7971
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
603 currentRev, closed, isPushableDraft):
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
604 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
605 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
606 given data.
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
607
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
608 @param column column index of the revision
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
609 @type int
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
610 @param color color of the node
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
611 @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
612 @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
613 @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
614 @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
615 @type list of tuples of (int, int, int)
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
616 @param dotColor color to be used for the dot
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
617 @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
618 @param currentRev flag indicating to draw the icon for the
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
619 current revision
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
620 @type bool
932
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
621 @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
622 branch
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
623 @type bool
7971
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
624 @param isPushableDraft flag indicating an entry of phase 'draft',
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
625 that can by pushed
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
626 @type bool
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
627 @return icon for the node
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
628 @rtype QIcon
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
629 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
630 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
631 """
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
632 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
633
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
634 @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
635 @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
636 """
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
637 return int(1.2 * radius) * col + radius // 2 + 3
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
638
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
639 textColor = self.logTree.palette().color(QPalette.ColorRole.Text)
7455
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
640
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
641 radius = self.__dotRadius
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
642 w = len(bottomedges) * radius + 20
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
643 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
644
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
645 dot_x = col2x(column, radius) - radius // 2
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
646 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
647
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
648 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
649 pix.fill(QColor(0, 0, 0, 0)) # draw transparent background
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
650 painter = QPainter(pix)
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7971
diff changeset
651 painter.setRenderHint(QPainter.RenderHint.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
652
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
653 # draw the revision history lines
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
654 for y1, y2, lines in ((0, h, bottomedges),
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
655 (-h, 0, topedges)):
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
656 if lines:
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
657 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
658 lpen = QPen(QColor(self.__getColor(ecolor)))
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
659 lpen.setWidth(2)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
660 painter.setPen(lpen)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
661 x1 = col2x(start, radius)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
662 x2 = col2x(end, radius)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
663 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
664
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
665 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
666 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
667
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
668 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
669
7455
9d0852f0bb2c GitLogBrowserDialog, HgLogBrowserDialog: added log tree colors to be used with dark backgrounds.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7454
diff changeset
670 # 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
671 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
672 # 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
673 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
674 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
675 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
676 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
677 penradius = 3
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
678 painter.setBrush(dotColor)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
679 pen = QPen(pencolor)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
680 pen.setWidth(penradius)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
681 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
682 if closed:
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
683 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
684 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
685 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
686 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
687 if self.commandMode == "incoming":
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
688 # 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
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, 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 + 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
692 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
693 )
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
694 else:
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
695 # 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
696 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
697 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
698 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
699 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
700 )
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
701 else:
7971
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
702 if isPushableDraft:
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
703 # 'draft' phase: draw an up arrow like outgoing,
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
704 # if it can be pushed
7009
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
705 offset = radius // 2
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
706 painter.drawConvexPolygon(
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
707 QPoint(dot_x + offset, dot_y),
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
708 QPoint(dot_x, dot_y + 2 * offset),
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
709 QPoint(dot_x + 2 * offset, dot_y + 2 * offset)
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
710 )
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
711 else:
eaf5ed6ef298 Mercurial Interface:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6986
diff changeset
712 painter.drawEllipse(dot_x, dot_y, radius, radius)
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
713 painter.end()
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
714 return QIcon(pix)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
715
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
716 def __getParents(self, rev):
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
717 """
932
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
718 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
719 file/directory.
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
720
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
721 @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
722 @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
723 """
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
724 errMsg = ""
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
725 parents = [-1]
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
726
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
727 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
728 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
729 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
730 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
731 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
732 args.append(self.__bundle)
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
733 elif (
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
734 self.vcs.bundleFile and
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
735 os.path.exists(self.vcs.bundleFile)
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
736 ):
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 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
738 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
739 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
740 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
741 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
742 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
743 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
744 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
745
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
746 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
747
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
748 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
749 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
750
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
751 return parents
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
752
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 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
754 """
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
755 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
756 """
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
757 errMsg = ""
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
758
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
759 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
760 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
761
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
762 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
763
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
764 if errMsg:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
765 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
766 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
767 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
768 errMsg)
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
769
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
770 if output:
2544
3868561e3962 Fixed an issue introduced by the last changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2543
diff changeset
771 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
772 if len(outputList) == 2:
7183
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 7142
diff changeset
773 outputRevs = outputList[0].strip()
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 7142
diff changeset
774 if outputRevs.endswith("+"):
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 7142
diff changeset
775 outputRevs = outputRevs[:-1]
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 7142
diff changeset
776 self.__projectWorkingDirParents = outputRevs.split('+')
7187
11b0c7802a70 HgLogBrowserDialog: fixed the patch submitted by Christos.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7183
diff changeset
777 else:
11b0c7802a70 HgLogBrowserDialog: fixed the patch submitted by Christos.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7183
diff changeset
778 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
779 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
780
921
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
781 def __getClosedBranches(self):
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
782 """
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
783 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
784 """
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
785 self.__closedBranchesRevs = []
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
786 errMsg = ""
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
787
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
788 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
789 args.append("--closed")
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
790
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
791 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
792
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
793 if errMsg:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
794 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
795 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
796 self.tr("Mercurial Error"),
921
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
797 errMsg)
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
798
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
799 if output:
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
800 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
801 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
802 parts = line.split()
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
803 self.__closedBranchesRevs.append(
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
804 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
805
7010
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
806 def __getHeads(self):
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
807 """
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
808 Private method to get the list of all heads.
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
809 """
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
810 self.__headRevisions = []
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
811 errMsg = ""
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
812
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
813 args = self.vcs.initCommand("heads")
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
814 args.append("--closed")
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
815 args.append("--template")
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
816 args.append("{rev}\n")
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
817
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
818 output, errMsg = self.__hgClient.runcommand(args)
7010
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
819
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
820 if errMsg:
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
821 E5MessageBox.critical(
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
822 self,
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
823 self.tr("Mercurial Error"),
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
824 errMsg)
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
825
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
826 if output:
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
827 for line in output.splitlines():
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
828 line = line.strip()
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
829 if line:
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
830 self.__headRevisions.append(line)
5d6f5a69a952 Mercurial Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7009
diff changeset
831
5459
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
832 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
833 """
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
834 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
835
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
836 @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
837 @type str
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
838 @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
839 @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
840 """
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
841 errMsg = ""
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
842
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
843 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
844
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
845 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
846
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
847 if errMsg:
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
848 E5MessageBox.critical(
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
849 self,
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
850 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
851 errMsg)
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
852
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
853 res = ("", "")
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
854 if output:
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
855 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
856 if line.strip():
8243
cc717c2ae956 Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8240
diff changeset
857 with contextlib.suppress(ValueError):
5477
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
858 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
859 if name == tag:
fb8875e356d4 Fixed a bug in the Mercurial GPG verify signature dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5463
diff changeset
860 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
861 break
5459
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
862
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
863 return res
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
864
932
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
865 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
866 parents, branches, tags, phase, bookmarks,
7971
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
867 latestTag, canPush=False):
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
868 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
869 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
870
7971
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
871 @param author author info
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
872 @type str
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
873 @param date date info
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
874 @type str
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
875 @param message text of the log message
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
876 @type list of str
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
877 @param revision revision info
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
878 @type str
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
879 @param changedPaths list of dictionary objects containing
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
880 info about the changed files/directories
7971
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
881 @type dict
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
882 @param parents list of parent revisions
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
883 @type list of int
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
884 @param branches list of branches
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
885 @type list of str
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
886 @param tags list of tags
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
887 @type str
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
888 @param phase phase of the entry
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
889 @type str
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
890 @param bookmarks list of bookmarks
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
891 @type str
5459
cdfdecd2faef Extended the details view of the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5451
diff changeset
892 @param latestTag the latest tag(s) reachable from the changeset
7971
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
893 @type list of str
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
894 @param canPush flag indicating that changesets can be pushed
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
895 @type bool
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
896 @return reference to the generated item
ff2971513d6d Mercurial: completed more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
897 @rtype QTreeWidgetItem
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
898 """
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
899 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
900 "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
901 msgtxt = ""
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
902 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
903 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
904 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
905 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
906 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
907 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
908 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
909 msgtxt = "{0}...".format(msgtxt[:logMessageColumnWidth])
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
910
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
911 rev, node = revision.split(":")
8234
fcb6b4b96274 Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8222
diff changeset
912 closedStr = (self.ClosedIndicator
fcb6b4b96274 Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8222
diff changeset
913 if rev in self.__closedBranchesRevs else "")
fcb6b4b96274 Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8222
diff changeset
914 phaseStr = self.phases.get(phase, phase)
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
915 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
916 "",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
917 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
918 "{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
919 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
920 author,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
921 date,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
922 msgtxt,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
923 ", ".join(tags),
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
924 ]
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
925 if bookmarks is not None:
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
926 columnLabels.append(", ".join(bookmarks))
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
927 itm = QTreeWidgetItem(self.logTree, columnLabels)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
928
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
929 itm.setForeground(self.BranchColumn,
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
930 QBrush(QColor(self.__branchColor(branches[0]))))
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
931
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
932 if not self.projectMode:
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
933 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
934 if not parents:
26ed553ad4fb Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 207
diff changeset
935 parents = [int(rev) - 1]
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
936 column, color, edges = self.__generateEdges(int(rev), parents)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
937
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
938 itm.setData(0, self.__messageRole, message)
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
939 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
940 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
941 itm.setData(0, self.__latestTagRole, latestTag)
3242
a7e006073658 Fixed an issue in Mercurial log dialogs showing a wrong