eric6/Plugins/VcsPlugins/vcsMercurial/HgCommitDialog.py

Tue, 02 Mar 2021 17:17:09 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 02 Mar 2021 17:17:09 +0100
changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8151
8c1445825e7b
permissions
-rw-r--r--

Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.

178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
3 # Copyright (c) 2010 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to enter the commit message.
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
5330
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
10 from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QDateTime
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
11 from PyQt5.QtWidgets import QWidget, QDialogButtonBox
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 from .Ui_HgCommitDialog import Ui_HgCommitDialog
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
15
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 class HgCommitDialog(QWidget, Ui_HgCommitDialog):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 Class implementing a dialog to enter the commit message.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 @signal accepted() emitted, if the dialog was accepted
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 @signal rejected() emitted, if the dialog was rejected
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 """
496
ed1e3f654d0b Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 495
diff changeset
23 accepted = pyqtSignal()
ed1e3f654d0b Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 495
diff changeset
24 rejected = pyqtSignal()
ed1e3f654d0b Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 495
diff changeset
25
7152
a99df2004bb7 Commit Merge in Mercurial added and Cancel renamed to Abort Merge
Christos Sevastiadis <csevast@auth.gr>
parents: 6942
diff changeset
26 def __init__(self, vcs, msg, mq, merge, parent=None):
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 Constructor
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 @param vcs reference to the vcs object
3353
ddc966a494b0 Added capability to commit a new branch directly without the need to select the commit menu entry.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
31 @param msg initial message (string)
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
32 @param mq flag indicating a queue commit (boolean)
7152
a99df2004bb7 Commit Merge in Mercurial added and Cancel renamed to Abort Merge
Christos Sevastiadis <csevast@auth.gr>
parents: 6942
diff changeset
33 @param merge flag indicating a merge commit (boolean)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 @param parent parent widget (QWidget)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 """
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
36 super(HgCommitDialog, self).__init__(
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
37 parent, Qt.WindowFlags(Qt.WindowType.Window))
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 self.setupUi(self)
1855
93bf1823466a Added support for amending commits as of Mercurial 2.2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
39
5329
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
40 self.__vcs = vcs
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
41
3353
ddc966a494b0 Added capability to commit a new branch directly without the need to select the commit menu entry.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
42 self.logEdit.setPlainText(msg)
ddc966a494b0 Added capability to commit a new branch directly without the need to select the commit menu entry.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
43
7152
a99df2004bb7 Commit Merge in Mercurial added and Cancel renamed to Abort Merge
Christos Sevastiadis <csevast@auth.gr>
parents: 6942
diff changeset
44 if mq or merge:
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
45 self.amendCheckBox.setVisible(False)
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
46 self.subrepoCheckBox.setVisible(False)
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
47 else:
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
48 self.subrepoCheckBox.setVisible(vcs.hasSubrepositories())
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 def showEvent(self, evt):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 """
3591
2f2a4a76dd22 Corrected a bunch of source docu issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
52 Protected method called when the dialog is about to be shown.
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 @param evt the event (QShowEvent)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 """
5329
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
56 commitMessages = self.__vcs.getPlugin().getPreferences('Commits')
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 self.recentComboBox.clear()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 self.recentComboBox.addItem("")
5329
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
59 for message in commitMessages:
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
60 abbrMsg = message[:60]
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
61 if len(message) > 60:
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
62 abbrMsg += "..."
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
63 self.recentComboBox.addItem(abbrMsg, message)
5330
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
64
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
65 commitAuthors = self.__vcs.getPlugin().getPreferences('CommitAuthors')
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
66 self.authorComboBox.clear()
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
67 self.authorComboBox.addItem("")
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
68 self.authorComboBox.addItems(commitAuthors)
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
69
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
70 self.dateTimeEdit.setDateTime(QDateTime.currentDateTime())
5497
7cba888c8895 Added a fix for a focus issue in the VCS commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
71
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
72 self.logEdit.setFocus(Qt.FocusReason.OtherFocusReason)
1906
8487f9c2533b Continued implementing support for Mercurial sub-repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1855
diff changeset
73
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 def on_buttonBox_clicked(self, button):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 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
77
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 @param button button that was clicked (QAbstractButton)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 """
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
80 if button == self.buttonBox.button(
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
81 QDialogButtonBox.StandardButton.Cancel
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
82 ):
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 self.logEdit.clear()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 def on_buttonBox_accepted(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 Private slot called by the buttonBox accepted signal.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 self.close()
495
b31b0bffa5b0 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 178
diff changeset
90 self.accepted.emit()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 def on_buttonBox_rejected(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 Private slot called by the buttonBox rejected signal.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 self.close()
495
b31b0bffa5b0 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 178
diff changeset
97 self.rejected.emit()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 @pyqtSlot(str)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 def on_recentComboBox_activated(self, txt):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 Private slot to select a commit message from recent ones.
1066
a3dd41fd9ea8 Added support for the Mercurial fetch extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
103
a3dd41fd9ea8 Added support for the Mercurial fetch extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
104 @param txt text of the selected entry (string)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 if txt:
5329
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
107 self.logEdit.setPlainText(self.recentComboBox.currentData())
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
108
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
109 def getCommitData(self):
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
110 """
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
111 Public method to retrieve the entered data for the commit.
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
112
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
113 @return tuple containing the log message, a flag indicating to amend
5330
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
114 the last commit, a flag indicating to commit subrepositories as
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
115 well, name of the author and date/time of the commit
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
116 @rtype tuple of str, bool, bool, str, str
5329
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
117 """
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
118 msg = self.logEdit.toPlainText()
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
119 if msg:
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
120 commitMessages = self.__vcs.getPlugin().getPreferences('Commits')
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
121 if msg in commitMessages:
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
122 commitMessages.remove(msg)
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
123 commitMessages.insert(0, msg)
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
124 no = self.__vcs.getPlugin().getPreferences("CommitMessages")
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
125 del commitMessages[no:]
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
126 self.__vcs.getPlugin().setPreferences(
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
127 'Commits', commitMessages)
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
128
5330
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
129 author = self.authorComboBox.currentText()
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
130 if author:
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
131 commitAuthors = self.__vcs.getPlugin().getPreferences(
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
132 'CommitAuthors')
5330
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
133 if author in commitAuthors:
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
134 commitAuthors.remove(author)
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
135 commitAuthors.insert(0, author)
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
136 no = self.__vcs.getPlugin().getPreferences("CommitAuthorsLimit")
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
137 del commitAuthors[no:]
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
138 self.__vcs.getPlugin().setPreferences(
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
139 'CommitAuthors', commitAuthors)
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
140
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
141 if self.dateTimeGroup.isChecked():
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
142 dateTime = self.dateTimeEdit.dateTime().toString(
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
143 "yyyy-MM-dd hh:mm")
5330
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
144 else:
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
145 dateTime = ""
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
146
5329
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
147 return (
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
148 msg,
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
149 self.amendCheckBox.isChecked(),
5330
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
150 self.subrepoCheckBox.isChecked(),
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
151 author,
381665763704 Added possibility to enter a commit author and commit date/time to the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5329
diff changeset
152 dateTime,
5329
ebec303b4e50 Refactored the Mercurial commit dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5327
diff changeset
153 )

eric ide

mercurial