--- a/eric6/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/HgShelveDataDialog.py Sun May 12 15:31:23 2019 +0200 +++ b/eric6/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/HgShelveDataDialog.py Tue May 14 19:52:39 2019 +0200 @@ -19,11 +19,14 @@ """ Class implementing a dialog to enter the data for a shelve operation. """ - def __init__(self, parent=None): + def __init__(self, version, parent=None): """ Constructor - @param parent reference to the parent widget (QWidget) + @param version Mercurial version + @type tuple of three int + @param parent reference to the parent widget + @type QWidget """ super(HgShelveDataDialog, self).__init__(parent) self.setupUi(self) @@ -31,6 +34,10 @@ self.__initialDateTime = QDateTime.currentDateTime() self.dateTimeEdit.setDateTime(self.__initialDateTime) + if version < (5, 0, 0): + self.keepCheckBox.setChecked(False) + self.keepCheckBox.hide() + msh = self.minimumSizeHint() self.resize(max(self.width(), msh.width()), msh.height()) @@ -38,9 +45,10 @@ """ Public method to get the user data. - @return tuple containing the name (string), date (QDateTime), - message (string) and a flag indicating to add/remove - new/missing files (boolean) + @return tuple containing the name, date, message, a flag indicating + to add/remove new/missing files and a flag indicating to keep the + shelved changes in the working directory + @rtype tuple of (str, QDateTime, str, bool, bool) """ if self.dateTimeEdit.dateTime() != self.__initialDateTime: dateTime = self.dateTimeEdit.dateTime() @@ -51,4 +59,5 @@ dateTime, self.messageEdit.text(), self.addRemoveCheckBox.isChecked(), + self.keepCheckBox.isChecked(), )