Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py

Sun, 04 May 2014 17:41:23 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 04 May 2014 17:41:23 +0200
changeset 3554
9ca56a89aec5
parent 3546
adce5fd2d051
child 3562
ef3f13a2c599
permissions
-rw-r--r--

A liitle enhancement and a fix to the Mercurial log browser dialog.

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
3160
209a07d7e401 Updated copyright for 2014.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3036
diff changeset
3 # Copyright (c) 2010 - 2014 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
645c12de6b0c Merge with default branch.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3178 3359
diff changeset
12 str = unicode
645c12de6b0c Merge with default branch.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3178 3359
diff changeset
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
932
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
19 from PyQt4.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
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
21 from PyQt4.QtGui import QWidget, QDialogButtonBox, QHeaderView, \
1131
7781e396c903 Changed the code to use super() to access the superclass.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1086
diff changeset
22 QTreeWidgetItem, QApplication, QCursor, QLineEdit, QColor, \
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
23 QPixmap, QPainter, QPen, QBrush, QIcon, QMenu
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
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
50
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
51 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
52 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
53 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
54
3554
9ca56a89aec5 A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3546
diff changeset
55 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
56
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
57 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
58 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 Constructor
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 @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
62 @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
63 @param parent parent widget (QWidget)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 """
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
65 super(HgLogBrowserDialog, self).__init__(parent)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 self.setupUi(self)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67
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
68 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
69
782
2c567a5ceade Added different window titles to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 781
diff changeset
70 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
71 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
72 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
73 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
74 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
75 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
76
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 self.filesTree.headerItem().setText(self.filesTree.columnCount(), "")
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 self.filesTree.header().setSortIndicator(0, Qt.AscendingOrder)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
83 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
84 self.tr("&Refresh"), QDialogButtonBox.ActionRole)
1086
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
85 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
86 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
87 self.refreshButton.setEnabled(False)
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
88
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 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
90 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
91 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
92 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
93 else:
215
e8978dca44af Fixed issues with non-existing bundle caches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 213
diff changeset
94 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
95 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
96 self.__hgClient = vcs.getClient()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97
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
98 if self.vcs.version >= (1, 8):
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
99 self.__detailsTemplate = self.tr(
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
100 "<table>"
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
101 "<tr><td><b>Revision</b></td><td>{0}</td></tr>"
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
102 "<tr><td><b>Date</b></td><td>{1}</td></tr>"
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
103 "<tr><td><b>Author</b></td><td>{2}</td></tr>"
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
104 "<tr><td><b>Branch</b></td><td>{3}</td></tr>"
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
105 "<tr><td><b>Tags</b></td><td>{4}</td></tr>"
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
106 "<tr><td><b>Bookmarks</b></td><td>{5}</td></tr>"
3554
9ca56a89aec5 A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3546
diff changeset
107 "<tr><td><b>Parents</b></td><td>{6}</td></tr>"
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
108 "</table>"
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
109 )
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
110 else:
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
111 self.__detailsTemplate = self.tr(
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
112 "<table>"
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
113 "<tr><td><b>Revision</b></td><td>{0}</td></tr>"
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
114 "<tr><td><b>Date</b></td><td>{1}</td></tr>"
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
115 "<tr><td><b>Author</b></td><td>{2}</td></tr>"
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
116 "<tr><td><b>Branch</b></td><td>{3}</td></tr>"
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
117 "<tr><td><b>Tags</b></td><td>{4}</td></tr>"
3554
9ca56a89aec5 A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3546
diff changeset
118 "<tr><td><b>Parents</b></td><td>{5}</td></tr>"
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
119 "</table>"
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
120 )
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
121
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
122 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
123 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
124 self.__isFile = 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
125
1086
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
126 self.__initData()
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
127
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
128 self.__allBranchesFilter = self.tr("All")
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 self.fromDate.setDisplayFormat("yyyy-MM-dd")
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131 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
132 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
133
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 self.__messageRole = Qt.UserRole
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
135 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
136 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
137 self.__parentsRole = Qt.UserRole + 3
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
139 if self.__hgClient:
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
140 self.process = None
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
141 else:
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
142 self.process = QProcess()
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
143 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
144 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
145 self.process.readyReadStandardError.connect(self.__readStderr)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 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
148 '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
149 '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
150 'M': self.tr('Modified'),
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 }
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152
1086
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
153 self.__dotRadius = 8
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
154 self.__rowHeight = 20
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
155
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
156 self.logTree.setIconSize(
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
157 QSize(100 * self.__rowHeight, self.__rowHeight))
1263
1b6054a9b668 Fixed the treatment of the Mercurial version number.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
158 if self.vcs.version >= (1, 8):
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
159 self.BookmarksColumn = self.logTree.columnCount()
3023
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
160 self.logTree.headerItem().setText(
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
161 self.BookmarksColumn, self.tr("Bookmarks"))
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
162 else:
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
163 self.BookmarksColumn = -1
1605
899cb1241de5 Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1532
diff changeset
164 if self.vcs.version < (2, 1):
899cb1241de5 Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1532
diff changeset
165 self.logTree.setColumnHidden(self.PhaseColumn, True)
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
166
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
167 self.__actionsMenu = QMenu()
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
168 if self.vcs.version >= (2, 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
169 self.__graftAct = self.__actionsMenu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
170 self.tr("Copy Changesets"), self.__graftActTriggered)
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
171 self.__graftAct.setToolTip(self.tr(
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
172 "Copy the selected changesets to the current branch"))
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
173 else:
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
174 self.__graftAct = None
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
175
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
176 if self.vcs.version >= (2, 1):
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
177 self.__phaseAct = self.__actionsMenu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
178 self.tr("Change Phase"), self.__phaseActTriggered)
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
179 self.__phaseAct.setToolTip(self.tr(
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
180 "Change the phase of the selected revisions"))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
181 self.__phaseAct.setWhatsThis(self.tr(
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 """<b>Change Phase</b>\n<p>This changes the phase of the"""
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
183 """ selected revisions. The selected revisions have to have"""
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
184 """ the same current phase.</p>"""))
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
185 else:
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
186 self.__phaseAct = None
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
187
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
188 self.__tagAct = self.__actionsMenu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
189 self.tr("Tag"), self.__tagActTriggered)
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
190 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
191
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
192 self.__switchAct = self.__actionsMenu.addAction(
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
193 self.tr("Switch"), self.__switchActTriggered)
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
194 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
195 "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
196
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
197 if self.vcs.version >= (2, 0):
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
198 self.__lfPullAct = self.__actionsMenu.addAction(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
199 self.tr("Pull Large Files"), self.__lfPullActTriggered)
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
200 self.__lfPullAct.setToolTip(self.tr(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
201 "Pull large files for selected revisions"))
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
202 else:
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
203 self.__lfPullAct = None
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
204
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
205 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
206 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
207 self.actionsButton.setMenu(self.__actionsMenu)
1086
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
208
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
209 def __initData(self):
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
210 """
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
211 Private method to (re-)initialize some data.
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
212 """
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
213 self.__maxDate = QDate()
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
214 self.__minDate = QDate()
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
215 self.__filterLogsEnabled = True
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
216
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217 self.buf = [] # buffer for stdout
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
218 self.diff = None
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
219 self.__started = False
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
220 self.__lastRev = 0
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
221 self.projectMode = False
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
222
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
223 # attributes to store log graph data
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
224 self.__revs = []
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
225 self.__revColors = {}
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
226 self.__revColor = 0
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
227
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
228 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
229
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
230 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
231 self.__projectBranch = ""
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
233 def closeEvent(self, e):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235 Private slot implementing a close event handler.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
236
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
237 @param e close event (QCloseEvent)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 """
1256
885706dbb69f Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1250
diff changeset
239 if self.__hgClient:
885706dbb69f Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1250
diff changeset
240 if self.__hgClient.isExecuting():
885706dbb69f Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1250
diff changeset
241 self.__hgClient.cancel()
885706dbb69f Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1250
diff changeset
242 else:
885706dbb69f Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1250
diff changeset
243 if self.process is not None and \
885706dbb69f Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1250
diff changeset
244 self.process.state() != QProcess.NotRunning:
885706dbb69f Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1250
diff changeset
245 self.process.terminate()
885706dbb69f Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1250
diff changeset
246 QTimer.singleShot(2000, self.process.kill)
885706dbb69f Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1250
diff changeset
247 self.process.waitForFinished(3000)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
248
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
249 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
250
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
251 e.accept()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
252
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
253 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
254 """
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
255 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
256 """
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
257 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
258 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
259 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
260
3484
645c12de6b0c Merge with default branch.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3178 3359
diff changeset
261 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
262
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
263 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
264 """
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
265 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
266 """
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
267 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
268 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
269 self.toDate.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
270 self.fieldCombo.setCurrentIndex(self.fieldCombo.findText(
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
271 self.tr("Message")))
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
272 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
273 "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
274 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
275 "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
276
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
277 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
278 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
279 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
280 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
281 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
282 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
283
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
284 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
285
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
286 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
287
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
288 def __resizeColumnsLog(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
289 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
290 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
291 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
292 self.logTree.header().resizeSections(QHeaderView.ResizeToContents)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
293 self.logTree.header().setStretchLastSection(True)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
294
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
295 def __resizeColumnsFiles(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
296 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
297 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
298 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
299 self.filesTree.header().resizeSections(QHeaderView.ResizeToContents)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
300 self.filesTree.header().setStretchLastSection(True)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
302 def __resortFiles(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
304 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
305 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
306 sortColumn = self.filesTree.sortColumn()
3023
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
307 self.filesTree.sortItems(
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
308 1, self.filesTree.header().sortIndicatorOrder())
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
309 self.filesTree.sortItems(
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
310 sortColumn, self.filesTree.header().sortIndicatorOrder())
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
311
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
312 def __getColor(self, n):
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
313 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
314 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
315
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
316 @param n color index (integer)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
317 @return color name (string)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
318 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
319 return COLORS[n % len(COLORS)]
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
320
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
321 def __branchColor(self, branchName):
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
322 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
323 Private method to calculate a color for a given branch name.
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
324
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
325 @param branchName name of the branch (string)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
326 @return name of the color to use (string)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
327 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
328 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
329 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
330 len(self.__branchColors))
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
331 return self.__branchColors[branchName]
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
332
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
333 def __generateEdges(self, rev, parents):
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
334 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
335 Private method to generate edge info for the give data.
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
336
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
337 @param rev revision to calculate edge info for (integer)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
338 @param parents list of parent revisions (list of integers)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
339 @return tuple containing the column and color index for
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
340 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
341 between the given node and its parents
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
342 (integer, integer, [(integer, integer, integer), ...])
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
343 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
344 if rev not in self.__revs:
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
345 # new head
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
346 self.__revs.append(rev)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
347 self.__revColors[rev] = self.__revColor
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
348 self.__revColor += 1
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
349
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
350 col = self.__revs.index(rev)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
351 color = self.__revColors.pop(rev)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
352 next = self.__revs[:]
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
353
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
354 # add parents to next
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
355 addparents = [p for p in parents if p not in next]
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
356 next[col:col + 1] = addparents
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
357
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
358 # set colors for the parents
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
359 for i, p in enumerate(addparents):
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
360 if not i:
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
361 self.__revColors[p] = color
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
362 else:
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
363 self.__revColors[p] = self.__revColor
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
364 self.__revColor += 1
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
365
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
366 # add edges to the graph
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
367 edges = []
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
368 if parents[0] != -1:
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
369 for ecol, erev in enumerate(self.__revs):
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
370 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
371 edges.append(
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
372 (ecol, next.index(erev), self.__revColors[erev]))
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
373 elif erev == rev:
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
374 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
375 edges.append(
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
376 (ecol, next.index(p), self.__revColors[p]))
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
377
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
378 self.__revs = next
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
379 return col, color, edges
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
380
932
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
381 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
382 currentRev, closed):
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
383 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
384 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
385 given data.
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 @param column column index of the revision (integer)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
388 @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
389 @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
390 (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
391 @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
392 (list of tuples of three integers)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
393 @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
394 @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
395 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
396 @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
397 branch (boolean)
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
398 @return icon for the node (QIcon)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
399 """
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
400 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
401 """
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
402 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
403
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
404 @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
405 @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
406 """
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
407 return int(1.2 * radius) * col + radius // 2 + 3
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
408
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
409 radius = self.__dotRadius
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
410 w = len(bottomedges) * radius + 20
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
411 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
412
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
413 dot_x = col2x(column, radius) - radius // 2
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
414 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
415
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
416 pix = QPixmap(w, h)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
417 pix.fill(QColor(0, 0, 0, 0))
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
418 painter = QPainter(pix)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
419 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
420
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
421 pen = QPen(Qt.blue)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
422 pen.setWidth(2)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
423 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
424
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
425 lpen = QPen(pen)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
426 lpen.setColor(Qt.black)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
427 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
428
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
429 # draw the revision history lines
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
430 for y1, y2, lines in ((0, h, bottomedges),
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
431 (-h, 0, topedges)):
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
432 if lines:
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
433 for start, end, ecolor in lines:
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
434 lpen = QPen(pen)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
435 lpen.setColor(QColor(self.__getColor(ecolor)))
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
436 lpen.setWidth(2)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
437 painter.setPen(lpen)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
438 x1 = col2x(start, radius)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
439 x2 = col2x(end, radius)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
440 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
441
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
442 penradius = 1
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
443 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
444
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
445 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
446
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
447 # 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
448 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
449 # 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
450 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
451 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
452 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
453 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
454 penradius = 3
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
455 painter.setBrush(dotColor)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
456 pen = QPen(pencolor)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
457 pen.setWidth(penradius)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
458 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
459 if closed:
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
460 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
461 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
462 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
463 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
464 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
465 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
466 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
467 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
468 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
469 )
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
470 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
471 painter.drawEllipse(dot_x, dot_y, radius, radius)
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
472 painter.end()
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
473 return QIcon(pix)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
474
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
475 def __getParents(self, rev):
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
476 """
932
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
477 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
478 file/directory.
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
479
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
480 @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
481 @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
482 """
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
483 errMsg = ""
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
484 parents = [-1]
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
485
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
486 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
487 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
488 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
489 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
490 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
491 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
492 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
493 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
494 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
495 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
496 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
497 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
498 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
499 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
500 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
501 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
502
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
503 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
504 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
505 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
506 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
507 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
508 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
509 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
510 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
511 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
512 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
513 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
514 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
515 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
516 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
517 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
518 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
519 "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
520 else:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
521 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
522
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
523 if errMsg:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
524 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
525 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
526 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
527 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
528
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
529 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
530 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
531
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
532 return parents
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
533
241
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
534 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
535 """
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
536 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
537 """
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
538 errMsg = ""
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
539
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
540 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
541 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
542
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
543 output = ""
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
544 if self.__hgClient:
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
545 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
546 else:
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
547 process = QProcess()
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
548 process.setWorkingDirectory(self.repodir)
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
549 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
550 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
551 if procStarted:
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
552 finished = process.waitForFinished(30000)
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
553 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
554 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
555 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
556 else:
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
557 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
558 errMsg = self.tr(
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
559 "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
560 else:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
561 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
562
aaa856499ed5 Added code to the Mercurial log browser to highlight the current revision.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 236
diff changeset
563 if errMsg:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
564 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
565 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
566 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
567 errMsg)
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
568
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
569 if output:
2544
3868561e3962 Fixed an issue introduced by the last changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2543
diff changeset
570 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
571 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
572 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
573 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
574 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
575 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
576
921
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
577 def __getClosedBranches(self):
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
578 """
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
579 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
580 """
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
581 self.__closedBranchesRevs = []
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
582 errMsg = ""
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
583
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
584 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
585 args.append("--closed")
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
586
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
587 output = ""
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
588 if self.__hgClient:
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
589 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
590 else:
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
591 process = QProcess()
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
592 process.setWorkingDirectory(self.repodir)
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
593 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
594 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
595 if procStarted:
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
596 finished = process.waitForFinished(30000)
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
597 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
598 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
599 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
600 else:
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
601 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
602 errMsg = self.tr(
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
603 "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
604 else:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
605 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
606
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
607 if errMsg:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
608 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
609 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
610 self.tr("Mercurial Error"),
921
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
611 errMsg)
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
612
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
613 if output:
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
614 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
615 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
616 parts = line.split()
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
617 self.__closedBranchesRevs.append(
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
618 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
619
932
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
620 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
621 parents, branches, tags, phase, bookmarks=None):
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
622 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
623 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
624
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
625 @param author author info (string)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
626 @param date date info (string)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
627 @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
628 @param revision revision info (string)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
629 @param changedPaths list of dictionary objects containing
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
630 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
631 @param parents list of parent revisions (list of integers)
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
632 @param branches list of branches (list of strings)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
633 @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
634 @param phase phase of the entry (string)
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
635 @param bookmarks list of bookmarks (string)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
636 @return reference to the generated item (QTreeWidgetItem)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
637 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
638 msg = []
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
639 for line in message:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
640 msg.append(line.strip())
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
641
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
642 rev, node = revision.split(":")
921
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
643 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
644 closedStr = self.ClosedIndicator
921
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
645 else:
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
646 closedStr = ""
185
f002e13c9aed Some more finetuning of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 181
diff changeset
647 msgtxt = msg[0]
f002e13c9aed Some more finetuning of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 181
diff changeset
648 if len(msgtxt) > 30:
f002e13c9aed Some more finetuning of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 181
diff changeset
649 msgtxt = "{0}...".format(msgtxt[:30])
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
650 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
651 "",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
652 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
653 "{0:>7}:{1}".format(rev, node),
1605
899cb1241de5 Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1532
diff changeset
654 phase,
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
655 author,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
656 date,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
657 msgtxt,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
658 ", ".join(tags),
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
659 ]
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
660 if bookmarks is not None:
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
661 columnLabels.append(", ".join(bookmarks))
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
662 itm = QTreeWidgetItem(self.logTree, columnLabels)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
663
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
664 itm.setForeground(self.BranchColumn,
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
665 QBrush(QColor(self.__branchColor(branches[0]))))
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
666
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
667 if not self.projectMode:
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
668 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
669 if not parents:
26ed553ad4fb Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 207
diff changeset
670 parents = [int(rev) - 1]
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
671 column, color, edges = self.__generateEdges(int(rev), parents)
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
672
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
673 itm.setData(0, self.__messageRole, message)
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
674 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
675 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
676 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
677 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
678 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
679 itm.setData(0, self.__parentsRole, parents)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
680
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
681 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
682 topedges = \
932
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
683 self.logTree.topLevelItem(
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
684 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
685 .data(0, self.__edgesRole)
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
686 else:
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
687 topedges = None
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
688
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
689 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
690 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
691 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
692 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
693 itm.setIcon(0, icon)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
694
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
695 try:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
696 self.__lastRev = int(revision.split(":")[0])
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
697 except ValueError:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
698 self.__lastRev = 0
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
699
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
700 return itm
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
701
203
0bd3912f3c5f Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
702 def __generateFileItem(self, action, path, copyfrom):
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
703 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
704 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
705
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
706 @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
707 @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
708 @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
709 @return reference to the generated item (QTreeWidgetItem)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
710 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
711 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
712 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
713 path,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
714 copyfrom,
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
715 ])
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
716
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
717 return itm
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
718
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
719 def __getLogEntries(self, startRev=None):
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
720 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
721 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
722
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
723 @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
724 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
725 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
726 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
727 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
728 QApplication.processEvents()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
729
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
730 QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
731 QApplication.processEvents()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
732
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
733 self.buf = []
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
734 self.cancelled = False
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
735 self.errors.clear()
1269
7b4d9f1d7c6c Fixed an issue in the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1265
diff changeset
736 self.intercept = False
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
737
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
738 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
739 args = self.vcs.initCommand(self.commandMode)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
740 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
741 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
742 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
743 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
744 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
745 args.append("--newest-first")
1906
8487f9c2533b Continued implementing support for Mercurial sub-repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1637
diff changeset
746 if self.vcs.hasSubrepositories():
8487f9c2533b Continued implementing support for Mercurial sub-repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1637
diff changeset
747 args.append("--subrepos")
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
748 if startRev is not None:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
749 args.append('--rev')
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
750 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
751 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
752 not self.fname == "." and \
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
753 not self.stopCheckBox.isChecked():
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
754 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
755 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
756 args.append('--copies')
203
0bd3912f3c5f Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
757 args.append('--style')
1605
899cb1241de5 Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1532
diff changeset
758 if self.vcs.version >= (2, 1):
899cb1241de5 Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1532
diff changeset
759 args.append(os.path.join(os.path.dirname(__file__),
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
760 "styles",
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
761 "logBrowserBookmarkPhase.style"))
1605
899cb1241de5 Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1532
diff changeset
762 elif self.vcs.version >= (1, 8):
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
763 args.append(os.path.join(os.path.dirname(__file__),
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
764 "styles",
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
765 "logBrowserBookmark.style"))
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
766 else:
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
767 args.append(os.path.join(os.path.dirname(__file__),
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
768 "styles",
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
769 "logBrowser.style"))
215
e8978dca44af Fixed issues with non-existing bundle caches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 213
diff changeset
770 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
771 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
772 args.append(self.__bundle)
1906
8487f9c2533b Continued implementing support for Mercurial sub-repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1637
diff changeset
773 elif not self.vcs.hasSubrepositories():
213
42bb97ff0bbb Added code to preview a changegroup file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 210
diff changeset
774 project = e5App().getObject("Project")
42bb97ff0bbb Added code to preview a changegroup file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 210
diff changeset
775 self.vcs.bundleFile = os.path.join(
42bb97ff0bbb Added code to preview a changegroup file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 210
diff changeset
776 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
777 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
778 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
779 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
780 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
781 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
782 preargs.append(self.vcs.bundleFile)
213
42bb97ff0bbb Added code to preview a changegroup file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 210
diff changeset
783 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
784 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
785 args.append(self.__filename)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
786
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
787 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
788 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
789 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
790
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
791 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
792 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
793 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
794 err = ""
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
795 if err:
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
796 self.__showError(err)
3249
8f22bfa586b1 Another fix for the Mercurial log dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3247
diff changeset
797 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
798 (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
799 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
800 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
801 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
802 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
803 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
804 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
805 self.__processBuffer()
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
806 self.__finish()
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
807 else:
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
808 self.process.kill()
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
809
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
810 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
811
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
812 self.inputGroup.setEnabled(True)
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
813 self.inputGroup.show()
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
814
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
815 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
816 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
817 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
818 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
819 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
820 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
821 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
822
3330
955e15f0ecce Fixed an issue in the Mercurial log dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3317
diff changeset
823 if self.commandMode != "incoming" or \
3359
6b6c224d67d6 Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3330
diff changeset
824 (self.vcs.bundleFile and
3330
955e15f0ecce Fixed an issue in the Mercurial log dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3317
diff changeset
825 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
826 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
827 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
828 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
829 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
830 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
831 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
832 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
833 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
834 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
835 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
836 '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
837 '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
838 ).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
839 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
840 self.__finish()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
841
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
842 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
843 """
198
7ab8e126f404 Fixed a few issues with the Mercurial plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 187
diff changeset
844 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
845
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
846 @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
847 @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
848 @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
849 (boolean)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
850 """
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
851 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
852 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
853
2079b76a738b Changed the Mercurial Log Browser dialog to maintain its position after being closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3279
diff changeset
854 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
855 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
856
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
857 self.errorGroup.hide()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
858 QApplication.processEvents()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
859
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
860 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
861
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
862 self.__filename = fn
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
863 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
864
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
865 # find the root of the repo
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
866 self.repodir = self.dname
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
867 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
868 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
869 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
870 return
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
871
187
d7916a2e31d6 Added some more refinements to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 185
diff changeset
872 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
873 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
874 self.activateWindow()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
875 self.raise_()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
876
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
877 self.logTree.clear()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
878 self.__started = True
243
a1d982e68edf Fixed an issue introduced by the latest change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 241
diff changeset
879 self.__identifyProject()
921
ae00e4fbcec0 Prepared Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
880 self.__getClosedBranches()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
881 self.__getLogEntries()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
882
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
883 def __procFinished(self, exitCode, exitStatus):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
884 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
885 Private slot connected to the finished signal.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
886
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
887 @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
888 @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
889 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
890 self.__processBuffer()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
891 self.__finish()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
892
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
893 def __finish(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
894 """
932
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
895 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
896 the button.
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
897 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
898 if self.process is not None and \
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
899 self.process.state() != QProcess.NotRunning:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
900 self.process.terminate()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
901 QTimer.singleShot(2000, self.process.kill)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
902 self.process.waitForFinished(3000)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
903
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
904 QApplication.restoreOverrideCursor()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
905
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
906 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
907 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
908 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
909
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
910 self.inputGroup.setEnabled(False)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
911 self.inputGroup.hide()
1086
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
912 self.refreshButton.setEnabled(True)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
913
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
914 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
915 """
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
916 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
917
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
918 @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
919 @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
920 """
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
921 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
922 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
923 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
924 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
925 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
926
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
927 def __processBuffer(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
928 """
198
7ab8e126f404 Fixed a few issues with the Mercurial plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 187
diff changeset
929 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
930 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
931 noEntries = 0
1605
899cb1241de5 Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1532
diff changeset
932 log = {"message": [], "bookmarks": None, "phase": ""}
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
933 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
934 initialText = True
203
0bd3912f3c5f Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
935 fileCopies = {}
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
936 for s in self.buf:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
937 if s != "@@@\n":
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
938 try:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
939 key, value = s.split("|", 1)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
940 except ValueError:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
941 key = ""
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
942 value = s
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
943 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
944 initialText = False
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
945 log["revision"] = value.strip()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
946 elif key == "user":
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
947 log["author"] = value.strip()
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
948 elif key == "parents":
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
949 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
950 [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
951 for x in value.strip().split()]
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
952 elif key == "date":
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
953 log["date"] = " ".join(value.strip().split()[:2])
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
954 elif key == "description":
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
955 log["message"].append(value.strip())
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
956 elif key == "file_adds":
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
957 if value.strip():
203
0bd3912f3c5f Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
958 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
959 if f in fileCopies:
0bd3912f3c5f Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
960 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
961 "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
962 "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
963 "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
964 fileCopies[f]),
203
0bd3912f3c5f Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
965 })
0bd3912f3c5f Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
966 else:
0bd3912f3c5f Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
967 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
968 "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
969 "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
970 "copyfrom": "",
203
0bd3912f3c5f Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
971 })
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
972 elif key == "files_mods":
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
973 if value.strip():
203
0bd3912f3c5f Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
974 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
975 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
976 "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
977 "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
978 "copyfrom": "",
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 elif key == "file_dels":
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
981 if value.strip():
203
0bd3912f3c5f Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
982 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
983 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
984 "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
985 "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
986 "copyfrom": "",
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
987 })
203
0bd3912f3c5f Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
988 elif key == "file_copies":
0bd3912f3c5f Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
989 if value.strip():
0bd3912f3c5f Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
990 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
991 newName, oldName = entry[:-1].split(" (")
0bd3912f3c5f Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
992 fileCopies[newName] = oldName
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
993 elif key == "branches":
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
994 if value.strip():
203
0bd3912f3c5f Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
995 log["branches"] = value.strip().split(", ")
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
996 else:
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
997 log["branches"] = ["default"]
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
998 elif key == "tags":
203
0bd3912f3c5f Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
999 log["tags"] = value.strip().split(", ")
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
1000 elif key == "bookmarks":
1019
d8a9697f78d1 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1017
diff changeset
1001 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
1002 elif key == "phase":
899cb1241de5 Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1532
diff changeset
1003 log["phase"] = value.strip()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1004 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
1005 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
1006 continue
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1007 if value.strip():
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1008 log["message"].append(value.strip())
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1009 else:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1010 if len(log) > 1:
3023
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1011 self.__generateLogItem(
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1012 log["author"], log["date"],
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
1013 log["message"], log["revision"], changedPaths,
1061
3e21869872e3 Fixed PEP-8 related issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1019
diff changeset
1014 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
1015 log["phase"], log["bookmarks"])
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1016 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
1017 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
1018 not self.__minDate.isValid():
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1019 self.__maxDate = dt
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1020 self.__minDate = dt
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1021 else:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1022 if self.__maxDate < dt:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1023 self.__maxDate = dt
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1024 if self.__minDate > dt:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1025 self.__minDate = dt
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1026 noEntries += 1
1605
899cb1241de5 Added support for Phases as of Mercurial 2.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1532
diff changeset
1027 log = {"message": [], "bookmarks": None, "phase": ""}
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1028 changedPaths = []
203
0bd3912f3c5f Refined the Mercurial log browser and log dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
1029 fileCopies = {}
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1030
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1031 self.__resizeColumnsLog()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1032
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1033 if self.__started:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1034 self.logTree.setCurrentItem(self.logTree.topLevelItem(0))
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1035 self.__started = False
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1036
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
1037 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
1038 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
1039 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
1040 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
1041 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
1042 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
1043 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
1044 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
1045 self.limitSpinBox.setEnabled(False)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1046
316
b7e499650928 Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 296
diff changeset
1047 # update the log filters
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1048 self.__filterLogsEnabled = False
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1049 self.fromDate.setMinimumDate(self.__minDate)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1050 self.fromDate.setMaximumDate(self.__maxDate)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1051 self.fromDate.setDate(self.__minDate)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1052 self.toDate.setMinimumDate(self.__minDate)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1053 self.toDate.setMaximumDate(self.__maxDate)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1054 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
1055
b7e499650928 Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 296
diff changeset
1056 branchFilter = self.branchCombo.currentText()
b7e499650928 Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 296
diff changeset
1057 if not branchFilter:
b7e499650928 Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 296
diff changeset
1058 branchFilter = self.__allBranchesFilter
b7e499650928 Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 296
diff changeset
1059 self.branchCombo.clear()
b7e499650928 Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 296
diff changeset
1060 self.branchCombo.addItems(
b7e499650928 Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 296
diff changeset
1061 [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
1062 self.branchCombo.setCurrentIndex(
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
1063 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
1064
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1065 self.__filterLogsEnabled = True
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1066 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
1067
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
1068 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
1069 self.__updateToolMenuActions()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1070
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1071 def __readStdout(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1072 """
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
1073 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
1074
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1075 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
1076 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1077 self.process.setReadChannel(QProcess.StandardOutput)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1078
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1079 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
1080 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
1081 'replace')
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1082 self.buf.append(line)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1083
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1084 def __readStderr(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1085 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1086 Private slot to handle the readyReadStandardError signal.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1087
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1088 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
1089 error pane.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1090 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1091 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
1092 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
1093 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
1094 self.__showError(s)
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
1095
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
1096 def __showError(self, out):
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
1097 """
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
1098 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
1099
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
1100 @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
1101 """
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
1102 self.errorGroup.show()
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
1103 self.errors.insertPlainText(out)
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
1104 self.errors.ensureCursorVisible()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1105
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1106 def __diffRevisions(self, rev1, rev2):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1107 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1108 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
1109
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1110 @param rev1 first revision number (integer)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1111 @param rev2 second revision number (integer)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1112 """
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
1113 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
1114 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
1115 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
1116 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
1117 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
1118 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
1119 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
1120 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
1121 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
1122 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
1123
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1124 def on_buttonBox_clicked(self, button):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1125 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1126 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
1127
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1128 @param button button that was clicked (QAbstractButton)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1129 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1130 if button == self.buttonBox.button(QDialogButtonBox.Close):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1131 self.close()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1132 elif button == self.buttonBox.button(QDialogButtonBox.Cancel):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1133 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
1134 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
1135 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
1136 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
1137 self.__finish()
1086
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1138 elif button == self.refreshButton:
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1139 self.on_refreshButton_clicked()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1140
235
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1141 def __updateDiffButtons(self):
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1142 """
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1143 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
1144 """
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1145 selectionLength = len(self.logTree.selectedItems())
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1146 if selectionLength <= 1:
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1147 current = self.logTree.currentItem()
1086
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1148 if current is None:
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1149 self.diffP1Button.setEnabled(False)
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1150 self.diffP2Button.setEnabled(False)
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1151 else:
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1152 parents = current.data(0, self.__parentsRole)
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1153 self.diffP1Button.setEnabled(len(parents) > 0)
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1154 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
1155
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1156 self.diffRevisionsButton.setEnabled(False)
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1157 elif selectionLength == 2:
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1158 self.diffP1Button.setEnabled(False)
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1159 self.diffP2Button.setEnabled(False)
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1160
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1161 self.diffRevisionsButton.setEnabled(True)
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1162 else:
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1163 self.diffP1Button.setEnabled(False)
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1164 self.diffP2Button.setEnabled(False)
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1165
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1166 self.diffRevisionsButton.setEnabled(False)
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1167
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
1168 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
1169 """
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
1170 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
1171 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
1172 """
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
1173 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
1174 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
1175 # 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
1176 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
1177 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
1178 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
1179 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
1180 phase = itm.text(self.PhaseColumn)
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
1181 if phase == "draft":
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
1182 draft += 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
1183 elif phase == "secret":
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
1184 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
1185 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
1186 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
1187
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
1188 # 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
1189 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
1190 ((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
1191 (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
1192 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
1193 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
1194 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
1195
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
1196 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
1197 # 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
1198 # 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
1199 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
1200 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
1201 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
1202 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
1203 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
1204
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
1205 # 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
1206 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
1207
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
1208 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
1209 self.__switchAct.setEnabled(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
1210
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
1211 if self.__lfPullAct is not None:
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
1212 if self.vcs.isExtensionActive("largefiles"):
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
1213 self.__lfPullAct.setEnabled(bool(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
1214 self.logTree.selectedItems()))
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
1215 else:
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
1216 self.__lfPullAct.setEnabled(False)
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
1217
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
1218 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
1219 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
1220 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
1221
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
1222 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
1223 """
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
1224 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
1225
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
1226 @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
1227 (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
1228 """
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
1229 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
1230 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
1231 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
1232
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
1233 if itm is not None:
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
1234 if self.vcs.version >= (1, 8):
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
1235 self.detailsEdit.setHtml(self.__detailsTemplate.format(
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
1236 itm.text(self.RevisionColumn),
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
1237 itm.text(self.DateColumn),
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
1238 itm.text(self.AuthorColumn),
3554
9ca56a89aec5 A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3546
diff changeset
1239 itm.text(self.BranchColumn).replace(
9ca56a89aec5 A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3546
diff changeset
1240 self.ClosedIndicator, ""),
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
1241 itm.text(self.TagsColumn),
3554
9ca56a89aec5 A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3546
diff changeset
1242 itm.text(self.BookmarksColumn),
9ca56a89aec5 A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3546
diff changeset
1243 ", ".join(
9ca56a89aec5 A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3546
diff changeset
1244 [str(x) for x in itm.data(0, self.__parentsRole)]
9ca56a89aec5 A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3546
diff changeset
1245 ),
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
1246 ))
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
1247 else:
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
1248 self.detailsEdit.setHtml(self.__detailsTemplate.format(
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
1249 itm.text(self.RevisionColumn),
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
1250 itm.text(self.DateColumn),
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
1251 itm.text(self.AuthorColumn),
3554
9ca56a89aec5 A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3546
diff changeset
1252 itm.text(self.BranchColumn).replace(
9ca56a89aec5 A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3546
diff changeset
1253 self.ClosedIndicator, ""),
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
1254 itm.text(self.TagsColumn),
3554
9ca56a89aec5 A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3546
diff changeset
1255 ", ".join(
9ca56a89aec5 A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3546
diff changeset
1256 [str(x) for x in itm.data(0, self.__parentsRole)]
9ca56a89aec5 A liitle enhancement and a fix to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3546
diff changeset
1257 ),
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
1258 ))
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
1259
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
1260 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
1261 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
1262
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
1263 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
1264 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
1265 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
1266 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
1267 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
1268 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
1269 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
1270
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1271 @pyqtSlot(QTreeWidgetItem, QTreeWidgetItem)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1272 def on_logTree_currentItemChanged(self, current, previous):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1273 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1274 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
1275
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1276 @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
1277 @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
1278 """
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
1279 self.__updateGui(current)
235
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1280 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
1281 self.__updateToolMenuActions()
235
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1282
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1283 @pyqtSlot()
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1284 def on_logTree_itemSelectionChanged(self):
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1285 """
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1286 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
1287 """
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1288 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
1289 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
1290
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1291 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
1292 self.__updateToolMenuActions()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1293
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1294 @pyqtSlot()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1295 def on_nextButton_clicked(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1296 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1297 Private slot to handle the Next button.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1298 """
784
3893c2537fb4 Fixed a little bug in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 783
diff changeset
1299 if self.__lastRev > 0:
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1300 self.__getLogEntries(self.__lastRev - 1)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1301
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1302 @pyqtSlot()
208
26ed553ad4fb Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 207
diff changeset
1303 def on_diffP1Button_clicked(self):
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1304 """
208
26ed553ad4fb Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 207
diff changeset
1305 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
1306 """
2567
f70f3103c927 Fixed a severe issue in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2544
diff changeset
1307 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
1308 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
1309 else:
f70f3103c927 Fixed a severe issue in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2544
diff changeset
1310 itm = self.logTree.currentItem()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1311 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
1312 self.diffP1Button.setEnabled(False)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1313 return
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
1314 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
1315
b1a204f22291 Fixed a few issues with the Mercurial log dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 208
diff changeset
1316 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
1317 if rev1 < 0:
208
26ed553ad4fb Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 207
diff changeset
1318 self.diffP1Button.setEnabled(False)
26ed553ad4fb Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 207
diff changeset
1319 return
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1320
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1321 self.__diffRevisions(rev1, rev2)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1322
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1323 @pyqtSlot()
210
b1a204f22291 Fixed a few issues with the Mercurial log dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 208
diff changeset
1324 def on_diffP2Button_clicked(self):
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1325 """
208
26ed553ad4fb Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 207
diff changeset
1326 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
1327 """
2567
f70f3103c927 Fixed a severe issue in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2544
diff changeset
1328 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
1329 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
1330 else:
f70f3103c927 Fixed a severe issue in the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2544
diff changeset
1331 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
1332 if itm is None:
26ed553ad4fb Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 207
diff changeset
1333 self.diffP2Button.setEnabled(False)
26ed553ad4fb Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 207
diff changeset
1334 return
26ed553ad4fb Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 207
diff changeset
1335 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
1336
b1a204f22291 Fixed a few issues with the Mercurial log dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 208
diff changeset
1337 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
1338 if rev1 < 0:
208
26ed553ad4fb Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 207
diff changeset
1339 self.diffP2Button.setEnabled(False)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1340 return
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1341
208
26ed553ad4fb Corrected the diff functions of the log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 207
diff changeset
1342 self.__diffRevisions(rev1, rev2)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1343
235
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1344 @pyqtSlot()
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1345 def on_diffRevisionsButton_clicked(self):
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1346 """
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1347 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
1348 """
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1349 items = self.logTree.selectedItems()
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1350
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1351 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
1352 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
1353
7cb9905b0cf9 Little enhancement to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 215
diff changeset
1354 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
1355
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1356 @pyqtSlot(QDate)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1357 def on_fromDate_dateChanged(self, date):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1358 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1359 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
1360
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1361 @param date new date (QDate)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1362 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1363 self.__filterLogs()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1364
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1365 @pyqtSlot(QDate)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1366 def on_toDate_dateChanged(self, date):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1367 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1368 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
1369
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1370 @param date new date (QDate)
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 self.__filterLogs()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1373
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1374 @pyqtSlot(str)
316
b7e499650928 Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 296
diff changeset
1375 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
1376 """
b7e499650928 Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 296
diff changeset
1377 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
1378
b7e499650928 Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 296
diff changeset
1379 @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
1380 """
b7e499650928 Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 296
diff changeset
1381 self.__filterLogs()
b7e499650928 Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 296
diff changeset
1382
b7e499650928 Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 296
diff changeset
1383 @pyqtSlot(str)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1384 def on_fieldCombo_activated(self, txt):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1385 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1386 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
1387
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1388 @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
1389 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1390 self.__filterLogs()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1391
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1392 @pyqtSlot(str)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1393 def on_rxEdit_textChanged(self, txt):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1394 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1395 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
1396
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1397 @param txt filter expression (string)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1398 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1399 self.__filterLogs()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1400
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1401 def __filterLogs(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1402 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1403 Private method to filter the log entries.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1404 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1405 if self.__filterLogsEnabled:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1406 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
1407 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
1408 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
1409 closedBranch = branch + '--'
316
b7e499650928 Added a branch filter to the Mercurial log browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 296
diff changeset
1410
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1411 txt = self.fieldCombo.currentText()
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
1412 if txt == self.tr("Author"):
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
1413 fieldIndex = self.AuthorColumn
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1414 searchRx = QRegExp(self.rxEdit.text(), Qt.CaseInsensitive)
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
1415 elif txt == self.tr("Revision"):
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
1416 fieldIndex = self.RevisionColumn
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1417 txt = self.rxEdit.text()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1418 if txt.startswith("^"):
932
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
1419 searchRx = QRegExp("^\s*{0}".format(txt[1:]),
efd23a913a09 Finished extending the Mercurial log browser to indicate closed branches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 921
diff changeset
1420 Qt.CaseInsensitive)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1421 else:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1422 searchRx = QRegExp(txt, Qt.CaseInsensitive)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1423 else:
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
1424 fieldIndex = self.MessageColumn
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1425 searchRx = QRegExp(self.rxEdit.text(), Qt.CaseInsensitive)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1426
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1427 currentItem = self.logTree.currentItem()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1428 for topIndex in range(self.logTree.topLevelItemCount()):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1429 topItem = self.logTree.topLevelItem(topIndex)
180
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
1430 if topItem.text(self.DateColumn) <= to_ and \
40ac468c2558 Enhanced LogBrowserDialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 179
diff changeset
1431 topItem.text(self.DateColumn) >= from_ and \
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
1432 (branch == self.__allBranchesFilter or
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
1433 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
1434 [branch, closedBranch]) and \
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1435 searchRx.indexIn(topItem.text(fieldIndex)) > -1:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1436 topItem.setHidden(False)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1437 if topItem is currentItem:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1438 self.on_logTree_currentItemChanged(topItem, None)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1439 else:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1440 topItem.setHidden(True)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1441 if topItem is currentItem:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1442 self.messageEdit.clear()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1443 self.filesTree.clear()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1444
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1445 @pyqtSlot(bool)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1446 def on_stopCheckBox_clicked(self, checked):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1447 """
2962
d6c9d1ca2da4 Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2848
diff changeset
1448 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
1449
d6c9d1ca2da4 Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2848
diff changeset
1450 @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
1451 """
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 932
diff changeset
1452 self.vcs.getPlugin().setPreferences("StopLogOnCopy",
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1453 self.stopCheckBox.isChecked())
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1454 self.nextButton.setEnabled(True)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1455 self.limitSpinBox.setEnabled(True)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1456
1086
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1457 @pyqtSlot()
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1458 def on_refreshButton_clicked(self):
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1459 """
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1460 Private slot to refresh the log.
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1461 """
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1462 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1463 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True)
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1464 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1465
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1466 self.inputGroup.setEnabled(True)
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1467 self.inputGroup.show()
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1468 self.refreshButton.setEnabled(False)
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1469
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
1470 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
1471 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
1472 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
1473 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
1474 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
1475 self.limitSpinBox.setEnabled(True)
1086
b48ce064b224 Enhanced the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1061
diff changeset
1476
1264
da42fd833a66 Fixed a little bug in the Mercurial log browser window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1263
diff changeset
1477 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
1478 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
1479
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1480 def on_passwordCheckBox_toggled(self, isOn):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1481 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1482 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
1483
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1484 @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
1485 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1486 if isOn:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1487 self.input.setEchoMode(QLineEdit.Password)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1488 else:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1489 self.input.setEchoMode(QLineEdit.Normal)
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 @pyqtSlot()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1492 def on_sendButton_clicked(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1493 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1494 Private slot to send the input to the merurial process.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1495 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1496 input = self.input.text()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1497 input += os.linesep
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1498
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1499 if self.passwordCheckBox.isChecked():
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1500 self.errors.insertPlainText(os.linesep)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1501 self.errors.ensureCursorVisible()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1502 else:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1503 self.errors.insertPlainText(input)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1504 self.errors.ensureCursorVisible()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1505 self.errorGroup.show()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1506
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1507 self.process.write(input)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1508
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1509 self.passwordCheckBox.setChecked(False)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1510 self.input.clear()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1511
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1512 def on_input_returnPressed(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1513 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1514 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
1515 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1516 self.intercept = True
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1517 self.on_sendButton_clicked()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1518
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1519 def keyPressEvent(self, evt):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1520 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1521 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
1522
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1523 @param evt the key press event (QKeyEvent)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1524 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1525 if self.intercept:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1526 self.intercept = False
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1527 evt.accept()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1528 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
1529 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
1530
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
1531 @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
1532 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
1533 """
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
1534 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
1535 """
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
1536 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
1537 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
1538 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
1539 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
1540 revs.append(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
1541 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
1542
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
1543 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
1544 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
1545 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
1546
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
1547 if currentPhase == "draft":
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
1548 newPhase = "secret"
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
1549 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
1550 else:
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
1551 newPhase = "draft"
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
1552 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
1553 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
1554 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
1555 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
1556 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
1557
eb9472947653 Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2444
diff changeset
1558 @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
1559 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
1560 """
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
1561 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
1562 """
eb9472947653 Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2444
diff changeset
1563 revs = []
eb9472947653 Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2444
diff changeset
1564
eb9472947653 Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2444
diff changeset
1565 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
1566 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
1567 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
1568 revs.append(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
1569 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
1570
eb9472947653 Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2444
diff changeset
1571 if revs:
eb9472947653 Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2444
diff changeset
1572 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
1573 if shouldReopen:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
1574 res = E5MessageBox.yesNo(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
1575 None,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3185
diff changeset
1576 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
1577 self.tr(
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2962
diff changeset
1578 """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
1579 yesDefault=True)
eb9472947653 Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2444
diff changeset
1580 if res:
eb9472947653 Added a 'Copy Changesets' button to the Mercurial log browser dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2444
diff changeset
1581 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
1582 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
1583
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
1584 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
1585
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
1586 @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
1587 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
1588 """
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
1589 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
1590 """
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
1591 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
1592 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
1593 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
1594 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
1595 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
1596 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
1597 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
1598
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
1599 @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
1600 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
1601 """
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
1602 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
1603 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
1604 """
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
1605 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
1606 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
1607 rev = itm.text(self.RevisionColumn).strip().split(":", 1)[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
1608 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
1609 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
1610 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
1611 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
1612 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
1613 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
1614 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
1615 """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
1616 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
1617 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
1618 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
1619 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
1620
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
1621 self.on_refreshButton_clicked()
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
1622
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
1623 def __lfPullActTriggered(self):
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
1624 """
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
1625 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
1626 """
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
1627 revs = []
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
1628 for itm in self.logTree.selectedItems():
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
1629 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
1630 if rev:
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
1631 revs.append(rev)
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
1632
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
1633 if revs:
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
1634 self.vcs.getExtensionObject("largefiles").hgLfPull(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
1635 self.repodir, revisions=revs)

eric ide

mercurial