diff -r e9e7eca7efee -r bf71ee032bb4 src/eric7/Plugins/VcsPlugins/vcsPySvn/SvnUrlSelectionDialog.py --- a/src/eric7/Plugins/VcsPlugins/vcsPySvn/SvnUrlSelectionDialog.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/Plugins/VcsPlugins/vcsPySvn/SvnUrlSelectionDialog.py Wed Jul 13 14:55:47 2022 +0200 @@ -26,10 +26,11 @@ """ Class implementing a dialog to enter the URLs for the svn diff command. """ + def __init__(self, vcs, tagsList, branchesList, path, parent=None): """ Constructor - + @param vcs reference to the vcs object @param tagsList list of tags (list of strings) @param branchesList list of branches (list of strings) @@ -38,18 +39,18 @@ """ super().__init__(parent) self.setupUi(self) - - if not hasattr(pysvn.Client(), 'diff_summarize'): + + if not hasattr(pysvn.Client(), "diff_summarize"): self.summaryCheckBox.setEnabled(False) self.summaryCheckBox.setChecked(False) - + self.vcs = vcs self.tagsList = tagsList self.branchesList = branchesList - + self.typeCombo1.addItems(["trunk/", "tags/", "branches/"]) self.typeCombo2.addItems(["trunk/", "tags/", "branches/"]) - + reposURL = self.vcs.svnGetReposName(path) if reposURL is None: EricMessageBox.critical( @@ -58,13 +59,15 @@ self.tr( """The URL of the project repository could not be""" """ retrieved from the working copy. The operation will""" - """ be aborted""")) + """ be aborted""" + ), + ) self.reject() return - + if self.vcs.otherData["standardLayout"]: # determine the base path of the project in the repository - rx_base = re.compile('(.+/)(trunk|tags|branches).*') + rx_base = re.compile("(.+/)(trunk|tags|branches).*") match = rx_base.fullmatch(reposURL) if match is None: EricMessageBox.critical( @@ -73,21 +76,22 @@ self.tr( """The URL of the project repository has an""" """ invalid format. The operation will""" - """ be aborted""")) + """ be aborted""" + ), + ) self.reject() return - + reposRoot = match.group(1) self.repoRootLabel1.setText(reposRoot) self.repoRootLabel2.setText(reposRoot) else: - project = ericApp().getObject('Project') - if ( - Utilities.normcasepath(path) != - Utilities.normcasepath(project.getProjectPath()) + project = ericApp().getObject("Project") + if Utilities.normcasepath(path) != Utilities.normcasepath( + project.getProjectPath() ): path = project.getRelativePath(path) - reposURL = reposURL.replace(path, '') + reposURL = reposURL.replace(path, "") self.repoRootLabel1.hide() self.typeCombo1.hide() self.labelCombo1.addItems([reposURL] + sorted(self.vcs.tagsList)) @@ -96,15 +100,15 @@ self.typeCombo2.hide() self.labelCombo2.addItems([reposURL] + sorted(self.vcs.tagsList)) self.labelCombo2.setEnabled(True) - + msh = self.minimumSizeHint() self.resize(max(self.width(), msh.width()), msh.height()) - + def __changeLabelCombo(self, labelCombo, type_): """ Private method used to change the label combo depending on the selected type. - + @param labelCombo reference to the labelCombo object (QComboBox) @param type_ type string (string) """ @@ -122,49 +126,49 @@ labelCombo.clearEditText() labelCombo.addItems(sorted(self.branchesList)) labelCombo.setEnabled(True) - + @pyqtSlot(int) def on_typeCombo1_currentIndexChanged(self, index): """ Private slot called when the selected type was changed. - + @param index index of the current item @type int """ type_ = self.typeCombo1.itemText(index) self.__changeLabelCombo(self.labelCombo1, type_) - + @pyqtSlot(int) def on_typeCombo2_currentIndexChanged(self, index): """ Private slot called when the selected type was changed. - + @param index index of the current item @type int """ type_ = self.typeCombo2.itemText(index) self.__changeLabelCombo(self.labelCombo2, type_) - + def getURLs(self): """ Public method to get the entered URLs. - + @return tuple of list of two URL strings (list of strings) and a flag indicating a diff summary (boolean) """ if self.vcs.otherData["standardLayout"]: url1 = ( - self.repoRootLabel1.text() + - self.typeCombo1.currentText() + - self.labelCombo1.currentText() + self.repoRootLabel1.text() + + self.typeCombo1.currentText() + + self.labelCombo1.currentText() ) url2 = ( - self.repoRootLabel2.text() + - self.typeCombo2.currentText() + - self.labelCombo2.currentText() + self.repoRootLabel2.text() + + self.typeCombo2.currentText() + + self.labelCombo2.currentText() ) else: url1 = self.labelCombo1.currentText() url2 = self.labelCombo2.currentText() - + return [url1, url2], self.summaryCheckBox.isChecked()