eric6/Plugins/VcsPlugins/vcsMercurial/HgBackoutDialog.py

Tue, 10 Sep 2019 19:30:07 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 10 Sep 2019 19:30:07 +0200
changeset 7229
53054eb5b15a
parent 6942
2602857055c5
child 7360
9190402e4505
permissions
-rw-r--r--

Removed obsolete "from __future__ import ..." statements.

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

eric ide

mercurial