eric6/Plugins/VcsPlugins/vcsSubversion/subversion.py

branch
without_py2_and_pyqt4
changeset 7192
a22eee00b052
parent 7167
b3557e77314a
child 7229
53054eb5b15a
equal deleted inserted replaced
7191:960850ec284c 7192:a22eee00b052
6 """ 6 """
7 Module implementing the version control systems interface to Subversion. 7 Module implementing the version control systems interface to Subversion.
8 """ 8 """
9 9
10 from __future__ import unicode_literals 10 from __future__ import unicode_literals
11 try:
12 str = unicode
13 except NameError:
14 pass
15 11
16 import os 12 import os
17 import re 13 import re
18 import shutil 14 import shutil
15 from urllib.parse import quote
19 16
20 from PyQt5.QtCore import pyqtSignal, QProcess, QRegExp, QCoreApplication 17 from PyQt5.QtCore import pyqtSignal, QProcess, QRegExp, QCoreApplication
21 from PyQt5.QtWidgets import QLineEdit, QDialog, QInputDialog, QApplication 18 from PyQt5.QtWidgets import QLineEdit, QDialog, QInputDialog, QApplication
22 19
23 from E5Gui.E5Application import e5App 20 from E5Gui.E5Application import e5App
992 """ be aborted""")) 989 """ be aborted"""))
993 return 990 return
994 991
995 reposRoot = rx_base.cap(1) 992 reposRoot = rx_base.cap(1)
996 if tagOp in [1, 4]: 993 if tagOp in [1, 4]:
997 url = '{0}/tags/{1}'.format(reposRoot, Utilities.quote(tag)) 994 url = '{0}/tags/{1}'.format(reposRoot, quote(tag))
998 elif tagOp in [2, 8]: 995 elif tagOp in [2, 8]:
999 url = '{0}/branches/{1}'.format( 996 url = '{0}/branches/{1}'.format(reposRoot, quote(tag))
1000 reposRoot, Utilities.quote(tag))
1001 else: 997 else:
1002 url = self.__svnURL(tag) 998 url = self.__svnURL(tag)
1003 999
1004 args = [] 1000 args = []
1005 if tagOp in [1, 2]: 1001 if tagOp in [1, 2]:
1115 return False 1111 return False
1116 1112
1117 reposRoot = rx_base.cap(1) 1113 reposRoot = rx_base.cap(1)
1118 tn = tag 1114 tn = tag
1119 if tagType == 1: 1115 if tagType == 1:
1120 url = '{0}/tags/{1}'.format(reposRoot, Utilities.quote(tag)) 1116 url = '{0}/tags/{1}'.format(reposRoot, quote(tag))
1121 elif tagType == 2: 1117 elif tagType == 2:
1122 url = '{0}/branches/{1}'.format( 1118 url = '{0}/branches/{1}'.format(reposRoot, quote(tag))
1123 reposRoot, Utilities.quote(tag))
1124 elif tagType == 4: 1119 elif tagType == 4:
1125 url = '{0}/trunk'.format(reposRoot) 1120 url = '{0}/trunk'.format(reposRoot)
1126 tn = 'HEAD' 1121 tn = 'HEAD'
1127 else: 1122 else:
1128 url = self.__svnURL(tag) 1123 url = self.__svnURL(tag)
2305 url = url.split(':', 2) 2300 url = url.split(':', 2)
2306 if len(url) == 3: 2301 if len(url) == 3:
2307 scheme = url[0] 2302 scheme = url[0]
2308 host = url[1] 2303 host = url[1]
2309 port, path = url[2].split("/", 1) 2304 port, path = url[2].split("/", 1)
2310 return "{0}:{1}:{2}/{3}".format( 2305 return "{0}:{1}:{2}/{3}".format(scheme, host, port, quote(path))
2311 scheme, host, port, Utilities.quote(path))
2312 else: 2306 else:
2313 scheme = url[0] 2307 scheme = url[0]
2314 if scheme == "file": 2308 if scheme == "file":
2315 return "{0}:{1}".format(scheme, Utilities.quote(url[1])) 2309 return "{0}:{1}".format(scheme, quote(url[1]))
2316 else: 2310 else:
2317 try: 2311 try:
2318 host, path = url[1][2:].split("/", 1) 2312 host, path = url[1][2:].split("/", 1)
2319 except ValueError: 2313 except ValueError:
2320 host = url[1][2:] 2314 host = url[1][2:]
2321 path = "" 2315 path = ""
2322 return "{0}://{1}/{2}".format( 2316 return "{0}://{1}/{2}".format(scheme, host, quote(path))
2323 scheme, host, Utilities.quote(path))
2324 2317
2325 def svnNormalizeURL(self, url): 2318 def svnNormalizeURL(self, url):
2326 """ 2319 """
2327 Public method to normalize a url for subversion. 2320 Public method to normalize a url for subversion.
2328 2321

eric ide

mercurial