diff -r e9e7eca7efee -r bf71ee032bb4 src/eric7/Plugins/VcsPlugins/vcsMercurial/HgRevisionSelectionDialog.py --- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgRevisionSelectionDialog.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgRevisionSelectionDialog.py Wed Jul 13 14:55:47 2022 +0200 @@ -17,11 +17,19 @@ """ Class implementing a dialog to select a revision. """ - def __init__(self, tagsList, branchesList, bookmarksList=None, - noneLabel="", revset=True, parent=None): + + def __init__( + self, + tagsList, + branchesList, + bookmarksList=None, + noneLabel="", + revset=True, + parent=None, + ): """ Constructor - + @param tagsList list of tags @type list of str @param branchesList list of branches @@ -38,10 +46,9 @@ """ super().__init__(parent) self.setupUi(self) - - self.buttonBox.button( - QDialogButtonBox.StandardButton.Ok).setEnabled(False) - + + self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(False) + self.tagCombo.addItems(sorted(tagsList)) self.branchCombo.addItems(["default"] + sorted(branchesList)) if bookmarksList is not None: @@ -49,30 +56,30 @@ else: self.bookmarkButton.setHidden(True) self.bookmarkCombo.setHidden(True) - + if noneLabel: self.noneButton.setText(noneLabel) - + self.__revset = revset self.expressionButton.setEnabled(revset) - + # connect various radio buttons and input fields self.idButton.toggled.connect(self.__updateOK) self.tagButton.toggled.connect(self.__updateOK) self.branchButton.toggled.connect(self.__updateOK) self.bookmarkButton.toggled.connect(self.__updateOK) self.expressionButton.toggled.connect(self.__updateOK) - + self.idEdit.textChanged.connect(self.__updateOK) self.expressionEdit.textChanged.connect(self.__updateOK) - + self.tagCombo.editTextChanged.connect(self.__updateOK) self.branchCombo.editTextChanged.connect(self.__updateOK) self.bookmarkCombo.editTextChanged.connect(self.__updateOK) - + msh = self.minimumSizeHint() self.resize(max(self.width(), msh.width()), msh.height()) - + @pyqtSlot() def __updateOK(self): """ @@ -89,14 +96,13 @@ enabled = bool(self.bookmarkCombo.currentText()) elif self.expressionButton.isChecked(): enabled = enabled and bool(self.expressionEdit.text()) - - self.buttonBox.button( - QDialogButtonBox.StandardButton.Ok).setEnabled(enabled) - + + self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(enabled) + def getRevision(self): """ Public method to retrieve the selected revision. - + @return selected revision @rtype str """ @@ -122,5 +128,5 @@ rev = "tip" else: rev = "" - + return rev