##// END OF EJS Templates
url: deal with drive letters
Matt Mackall -
r13807:974490c1 default
parent child Browse files
Show More
@@ -39,6 +39,8 b' class url(object):'
39 <url scheme: 'file', path: '/home/joe/repo'>
39 <url scheme: 'file', path: '/home/joe/repo'>
40 >>> url('bundle:foo')
40 >>> url('bundle:foo')
41 <url scheme: 'bundle', path: 'foo'>
41 <url scheme: 'bundle', path: 'foo'>
42 >>> url('c:\\\\foo\\\\bar')
43 <url path: 'c:\\\\foo\\\\bar'>
42
44
43 Authentication credentials:
45 Authentication credentials:
44
46
@@ -64,6 +66,11 b' class url(object):'
64 self.port = self.path = self.query = self.fragment = None
66 self.port = self.path = self.query = self.fragment = None
65 self._localpath = True
67 self._localpath = True
66
68
69 # special case for Windows drive letters
70 if path[1:2] == ':' and path[0:1].isalpha():
71 self.path = path
72 return
73
67 if not path.startswith('/') and ':' in path:
74 if not path.startswith('/') and ':' in path:
68 parts = path.split(':', 1)
75 parts = path.split(':', 1)
69 if parts[0]:
76 if parts[0]:
General Comments 0
You need to be logged in to leave comments. Login now