Plugins/VcsPlugins/vcsMercurial/hg.py

branch
Py2 comp.
changeset 2575
cbdf5b8a5bc5
parent 2545
2d385ccc14f9
child 2677
3d4277929fb3
equal deleted inserted replaced
2574:9d6b6cf31ec6 2575:cbdf5b8a5bc5
14 pass 14 pass
15 15
16 import os 16 import os
17 import shutil 17 import shutil
18 import re 18 import re
19 import urllib.request 19 try: # Py3
20 import urllib.parse 20 import urllib.parse as parse
21 import urllib.error 21 except:
22 import urllib as parse
22 23
23 from PyQt4.QtCore import QProcess, pyqtSignal, QFileInfo, QFileSystemWatcher 24 from PyQt4.QtCore import QProcess, pyqtSignal, QFileInfo, QFileSystemWatcher
24 from PyQt4.QtGui import QApplication, QDialog, QInputDialog 25 from PyQt4.QtGui import QApplication, QDialog, QInputDialog
25 26
26 from E5Gui.E5Application import e5App 27 from E5Gui.E5Application import e5App
1357 scheme = url[0] 1358 scheme = url[0]
1358 user = url[1] 1359 user = url[1]
1359 host = url[2] 1360 host = url[2]
1360 port, path = url[3].split("/", 1) 1361 port, path = url[3].split("/", 1)
1361 return "{0}:{1}:{2}:{3}/{4}".format( 1362 return "{0}:{1}:{2}:{3}/{4}".format(
1362 scheme, user, host, port, urllib.parse.quote(path)) 1363 scheme, user, host, port, parse.quote(path))
1363 elif len(url) == 3: 1364 elif len(url) == 3:
1364 scheme = url[0] 1365 scheme = url[0]
1365 host = url[1] 1366 host = url[1]
1366 port, path = url[2].split("/", 1) 1367 port, path = url[2].split("/", 1)
1367 return "{0}:{1}:{2}/{3}".format(scheme, host, port, urllib.parse.quote(path)) 1368 return "{0}:{1}:{2}/{3}".format(scheme, host, port, parse.quote(path))
1368 else: 1369 else:
1369 scheme = url[0] 1370 scheme = url[0]
1370 if scheme == "file": 1371 if scheme == "file":
1371 return "{0}:{1}".format(scheme, urllib.parse.quote(url[1])) 1372 return "{0}:{1}".format(scheme, parse.quote(url[1]))
1372 else: 1373 else:
1373 host, path = url[1][2:].split("/", 1) 1374 host, path = url[1][2:].split("/", 1)
1374 return "{0}://{1}/{2}".format(scheme, host, urllib.parse.quote(path)) 1375 return "{0}://{1}/{2}".format(scheme, host, parse.quote(path))
1375 1376
1376 def hgNormalizeURL(self, url): 1377 def hgNormalizeURL(self, url):
1377 """ 1378 """
1378 Public method to normalize a url for Mercurial. 1379 Public method to normalize a url for Mercurial.
1379 1380

eric ide

mercurial