Plugins/VcsPlugins/vcsMercurial/HgGraftDialog.py

changeset 1990
7fee3661c4f9
parent 1655
d2b583fdde1c
child 2302
f29e9405c851
equal deleted inserted replaced
1987:c7b98f0180ab 1990:7fee3661c4f9
15 15
16 class HgGraftDialog(QDialog, Ui_HgGraftDialog): 16 class HgGraftDialog(QDialog, Ui_HgGraftDialog):
17 """ 17 """
18 Class implementing a dialog to enter the data for a graft session. 18 Class implementing a dialog to enter the data for a graft session.
19 """ 19 """
20 def __init__(self, parent=None): 20 def __init__(self, vcs, parent=None):
21 """ 21 """
22 Constructor 22 Constructor
23 23
24 @param vcs reference to the VCS object (Hg)
24 @param parent reference to the parent widget (QWidget) 25 @param parent reference to the parent widget (QWidget)
25 """ 26 """
26 super().__init__(parent) 27 super().__init__(parent)
27 self.setupUi(self) 28 self.setupUi(self)
28 29
29 self.dateTimeEdit.setDateTime(QDateTime.currentDateTime()) 30 self.dateTimeEdit.setDateTime(QDateTime.currentDateTime())
31
32 if vcs.version < (2, 3):
33 self.logCheckBox.setEnabled(False)
34 self.logCheckBox.setChecked(False)
35 self.logCheckBox.setVisible(False)
30 36
31 self.__updateOk() 37 self.__updateOk()
32 38
33 def __updateOk(self): 39 def __updateOk(self):
34 """ 40 """
80 """ 86 """
81 Public method to retrieve the entered data. 87 Public method to retrieve the entered data.
82 88
83 @return tuple with list of revisions, a tuple giving a 89 @return tuple with list of revisions, a tuple giving a
84 flag indicating to set the user, a flag indicating to use the 90 flag indicating to set the user, a flag indicating to use the
85 current user and the user name and another tuple giving a flag 91 current user and the user name, another tuple giving a flag
86 indicating to set the date, a flag indicating to use the 92 indicating to set the date, a flag indicating to use the
87 current date and the date (list of strings, (boolean, boolean, string), 93 current date and the date, a flag indicating to append graft info
88 (boolean, boolean, string)) 94 to the log message and a flag indicating a dry-run (list of strings,
95 (boolean, boolean, string), (boolean, boolean, string), boolean,
96 boolean)
89 """ 97 """
90 userData = (self.userGroup.isChecked(), 98 userData = (self.userGroup.isChecked(),
91 self.currentUserCheckBox.isChecked(), 99 self.currentUserCheckBox.isChecked(),
92 self.userEdit.text()) 100 self.userEdit.text())
93 dateData = (self.dateGroup.isChecked(), 101 dateData = (self.dateGroup.isChecked(),
94 self.currentDateCheckBox.isChecked(), 102 self.currentDateCheckBox.isChecked(),
95 self.dateTimeEdit.dateTime().toString("yyyy-MM-dd hh:mm")) 103 self.dateTimeEdit.dateTime().toString("yyyy-MM-dd hh:mm"))
96 return (self.revisionsEdit.toPlainText().strip().splitlines(), 104 return (self.revisionsEdit.toPlainText().strip().splitlines(),
97 userData, dateData) 105 userData, dateData,
106 self.logCheckBox.isChecked(),
107 self.dryRunCheckBox.isChecked())

eric ide

mercurial