10 import re |
10 import re |
11 |
11 |
12 from PyQt6.QtCore import pyqtSlot |
12 from PyQt6.QtCore import pyqtSlot |
13 from PyQt6.QtWidgets import QDialog |
13 from PyQt6.QtWidgets import QDialog |
14 |
14 |
15 from E5Gui.E5Application import e5App |
15 from E5Gui.EricApplication import ericApp |
16 from E5Gui import E5MessageBox |
16 from E5Gui import EricMessageBox |
17 |
17 |
18 import pysvn |
18 import pysvn |
19 |
19 |
20 from .Ui_SvnUrlSelectionDialog import Ui_SvnUrlSelectionDialog |
20 from .Ui_SvnUrlSelectionDialog import Ui_SvnUrlSelectionDialog |
21 |
21 |
50 self.typeCombo1.addItems(["trunk/", "tags/", "branches/"]) |
50 self.typeCombo1.addItems(["trunk/", "tags/", "branches/"]) |
51 self.typeCombo2.addItems(["trunk/", "tags/", "branches/"]) |
51 self.typeCombo2.addItems(["trunk/", "tags/", "branches/"]) |
52 |
52 |
53 reposURL = self.vcs.svnGetReposName(path) |
53 reposURL = self.vcs.svnGetReposName(path) |
54 if reposURL is None: |
54 if reposURL is None: |
55 E5MessageBox.critical( |
55 EricMessageBox.critical( |
56 self, |
56 self, |
57 self.tr("Subversion Error"), |
57 self.tr("Subversion Error"), |
58 self.tr( |
58 self.tr( |
59 """The URL of the project repository could not be""" |
59 """The URL of the project repository could not be""" |
60 """ retrieved from the working copy. The operation will""" |
60 """ retrieved from the working copy. The operation will""" |
65 if self.vcs.otherData["standardLayout"]: |
65 if self.vcs.otherData["standardLayout"]: |
66 # determine the base path of the project in the repository |
66 # determine the base path of the project in the repository |
67 rx_base = re.compile('(.+/)(trunk|tags|branches).*') |
67 rx_base = re.compile('(.+/)(trunk|tags|branches).*') |
68 match = rx_base.fullmatch(reposURL) |
68 match = rx_base.fullmatch(reposURL) |
69 if match is None: |
69 if match is None: |
70 E5MessageBox.critical( |
70 EricMessageBox.critical( |
71 self, |
71 self, |
72 self.tr("Subversion Error"), |
72 self.tr("Subversion Error"), |
73 self.tr( |
73 self.tr( |
74 """The URL of the project repository has an""" |
74 """The URL of the project repository has an""" |
75 """ invalid format. The operation will""" |
75 """ invalid format. The operation will""" |
79 |
79 |
80 reposRoot = match.group(1) |
80 reposRoot = match.group(1) |
81 self.repoRootLabel1.setText(reposRoot) |
81 self.repoRootLabel1.setText(reposRoot) |
82 self.repoRootLabel2.setText(reposRoot) |
82 self.repoRootLabel2.setText(reposRoot) |
83 else: |
83 else: |
84 project = e5App().getObject('Project') |
84 project = ericApp().getObject('Project') |
85 if ( |
85 if ( |
86 Utilities.normcasepath(path) != |
86 Utilities.normcasepath(path) != |
87 Utilities.normcasepath(project.getProjectPath()) |
87 Utilities.normcasepath(project.getProjectPath()) |
88 ): |
88 ): |
89 path = project.getRelativePath(path) |
89 path = project.getRelativePath(path) |