# HG changeset patch # User Brodie Rao # Date 1301540527 25200 # Node ID ad179644750fb254517d822541f4e4a3bd2005e2 # Parent fbf32a6c903ed0d2b9fbf5e46b64236042b20df3 hg: look up schemes using url.url diff -r fbf32a6c903e -r ad179644750f mercurial/hg.py --- a/mercurial/hg.py Wed Mar 30 20:01:47 2011 -0700 +++ b/mercurial/hg.py Wed Mar 30 20:02:07 2011 -0700 @@ -69,11 +69,8 @@ } def _lookup(path): - scheme = 'file' - if path: - c = path.find(':') - if c > 0: - scheme = path[:c] + u = url.url(path) + scheme = u.scheme or 'file' thing = schemes.get(scheme) or schemes['file'] try: return thing(path) diff -r fbf32a6c903e -r ad179644750f tests/test-pull.t --- a/tests/test-pull.t Wed Mar 30 20:01:47 2011 -0700 +++ b/tests/test-pull.t Wed Mar 30 20:02:07 2011 -0700 @@ -68,7 +68,7 @@ Test 'file:' uri handling: $ hg pull -q file://../test-doesnt-exist - abort: repository /test-doesnt-exist not found! + abort: file:// URLs can only refer to localhost [255] $ hg pull -q file:../test