Sat, 31 Dec 2016 13:34:21 +0100
Updated copyright for 2017.
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 | |
5389
9b1c800daff3
Updated copyright for 2017.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5353
diff
changeset
|
3 | # Copyright (c) 2010 - 2017 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 | |
3145
a9de05d4a22f
# __IGNORE_WARNING__ added/ removed.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
3060
diff
changeset
|
10 | from __future__ import unicode_literals |
2525
8b507a9a2d40
Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
2444
diff
changeset
|
11 | try: |
3484 | 12 | str = unicode |
13 | except NameError: | |
2525
8b507a9a2d40
Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
2444
diff
changeset
|
14 | pass |
8b507a9a2d40
Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
2444
diff
changeset
|
15 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
16 | 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
|
17 | import re |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | |
3656
441956d8fce5
Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3591
diff
changeset
|
19 | from PyQt5.QtCore import pyqtSlot, Qt, QDate, QProcess, QTimer, QRegExp, \ |
3036
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
20 | QSize, QPoint |
3656
441956d8fce5
Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3591
diff
changeset
|
21 | from PyQt5.QtGui import QCursor, QColor, QPixmap, QPainter, QPen, QBrush, QIcon |
441956d8fce5
Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3591
diff
changeset
|
22 | from PyQt5.QtWidgets import QWidget, QDialogButtonBox, QHeaderView, \ |
5322
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
23 | QTreeWidgetItem, QApplication, QLineEdit, QMenu, QInputDialog |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | |
207
3f889378dede
Added some code to inspect incoming patches as well.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
204
diff
changeset
|
25 | from E5Gui.E5Application import e5App |
537
72b32daeb8d6
Continued replacing QMessageBox methods with own methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
470
diff
changeset
|
26 | from E5Gui import E5MessageBox |
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 | |
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
|
30 | import UI.PixmapCache |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
31 | |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
32 | COLORNAMES = ["blue", "darkgreen", "red", "green", "darkblue", "purple", |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
33 | "cyan", "olive", "magenta", "darkred", "darkmagenta", |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
34 | "darkcyan", "gray", "yellow"] |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
35 | COLORS = [str(QColor(x).name()) for x in COLORNAMES] |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
36 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
37 | |
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
|
38 | class HgLogBrowserDialog(QWidget, Ui_HgLogBrowserDialog): |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
39 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | 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
|
41 | """ |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
42 | 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
|
43 | BranchColumn = 1 |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
44 | RevisionColumn = 2 |
1605
899cb1241de5
Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1532
diff
changeset
|
45 | PhaseColumn = 3 |
899cb1241de5
Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1532
diff
changeset
|
46 | AuthorColumn = 4 |
899cb1241de5
Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1532
diff
changeset
|
47 | DateColumn = 5 |
899cb1241de5
Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1532
diff
changeset
|
48 | MessageColumn = 6 |
899cb1241de5
Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1532
diff
changeset
|
49 | 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
|
50 | BookmarksColumn = 8 |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
51 | |
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
|
52 | 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
|
53 | 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
|
54 | 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
|
55 | |
3554
9ca56a89aec5
A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3546
diff
changeset
|
56 | 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
|
57 | |
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
|
58 | def __init__(self, vcs, mode="log", parent=None): |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
59 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
60 | Constructor |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
61 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
62 | @param vcs reference to the vcs object |
215
e8978dca44af
Fixed issues with non-existing bundle caches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
213
diff
changeset
|
63 | @param mode mode of the dialog (string; one of log, incoming, outgoing) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
64 | @param parent parent widget (QWidget) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
65 | """ |
2525
8b507a9a2d40
Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
2444
diff
changeset
|
66 | super(HgLogBrowserDialog, self).__init__(parent) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
67 | self.setupUi(self) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
68 | |
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
|
69 | self.__position = QPoint() |
2079b76a738b
Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3279
diff
changeset
|
70 | |
782
2c567a5ceade
Added different window titles to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
781
diff
changeset
|
71 | 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
|
72 | 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
|
73 | 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
|
74 | 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
|
75 | 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
|
76 | self.setWindowTitle(self.tr("Mercurial Log (Outgoing)")) |
782
2c567a5ceade
Added different window titles to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
781
diff
changeset
|
77 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
78 | self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
79 | self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
80 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
81 | self.filesTree.headerItem().setText(self.filesTree.columnCount(), "") |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
82 | self.filesTree.header().setSortIndicator(0, Qt.AscendingOrder) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
83 | |
3008
7848489bcb92
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2962
diff
changeset
|
84 | self.refreshButton = self.buttonBox.addButton( |
3190
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3185
diff
changeset
|
85 | self.tr("&Refresh"), QDialogButtonBox.ActionRole) |
1086
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
86 | 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
|
87 | 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
|
88 | self.refreshButton.setEnabled(False) |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
89 | |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
90 | self.findPrevButton.setIcon(UI.PixmapCache.getIcon("1leftarrow.png")) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
91 | self.findNextButton.setIcon(UI.PixmapCache.getIcon("1rightarrow.png")) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
92 | self.__findBackwards = False |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
93 | |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
94 | 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
|
95 | 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
|
96 | |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
97 | 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
|
98 | 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
|
99 | 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
|
100 | self.fieldCombo.addItem(self.tr("File"), "file") |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
101 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
102 | self.vcs = vcs |
181
4af57f97c1bc
Added code to choose the way incoming and outgoing logs are shown.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
180
diff
changeset
|
103 | if mode in ("log", "incoming", "outgoing"): |
187
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
104 | 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
|
105 | 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
|
106 | else: |
215
e8978dca44af
Fixed issues with non-existing bundle caches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
213
diff
changeset
|
107 | 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
|
108 | 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
|
109 | self.__hgClient = vcs.getClient() |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
110 | |
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
|
111 | 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
|
112 | "<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
|
113 | "<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
|
114 | "<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
|
115 | "<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
|
116 | "<tr><td><b>Branch</b></td><td>{3}</td></tr>" |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
117 | "<tr><td><b>Parents</b></td><td>{4}</td></tr>" |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
118 | "{5}" |
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
|
119 | "</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
|
120 | ) |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
121 | 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
|
122 | "<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
|
123 | ) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
124 | 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
|
125 | "<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
|
126 | ) |
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
|
127 | |
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
|
128 | 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
|
129 | 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
|
130 | self.__isFile = False |
3927
3e1dc0fb26ed
Enhanced the Mercurial log browser a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3909
diff
changeset
|
131 | self.__currentRevision = "" |
4250
d3bd7c3dcb80
Fixed issues in the Subversion and Mercurial log browser windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4080
diff
changeset
|
132 | 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
|
133 | |
1086
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
134 | self.__initData() |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
135 | |
3190
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3185
diff
changeset
|
136 | self.__allBranchesFilter = self.tr("All") |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
137 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
138 | self.fromDate.setDisplayFormat("yyyy-MM-dd") |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
139 | 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
|
140 | 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
|
141 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
142 | self.__messageRole = Qt.UserRole |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
143 | self.__changesRole = Qt.UserRole + 1 |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
144 | self.__edgesRole = Qt.UserRole + 2 |
208
26ed553ad4fb
Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
207
diff
changeset
|
145 | self.__parentsRole = Qt.UserRole + 3 |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
146 | |
1241
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
147 | if self.__hgClient: |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
148 | self.process = None |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
149 | else: |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
150 | self.process = QProcess() |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
151 | self.process.finished.connect(self.__procFinished) |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
152 | self.process.readyReadStandardOutput.connect(self.__readStdout) |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
153 | self.process.readyReadStandardError.connect(self.__readStderr) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
154 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
155 | 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
|
156 | '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
|
157 | '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
|
158 | 'M': self.tr('Modified'), |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
159 | } |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
160 | |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
161 | self.phases = { |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
162 | '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
|
163 | '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
|
164 | '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
|
165 | } |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
166 | |
1086
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
167 | self.__dotRadius = 8 |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
168 | self.__rowHeight = 20 |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
169 | |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
170 | self.logTree.setIconSize( |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
171 | 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
|
172 | 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
|
173 | 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
|
174 | 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
|
175 | |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
176 | self.__initActionsMenu() |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
177 | |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
178 | def __initActionsMenu(self): |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
179 | """ |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
180 | 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
|
181 | """ |
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
|
182 | self.__actionsMenu = QMenu() |
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
|
183 | self.__graftAct = self.__actionsMenu.addAction( |
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
|
184 | UI.PixmapCache.getIcon("vcsGraft.png"), |
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
|
185 | 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
|
186 | 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
|
187 | "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
|
188 | |
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
|
189 | 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
|
190 | 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
|
191 | 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
|
192 | "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
|
193 | 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
|
194 | """<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
|
195 | """ 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
|
196 | """ 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
|
197 | |
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
|
198 | self.__tagAct = self.__actionsMenu.addAction( |
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
|
199 | UI.PixmapCache.getIcon("vcsTag.png"), self.tr("Tag"), |
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
|
200 | 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
|
201 | 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
|
202 | |
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
|
203 | self.__switchAct = self.__actionsMenu.addAction( |
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
|
204 | UI.PixmapCache.getIcon("vcsSwitch.png"), self.tr("Switch"), |
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
|
205 | 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
|
206 | 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
|
207 | "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
|
208 | |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
209 | self.__actionsMenu.addSeparator() |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
210 | |
5322
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
211 | self.__bookmarkAct = self.__actionsMenu.addAction( |
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
|
212 | UI.PixmapCache.getIcon("addBookmark.png"), |
5322
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
213 | 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
|
214 | self.__bookmarkAct.setToolTip( |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
215 | 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
|
216 | self.__bookmarkMoveAct = self.__actionsMenu.addAction( |
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
|
217 | UI.PixmapCache.getIcon("moveBookmark.png"), |
5322
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
218 | 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
|
219 | self.__bookmarkMoveAct.setToolTip( |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
220 | 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
|
221 | |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
222 | self.__actionsMenu.addSeparator() |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
223 | |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
224 | self.__pullAct = self.__actionsMenu.addAction( |
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
|
225 | UI.PixmapCache.getIcon("vcsUpdate.png"), self.tr("Pull Changes"), |
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
|
226 | self.__pullActTriggered) |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
227 | 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
|
228 | "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
|
229 | 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
|
230 | 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
|
231 | 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
|
232 | "Pull large files for selected revisions")) |
5270
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
233 | self.__fetchAct = self.__actionsMenu.addAction( |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
234 | self.tr("Fetch Changes"), self.__fetchActTriggered) |
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
|
235 | self.__fetchAct.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
|
236 | "Fetch changes from a remote repository")) |
3315
bd1a25ead18d
Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3302
diff
changeset
|
237 | |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
238 | self.__actionsMenu.addSeparator() |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
239 | |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
240 | self.__pushAct = self.__actionsMenu.addAction( |
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
|
241 | UI.PixmapCache.getIcon("vcsCommit.png"), |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
242 | 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
|
243 | 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
|
244 | "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
|
245 | " 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
|
246 | self.__pushAllAct = self.__actionsMenu.addAction( |
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
|
247 | UI.PixmapCache.getIcon("vcsCommit.png"), |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
248 | 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
|
249 | 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
|
250 | "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
|
251 | |
5270
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
252 | 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
|
253 | |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
254 | self.__stripAct = self.__actionsMenu.addAction( |
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
|
255 | UI.PixmapCache.getIcon("fileDelete.png"), |
5270
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
256 | 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
|
257 | 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
|
258 | "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
|
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.actionsButton.setIcon( |
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
|
261 | UI.PixmapCache.getIcon("actionsToolButton.png")) |
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
|
262 | self.actionsButton.setMenu(self.__actionsMenu) |
1086
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
263 | |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
264 | def __initData(self): |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
265 | """ |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
266 | Private method to (re-)initialize some data. |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
267 | """ |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
268 | self.__maxDate = QDate() |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
269 | self.__minDate = QDate() |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
270 | self.__filterLogsEnabled = True |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
271 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
272 | self.buf = [] # buffer for stdout |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
273 | self.diff = None |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
274 | self.__started = False |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
275 | self.__lastRev = 0 |
187
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
276 | self.projectMode = False |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
277 | |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
278 | # attributes to store log graph data |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
279 | self.__revs = [] |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
280 | self.__revColors = {} |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
281 | self.__revColor = 0 |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
282 | |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
283 | 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
|
284 | |
aaa856499ed5
Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
236
diff
changeset
|
285 | self.__projectRevision = -1 |
2543
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
286 | self.__projectBranch = "" |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
287 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
288 | def closeEvent(self, e): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
289 | """ |
3591
2f2a4a76dd22
Corrected a bunch of source docu issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3562
diff
changeset
|
290 | 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
|
291 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
292 | @param e close event (QCloseEvent) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
293 | """ |
1256
885706dbb69f
Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1250
diff
changeset
|
294 | if self.__hgClient: |
885706dbb69f
Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1250
diff
changeset
|
295 | if self.__hgClient.isExecuting(): |
885706dbb69f
Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1250
diff
changeset
|
296 | self.__hgClient.cancel() |
885706dbb69f
Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1250
diff
changeset
|
297 | else: |
885706dbb69f
Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1250
diff
changeset
|
298 | if self.process is not None and \ |
885706dbb69f
Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1250
diff
changeset
|
299 | self.process.state() != QProcess.NotRunning: |
885706dbb69f
Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1250
diff
changeset
|
300 | self.process.terminate() |
885706dbb69f
Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1250
diff
changeset
|
301 | QTimer.singleShot(2000, self.process.kill) |
885706dbb69f
Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1250
diff
changeset
|
302 | self.process.waitForFinished(3000) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
303 | |
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
|
304 | self.__position = self.pos() |
2079b76a738b
Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3279
diff
changeset
|
305 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
306 | e.accept() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
307 | |
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
|
308 | 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
|
309 | """ |
2079b76a738b
Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3279
diff
changeset
|
310 | 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
|
311 | """ |
2079b76a738b
Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3279
diff
changeset
|
312 | if not self.__position.isNull(): |
2079b76a738b
Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3279
diff
changeset
|
313 | self.move(self.__position) |
2079b76a738b
Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3279
diff
changeset
|
314 | 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
|
315 | |
3484 | 316 | super(HgLogBrowserDialog, self).show() |
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
|
317 | |
2079b76a738b
Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3279
diff
changeset
|
318 | 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
|
319 | """ |
2079b76a738b
Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3279
diff
changeset
|
320 | 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
|
321 | """ |
2079b76a738b
Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3279
diff
changeset
|
322 | 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
|
323 | 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
|
324 | 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
|
325 | 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
|
326 | 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
|
327 | "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
|
328 | 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
|
329 | "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
|
330 | |
2079b76a738b
Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3279
diff
changeset
|
331 | 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
|
332 | 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
|
333 | 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
|
334 | 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
|
335 | 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
|
336 | 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
|
337 | |
2079b76a738b
Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3279
diff
changeset
|
338 | 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
|
339 | |
2079b76a738b
Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3279
diff
changeset
|
340 | self.commandMode = self.initialCommandMode |
2079b76a738b
Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3279
diff
changeset
|
341 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
342 | def __resizeColumnsLog(self): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
343 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
344 | 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
|
345 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
346 | self.logTree.header().resizeSections(QHeaderView.ResizeToContents) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
347 | self.logTree.header().setStretchLastSection(True) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
348 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
349 | def __resizeColumnsFiles(self): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
350 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
351 | 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
|
352 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
353 | self.filesTree.header().resizeSections(QHeaderView.ResizeToContents) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
354 | self.filesTree.header().setStretchLastSection(True) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
355 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
356 | def __resortFiles(self): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
357 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
358 | 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
|
359 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
360 | sortColumn = self.filesTree.sortColumn() |
3023
34ce20603bf7
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3020
diff
changeset
|
361 | self.filesTree.sortItems( |
34ce20603bf7
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3020
diff
changeset
|
362 | 1, self.filesTree.header().sortIndicatorOrder()) |
34ce20603bf7
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3020
diff
changeset
|
363 | self.filesTree.sortItems( |
34ce20603bf7
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3020
diff
changeset
|
364 | sortColumn, self.filesTree.header().sortIndicatorOrder()) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
365 | |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
366 | def __getColor(self, n): |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
367 | """ |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
368 | 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
|
369 | |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
370 | @param n color index (integer) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
371 | @return color name (string) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
372 | """ |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
373 | return COLORS[n % len(COLORS)] |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
374 | |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
375 | def __branchColor(self, branchName): |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
376 | """ |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
377 | Private method to calculate a color for a given branch name. |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
378 | |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
379 | @param branchName name of the branch (string) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
380 | @return name of the color to use (string) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
381 | """ |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
382 | 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
|
383 | 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
|
384 | len(self.__branchColors)) |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
385 | return self.__branchColors[branchName] |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
386 | |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
387 | def __generateEdges(self, rev, parents): |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
388 | """ |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
389 | Private method to generate edge info for the give data. |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
390 | |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
391 | @param rev revision to calculate edge info for (integer) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
392 | @param parents list of parent revisions (list of integers) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
393 | @return tuple containing the column and color index for |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
394 | 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
|
395 | between the given node and its parents |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
396 | (integer, integer, [(integer, integer, integer), ...]) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
397 | """ |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
398 | if rev not in self.__revs: |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
399 | # new head |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
400 | self.__revs.append(rev) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
401 | self.__revColors[rev] = self.__revColor |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
402 | self.__revColor += 1 |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
403 | |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
404 | col = self.__revs.index(rev) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
405 | color = self.__revColors.pop(rev) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
406 | next = self.__revs[:] |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
407 | |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
408 | # add parents to next |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
409 | addparents = [p for p in parents if p not in next] |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
410 | next[col:col + 1] = addparents |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
411 | |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
412 | # set colors for the parents |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
413 | for i, p in enumerate(addparents): |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
414 | if not i: |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
415 | self.__revColors[p] = color |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
416 | else: |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
417 | self.__revColors[p] = self.__revColor |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
418 | self.__revColor += 1 |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
419 | |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
420 | # add edges to the graph |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
421 | edges = [] |
187
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
422 | if parents[0] != -1: |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
423 | for ecol, erev in enumerate(self.__revs): |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
424 | if erev in next: |
932
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
425 | edges.append( |
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
426 | (ecol, next.index(erev), self.__revColors[erev])) |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
427 | elif erev == rev: |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
428 | 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
|
429 | edges.append( |
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
430 | (ecol, next.index(p), self.__revColors[p])) |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
431 | |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
432 | self.__revs = next |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
433 | return col, color, edges |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
434 | |
932
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
435 | def __generateIcon(self, column, color, bottomedges, topedges, dotColor, |
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
436 | currentRev, closed): |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
437 | """ |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
438 | 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
|
439 | given data. |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
440 | |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
441 | @param column column index of the revision (integer) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
442 | @param color color of the node (integer) |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
443 | @param bottomedges list of edges for the bottom of the node |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
444 | (list of tuples of three integers) |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
445 | @param topedges list of edges for the top of the node |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
446 | (list of tuples of three integers) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
447 | @param dotColor color to be used for the dot (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
|
448 | @param currentRev flag indicating to draw the icon for the |
aaa856499ed5
Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
236
diff
changeset
|
449 | current revision (boolean) |
932
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
450 | @param closed flag indicating to draw an icon for a closed |
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
451 | branch (boolean) |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
452 | @return icon for the node (QIcon) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
453 | """ |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
454 | 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
|
455 | """ |
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
|
456 | 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
|
457 | |
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
|
458 | @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
|
459 | @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
|
460 | """ |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
461 | return int(1.2 * radius) * col + radius // 2 + 3 |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
462 | |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
463 | radius = self.__dotRadius |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
464 | w = len(bottomedges) * radius + 20 |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
465 | 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
|
466 | |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
467 | dot_x = col2x(column, radius) - radius // 2 |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
468 | 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
|
469 | |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
470 | pix = QPixmap(w, h) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
471 | pix.fill(QColor(0, 0, 0, 0)) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
472 | painter = QPainter(pix) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
473 | painter.setRenderHint(QPainter.Antialiasing) |
241
aaa856499ed5
Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
236
diff
changeset
|
474 | |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
475 | pen = QPen(Qt.blue) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
476 | pen.setWidth(2) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
477 | painter.setPen(pen) |
241
aaa856499ed5
Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
236
diff
changeset
|
478 | |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
479 | lpen = QPen(pen) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
480 | lpen.setColor(Qt.black) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
481 | painter.setPen(lpen) |
241
aaa856499ed5
Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
236
diff
changeset
|
482 | |
aaa856499ed5
Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
236
diff
changeset
|
483 | # draw the revision history lines |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
484 | for y1, y2, lines in ((0, h, bottomedges), |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
485 | (-h, 0, topedges)): |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
486 | if lines: |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
487 | for start, end, ecolor in lines: |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
488 | lpen = QPen(pen) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
489 | lpen.setColor(QColor(self.__getColor(ecolor))) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
490 | lpen.setWidth(2) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
491 | painter.setPen(lpen) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
492 | x1 = col2x(start, radius) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
493 | x2 = col2x(end, radius) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
494 | 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
|
495 | |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
496 | penradius = 1 |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
497 | pencolor = Qt.black |
241
aaa856499ed5
Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
236
diff
changeset
|
498 | |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
499 | 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
|
500 | |
aaa856499ed5
Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
236
diff
changeset
|
501 | # draw a dot for the revision |
aaa856499ed5
Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
236
diff
changeset
|
502 | if currentRev: |
aaa856499ed5
Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
236
diff
changeset
|
503 | # enlarge dot 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
|
504 | 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
|
505 | 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
|
506 | 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
|
507 | 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
|
508 | penradius = 3 |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
509 | painter.setBrush(dotColor) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
510 | pen = QPen(pencolor) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
511 | pen.setWidth(penradius) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
512 | 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
|
513 | if closed: |
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
514 | 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
|
515 | 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
|
516 | 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
|
517 | offset = radius // 2 |
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
|
518 | painter.drawConvexPolygon( |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
519 | QPoint(dot_x + offset, dot_y), |
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
520 | QPoint(dot_x, dot_y + offset), |
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
521 | QPoint(dot_x + offset, dot_y + 2 * offset), |
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
|
522 | QPoint(dot_x + 2 * offset, dot_y + offset) |
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
|
523 | ) |
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
|
524 | else: |
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
|
525 | painter.drawEllipse(dot_x, dot_y, radius, radius) |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
526 | painter.end() |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
527 | return QIcon(pix) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
528 | |
187
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
529 | def __getParents(self, rev): |
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
530 | """ |
932
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
531 | 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
|
532 | file/directory. |
187
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
533 | |
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
534 | @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
|
535 | @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
|
536 | """ |
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
537 | errMsg = "" |
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
538 | parents = [-1] |
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
539 | |
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
|
540 | 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
|
541 | 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
|
542 | 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
|
543 | 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
|
544 | 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
|
545 | args.append(self.__bundle) |
3008
7848489bcb92
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2962
diff
changeset
|
546 | elif self.vcs.bundleFile and \ |
7848489bcb92
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2962
diff
changeset
|
547 | os.path.exists(self.vcs.bundleFile): |
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
|
548 | 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
|
549 | 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
|
550 | 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
|
551 | 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
|
552 | 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
|
553 | 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
|
554 | 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
|
555 | 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
|
556 | |
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
|
557 | 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
|
558 | if self.__hgClient: |
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
|
559 | output, errMsg = self.__hgClient.runcommand(args) |
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
|
560 | else: |
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
|
561 | process = QProcess() |
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
|
562 | process.setWorkingDirectory(self.repodir) |
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
|
563 | process.start('hg', args) |
2771
281c9b30dd91
Changed all QProcess.waitForStarted() calls to use a 5s timeout (except the debugger interfaces, which have a 10s timeout).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2731
diff
changeset
|
564 | procStarted = process.waitForStarted(5000) |
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
|
565 | if procStarted: |
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
|
566 | finished = process.waitForFinished(30000) |
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
|
567 | if finished and process.exitCode() == 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
|
568 | output = str(process.readAllStandardOutput(), |
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
|
569 | self.vcs.getEncoding(), 'replace') |
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
|
570 | else: |
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
|
571 | if not finished: |
3190
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3185
diff
changeset
|
572 | errMsg = self.tr( |
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
|
573 | "The hg process did not finish within 30s.") |
1241
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
574 | else: |
3190
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3185
diff
changeset
|
575 | errMsg = self.tr("Could not start the hg executable.") |
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
|
576 | |
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
|
577 | if errMsg: |
3020
542e97d4ecb3
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3008
diff
changeset
|
578 | E5MessageBox.critical( |
542e97d4ecb3
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3008
diff
changeset
|
579 | self, |
3190
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3185
diff
changeset
|
580 | self.tr("Mercurial Error"), |
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
|
581 | errMsg) |
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
|
582 | |
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
|
583 | 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
|
584 | 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
|
585 | |
187
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
586 | return parents |
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
587 | |
241
aaa856499ed5
Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
236
diff
changeset
|
588 | 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
|
589 | """ |
aaa856499ed5
Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
236
diff
changeset
|
590 | 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
|
591 | """ |
aaa856499ed5
Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
236
diff
changeset
|
592 | errMsg = "" |
aaa856499ed5
Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
236
diff
changeset
|
593 | |
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
|
594 | 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
|
595 | 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
|
596 | |
1241
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
597 | output = "" |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
598 | if self.__hgClient: |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
599 | output, errMsg = self.__hgClient.runcommand(args) |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
600 | else: |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
601 | process = QProcess() |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
602 | process.setWorkingDirectory(self.repodir) |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
603 | process.start('hg', args) |
2771
281c9b30dd91
Changed all QProcess.waitForStarted() calls to use a 5s timeout (except the debugger interfaces, which have a 10s timeout).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2731
diff
changeset
|
604 | procStarted = process.waitForStarted(5000) |
1241
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
605 | if procStarted: |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
606 | finished = process.waitForFinished(30000) |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
607 | if finished and process.exitCode() == 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
|
608 | output = str(process.readAllStandardOutput(), |
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
|
609 | self.vcs.getEncoding(), 'replace') |
1241
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
610 | else: |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
611 | if not finished: |
3190
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3185
diff
changeset
|
612 | errMsg = self.tr( |
1241
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
613 | "The hg process did not finish within 30s.") |
241
aaa856499ed5
Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
236
diff
changeset
|
614 | else: |
3190
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3185
diff
changeset
|
615 | errMsg = self.tr("Could not start the hg executable.") |
241
aaa856499ed5
Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
236
diff
changeset
|
616 | |
aaa856499ed5
Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
236
diff
changeset
|
617 | if errMsg: |
3020
542e97d4ecb3
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3008
diff
changeset
|
618 | E5MessageBox.critical( |
542e97d4ecb3
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3008
diff
changeset
|
619 | self, |
3190
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3185
diff
changeset
|
620 | 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
|
621 | errMsg) |
1241
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
622 | |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
623 | if output: |
2544
3868561e3962
Fixed an issue introduced by the last changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2543
diff
changeset
|
624 | 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
|
625 | if len(outputList) == 2: |
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
626 | self.__projectRevision = outputList[0].strip() |
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
627 | if self.__projectRevision.endswith("+"): |
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
628 | self.__projectRevision = self.__projectRevision[:-1] |
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
|
629 | 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
|
630 | |
921
ae00e4fbcec0
Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
631 | def __getClosedBranches(self): |
ae00e4fbcec0
Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
632 | """ |
ae00e4fbcec0
Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
633 | 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
|
634 | """ |
ae00e4fbcec0
Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
635 | self.__closedBranchesRevs = [] |
ae00e4fbcec0
Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
636 | errMsg = "" |
ae00e4fbcec0
Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
637 | |
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
|
638 | 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
|
639 | args.append("--closed") |
ae00e4fbcec0
Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
640 | |
1241
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
641 | output = "" |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
642 | if self.__hgClient: |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
643 | output, errMsg = self.__hgClient.runcommand(args) |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
644 | else: |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
645 | process = QProcess() |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
646 | process.setWorkingDirectory(self.repodir) |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
647 | process.start('hg', args) |
2771
281c9b30dd91
Changed all QProcess.waitForStarted() calls to use a 5s timeout (except the debugger interfaces, which have a 10s timeout).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2731
diff
changeset
|
648 | procStarted = process.waitForStarted(5000) |
1241
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
649 | if procStarted: |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
650 | finished = process.waitForFinished(30000) |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
651 | if finished and process.exitCode() == 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
|
652 | output = str(process.readAllStandardOutput(), |
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
|
653 | self.vcs.getEncoding(), 'replace') |
1241
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
654 | else: |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
655 | if not finished: |
3190
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3185
diff
changeset
|
656 | errMsg = self.tr( |
1241
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
657 | "The hg process did not finish within 30s.") |
921
ae00e4fbcec0
Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
658 | else: |
3190
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3185
diff
changeset
|
659 | errMsg = self.tr("Could not start the hg executable.") |
921
ae00e4fbcec0
Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
660 | |
ae00e4fbcec0
Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
661 | if errMsg: |
3020
542e97d4ecb3
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3008
diff
changeset
|
662 | E5MessageBox.critical( |
542e97d4ecb3
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3008
diff
changeset
|
663 | self, |
3190
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3185
diff
changeset
|
664 | self.tr("Mercurial Error"), |
921
ae00e4fbcec0
Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
665 | errMsg) |
1241
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
666 | |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
667 | if output: |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
668 | 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
|
669 | 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
|
670 | parts = line.split() |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
671 | self.__closedBranchesRevs.append( |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
672 | 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
|
673 | |
932
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
674 | def __generateLogItem(self, author, date, message, revision, changedPaths, |
1605
899cb1241de5
Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1532
diff
changeset
|
675 | parents, branches, tags, phase, bookmarks=None): |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
676 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
677 | 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
|
678 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
679 | @param author author info (string) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
680 | @param date date info (string) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
681 | @param message text of the log message (list of strings) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
682 | @param revision revision info (string) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
683 | @param changedPaths list of dictionary objects containing |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
684 | info about the changed files/directories |
179
09260f69bf37
Included parents info in log browser items.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
178
diff
changeset
|
685 | @param parents list of parent revisions (list of integers) |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
686 | @param branches list of branches (list of strings) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
687 | @param tags list of tags (string) |
2444
0fdd7f9ebd0b
Fixed a source docu and regenerated them.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2405
diff
changeset
|
688 | @param phase phase of the entry (string) |
1017
919147f2b518
Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
945
diff
changeset
|
689 | @param bookmarks list of bookmarks (string) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
690 | @return reference to the generated item (QTreeWidgetItem) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
691 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
692 | msg = [] |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
693 | for line in message: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
694 | msg.append(line.strip()) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
695 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
696 | rev, node = revision.split(":") |
921
ae00e4fbcec0
Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
697 | if rev in self.__closedBranchesRevs: |
3554
9ca56a89aec5
A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3546
diff
changeset
|
698 | closedStr = self.ClosedIndicator |
921
ae00e4fbcec0
Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
699 | else: |
ae00e4fbcec0
Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
700 | closedStr = "" |
185
f002e13c9aed
Some more finetuning of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
181
diff
changeset
|
701 | msgtxt = msg[0] |
f002e13c9aed
Some more finetuning of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
181
diff
changeset
|
702 | if len(msgtxt) > 30: |
f002e13c9aed
Some more finetuning of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
181
diff
changeset
|
703 | msgtxt = "{0}...".format(msgtxt[:30]) |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
704 | if phase in self.phases: |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
705 | phaseStr = self.phases[phase] |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
706 | else: |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
707 | phaseStr = phase |
1017
919147f2b518
Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
945
diff
changeset
|
708 | 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
|
709 | "", |
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
710 | 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
|
711 | "{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
|
712 | 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
|
713 | author, |
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
714 | date, |
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
715 | msgtxt, |
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
716 | ", ".join(tags), |
1017
919147f2b518
Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
945
diff
changeset
|
717 | ] |
919147f2b518
Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
945
diff
changeset
|
718 | if bookmarks is not None: |
919147f2b518
Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
945
diff
changeset
|
719 | columnLabels.append(", ".join(bookmarks)) |
919147f2b518
Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
945
diff
changeset
|
720 | itm = QTreeWidgetItem(self.logTree, columnLabels) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
721 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
722 | itm.setForeground(self.BranchColumn, |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
723 | QBrush(QColor(self.__branchColor(branches[0])))) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
724 | |
187
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
725 | if not self.projectMode: |
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
726 | 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
|
727 | if not parents: |
26ed553ad4fb
Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
207
diff
changeset
|
728 | parents = [int(rev) - 1] |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
729 | column, color, edges = self.__generateEdges(int(rev), parents) |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
730 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
731 | itm.setData(0, self.__messageRole, message) |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
732 | 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
|
733 | itm.setData(0, self.__edgesRole, edges) |
3242
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
734 | if parents == [-1]: |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
735 | itm.setData(0, self.__parentsRole, []) |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
736 | else: |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
737 | itm.setData(0, self.__parentsRole, parents) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
738 | |
187
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
739 | if self.logTree.topLevelItemCount() > 1: |
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
740 | topedges = \ |
932
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
741 | self.logTree.topLevelItem( |
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
742 | self.logTree.indexOfTopLevelItem(itm) - 1)\ |
187
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
743 | .data(0, self.__edgesRole) |
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
744 | else: |
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
745 | topedges = None |
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
746 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
747 | icon = self.__generateIcon(column, color, edges, topedges, |
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
748 | QColor(self.__branchColor(branches[0])), |
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
749 | rev == self.__projectRevision, |
932
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
750 | rev in self.__closedBranchesRevs) |
187
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
751 | itm.setIcon(0, icon) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
752 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
753 | try: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
754 | self.__lastRev = int(revision.split(":")[0]) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
755 | except ValueError: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
756 | self.__lastRev = 0 |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
757 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
758 | return itm |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
759 | |
203
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
760 | def __generateFileItem(self, action, path, copyfrom): |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
761 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
762 | Private method to generate a changed files tree entry. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
763 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
764 | @param action indicator for the change action ("A", "D" or "M") |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
765 | @param path path of the file in the repository (string) |
203
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
766 | @param copyfrom path the file was copied from (string) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
767 | @return reference to the generated item (QTreeWidgetItem) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
768 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
769 | itm = QTreeWidgetItem(self.filesTree, [ |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
770 | self.flags[action], |
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
771 | path, |
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
772 | copyfrom, |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
773 | ]) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
774 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
775 | return itm |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
776 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
777 | def __getLogEntries(self, startRev=None): |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
778 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
779 | Private method to retrieve log entries from the repository. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
780 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
781 | @param startRev revision number to start from (integer, string) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
782 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
783 | self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
784 | self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
785 | self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
786 | QApplication.processEvents() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
787 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
788 | QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
789 | QApplication.processEvents() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
790 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
791 | self.buf = [] |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
792 | self.cancelled = False |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
793 | self.errors.clear() |
1269
7b4d9f1d7c6c
Fixed an issue in the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1265
diff
changeset
|
794 | self.intercept = False |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
795 | |
3242
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
796 | preargs = [] |
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
|
797 | args = self.vcs.initCommand(self.commandMode) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
798 | args.append('--verbose') |
779
04c3a6026543
Fixed an issue where long incoming patchsets were not shown completely.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
537
diff
changeset
|
799 | if self.commandMode not in ("incoming", "outgoing"): |
04c3a6026543
Fixed an issue where long incoming patchsets were not shown completely.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
537
diff
changeset
|
800 | args.append('--limit') |
04c3a6026543
Fixed an issue where long incoming patchsets were not shown completely.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
537
diff
changeset
|
801 | args.append(str(self.limitSpinBox.value())) |
187
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
802 | if self.commandMode in ("incoming", "outgoing"): |
181
4af57f97c1bc
Added code to choose the way incoming and outgoing logs are shown.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
180
diff
changeset
|
803 | args.append("--newest-first") |
1906
8487f9c2533b
Continued implementing support for Mercurial sub-repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1637
diff
changeset
|
804 | if self.vcs.hasSubrepositories(): |
8487f9c2533b
Continued implementing support for Mercurial sub-repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1637
diff
changeset
|
805 | args.append("--subrepos") |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
806 | if startRev is not None: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
807 | args.append('--rev') |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
808 | args.append('{0}:0'.format(startRev)) |
187
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
809 | if not self.projectMode and \ |
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
810 | not self.fname == "." and \ |
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
811 | not self.stopCheckBox.isChecked(): |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
812 | args.append('--follow') |
204
61552f56788a
Fixed an issue introduced by the last change to Mercurial log browser and dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
203
diff
changeset
|
813 | if self.commandMode == "log": |
61552f56788a
Fixed an issue introduced by the last change to Mercurial log browser and dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
203
diff
changeset
|
814 | args.append('--copies') |
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
|
815 | args.append('--template') |
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
|
816 | args.append(os.path.join(os.path.dirname(__file__), |
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
|
817 | "templates", |
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
|
818 | "logBrowserBookmarkPhase.tmpl")) |
215
e8978dca44af
Fixed issues with non-existing bundle caches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
213
diff
changeset
|
819 | 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
|
820 | if 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
|
821 | args.append(self.__bundle) |
1906
8487f9c2533b
Continued implementing support for Mercurial sub-repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1637
diff
changeset
|
822 | elif not self.vcs.hasSubrepositories(): |
213
42bb97ff0bbb
Added code to preview a changegroup file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
210
diff
changeset
|
823 | project = e5App().getObject("Project") |
42bb97ff0bbb
Added code to preview a changegroup file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
210
diff
changeset
|
824 | self.vcs.bundleFile = os.path.join( |
42bb97ff0bbb
Added code to preview a changegroup file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
210
diff
changeset
|
825 | project.getProjectManagementDir(), "hg-bundle.hg") |
3242
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
826 | if os.path.exists(self.vcs.bundleFile): |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
827 | os.remove(self.vcs.bundleFile) |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
828 | preargs = args[:] |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
829 | preargs.append("--quiet") |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
830 | preargs.append('--bundle') |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
831 | preargs.append(self.vcs.bundleFile) |
213
42bb97ff0bbb
Added code to preview a changegroup file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
210
diff
changeset
|
832 | args.append(self.vcs.bundleFile) |
187
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
833 | 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
|
834 | args.append(self.__filename) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
835 | |
1241
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
836 | if self.__hgClient: |
1242
dfb9609caf51
Continued implementing an interface to the Mercurial command server. Modified client all all dialogs done so far to provide a cancel capability..
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1241
diff
changeset
|
837 | self.inputGroup.setEnabled(False) |
dfb9609caf51
Continued implementing an interface to the Mercurial command server. Modified client all all dialogs done so far to provide a cancel capability..
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1241
diff
changeset
|
838 | self.inputGroup.hide() |
dfb9609caf51
Continued implementing an interface to the Mercurial command server. Modified client all all dialogs done so far to provide a cancel capability..
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1241
diff
changeset
|
839 | |
3242
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
840 | if preargs: |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
841 | out, err = self.__hgClient.runcommand(preargs) |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
842 | else: |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
843 | err = "" |
1241
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
844 | if err: |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
845 | self.__showError(err) |
3249
8f22bfa586b1
Another fix for the Mercurial log dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3247
diff
changeset
|
846 | elif self.commandMode != "incoming" or \ |
3265
972d6be9dde7
Fixed issues in the Mercurial interface handling bundle files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3255
diff
changeset
|
847 | (self.vcs.bundleFile and |
3268
8bfa66a9138a
Fixed issues in the Mercurial interface handling bundle files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3265
diff
changeset
|
848 | os.path.exists(self.vcs.bundleFile)) or \ |
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
|
849 | self.__bundle: |
3242
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
850 | out, err = self.__hgClient.runcommand(args) |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
851 | self.buf = out.splitlines(True) |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
852 | if err: |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
853 | self.__showError(err) |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
854 | self.__processBuffer() |
1241
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
855 | self.__finish() |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
856 | else: |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
857 | self.process.kill() |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
858 | |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
859 | self.process.setWorkingDirectory(self.repodir) |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
860 | |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
861 | self.inputGroup.setEnabled(True) |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
862 | self.inputGroup.show() |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
863 | |
3242
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
864 | if preargs: |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
865 | process = QProcess() |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
866 | process.setWorkingDirectory(self.repodir) |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
867 | process.start('hg', args) |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
868 | procStarted = process.waitForStarted(5000) |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
869 | if procStarted: |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
870 | process.waitForFinished(30000) |
a7e006073658
Fixed an issue in Mercurial log dialogs showing a wrong diff for incoming changesets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3190
diff
changeset
|
871 | |
3330
955e15f0ecce
Fixed an issue in the Mercurial log dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3317
diff
changeset
|
872 | if self.commandMode != "incoming" or \ |
3359
6b6c224d67d6
Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3330
diff
changeset
|
873 | (self.vcs.bundleFile and |
3330
955e15f0ecce
Fixed an issue in the Mercurial log dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3317
diff
changeset
|
874 | os.path.exists(self.vcs.bundleFile)) or \ |
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
|
875 | self.__bundle: |
3247
ed79e48ba0b4
Fix for the Mercurial log dialogs for checking incoming changes when there are none.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3243
diff
changeset
|
876 | self.process.start('hg', args) |
ed79e48ba0b4
Fix for the Mercurial log dialogs for checking incoming changes when there are none.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3243
diff
changeset
|
877 | procStarted = self.process.waitForStarted(5000) |
ed79e48ba0b4
Fix for the Mercurial log dialogs for checking incoming changes when there are none.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3243
diff
changeset
|
878 | if not procStarted: |
ed79e48ba0b4
Fix for the Mercurial log dialogs for checking incoming changes when there are none.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3243
diff
changeset
|
879 | self.inputGroup.setEnabled(False) |
ed79e48ba0b4
Fix for the Mercurial log dialogs for checking incoming changes when there are none.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3243
diff
changeset
|
880 | self.inputGroup.hide() |
ed79e48ba0b4
Fix for the Mercurial log dialogs for checking incoming changes when there are none.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3243
diff
changeset
|
881 | E5MessageBox.critical( |
ed79e48ba0b4
Fix for the Mercurial log dialogs for checking incoming changes when there are none.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3243
diff
changeset
|
882 | self, |
ed79e48ba0b4
Fix for the Mercurial log dialogs for checking incoming changes when there are none.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3243
diff
changeset
|
883 | self.tr('Process Generation Error'), |
ed79e48ba0b4
Fix for the Mercurial log dialogs for checking incoming changes when there are none.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3243
diff
changeset
|
884 | self.tr( |
ed79e48ba0b4
Fix for the Mercurial log dialogs for checking incoming changes when there are none.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3243
diff
changeset
|
885 | 'The process {0} could not be started. ' |
ed79e48ba0b4
Fix for the Mercurial log dialogs for checking incoming changes when there are none.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3243
diff
changeset
|
886 | 'Ensure, that it is in the search path.' |
ed79e48ba0b4
Fix for the Mercurial log dialogs for checking incoming changes when there are none.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3243
diff
changeset
|
887 | ).format('hg')) |
ed79e48ba0b4
Fix for the Mercurial log dialogs for checking incoming changes when there are none.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3243
diff
changeset
|
888 | else: |
ed79e48ba0b4
Fix for the Mercurial log dialogs for checking incoming changes when there are none.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3243
diff
changeset
|
889 | self.__finish() |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
890 | |
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
|
891 | def start(self, fn, bundle=None, isFile=False): |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
892 | """ |
198
7ab8e126f404
Fixed a few issues with the Mercurial plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
187
diff
changeset
|
893 | Public slot to start the hg log command. |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
894 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
895 | @param fn filename to show the log for (string) |
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
|
896 | @keyparam bundle name of a bundle file (string) |
2079b76a738b
Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3279
diff
changeset
|
897 | @keyparam isFile flag indicating log for a file is to be shown |
2079b76a738b
Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3279
diff
changeset
|
898 | (boolean) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
899 | """ |
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
|
900 | self.__bundle = 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
|
901 | self.__isFile = isFile |
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
|
902 | |
2079b76a738b
Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3279
diff
changeset
|
903 | self.sbsCheckBox.setEnabled(isFile) |
2079b76a738b
Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3279
diff
changeset
|
904 | self.sbsCheckBox.setVisible(isFile) |
2079b76a738b
Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3279
diff
changeset
|
905 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
906 | self.errorGroup.hide() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
907 | QApplication.processEvents() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
908 | |
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
|
909 | self.__initData() |
2079b76a738b
Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3279
diff
changeset
|
910 | |
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
|
911 | self.__filename = fn |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
912 | self.dname, self.fname = self.vcs.splitPath(fn) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
913 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
914 | # find the root of the repo |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
915 | self.repodir = self.dname |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
916 | while not os.path.isdir(os.path.join(self.repodir, self.vcs.adminDir)): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
917 | self.repodir = os.path.dirname(self.repodir) |
1324
370e8b9cfc23
Fixed an issue introduced by the last fix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1319
diff
changeset
|
918 | if os.path.splitdrive(self.repodir)[1] == os.sep: |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
919 | return |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
920 | |
187
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
921 | self.projectMode = (self.fname == "." and self.dname == self.repodir) |
d7916a2e31d6
Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
185
diff
changeset
|
922 | self.stopCheckBox.setDisabled(self.projectMode or self.fname == ".") |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
923 | self.activateWindow() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
924 | self.raise_() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
925 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
926 | self.logTree.clear() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
927 | self.__started = True |
243
a1d982e68edf
Fixed an issue introduced by the latest change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
241
diff
changeset
|
928 | self.__identifyProject() |
921
ae00e4fbcec0
Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
929 | self.__getClosedBranches() |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
930 | self.__getLogEntries() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
931 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
932 | def __procFinished(self, exitCode, exitStatus): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
933 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
934 | Private slot connected to the finished signal. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
935 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
936 | @param exitCode exit code of the process (integer) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
937 | @param exitStatus exit status of the process (QProcess.ExitStatus) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
938 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
939 | self.__processBuffer() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
940 | self.__finish() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
941 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
942 | def __finish(self): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
943 | """ |
932
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
944 | Private slot called when the process finished or the user pressed |
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
945 | the button. |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
946 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
947 | if self.process is not None and \ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
948 | self.process.state() != QProcess.NotRunning: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
949 | self.process.terminate() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
950 | QTimer.singleShot(2000, self.process.kill) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
951 | self.process.waitForFinished(3000) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
952 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
953 | QApplication.restoreOverrideCursor() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
954 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
955 | self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
956 | self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
957 | self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
958 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
959 | self.inputGroup.setEnabled(False) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
960 | self.inputGroup.hide() |
1086
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
961 | self.refreshButton.setEnabled(True) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
962 | |
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
|
963 | def __modifyForLargeFiles(self, filename): |
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
|
964 | """ |
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
|
965 | Private method to convert the displayed file name for a large file. |
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
|
966 | |
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
|
967 | @param filename file name to be processed (string) |
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
|
968 | @return processed file name (string) |
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
|
969 | """ |
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
|
970 | if filename.startswith((self.LargefilesCacheL, self.LargefilesCacheW)): |
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
|
971 | return self.tr("{0} (large file)").format( |
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
|
972 | self.PathSeparatorRe.split(filename, 1)[1]) |
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
|
973 | else: |
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
|
974 | return filename |
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
|
975 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
976 | def __processBuffer(self): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
977 | """ |
198
7ab8e126f404
Fixed a few issues with the Mercurial plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
187
diff
changeset
|
978 | Private method to process the buffered output of the hg log command. |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
979 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
980 | noEntries = 0 |
1605
899cb1241de5
Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1532
diff
changeset
|
981 | log = {"message": [], "bookmarks": None, "phase": ""} |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
982 | changedPaths = [] |
181
4af57f97c1bc
Added code to choose the way incoming and outgoing logs are shown.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
180
diff
changeset
|
983 | initialText = True |
203
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
984 | fileCopies = {} |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
985 | for s in self.buf: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
986 | if s != "@@@\n": |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
987 | try: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
988 | key, value = s.split("|", 1) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
989 | except ValueError: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
990 | key = "" |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
991 | value = s |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
992 | if key == "change": |
181
4af57f97c1bc
Added code to choose the way incoming and outgoing logs are shown.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
180
diff
changeset
|
993 | initialText = False |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
994 | log["revision"] = value.strip() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
995 | elif key == "user": |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
996 | log["author"] = value.strip() |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
997 | elif key == "parents": |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
998 | log["parents"] = \ |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
999 | [int(x.split(":", 1)[0]) |
932
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
1000 | for x in value.strip().split()] |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1001 | elif key == "date": |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1002 | log["date"] = " ".join(value.strip().split()[:2]) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1003 | elif key == "description": |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1004 | log["message"].append(value.strip()) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1005 | elif key == "file_adds": |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1006 | if value.strip(): |
203
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
1007 | for f in value.strip().split(", "): |
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
1008 | if f in fileCopies: |
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
1009 | changedPaths.append({ |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
1010 | "action": "A", |
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
|
1011 | "path": self.__modifyForLargeFiles(f), |
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
|
1012 | "copyfrom": self.__modifyForLargeFiles( |
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
|
1013 | fileCopies[f]), |
203
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
1014 | }) |
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
1015 | else: |
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
1016 | changedPaths.append({ |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
1017 | "action": "A", |
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
|
1018 | "path": self.__modifyForLargeFiles(f), |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
1019 | "copyfrom": "", |
203
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
1020 | }) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1021 | elif key == "files_mods": |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1022 | if value.strip(): |
203
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
1023 | for f in value.strip().split(", "): |
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
1024 | changedPaths.append({ |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
1025 | "action": "M", |
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
|
1026 | "path": self.__modifyForLargeFiles(f), |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
1027 | "copyfrom": "", |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1028 | }) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1029 | elif key == "file_dels": |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1030 | if value.strip(): |
203
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
1031 | for f in value.strip().split(", "): |
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
1032 | changedPaths.append({ |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
1033 | "action": "D", |
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
|
1034 | "path": self.__modifyForLargeFiles(f), |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
1035 | "copyfrom": "", |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1036 | }) |
203
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
1037 | elif key == "file_copies": |
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
1038 | if value.strip(): |
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
1039 | for entry in value.strip().split(", "): |
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
1040 | newName, oldName = entry[:-1].split(" (") |
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
1041 | fileCopies[newName] = oldName |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
1042 | elif key == "branches": |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
1043 | if value.strip(): |
203
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
1044 | log["branches"] = value.strip().split(", ") |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
1045 | else: |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
1046 | log["branches"] = ["default"] |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
1047 | elif key == "tags": |
203
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
1048 | log["tags"] = value.strip().split(", ") |
1017
919147f2b518
Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
945
diff
changeset
|
1049 | elif key == "bookmarks": |
1019
d8a9697f78d1
Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1017
diff
changeset
|
1050 | log["bookmarks"] = value.strip().split(", ") |
1605
899cb1241de5
Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1532
diff
changeset
|
1051 | elif key == "phase": |
899cb1241de5
Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1532
diff
changeset
|
1052 | log["phase"] = value.strip() |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1053 | else: |
181
4af57f97c1bc
Added code to choose the way incoming and outgoing logs are shown.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
180
diff
changeset
|
1054 | if initialText: |
4af57f97c1bc
Added code to choose the way incoming and outgoing logs are shown.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
180
diff
changeset
|
1055 | continue |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1056 | if value.strip(): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1057 | log["message"].append(value.strip()) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1058 | else: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1059 | if len(log) > 1: |
3023
34ce20603bf7
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3020
diff
changeset
|
1060 | self.__generateLogItem( |
34ce20603bf7
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3020
diff
changeset
|
1061 | log["author"], log["date"], |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
1062 | log["message"], log["revision"], changedPaths, |
1061
3e21869872e3
Fixed PEP-8 related issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1019
diff
changeset
|
1063 | log["parents"], log["branches"], log["tags"], |
1605
899cb1241de5
Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1532
diff
changeset
|
1064 | log["phase"], log["bookmarks"]) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1065 | dt = QDate.fromString(log["date"], Qt.ISODate) |
932
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
1066 | if not self.__maxDate.isValid() and \ |
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
1067 | not self.__minDate.isValid(): |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1068 | self.__maxDate = dt |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1069 | self.__minDate = dt |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1070 | else: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1071 | if self.__maxDate < dt: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1072 | self.__maxDate = dt |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1073 | if self.__minDate > dt: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1074 | self.__minDate = dt |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1075 | noEntries += 1 |
1605
899cb1241de5
Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1532
diff
changeset
|
1076 | log = {"message": [], "bookmarks": None, "phase": ""} |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1077 | changedPaths = [] |
203
0bd3912f3c5f
Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
201
diff
changeset
|
1078 | fileCopies = {} |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1079 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1080 | self.__resizeColumnsLog() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1081 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1082 | if self.__started: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1083 | self.logTree.setCurrentItem(self.logTree.topLevelItem(0)) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1084 | self.__started = False |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1085 | |
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
|
1086 | if self.commandMode in ("incoming", "outgoing"): |
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
|
1087 | self.commandMode = "log" # switch to log mode |
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
|
1088 | if self.__lastRev > 0: |
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
|
1089 | self.nextButton.setEnabled(True) |
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
|
1090 | self.limitSpinBox.setEnabled(True) |
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
|
1091 | else: |
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
|
1092 | if noEntries < self.limitSpinBox.value() and not self.cancelled: |
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
|
1093 | self.nextButton.setEnabled(False) |
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
|
1094 | self.limitSpinBox.setEnabled(False) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1095 | |
316
b7e499650928
Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
296
diff
changeset
|
1096 | # update the log filters |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1097 | self.__filterLogsEnabled = False |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1098 | self.fromDate.setMinimumDate(self.__minDate) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1099 | self.fromDate.setMaximumDate(self.__maxDate) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1100 | self.fromDate.setDate(self.__minDate) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1101 | self.toDate.setMinimumDate(self.__minDate) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1102 | self.toDate.setMaximumDate(self.__maxDate) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1103 | self.toDate.setDate(self.__maxDate) |
316
b7e499650928
Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
296
diff
changeset
|
1104 | |
b7e499650928
Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
296
diff
changeset
|
1105 | branchFilter = self.branchCombo.currentText() |
b7e499650928
Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
296
diff
changeset
|
1106 | if not branchFilter: |
b7e499650928
Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
296
diff
changeset
|
1107 | branchFilter = self.__allBranchesFilter |
b7e499650928
Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
296
diff
changeset
|
1108 | self.branchCombo.clear() |
b7e499650928
Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
296
diff
changeset
|
1109 | self.branchCombo.addItems( |
b7e499650928
Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
296
diff
changeset
|
1110 | [self.__allBranchesFilter] + sorted(self.__branchColors.keys())) |
932
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
1111 | self.branchCombo.setCurrentIndex( |
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
1112 | self.branchCombo.findText(branchFilter)) |
316
b7e499650928
Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
296
diff
changeset
|
1113 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1114 | self.__filterLogsEnabled = True |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1115 | if self.__actionMode() == "filter": |
4080
d4ba5fab5557
Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4060
diff
changeset
|
1116 | self.__filterLogs() |
2569
0fff8dc5d472
Fixed an issue in the Mercurial log browser setting the correct state of the phase button in 'incoming' and 'outgoing' mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2567
diff
changeset
|
1117 | self.__updateDiffButtons() |
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
|
1118 | self.__updateToolMenuActions() |
3927
3e1dc0fb26ed
Enhanced the Mercurial log browser a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3909
diff
changeset
|
1119 | |
3e1dc0fb26ed
Enhanced the Mercurial log browser a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3909
diff
changeset
|
1120 | # restore current item |
3e1dc0fb26ed
Enhanced the Mercurial log browser a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3909
diff
changeset
|
1121 | if self.__currentRevision: |
3e1dc0fb26ed
Enhanced the Mercurial log browser a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3909
diff
changeset
|
1122 | items = self.logTree.findItems( |
3e1dc0fb26ed
Enhanced the Mercurial log browser a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3909
diff
changeset
|
1123 | self.__currentRevision, Qt.MatchExactly, self.RevisionColumn) |
3e1dc0fb26ed
Enhanced the Mercurial log browser a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3909
diff
changeset
|
1124 | if items: |
3e1dc0fb26ed
Enhanced the Mercurial log browser a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3909
diff
changeset
|
1125 | self.logTree.setCurrentItem(items[0]) |
3e1dc0fb26ed
Enhanced the Mercurial log browser a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3909
diff
changeset
|
1126 | self.__currentRevision = "" |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1127 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1128 | def __readStdout(self): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1129 | """ |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
1130 | Private slot to handle the readyReadStandardOutput signal. |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1131 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1132 | It reads the output of the process and inserts it into a buffer. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1133 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1134 | self.process.setReadChannel(QProcess.StandardOutput) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1135 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1136 | while self.process.canReadLine(): |
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
|
1137 | line = str(self.process.readLine(), self.vcs.getEncoding(), |
3036
30c81c9e88b8
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3034
diff
changeset
|
1138 | 'replace') |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1139 | self.buf.append(line) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1140 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1141 | def __readStderr(self): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1142 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1143 | Private slot to handle the readyReadStandardError signal. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1144 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1145 | It reads the error output of the process and inserts it into the |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1146 | error pane. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1147 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1148 | if self.process is not None: |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
1149 | s = str(self.process.readAllStandardError(), |
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
|
1150 | self.vcs.getEncoding(), 'replace') |
1241
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
1151 | self.__showError(s) |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
1152 | |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
1153 | def __showError(self, out): |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
1154 | """ |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
1155 | Private slot to show some error. |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
1156 | |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
1157 | @param out error to be shown (string) |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
1158 | """ |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
1159 | self.errorGroup.show() |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
1160 | self.errors.insertPlainText(out) |
09c6155ee612
Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1131
diff
changeset
|
1161 | self.errors.ensureCursorVisible() |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1162 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1163 | def __diffRevisions(self, rev1, rev2): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1164 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1165 | Private method to do a diff of two revisions. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1166 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1167 | @param rev1 first revision number (integer) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1168 | @param rev2 second revision number (integer) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1169 | """ |
2841
1f79e88f18b7
Added side-by-side capability to the Mercurial log dialog and log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2838
diff
changeset
|
1170 | if self.sbsCheckBox.isEnabled() and self.sbsCheckBox.isChecked(): |
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
|
1171 | self.vcs.hgSbsDiff(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
|
1172 | revisions=(str(rev1), str(rev2))) |
2841
1f79e88f18b7
Added side-by-side capability to the Mercurial log dialog and log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2838
diff
changeset
|
1173 | else: |
1f79e88f18b7
Added side-by-side capability to the Mercurial log dialog and log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2838
diff
changeset
|
1174 | if self.diff is None: |
1f79e88f18b7
Added side-by-side capability to the Mercurial log dialog and log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2838
diff
changeset
|
1175 | from .HgDiffDialog import HgDiffDialog |
1f79e88f18b7
Added side-by-side capability to the Mercurial log dialog and log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2838
diff
changeset
|
1176 | self.diff = HgDiffDialog(self.vcs) |
1f79e88f18b7
Added side-by-side capability to the Mercurial log dialog and log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2838
diff
changeset
|
1177 | self.diff.show() |
1f79e88f18b7
Added side-by-side capability to the Mercurial log dialog and log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2838
diff
changeset
|
1178 | self.diff.raise_() |
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
|
1179 | self.diff.start(self.__filename, [rev1, rev2], self.__bundle) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1180 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1181 | def on_buttonBox_clicked(self, button): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1182 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1183 | Private slot called by a button of the button box clicked. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1184 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1185 | @param button button that was clicked (QAbstractButton) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1186 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1187 | if button == self.buttonBox.button(QDialogButtonBox.Close): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1188 | self.close() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1189 | elif button == self.buttonBox.button(QDialogButtonBox.Cancel): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1190 | self.cancelled = True |
1242
dfb9609caf51
Continued implementing an interface to the Mercurial command server. Modified client all all dialogs done so far to provide a cancel capability..
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1241
diff
changeset
|
1191 | if self.__hgClient: |
dfb9609caf51
Continued implementing an interface to the Mercurial command server. Modified client all all dialogs done so far to provide a cancel capability..
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1241
diff
changeset
|
1192 | self.__hgClient.cancel() |
dfb9609caf51
Continued implementing an interface to the Mercurial command server. Modified client all all dialogs done so far to provide a cancel capability..
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1241
diff
changeset
|
1193 | else: |
dfb9609caf51
Continued implementing an interface to the Mercurial command server. Modified client all all dialogs done so far to provide a cancel capability..
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1241
diff
changeset
|
1194 | self.__finish() |
1086
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1195 | elif button == self.refreshButton: |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1196 | self.on_refreshButton_clicked() |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1197 | |
235
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1198 | def __updateDiffButtons(self): |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1199 | """ |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1200 | Private slot to update the enabled status of the diff buttons. |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1201 | """ |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1202 | selectionLength = len(self.logTree.selectedItems()) |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1203 | if selectionLength <= 1: |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1204 | current = self.logTree.currentItem() |
1086
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1205 | if current is None: |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1206 | self.diffP1Button.setEnabled(False) |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1207 | self.diffP2Button.setEnabled(False) |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1208 | else: |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1209 | parents = current.data(0, self.__parentsRole) |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1210 | self.diffP1Button.setEnabled(len(parents) > 0) |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1211 | self.diffP2Button.setEnabled(len(parents) > 1) |
235
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1212 | |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1213 | self.diffRevisionsButton.setEnabled(False) |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1214 | elif selectionLength == 2: |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1215 | self.diffP1Button.setEnabled(False) |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1216 | self.diffP2Button.setEnabled(False) |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1217 | |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1218 | self.diffRevisionsButton.setEnabled(True) |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1219 | else: |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1220 | self.diffP1Button.setEnabled(False) |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1221 | self.diffP2Button.setEnabled(False) |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1222 | |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1223 | self.diffRevisionsButton.setEnabled(False) |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1224 | |
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
|
1225 | def __updateToolMenuActions(self): |
1608
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1226 | """ |
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
|
1227 | Private slot to update the status of the tool menu actions and |
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
|
1228 | the tool menu button. |
1608
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1229 | """ |
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
|
1230 | if self.initialCommandMode == "log" and self.projectMode: |
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
|
1231 | if self.__phaseAct is not None: |
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
|
1232 | # step 1: count entries with changeable phases |
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
|
1233 | secret = 0 |
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
|
1234 | draft = 0 |
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
|
1235 | public = 0 |
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
|
1236 | for itm in self.logTree.selectedItems(): |
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
|
1237 | phase = itm.text(self.PhaseColumn) |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1238 | if phase == self.phases["draft"]: |
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
|
1239 | draft += 1 |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1240 | elif phase == self.phases["secret"]: |
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
|
1241 | secret += 1 |
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
|
1242 | else: |
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
|
1243 | public += 1 |
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
|
1244 | |
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
|
1245 | # step 2: set the status of the phase button |
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
|
1246 | if public == 0 and \ |
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
|
1247 | ((secret > 0 and draft == 0) or |
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
|
1248 | (secret == 0 and draft > 0)): |
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
|
1249 | self.__phaseAct.setEnabled(True) |
2569
0fff8dc5d472
Fixed an issue in the Mercurial log browser setting the correct state of the phase button in 'incoming' and 'outgoing' mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2567
diff
changeset
|
1250 | else: |
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
|
1251 | self.__phaseAct.setEnabled(False) |
2569
0fff8dc5d472
Fixed an issue in the Mercurial log browser setting the correct state of the phase button in 'incoming' and 'outgoing' mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2567
diff
changeset
|
1252 | |
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
|
1253 | if self.__graftAct is not None: |
3008
7848489bcb92
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2962
diff
changeset
|
1254 | # step 1: count selected entries not belonging to the |
7848489bcb92
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2962
diff
changeset
|
1255 | # current branch |
2570
a2de94bae41b
Fixed an issue in the Mercurial log browser setting the correct state of the graft button in 'incoming' and 'outgoing' mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2569
diff
changeset
|
1256 | otherBranches = 0 |
a2de94bae41b
Fixed an issue in the Mercurial log browser setting the correct state of the graft button in 'incoming' and 'outgoing' mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2569
diff
changeset
|
1257 | for itm in self.logTree.selectedItems(): |
a2de94bae41b
Fixed an issue in the Mercurial log browser setting the correct state of the graft button in 'incoming' and 'outgoing' mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2569
diff
changeset
|
1258 | branch = itm.text(self.BranchColumn) |
a2de94bae41b
Fixed an issue in the Mercurial log browser setting the correct state of the graft button in 'incoming' and 'outgoing' mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2569
diff
changeset
|
1259 | if branch != self.__projectBranch: |
a2de94bae41b
Fixed an issue in the Mercurial log browser setting the correct state of the graft button in 'incoming' and 'outgoing' mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2569
diff
changeset
|
1260 | otherBranches += 1 |
a2de94bae41b
Fixed an issue in the Mercurial log browser setting the correct state of the graft button in 'incoming' and 'outgoing' mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2569
diff
changeset
|
1261 | |
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
|
1262 | # step 2: set the status of the graft action |
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
|
1263 | self.__graftAct.setEnabled(otherBranches > 0) |
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
|
1264 | |
3243
bbaa32bb9e63
Fixed an issue in the Mercurial log browser dialog that caused the tag action being activated in wrong dialog modes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3242
diff
changeset
|
1265 | self.__tagAct.setEnabled(len(self.logTree.selectedItems()) == 1) |
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
|
1266 | self.__switchAct.setEnabled(len(self.logTree.selectedItems()) == 1) |
5322
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1267 | self.__bookmarkAct.setEnabled( |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1268 | len(self.logTree.selectedItems()) == 1) |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1269 | self.__bookmarkMoveAct.setEnabled( |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1270 | len(self.logTree.selectedItems()) == 1) |
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
|
1271 | |
5270
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1272 | if self.vcs.canPull(): |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1273 | self.__pullAct.setEnabled(True) |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1274 | self.__lfPullAct.setEnabled( |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1275 | self.vcs.isExtensionActive("largefiles") and |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1276 | bool(self.logTree.selectedItems())) |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1277 | self.__fetchAct.setEnabled( |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1278 | self.vcs.isExtensionActive("fetch")) |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1279 | else: |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1280 | self.__pullAct.setEnabled(False) |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1281 | self.__lfPullAct.setEnabled(False) |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1282 | self.__fetchAct.setEnabled(False) |
3315
bd1a25ead18d
Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3302
diff
changeset
|
1283 | |
5270
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1284 | if self.vcs.canPush(): |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1285 | self.__pushAct.setEnabled( |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1286 | len(self.logTree.selectedItems()) == 1 and |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1287 | self.logTree.selectedItems()[0].text(self.PhaseColumn) == |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1288 | self.phases["draft"]) |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1289 | self.__pushAllAct.setEnabled(True) |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1290 | else: |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1291 | self.__pushAct.setEnabled(False) |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1292 | self.__pushAllAct.setEnabled(False) |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1293 | |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1294 | self.__stripAct.setEnabled( |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1295 | self.vcs.isExtensionActive("strip") and |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1296 | len(self.logTree.selectedItems()) == 1) |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1297 | |
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
|
1298 | self.actionsButton.setEnabled(True) |
3243
bbaa32bb9e63
Fixed an issue in the Mercurial log browser dialog that caused the tag action being activated in wrong dialog modes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3242
diff
changeset
|
1299 | else: |
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
|
1300 | self.actionsButton.setEnabled(False) |
3243
bbaa32bb9e63
Fixed an issue in the Mercurial log browser dialog that caused the tag action being activated in wrong dialog modes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3242
diff
changeset
|
1301 | |
1608
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1302 | def __updateGui(self, itm): |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1303 | """ |
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
|
1304 | Private slot to update GUI elements except tool menu actions. |
1608
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1305 | |
3008
7848489bcb92
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2962
diff
changeset
|
1306 | @param itm reference to the item the update should be based on |
7848489bcb92
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2962
diff
changeset
|
1307 | (QTreeWidgetItem) |
1608
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1308 | """ |
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
|
1309 | self.detailsEdit.clear() |
1608
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1310 | self.messageEdit.clear() |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1311 | self.filesTree.clear() |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1312 | |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1313 | if itm is not None: |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1314 | if itm.text(self.TagsColumn): |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1315 | tagsStr = self.__tagsTemplate.format(itm.text(self.TagsColumn)) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1316 | else: |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1317 | tagsStr = "" |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1318 | if itm.text(self.BookmarksColumn): |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1319 | bookmarksStr = self.__bookmarksTemplate.format( |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1320 | itm.text(self.BookmarksColumn)) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1321 | else: |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1322 | bookmarksStr = "" |
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
|
1323 | self.detailsEdit.setHtml(self.__detailsTemplate.format( |
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
|
1324 | itm.text(self.RevisionColumn), |
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
|
1325 | itm.text(self.DateColumn), |
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
|
1326 | itm.text(self.AuthorColumn), |
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
|
1327 | itm.text(self.BranchColumn).replace( |
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
|
1328 | self.ClosedIndicator, ""), |
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
|
1329 | ", ".join( |
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
|
1330 | [str(x) for x in itm.data(0, self.__parentsRole)] |
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
|
1331 | ), |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1332 | tagsStr + bookmarksStr, |
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
|
1333 | )) |
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
|
1334 | |
1608
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1335 | for line in itm.data(0, self.__messageRole): |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1336 | self.messageEdit.append(line.strip()) |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1337 | |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1338 | changes = itm.data(0, self.__changesRole) |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1339 | if len(changes) > 0: |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1340 | for change in changes: |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1341 | self.__generateFileItem( |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1342 | change["action"], change["path"], change["copyfrom"]) |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1343 | self.__resizeColumnsFiles() |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1344 | self.__resortFiles() |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1345 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1346 | @pyqtSlot(QTreeWidgetItem, QTreeWidgetItem) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1347 | def on_logTree_currentItemChanged(self, current, previous): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1348 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1349 | Private slot called, when the current item of the log tree changes. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1350 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1351 | @param current reference to the new current item (QTreeWidgetItem) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1352 | @param previous reference to the old current item (QTreeWidgetItem) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1353 | """ |
1608
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1354 | self.__updateGui(current) |
235
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1355 | self.__updateDiffButtons() |
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
|
1356 | self.__updateToolMenuActions() |
235
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1357 | |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1358 | @pyqtSlot() |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1359 | def on_logTree_itemSelectionChanged(self): |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1360 | """ |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1361 | Private slot called, when the selection has changed. |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1362 | """ |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1363 | if len(self.logTree.selectedItems()) == 1: |
1608
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1364 | self.__updateGui(self.logTree.selectedItems()[0]) |
235
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1365 | |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1366 | self.__updateDiffButtons() |
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
|
1367 | self.__updateToolMenuActions() |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1368 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1369 | @pyqtSlot() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1370 | def on_nextButton_clicked(self): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1371 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1372 | Private slot to handle the Next button. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1373 | """ |
784
3893c2537fb4
Fixed a little bug in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
783
diff
changeset
|
1374 | if self.__lastRev > 0: |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1375 | self.__getLogEntries(self.__lastRev - 1) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1376 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1377 | @pyqtSlot() |
208
26ed553ad4fb
Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
207
diff
changeset
|
1378 | def on_diffP1Button_clicked(self): |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1379 | """ |
208
26ed553ad4fb
Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
207
diff
changeset
|
1380 | Private slot to handle the Diff to Parent 1 button. |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1381 | """ |
2567
f70f3103c927
Fixed a severe issue in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2544
diff
changeset
|
1382 | if len(self.logTree.selectedItems()): |
f70f3103c927
Fixed a severe issue in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2544
diff
changeset
|
1383 | itm = self.logTree.selectedItems()[0] |
f70f3103c927
Fixed a severe issue in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2544
diff
changeset
|
1384 | else: |
f70f3103c927
Fixed a severe issue in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2544
diff
changeset
|
1385 | itm = self.logTree.currentItem() |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1386 | if itm is None: |
208
26ed553ad4fb
Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
207
diff
changeset
|
1387 | self.diffP1Button.setEnabled(False) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1388 | return |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
1389 | rev2 = int(itm.text(self.RevisionColumn).split(":")[0]) |
210
b1a204f22291
Fixed a few issues with the Mercurial log dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
208
diff
changeset
|
1390 | |
b1a204f22291
Fixed a few issues with the Mercurial log dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
208
diff
changeset
|
1391 | rev1 = itm.data(0, self.__parentsRole)[0] |
b1a204f22291
Fixed a few issues with the Mercurial log dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
208
diff
changeset
|
1392 | if rev1 < 0: |
208
26ed553ad4fb
Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
207
diff
changeset
|
1393 | self.diffP1Button.setEnabled(False) |
26ed553ad4fb
Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
207
diff
changeset
|
1394 | return |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1395 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1396 | self.__diffRevisions(rev1, rev2) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1397 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1398 | @pyqtSlot() |
210
b1a204f22291
Fixed a few issues with the Mercurial log dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
208
diff
changeset
|
1399 | def on_diffP2Button_clicked(self): |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1400 | """ |
208
26ed553ad4fb
Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
207
diff
changeset
|
1401 | Private slot to handle the Diff to Parent 2 button. |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1402 | """ |
2567
f70f3103c927
Fixed a severe issue in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2544
diff
changeset
|
1403 | if len(self.logTree.selectedItems()): |
f70f3103c927
Fixed a severe issue in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2544
diff
changeset
|
1404 | itm = self.logTree.selectedItems()[0] |
f70f3103c927
Fixed a severe issue in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2544
diff
changeset
|
1405 | else: |
f70f3103c927
Fixed a severe issue in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2544
diff
changeset
|
1406 | itm = self.logTree.currentItem() |
208
26ed553ad4fb
Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
207
diff
changeset
|
1407 | if itm is None: |
26ed553ad4fb
Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
207
diff
changeset
|
1408 | self.diffP2Button.setEnabled(False) |
26ed553ad4fb
Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
207
diff
changeset
|
1409 | return |
26ed553ad4fb
Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
207
diff
changeset
|
1410 | rev2 = int(itm.text(self.RevisionColumn).split(":")[0]) |
210
b1a204f22291
Fixed a few issues with the Mercurial log dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
208
diff
changeset
|
1411 | |
b1a204f22291
Fixed a few issues with the Mercurial log dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
208
diff
changeset
|
1412 | rev1 = itm.data(0, self.__parentsRole)[1] |
b1a204f22291
Fixed a few issues with the Mercurial log dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
208
diff
changeset
|
1413 | if rev1 < 0: |
208
26ed553ad4fb
Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
207
diff
changeset
|
1414 | self.diffP2Button.setEnabled(False) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1415 | return |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1416 | |
208
26ed553ad4fb
Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
207
diff
changeset
|
1417 | self.__diffRevisions(rev1, rev2) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1418 | |
235
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1419 | @pyqtSlot() |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1420 | def on_diffRevisionsButton_clicked(self): |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1421 | """ |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1422 | Private slot to handle the Compare Revisions button. |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1423 | """ |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1424 | items = self.logTree.selectedItems() |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1425 | |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1426 | rev2 = int(items[0].text(self.RevisionColumn).split(":")[0]) |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1427 | rev1 = int(items[1].text(self.RevisionColumn).split(":")[0]) |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1428 | |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1429 | self.__diffRevisions(min(rev1, rev2), max(rev1, rev2)) |
7cb9905b0cf9
Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
215
diff
changeset
|
1430 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1431 | @pyqtSlot(QDate) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1432 | def on_fromDate_dateChanged(self, date): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1433 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1434 | Private slot called, when the from date changes. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1435 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1436 | @param date new date (QDate) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1437 | """ |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1438 | if self.__actionMode() == "filter": |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1439 | self.__filterLogs() |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1440 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1441 | @pyqtSlot(QDate) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1442 | def on_toDate_dateChanged(self, date): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1443 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1444 | Private slot called, when the from date changes. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1445 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1446 | @param date new date (QDate) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1447 | """ |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1448 | if self.__actionMode() == "filter": |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1449 | self.__filterLogs() |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1450 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1451 | @pyqtSlot(str) |
316
b7e499650928
Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
296
diff
changeset
|
1452 | def on_branchCombo_activated(self, txt): |
b7e499650928
Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
296
diff
changeset
|
1453 | """ |
b7e499650928
Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
296
diff
changeset
|
1454 | Private slot called, when a new branch is selected. |
b7e499650928
Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
296
diff
changeset
|
1455 | |
b7e499650928
Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
296
diff
changeset
|
1456 | @param txt text of the selected branch (string) |
b7e499650928
Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
296
diff
changeset
|
1457 | """ |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1458 | if self.__actionMode() == "filter": |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1459 | self.__filterLogs() |
316
b7e499650928
Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
296
diff
changeset
|
1460 | |
b7e499650928
Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
296
diff
changeset
|
1461 | @pyqtSlot(str) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1462 | def on_fieldCombo_activated(self, txt): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1463 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1464 | Private slot called, when a new filter field is selected. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1465 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1466 | @param txt text of the selected field (string) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1467 | """ |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1468 | if self.__actionMode() == "filter": |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1469 | self.__filterLogs() |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1470 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1471 | @pyqtSlot(str) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1472 | def on_rxEdit_textChanged(self, txt): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1473 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1474 | Private slot called, when a filter expression is entered. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1475 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1476 | @param txt filter expression (string) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1477 | """ |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1478 | if self.__actionMode() == "filter": |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1479 | self.__filterLogs() |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1480 | elif self.__actionMode() == "find": |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1481 | self.__findItem(self.__findBackwards, interactive=True) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1482 | |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1483 | @pyqtSlot() |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1484 | def on_rxEdit_returnPressed(self): |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1485 | """ |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1486 | Private slot handling a press of the Return key in the rxEdit input. |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1487 | """ |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1488 | if self.__actionMode() == "find": |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1489 | self.__findItem(self.__findBackwards, interactive=True) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1490 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1491 | def __filterLogs(self): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1492 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1493 | Private method to filter the log entries. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1494 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1495 | if self.__filterLogsEnabled: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1496 | from_ = self.fromDate.date().toString("yyyy-MM-dd") |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1497 | to_ = self.toDate.date().addDays(1).toString("yyyy-MM-dd") |
316
b7e499650928
Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
296
diff
changeset
|
1498 | branch = self.branchCombo.currentText() |
932
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
1499 | closedBranch = branch + '--' |
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
|
1500 | fieldIndex, searchRx, indexIsRole = self.__prepareFieldSearch() |
316
b7e499650928
Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
296
diff
changeset
|
1501 | |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1502 | visibleItemCount = self.logTree.topLevelItemCount() |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1503 | currentItem = self.logTree.currentItem() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1504 | for topIndex in range(self.logTree.topLevelItemCount()): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1505 | topItem = self.logTree.topLevelItem(topIndex) |
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
|
1506 | if indexIsRole: |
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
|
1507 | if fieldIndex == self.__changesRole: |
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
|
1508 | changes = topItem.data(0, self.__changesRole) |
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
|
1509 | txt = "\n".join( |
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
|
1510 | [c["path"] for c in changes] + |
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
|
1511 | [c["copyfrom"] for c in changes] |
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
|
1512 | ) |
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
|
1513 | else: |
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
|
1514 | # Find based on complete message text |
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
|
1515 | txt = "\n".join(topItem.data(0, self.__messageRole)) |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1516 | else: |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1517 | txt = topItem.text(fieldIndex) |
180
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
1518 | if topItem.text(self.DateColumn) <= to_ and \ |
40ac468c2558
Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
179
diff
changeset
|
1519 | topItem.text(self.DateColumn) >= from_ and \ |
3034
7ce719013078
Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3023
diff
changeset
|
1520 | (branch == self.__allBranchesFilter or |
7ce719013078
Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3023
diff
changeset
|
1521 | topItem.text(self.BranchColumn) in |
932
efd23a913a09
Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
921
diff
changeset
|
1522 | [branch, closedBranch]) and \ |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1523 | searchRx.indexIn(txt) > -1: |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1524 | topItem.setHidden(False) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1525 | if topItem is currentItem: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1526 | self.on_logTree_currentItemChanged(topItem, None) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1527 | else: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1528 | topItem.setHidden(True) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1529 | if topItem is currentItem: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1530 | self.messageEdit.clear() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1531 | self.filesTree.clear() |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1532 | visibleItemCount -= 1 |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1533 | self.logTree.header().setSectionHidden( |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1534 | self.IconColumn, |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1535 | visibleItemCount != self.logTree.topLevelItemCount()) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1536 | |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1537 | def __prepareFieldSearch(self): |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1538 | """ |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1539 | Private slot to prepare the filed search data. |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1540 | |
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
|
1541 | @return tuple of field index, search expression and flag indicating |
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
|
1542 | that the field index is a data role (integer, string, boolean) |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1543 | """ |
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
|
1544 | indexIsRole = False |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1545 | txt = self.fieldCombo.itemData(self.fieldCombo.currentIndex()) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1546 | if txt == "author": |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1547 | fieldIndex = self.AuthorColumn |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1548 | searchRx = QRegExp(self.rxEdit.text(), Qt.CaseInsensitive) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1549 | elif txt == "revision": |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1550 | fieldIndex = self.RevisionColumn |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1551 | txt = self.rxEdit.text() |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1552 | if txt.startswith("^"): |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1553 | searchRx = QRegExp("^\s*{0}".format(txt[1:]), |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1554 | Qt.CaseInsensitive) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1555 | else: |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1556 | searchRx = QRegExp(txt, Qt.CaseInsensitive) |
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
|
1557 | elif txt == "file": |
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
|
1558 | fieldIndex = self.__changesRole |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1559 | searchRx = QRegExp(self.rxEdit.text(), Qt.CaseInsensitive) |
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
|
1560 | indexIsRole = True |
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
|
1561 | else: |
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
|
1562 | fieldIndex = self.__messageRole |
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
|
1563 | searchRx = QRegExp(self.rxEdit.text(), Qt.CaseInsensitive) |
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
|
1564 | indexIsRole = True |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1565 | |
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
|
1566 | return fieldIndex, searchRx, indexIsRole |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1567 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1568 | @pyqtSlot(bool) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1569 | def on_stopCheckBox_clicked(self, checked): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1570 | """ |
2962
d6c9d1ca2da4
Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2848
diff
changeset
|
1571 | Private slot called, when the stop on copy/move checkbox is clicked. |
d6c9d1ca2da4
Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2848
diff
changeset
|
1572 | |
d6c9d1ca2da4
Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2848
diff
changeset
|
1573 | @param checked flag indicating the state of the check box (boolean) |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1574 | """ |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
932
diff
changeset
|
1575 | self.vcs.getPlugin().setPreferences("StopLogOnCopy", |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1576 | self.stopCheckBox.isChecked()) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1577 | self.nextButton.setEnabled(True) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1578 | self.limitSpinBox.setEnabled(True) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1579 | |
1086
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1580 | @pyqtSlot() |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1581 | def on_refreshButton_clicked(self): |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1582 | """ |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1583 | Private slot to refresh the log. |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1584 | """ |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1585 | self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1586 | self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True) |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1587 | self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1588 | |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1589 | self.inputGroup.setEnabled(True) |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1590 | self.inputGroup.show() |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1591 | self.refreshButton.setEnabled(False) |
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1592 | |
3927
3e1dc0fb26ed
Enhanced the Mercurial log browser a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3909
diff
changeset
|
1593 | # save the current items commit ID |
3e1dc0fb26ed
Enhanced the Mercurial log browser a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3909
diff
changeset
|
1594 | itm = self.logTree.currentItem() |
3e1dc0fb26ed
Enhanced the Mercurial log browser a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3909
diff
changeset
|
1595 | if itm is not None: |
3e1dc0fb26ed
Enhanced the Mercurial log browser a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3909
diff
changeset
|
1596 | self.__currentRevision = itm.text(self.RevisionColumn) |
3e1dc0fb26ed
Enhanced the Mercurial log browser a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3909
diff
changeset
|
1597 | else: |
3e1dc0fb26ed
Enhanced the Mercurial log browser a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3909
diff
changeset
|
1598 | self.__currentRevision = "" |
3e1dc0fb26ed
Enhanced the Mercurial log browser a little bit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3909
diff
changeset
|
1599 | |
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
|
1600 | if self.initialCommandMode in ("incoming", "outgoing"): |
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
|
1601 | self.nextButton.setEnabled(False) |
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
|
1602 | self.limitSpinBox.setEnabled(False) |
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
|
1603 | 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
|
1604 | 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
|
1605 | self.limitSpinBox.setEnabled(True) |
1086
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1606 | |
1264
da42fd833a66
Fixed a little bug in the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1263
diff
changeset
|
1607 | self.commandMode = self.initialCommandMode |
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
|
1608 | self.start(self.__filename, isFile=self.__isFile) |
1086
b48ce064b224
Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1061
diff
changeset
|
1609 | |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1610 | def on_passwordCheckBox_toggled(self, isOn): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1611 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1612 | Private slot to handle the password checkbox toggled. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1613 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1614 | @param isOn flag indicating the status of the check box (boolean) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1615 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1616 | if isOn: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1617 | self.input.setEchoMode(QLineEdit.Password) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1618 | else: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1619 | self.input.setEchoMode(QLineEdit.Normal) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1620 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1621 | @pyqtSlot() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1622 | def on_sendButton_clicked(self): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1623 | """ |
3909
354f4f62d507
Corrected some typos.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3715
diff
changeset
|
1624 | Private slot to send the input to the mercurial process. |
178
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1625 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1626 | input = self.input.text() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1627 | input += os.linesep |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1628 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1629 | if self.passwordCheckBox.isChecked(): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1630 | self.errors.insertPlainText(os.linesep) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1631 | self.errors.ensureCursorVisible() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1632 | else: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1633 | self.errors.insertPlainText(input) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1634 | self.errors.ensureCursorVisible() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1635 | self.errorGroup.show() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1636 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1637 | self.process.write(input) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1638 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1639 | self.passwordCheckBox.setChecked(False) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1640 | self.input.clear() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1641 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1642 | def on_input_returnPressed(self): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1643 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1644 | Private slot to handle the press of the return key in the input field. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1645 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1646 | self.intercept = True |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1647 | self.on_sendButton_clicked() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1648 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1649 | def keyPressEvent(self, evt): |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1650 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1651 | Protected slot to handle a key press event. |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1652 | |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1653 | @param evt the key press event (QKeyEvent) |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1654 | """ |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1655 | if self.intercept: |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1656 | self.intercept = False |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1657 | evt.accept() |
dd9f0bca5e2f
Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1658 | return |
2525
8b507a9a2d40
Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
2444
diff
changeset
|
1659 | super(HgLogBrowserDialog, self).keyPressEvent(evt) |
1608
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1660 | |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1661 | @pyqtSlot() |
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
|
1662 | def __phaseActTriggered(self): |
1608
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1663 | """ |
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
|
1664 | Private slot to handle the Change Phase action. |
1608
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1665 | """ |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1666 | currentPhase = self.logTree.selectedItems()[0].text(self.PhaseColumn) |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1667 | revs = [] |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1668 | for itm in self.logTree.selectedItems(): |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1669 | if itm.text(self.PhaseColumn) == currentPhase: |
3008
7848489bcb92
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2962
diff
changeset
|
1670 | revs.append( |
7848489bcb92
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2962
diff
changeset
|
1671 | itm.text(self.RevisionColumn).split(":")[0].strip()) |
1608
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1672 | |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1673 | if not revs: |
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
|
1674 | self.__phaseAct.setEnabled(False) |
1608
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1675 | return |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1676 | |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1677 | if currentPhase == self.phases["draft"]: |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1678 | newPhase = self.phases["secret"] |
1608
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1679 | data = (revs, "s", True) |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1680 | else: |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1681 | newPhase = self.phases["draft"] |
1608
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1682 | data = (revs, "d", False) |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1683 | res = self.vcs.hgPhase(self.repodir, data) |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1684 | if res: |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1685 | for itm in self.logTree.selectedItems(): |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1605
diff
changeset
|
1686 | itm.setText(self.PhaseColumn, newPhase) |
2543
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
1687 | |
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
1688 | @pyqtSlot() |
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
|
1689 | def __graftActTriggered(self): |
2543
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
1690 | """ |
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
|
1691 | Private slot to handle the Copy Changesets action. |
2543
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
1692 | """ |
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
1693 | revs = [] |
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
1694 | |
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
1695 | for itm in self.logTree.selectedItems(): |
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
1696 | branch = itm.text(self.BranchColumn) |
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
1697 | if branch != self.__projectBranch: |
3008
7848489bcb92
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2962
diff
changeset
|
1698 | revs.append( |
7848489bcb92
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2962
diff
changeset
|
1699 | itm.text(self.RevisionColumn).strip().split(":", 1)[0]) |
2543
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
1700 | |
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
1701 | if revs: |
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
1702 | shouldReopen = self.vcs.hgGraft(self.repodir, revs) |
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
1703 | if shouldReopen: |
3020
542e97d4ecb3
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3008
diff
changeset
|
1704 | res = E5MessageBox.yesNo( |
542e97d4ecb3
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3008
diff
changeset
|
1705 | None, |
3190
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3185
diff
changeset
|
1706 | self.tr("Copy Changesets"), |
a9a94491c4fd
Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3185
diff
changeset
|
1707 | self.tr( |
3008
7848489bcb92
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2962
diff
changeset
|
1708 | """The project should be reread. Do this now?"""), |
2543
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
1709 | yesDefault=True) |
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
1710 | if res: |
eb9472947653
Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2444
diff
changeset
|
1711 | e5App().getObject("Project").reopenProject() |
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
|
1712 | return |
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
|
1713 | |
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
|
1714 | self.on_refreshButton_clicked() |
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
|
1715 | |
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
|
1716 | @pyqtSlot() |
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
|
1717 | def __tagActTriggered(self): |
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
|
1718 | """ |
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
|
1719 | Private slot to tag the selected revision. |
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
|
1720 | """ |
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
|
1721 | if len(self.logTree.selectedItems()) == 1: |
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
|
1722 | itm = self.logTree.selectedItems()[0] |
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
|
1723 | rev = itm.text(self.RevisionColumn).strip().split(":", 1)[0] |
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
|
1724 | tag = itm.text(self.TagsColumn).strip().split(", ", 1)[0] |
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
|
1725 | res = self.vcs.vcsTag(self.repodir, revision=rev, tagName=tag) |
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
|
1726 | if res: |
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
|
1727 | self.on_refreshButton_clicked() |
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
|
1728 | |
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
|
1729 | @pyqtSlot() |
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
|
1730 | def __switchActTriggered(self): |
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
|
1731 | """ |
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
|
1732 | Private slot to switch the working directory to the |
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
|
1733 | 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
|
1734 | """ |
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
|
1735 | if len(self.logTree.selectedItems()) == 1: |
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
|
1736 | itm = self.logTree.selectedItems()[0] |
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
|
1737 | rev = itm.text(self.RevisionColumn).strip().split(":", 1)[0] |
5353
60fcaa1c3c3c
Corrected some code style issues and regenerated the source docu files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5324
diff
changeset
|
1738 | bookmarks = [bm.strip() for bm in |
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
|
1739 | itm.text(self.BookmarksColumn).strip().split(",") |
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
|
1740 | if bm.strip()] |
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
|
1741 | if bookmarks: |
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
|
1742 | bookmark, ok = QInputDialog.getItem( |
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
|
1743 | self, |
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
|
1744 | self.tr("Switch"), |
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
|
1745 | self.tr("Select bookmark to switch to (leave empty to" |
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
|
1746 | " use revision):"), |
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
|
1747 | [""] + bookmarks, |
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
|
1748 | 0, False) |
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
|
1749 | if not ok: |
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
|
1750 | return |
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
|
1751 | if bookmark: |
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
|
1752 | rev = bookmark |
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
|
1753 | if rev: |
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
|
1754 | shouldReopen = self.vcs.vcsUpdate(self.repodir, revision=rev) |
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
|
1755 | if shouldReopen: |
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
|
1756 | res = E5MessageBox.yesNo( |
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
|
1757 | None, |
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
|
1758 | self.tr("Switch"), |
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
|
1759 | 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
|
1760 | """The project should be reread. Do this now?"""), |
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
|
1761 | yesDefault=True) |
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
|
1762 | if res: |
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
|
1763 | e5App().getObject("Project").reopenProject() |
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
|
1764 | return |
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
|
1765 | |
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
|
1766 | self.on_refreshButton_clicked() |
3315
bd1a25ead18d
Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3302
diff
changeset
|
1767 | |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1768 | @pyqtSlot() |
5322
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1769 | def __bookmarkActTriggered(self): |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1770 | """ |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1771 | Private slot to 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
|
1772 | """ |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1773 | if len(self.logTree.selectedItems()) == 1: |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1774 | itm = self.logTree.selectedItems()[0] |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1775 | rev, changeset = \ |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1776 | itm.text(self.RevisionColumn).strip().split(":", 1) |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1777 | bookmark, ok = QInputDialog.getText( |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1778 | self, |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1779 | self.tr("Define Bookmark"), |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1780 | self.tr('Enter bookmark name for changeset "{0}":').format( |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1781 | changeset), |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1782 | QLineEdit.Normal) |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1783 | if ok and bool(bookmark): |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1784 | self.vcs.hgBookmarkDefine( |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1785 | self.repodir, revision="rev({0})".format(rev), |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1786 | bookmark=bookmark) |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1787 | self.on_refreshButton_clicked() |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1788 | |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1789 | @pyqtSlot() |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1790 | def __bookmarkMoveActTriggered(self): |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1791 | """ |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1792 | Private slot to move a 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
|
1793 | """ |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1794 | if len(self.logTree.selectedItems()) == 1: |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1795 | itm = self.logTree.selectedItems()[0] |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1796 | rev, changeset = \ |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1797 | itm.text(self.RevisionColumn).strip().split(":", 1) |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1798 | bookmarksList = self.vcs.hgGetBookmarksList(self.repodir) |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1799 | bookmark, ok = QInputDialog.getItem( |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1800 | self, |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1801 | self.tr("Move Bookmark"), |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1802 | self.tr('Select the bookmark to be moved to changeset' |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1803 | ' "{0}":').format(changeset), |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1804 | [""] + bookmarksList, |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1805 | 0, False) |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1806 | if ok and bool(bookmark): |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1807 | self.vcs.hgBookmarkMove( |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1808 | self.repodir, revision="rev({0})".format(rev), |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1809 | bookmark=bookmark) |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1810 | self.on_refreshButton_clicked() |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1811 | |
c2cabdca0734
Added bookmark actions to the Mercurial Log Browser tools menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5276
diff
changeset
|
1812 | @pyqtSlot() |
3315
bd1a25ead18d
Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3302
diff
changeset
|
1813 | def __lfPullActTriggered(self): |
bd1a25ead18d
Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3302
diff
changeset
|
1814 | """ |
bd1a25ead18d
Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3302
diff
changeset
|
1815 | Private slot to pull large files of selected revisions. |
bd1a25ead18d
Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3302
diff
changeset
|
1816 | """ |
bd1a25ead18d
Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3302
diff
changeset
|
1817 | revs = [] |
bd1a25ead18d
Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3302
diff
changeset
|
1818 | for itm in self.logTree.selectedItems(): |
bd1a25ead18d
Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3302
diff
changeset
|
1819 | rev = itm.text(self.RevisionColumn).strip().split(":", 1)[0] |
bd1a25ead18d
Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3302
diff
changeset
|
1820 | if rev: |
bd1a25ead18d
Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3302
diff
changeset
|
1821 | revs.append(rev) |
bd1a25ead18d
Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3302
diff
changeset
|
1822 | |
bd1a25ead18d
Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3302
diff
changeset
|
1823 | if revs: |
bd1a25ead18d
Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3302
diff
changeset
|
1824 | self.vcs.getExtensionObject("largefiles").hgLfPull( |
bd1a25ead18d
Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3302
diff
changeset
|
1825 | self.repodir, revisions=revs) |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1826 | |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1827 | @pyqtSlot() |
5270
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1828 | def __fetchActTriggered(self): |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1829 | """ |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1830 | Private slot to fetch changes from a remote repository. |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1831 | """ |
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
|
1832 | shouldReopen = self.vcs.getExtensionObject("fetch").hgFetch( |
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
|
1833 | self.repodir) |
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
|
1834 | if shouldReopen: |
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
|
1835 | res = E5MessageBox.yesNo( |
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
|
1836 | None, |
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
|
1837 | self.tr("Fetch Changes"), |
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
|
1838 | 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
|
1839 | """The project should be reread. Do this now?"""), |
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
|
1840 | yesDefault=True) |
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
|
1841 | if res: |
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
|
1842 | e5App().getObject("Project").reopenProject() |
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
|
1843 | return |
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
|
1844 | |
5270
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1845 | self.on_refreshButton_clicked() |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1846 | |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1847 | @pyqtSlot() |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1848 | def __pullActTriggered(self): |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1849 | """ |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1850 | Private slot to pull changes from a remote repository. |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1851 | """ |
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
|
1852 | shouldReopen = self.vcs.hgPull(self.repodir) |
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
|
1853 | if shouldReopen: |
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
|
1854 | res = E5MessageBox.yesNo( |
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
|
1855 | None, |
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
|
1856 | self.tr("Pull Changes"), |
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
|
1857 | 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
|
1858 | """The project should be reread. Do this now?"""), |
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
|
1859 | yesDefault=True) |
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
|
1860 | if res: |
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
|
1861 | e5App().getObject("Project").reopenProject() |
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
|
1862 | return |
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
|
1863 | |
4474
d823ad9e714d
Fixed an issue pulling in the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4410
diff
changeset
|
1864 | self.on_refreshButton_clicked() |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1865 | |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1866 | @pyqtSlot() |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1867 | def __pushActTriggered(self): |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1868 | """ |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1869 | Private slot to push changes to a remote repository up to a selected |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1870 | changeset. |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1871 | """ |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1872 | itm = self.logTree.selectedItems()[0] |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1873 | rev = itm.text(self.RevisionColumn).strip().split(":", 1)[0] |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1874 | if rev: |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1875 | self.vcs.hgPush(self.repodir, rev=rev) |
4410
a3a2b652286d
Fixed forgotten refresh for the Mercurial log browser push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4409
diff
changeset
|
1876 | self.on_refreshButton_clicked() |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1877 | |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1878 | @pyqtSlot() |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1879 | def __pushAllActTriggered(self): |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1880 | """ |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1881 | Private slot to 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
|
1882 | """ |
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1883 | self.vcs.hgPush(self.repodir) |
4410
a3a2b652286d
Fixed forgotten refresh for the Mercurial log browser push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4409
diff
changeset
|
1884 | self.on_refreshButton_clicked() |
4409
ff1cb0107d40
Enhanced the log browser functionality by pull and push actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4395
diff
changeset
|
1885 | |
5270
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1886 | @pyqtSlot() |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1887 | def __stripActTriggered(self): |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1888 | """ |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1889 | Private slot to strip changesets from the repository. |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1890 | """ |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1891 | itm = self.logTree.selectedItems()[0] |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1892 | rev = itm.text(self.RevisionColumn).strip().split(":", 1)[1] |
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
|
1893 | shouldReopen = self.vcs.getExtensionObject("strip").hgStrip( |
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
|
1894 | self.repodir, rev=rev) |
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
|
1895 | if shouldReopen: |
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
|
1896 | res = E5MessageBox.yesNo( |
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
|
1897 | None, |
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
|
1898 | self.tr("Strip Changesets"), |
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
|
1899 | 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
|
1900 | """The project should be reread. Do this now?"""), |
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
|
1901 | yesDefault=True) |
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
|
1902 | if res: |
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
|
1903 | e5App().getObject("Project").reopenProject() |
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
|
1904 | return |
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
|
1905 | |
5270
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1906 | self.on_refreshButton_clicked() |
7758f0c7d9f6
Added support for the strip and fetch extensions to the log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5104
diff
changeset
|
1907 | |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1908 | def __actionMode(self): |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1909 | """ |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1910 | Private method to get the selected action mode. |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1911 | |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1912 | @return selected action mode (string, one of filter or find) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1913 | """ |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1914 | return self.modeComboBox.itemData( |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1915 | self.modeComboBox.currentIndex()) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1916 | |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1917 | @pyqtSlot(int) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1918 | def on_modeComboBox_currentIndexChanged(self, index): |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1919 | """ |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1920 | Private slot to react on mode changes. |
4080
d4ba5fab5557
Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4060
diff
changeset
|
1921 | |
d4ba5fab5557
Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4060
diff
changeset
|
1922 | @param index index of the selected entry (integer) |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1923 | """ |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1924 | mode = self.modeComboBox.itemData(index) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1925 | findMode = mode == "find" |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1926 | filterMode = mode == "filter" |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1927 | |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1928 | self.fromDate.setEnabled(filterMode) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1929 | self.toDate.setEnabled(filterMode) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1930 | self.branchCombo.setEnabled(filterMode) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1931 | self.findPrevButton.setVisible(findMode) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1932 | self.findNextButton.setVisible(findMode) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1933 | |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1934 | if findMode: |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1935 | for topIndex in range(self.logTree.topLevelItemCount()): |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1936 | self.logTree.topLevelItem(topIndex).setHidden(False) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1937 | self.logTree.header().setSectionHidden(self.IconColumn, False) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1938 | elif filterMode: |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1939 | self.__filterLogs() |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1940 | |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1941 | @pyqtSlot() |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1942 | def on_findPrevButton_clicked(self): |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1943 | """ |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1944 | Private slot to find the previous item matching the entered criteria. |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1945 | """ |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1946 | self.__findItem(True) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1947 | |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1948 | @pyqtSlot() |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1949 | def on_findNextButton_clicked(self): |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1950 | """ |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1951 | Private slot to find the next item matching the entered criteria. |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1952 | """ |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1953 | self.__findItem(False) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1954 | |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1955 | def __findItem(self, backwards=False, interactive=False): |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1956 | """ |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1957 | Private slot to find an item matching the entered criteria. |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1958 | |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1959 | @param backwards flag indicating to search backwards (boolean) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1960 | @param interactive flag indicating an interactive search (boolean) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1961 | """ |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1962 | self.__findBackwards = backwards |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1963 | |
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
|
1964 | fieldIndex, searchRx, indexIsRole = self.__prepareFieldSearch() |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1965 | currentIndex = self.logTree.indexOfTopLevelItem( |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1966 | self.logTree.currentItem()) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1967 | if backwards: |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1968 | if interactive: |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1969 | indexes = range(currentIndex, -1, -1) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1970 | else: |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1971 | indexes = range(currentIndex - 1, -1, -1) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1972 | else: |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1973 | if interactive: |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1974 | indexes = range(currentIndex, self.logTree.topLevelItemCount()) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1975 | else: |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1976 | indexes = range(currentIndex + 1, |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1977 | self.logTree.topLevelItemCount()) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1978 | |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1979 | for index in indexes: |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1980 | topItem = self.logTree.topLevelItem(index) |
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
|
1981 | if indexIsRole: |
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
|
1982 | if fieldIndex == self.__changesRole: |
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
|
1983 | changes = topItem.data(0, self.__changesRole) |
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
|
1984 | txt = "\n".join( |
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
|
1985 | [c["path"] for c in changes] + |
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
|
1986 | [c["copyfrom"] for c in changes] |
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
|
1987 | ) |
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
|
1988 | else: |
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
|
1989 | # Find based on complete message text |
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
|
1990 | txt = "\n".join(topItem.data(0, self.__messageRole)) |
4059
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1991 | else: |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1992 | txt = topItem.text(fieldIndex) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1993 | if searchRx.indexIn(txt) > -1: |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1994 | self.logTree.setCurrentItem(self.logTree.topLevelItem(index)) |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1995 | break |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1996 | else: |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1997 | E5MessageBox.information( |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1998 | self, |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
1999 | self.tr("Find Commit"), |
15b78ac687fb
Enhanced the Mercurial log browser functionality by a search mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
2000 | self.tr("""'{0}' was not found.""").format(self.rxEdit.text())) |