eric6/Plugins/VcsPlugins/vcsSubversion/SvnUrlSelectionDialog.py

changeset 7775
4a1db75550bd
parent 7360
9190402e4505
child 7923
91e843545d9a
equal deleted inserted replaced
7774:9eed155411f0 7775:4a1db75550bd
5 5
6 """ 6 """
7 Module implementing a dialog to enter the URLs for the svn diff command. 7 Module implementing a dialog to enter the URLs for the svn diff command.
8 """ 8 """
9 9
10 import re
10 11
11 from PyQt5.QtCore import QRegExp, pyqtSlot 12 from PyQt5.QtCore import pyqtSlot
12 from PyQt5.QtWidgets import QDialog 13 from PyQt5.QtWidgets import QDialog
13 14
14 from E5Gui.E5Application import e5App 15 from E5Gui.E5Application import e5App
15 from E5Gui import E5MessageBox 16 from E5Gui import E5MessageBox
16 17
59 self.reject() 60 self.reject()
60 return 61 return
61 62
62 if self.vcs.otherData["standardLayout"]: 63 if self.vcs.otherData["standardLayout"]:
63 # determine the base path of the project in the repository 64 # determine the base path of the project in the repository
64 rx_base = QRegExp('(.+/)(trunk|tags|branches).*') 65 rx_base = re.compile('(.+/)(trunk|tags|branches).*')
65 if not rx_base.exactMatch(reposURL): 66 match = rx_base.fullmatch(reposURL)
67 if match is None:
66 E5MessageBox.critical( 68 E5MessageBox.critical(
67 self, 69 self,
68 self.tr("Subversion Error"), 70 self.tr("Subversion Error"),
69 self.tr( 71 self.tr(
70 """The URL of the project repository has an""" 72 """The URL of the project repository has an"""
71 """ invalid format. The list operation will""" 73 """ invalid format. The list operation will"""
72 """ be aborted""")) 74 """ be aborted"""))
73 self.reject() 75 self.reject()
74 return 76 return
75 77
76 reposRoot = rx_base.cap(1) 78 reposRoot = match.group(1)
77 self.repoRootLabel1.setText(reposRoot) 79 self.repoRootLabel1.setText(reposRoot)
78 self.repoRootLabel2.setText(reposRoot) 80 self.repoRootLabel2.setText(reposRoot)
79 else: 81 else:
80 project = e5App().getObject('Project') 82 project = e5App().getObject('Project')
81 if ( 83 if (

eric ide

mercurial