eric6/Plugins/VcsPlugins/vcsMercurial/HgBackoutDialog.py

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

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 30 Dec 2020 11:00:44 +0100
branch
maintenance
changeset 7924
8a96736d465e
parent 7780
41420f82c0ac
child 8143
2c730d5fd177
permissions
-rw-r--r--

Updated copyright for 2021.

220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7924
8a96736d465e 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>
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to enter the data for a backout operation.
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
10 from PyQt5.QtCore import pyqtSlot, QDateTime
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
11 from PyQt5.QtWidgets import QDialog, QDialogButtonBox
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 from .Ui_HgBackoutDialog import Ui_HgBackoutDialog
92b796009140 Added files forgotten in previous commits.
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
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 class HgBackoutDialog(QDialog, Ui_HgBackoutDialog):
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 """
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 Class implementing a dialog to enter the data for a backout operation.
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 """
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
20 def __init__(self, tagsList, branchesList, bookmarksList=None,
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
21 parent=None):
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 """
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 Constructor
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 @param tagsList list of tags (list of strings)
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 @param branchesList list of branches (list of strings)
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
27 @param bookmarksList list of bookmarks (list of strings)
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 @param parent parent widget (QWidget)
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 """
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2302
diff changeset
30 super(HgBackoutDialog, self).__init__(parent)
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 self.setupUi(self)
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
33 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
34
739
efbfe57c8219 Modified some list(sorted(...)) calls.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 220
diff changeset
35 self.tagCombo.addItems(sorted(tagsList))
efbfe57c8219 Modified some list(sorted(...)) calls.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 220
diff changeset
36 self.branchCombo.addItems(["default"] + sorted(branchesList))
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
37 if bookmarksList is not None:
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
38 self.bookmarkCombo.addItems(sorted(bookmarksList))
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
39 else:
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
40 self.bookmarkButton.setHidden(True)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
41 self.bookmarkCombo.setHidden(True)
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 self.__initDateTime = QDateTime.currentDateTime()
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 self.dateEdit.setDateTime(self.__initDateTime)
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
46 def __updateOK(self):
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
47 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
48 Private slot to update the OK button.
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
49 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
50 enabled = True
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
51 if self.noneButton.isChecked():
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
52 enabled = False
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
53 elif self.idButton.isChecked():
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
54 enabled = self.idEdit.text() != ""
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
55 elif self.tagButton.isChecked():
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
56 enabled = self.tagCombo.currentText() != ""
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
57 elif self.branchButton.isChecked():
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
58 enabled = self.branchCombo.currentText() != ""
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
59 elif self.bookmarkButton.isChecked():
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
60 enabled = self.bookmarkCombo.currentText() != ""
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
61
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
62 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enabled)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
63
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
64 @pyqtSlot(bool)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
65 def on_idButton_toggled(self, checked):
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
66 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
67 Private slot to handle changes of the ID select button.
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
68
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
69 @param checked state of the button (boolean)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
70 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
71 self.__updateOK()
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
72
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
73 @pyqtSlot(bool)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
74 def on_tagButton_toggled(self, checked):
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
75 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
76 Private slot to handle changes of the Tag select button.
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
77
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
78 @param checked state of the button (boolean)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
79 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
80 self.__updateOK()
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
81
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
82 @pyqtSlot(bool)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
83 def on_branchButton_toggled(self, checked):
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
84 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
85 Private slot to handle changes of the Branch select button.
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
86
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
87 @param checked state of the button (boolean)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
88 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
89 self.__updateOK()
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
90
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
91 @pyqtSlot(bool)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
92 def on_bookmarkButton_toggled(self, checked):
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
93 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
94 Private slot to handle changes of the Bookmark select button.
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
95
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
96 @param checked state of the button (boolean)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
97 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
98 self.__updateOK()
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
99
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 @pyqtSlot(bool)
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 def on_noneButton_toggled(self, checked):
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 """
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 Private slot to handle the toggling of the None revision button.
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 @param checked flag indicating the checked state (boolean)
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 """
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
107 self.__updateOK()
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
108
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
109 @pyqtSlot(str)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
110 def on_idEdit_textChanged(self, txt):
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
111 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
112 Private slot to handle changes of the ID edit.
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
113
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
114 @param txt text of the edit (string)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
115 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
116 self.__updateOK()
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
117
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
118 @pyqtSlot(str)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
119 def on_tagCombo_editTextChanged(self, txt):
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
120 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
121 Private slot to handle changes of the Tag combo.
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
122
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
123 @param txt text of the combo (string)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
124 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
125 self.__updateOK()
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
126
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
127 @pyqtSlot(str)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
128 def on_branchCombo_editTextChanged(self, txt):
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
129 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
130 Private slot to handle changes of the Branch combo.
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
131
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
132 @param txt text of the combo (string)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
133 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
134 self.__updateOK()
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
135
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
136 @pyqtSlot(str)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
137 def on_bookmarkCombo_editTextChanged(self, txt):
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
138 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
139 Private slot to handle changes of the Bookmark combo.
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
140
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
141 @param txt text of the combo (string)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
142 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
143 self.__updateOK()
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145 def getParameters(self):
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 """
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 Public method to retrieve the backout data.
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
149 @return tuple naming the revision, a flag indicating a
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 merge, the commit date, the commit user and a commit message
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 (string, boolean, string, string, string)
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 """
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 if self.numberButton.isChecked():
3337
49faa820151a Corrected some Mercurial input dialogs offering to enter either a revision number or a changeset id to use rev() and id() to make the operation unambigous.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
154 rev = "rev({0})".format(self.numberSpinBox.value())
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155 elif self.idButton.isChecked():
3337
49faa820151a Corrected some Mercurial input dialogs offering to enter either a revision number or a changeset id to use rev() and id() to make the operation unambigous.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
156 rev = "id({0})".format(self.idEdit.text())
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 elif self.tagButton.isChecked():
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 rev = self.tagCombo.currentText()
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 elif self.branchButton.isChecked():
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160 rev = self.branchCombo.currentText()
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
161 elif self.bookmarkButton.isChecked():
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
162 rev = self.bookmarkCombo.currentText()
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 else:
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164 rev = ""
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 if self.dateEdit.dateTime() != self.__initDateTime:
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167 date = self.dateEdit.dateTime().toString("yyyy-MM-dd hh:mm")
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 else:
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169 date = ""
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 if self.messageEdit.toPlainText():
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 msg = self.messageEdit.toPlainText()
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 else:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
174 msg = self.tr("Backed out changeset <{0}>.").format(rev)
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
176 return (rev,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
177 self.mergeCheckBox.isChecked,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
178 date,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
179 self.userEdit.text(),
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180 msg
3036
30c81c9e88b8 Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
181 )

eric ide

mercurial