eric6/Plugins/VcsPlugins/vcsPySvn/subversion.py

branch
without_py2_and_pyqt4
changeset 7192
a22eee00b052
parent 7167
b3557e77314a
child 7229
53054eb5b15a
diff -r 960850ec284c -r a22eee00b052 eric6/Plugins/VcsPlugins/vcsPySvn/subversion.py
--- a/eric6/Plugins/VcsPlugins/vcsPySvn/subversion.py	Sat Aug 31 12:29:57 2019 +0200
+++ b/eric6/Plugins/VcsPlugins/vcsPySvn/subversion.py	Sat Aug 31 12:58:11 2019 +0200
@@ -10,9 +10,9 @@
 from __future__ import unicode_literals
 
 import os
-import sys
 import shutil
 import time
+from urllib.parse import quote
 
 from PyQt5.QtCore import Qt, QMutexLocker, pyqtSignal, QRegExp, QDateTime, \
     QCoreApplication
@@ -1075,10 +1075,9 @@
             
             reposRoot = rx_base.cap(1)
             if tagOp in [1, 4]:
-                url = '{0}/tags/{1}'.format(reposRoot, Utilities.quote(tag))
+                url = '{0}/tags/{1}'.format(reposRoot, quote(tag))
             elif tagOp in [2, 8]:
-                url = '{0}/branches/{1}'.format(
-                    reposRoot, Utilities.quote(tag))
+                url = '{0}/branches/{1}'.format(reposRoot, quote(tag))
         else:
             url = self.__svnURL(tag)
         
@@ -1219,10 +1218,9 @@
             reposRoot = rx_base.cap(1)
             tn = tag
             if tagType == 1:
-                url = '{0}/tags/{1}'.format(reposRoot, Utilities.quote(tag))
+                url = '{0}/tags/{1}'.format(reposRoot, quote(tag))
             elif tagType == 2:
-                url = '{0}/branches/{1}'.format(
-                    reposRoot, Utilities.quote(tag))
+                url = '{0}/branches/{1}'.format(reposRoot, quote(tag))
             elif tagType == 4:
                 url = '{0}/trunk'.format(reposRoot)
                 tn = 'HEAD'
@@ -1725,8 +1723,6 @@
             apiVersion = QCoreApplication.translate('subversion', "unknown")
         
         hmsz = time.strftime("%H:%M:%S %Z", time.localtime(entry.commit_time))
-        if sys.version_info[0] == 2:
-            hmsz = hmsz.decode(sys.getfilesystemencoding())
         return QCoreApplication.translate(
             'subversion',
             """<h3>Repository information</h3>"""
@@ -2486,8 +2482,6 @@
                                                 depth=pysvn.depth.infinity)
                 for entry in entries:
                     changelist = entry[1]
-                    if sys.version_info[0] == 2:
-                        changelist = changelist.decode('utf-8')
                     if changelist not in changelists:
                         changelists.append(changelist)
             except pysvn.ClientError:
@@ -2534,20 +2528,18 @@
             scheme = url[0]
             host = url[1]
             port, path = url[2].split("/", 1)
-            return "{0}:{1}:{2}/{3}".format(scheme, host, port,
-                                            Utilities.quote(path))
+            return "{0}:{1}:{2}/{3}".format(scheme, host, port, quote(path))
         else:
             scheme = url[0]
             if scheme == "file":
-                return "{0}:{1}".format(scheme, Utilities.quote(url[1]))
+                return "{0}:{1}".format(scheme, quote(url[1]))
             else:
                 try:
                     host, path = url[1][2:].split("/", 1)
                 except ValueError:
                     host = url[1][2:]
                     path = ""
-                return "{0}://{1}/{2}".format(scheme, host,
-                                              Utilities.quote(path))
+                return "{0}://{1}/{2}".format(scheme, host, quote(path))
 
     def svnNormalizeURL(self, url):
         """

eric ide

mercurial