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 from .Ui_SvnUrlSelectionDialog import Ui_SvnUrlSelectionDialog |
18 from .Ui_SvnUrlSelectionDialog import Ui_SvnUrlSelectionDialog |
19 |
19 |
20 import Utilities |
20 import Utilities |
21 |
21 |
48 self.typeCombo1.addItems(["trunk/", "tags/", "branches/"]) |
48 self.typeCombo1.addItems(["trunk/", "tags/", "branches/"]) |
49 self.typeCombo2.addItems(["trunk/", "tags/", "branches/"]) |
49 self.typeCombo2.addItems(["trunk/", "tags/", "branches/"]) |
50 |
50 |
51 reposURL = self.vcs.svnGetReposName(path) |
51 reposURL = self.vcs.svnGetReposName(path) |
52 if reposURL is None: |
52 if reposURL is None: |
53 E5MessageBox.critical( |
53 EricMessageBox.critical( |
54 self, |
54 self, |
55 self.tr("Subversion Error"), |
55 self.tr("Subversion Error"), |
56 self.tr( |
56 self.tr( |
57 """The URL of the project repository could not be""" |
57 """The URL of the project repository could not be""" |
58 """ retrieved from the working copy. The operation will""" |
58 """ retrieved from the working copy. The operation will""" |
63 if self.vcs.otherData["standardLayout"]: |
63 if self.vcs.otherData["standardLayout"]: |
64 # determine the base path of the project in the repository |
64 # determine the base path of the project in the repository |
65 rx_base = re.compile('(.+/)(trunk|tags|branches).*') |
65 rx_base = re.compile('(.+/)(trunk|tags|branches).*') |
66 match = rx_base.fullmatch(reposURL) |
66 match = rx_base.fullmatch(reposURL) |
67 if match is None: |
67 if match is None: |
68 E5MessageBox.critical( |
68 EricMessageBox.critical( |
69 self, |
69 self, |
70 self.tr("Subversion Error"), |
70 self.tr("Subversion Error"), |
71 self.tr( |
71 self.tr( |
72 """The URL of the project repository has an""" |
72 """The URL of the project repository has an""" |
73 """ invalid format. The list operation will""" |
73 """ invalid format. The list operation will""" |
77 |
77 |
78 reposRoot = match.group(1) |
78 reposRoot = match.group(1) |
79 self.repoRootLabel1.setText(reposRoot) |
79 self.repoRootLabel1.setText(reposRoot) |
80 self.repoRootLabel2.setText(reposRoot) |
80 self.repoRootLabel2.setText(reposRoot) |
81 else: |
81 else: |
82 project = e5App().getObject('Project') |
82 project = ericApp().getObject('Project') |
83 if ( |
83 if ( |
84 Utilities.normcasepath(path) != |
84 Utilities.normcasepath(path) != |
85 Utilities.normcasepath(project.getProjectPath()) |
85 Utilities.normcasepath(project.getProjectPath()) |
86 ): |
86 ): |
87 path = project.getRelativePath(path) |
87 path = project.getRelativePath(path) |