eric6/Plugins/VcsPlugins/vcsPySvn/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
61 self.reject() 62 self.reject()
62 return 63 return
63 64
64 if self.vcs.otherData["standardLayout"]: 65 if self.vcs.otherData["standardLayout"]:
65 # determine the base path of the project in the repository 66 # determine the base path of the project in the repository
66 rx_base = QRegExp('(.+/)(trunk|tags|branches).*') 67 rx_base = re.compile('(.+/)(trunk|tags|branches).*')
67 if not rx_base.exactMatch(reposURL): 68 match = rx_base.fullmatch(reposURL)
69 if match is None:
68 E5MessageBox.critical( 70 E5MessageBox.critical(
69 self, 71 self,
70 self.tr("Subversion Error"), 72 self.tr("Subversion Error"),
71 self.tr( 73 self.tr(
72 """The URL of the project repository has an""" 74 """The URL of the project repository has an"""
73 """ invalid format. The operation will""" 75 """ invalid format. The operation will"""
74 """ be aborted""")) 76 """ be aborted"""))
75 self.reject() 77 self.reject()
76 return 78 return
77 79
78 reposRoot = rx_base.cap(1) 80 reposRoot = match.group(1)
79 self.repoRootLabel1.setText(reposRoot) 81 self.repoRootLabel1.setText(reposRoot)
80 self.repoRootLabel2.setText(reposRoot) 82 self.repoRootLabel2.setText(reposRoot)
81 else: 83 else:
82 project = e5App().getObject('Project') 84 project = e5App().getObject('Project')
83 if ( 85 if (

eric ide

mercurial