##// END OF EJS Templates
url: use url.url in url.open()
Brodie Rao -
r13818:bf6156ba default
parent child Browse files
Show More
@@ -7,7 +7,7 b''
7 # This software may be used and distributed according to the terms of the
7 # This software may be used and distributed according to the terms of the
8 # GNU General Public License version 2 or any later version.
8 # GNU General Public License version 2 or any later version.
9
9
10 import urllib, urllib2, urlparse, httplib, os, re, socket, cStringIO
10 import urllib, urllib2, urlparse, httplib, os, socket, cStringIO
11 import __builtin__
11 import __builtin__
12 from i18n import _
12 from i18n import _
13 import keepalive, util
13 import keepalive, util
@@ -961,17 +961,13 b' def opener(ui, authinfo=None):'
961 opener.addheaders.append(('Accept', 'application/mercurial-0.1'))
961 opener.addheaders.append(('Accept', 'application/mercurial-0.1'))
962 return opener
962 return opener
963
963
964 scheme_re = re.compile(r'^([a-zA-Z0-9+-.]+)://')
964 def open(ui, url_, data=None):
965
965 u = url(url_)
966 def open(ui, url, data=None):
966 if u.scheme:
967 scheme = None
967 u.scheme = u.scheme.lower()
968 m = scheme_re.search(url)
968 url_, authinfo = u.authinfo()
969 if m:
969 else:
970 scheme = m.group(1).lower()
970 path = util.normpath(os.path.abspath(url_))
971 if not scheme:
971 url_ = 'file://' + urllib.pathname2url(path)
972 path = util.normpath(os.path.abspath(url))
973 url = 'file://' + urllib.pathname2url(path)
974 authinfo = None
972 authinfo = None
975 else:
973 return opener(ui, authinfo).open(url_, data)
976 url, authinfo = getauthinfo(url)
977 return opener(ui, authinfo).open(url, data)
@@ -206,7 +206,7 b" doesn't work (yet ?)"
206 hg -R bundle://../full.hg verify
206 hg -R bundle://../full.hg verify
207
207
208 $ hg pull bundle://../full.hg
208 $ hg pull bundle://../full.hg
209 pulling from bundle://../full.hg
209 pulling from bundle:../full.hg
210 requesting all changes
210 requesting all changes
211 adding changesets
211 adding changesets
212 adding manifests
212 adding manifests
@@ -310,7 +310,7 b' Log -R full.hg in partial'
310 Incoming full.hg in partial
310 Incoming full.hg in partial
311
311
312 $ hg incoming bundle://../full.hg
312 $ hg incoming bundle://../full.hg
313 comparing with bundle://../full.hg
313 comparing with bundle:../full.hg
314 searching for changes
314 searching for changes
315 changeset: 4:095197eb4973
315 changeset: 4:095197eb4973
316 parent: 0:f9ee2f85a263
316 parent: 0:f9ee2f85a263
General Comments 0
You need to be logged in to leave comments. Login now