eric6/Plugins/VcsPlugins/vcsPySvn/SvnTagBranchListDialog.py

changeset 7775
4a1db75550bd
parent 7774
9eed155411f0
child 7923
91e843545d9a
equal deleted inserted replaced
7774:9eed155411f0 7775:4a1db75550bd
5 5
6 """ 6 """
7 Module implementing a dialog to show a list of tags or branches. 7 Module implementing a dialog to show a list of tags or branches.
8 """ 8 """
9 9
10 10 import re
11 import os 11 import os
12 12
13 import pysvn 13 import pysvn
14 14
15 from PyQt5.QtCore import QRegExp, Qt 15 from PyQt5.QtCore import Qt
16 from PyQt5.QtWidgets import ( 16 from PyQt5.QtWidgets import (
17 QHeaderView, QLineEdit, QDialog, QInputDialog, QApplication, 17 QHeaderView, QLineEdit, QDialog, QInputDialog, QApplication,
18 QDialogButtonBox, QTreeWidgetItem 18 QDialogButtonBox, QTreeWidgetItem
19 ) 19 )
20 20
92 self.close() 92 self.close()
93 return False 93 return False
94 94
95 if self.vcs.otherData["standardLayout"]: 95 if self.vcs.otherData["standardLayout"]:
96 # determine the base path of the project in the repository 96 # determine the base path of the project in the repository
97 rx_base = QRegExp('(.+)/(trunk|tags|branches).*') 97 rx_base = re.compile('(.+)/(trunk|tags|branches).*')
98 if not rx_base.exactMatch(reposURL): 98 match = rx_base.fullmatch(reposURL)
99 if match is None:
99 E5MessageBox.critical( 100 E5MessageBox.critical(
100 self, 101 self,
101 self.tr("Subversion Error"), 102 self.tr("Subversion Error"),
102 self.tr( 103 self.tr(
103 """The URL of the project repository has an""" 104 """The URL of the project repository has an"""
104 """ invalid format. The list operation will""" 105 """ invalid format. The list operation will"""
105 """ be aborted""")) 106 """ be aborted"""))
106 return False 107 return False
107 108
108 reposRoot = rx_base.cap(1) 109 reposRoot = match.group(1)
109 110
110 if tags: 111 if tags:
111 path = "{0}/tags".format(reposRoot) 112 path = "{0}/tags".format(reposRoot)
112 else: 113 else:
113 path = "{0}/branches".format(reposRoot) 114 path = "{0}/branches".format(reposRoot)

eric ide

mercurial