[PATCH] path handling: don't treat paths with unknown scheme as file paths (issue3715)

Till Schneidereit tschneidereit at gmail.com
Thu Nov 29 16:40:39 UTC 2012


# HG changeset patch
# User Till Schneidereit <tschneidereit at gmail.com>
# Date 1354207103 -3600
# Node ID 3cb67ba27a0795c2fa2728dbcacccd63366723b6
# Parent  83aa4359c49f67bcb98fb9c7d885ed4ac7443239
path handling: don't treat paths with unknown scheme as file paths (issue3715)

islocal in hg.py returns True for paths with unknown schemes, making it
impossible for scheme handlers registered via the handlerfuncs list in url.py
to handle the URIs.

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -69,17 +69,17 @@ schemes = {
     'https': httppeer,
     'ssh': sshpeer,
     'static-http': statichttprepo,
 }
 
 def _peerlookup(path):
     u = util.url(path)
     scheme = u.scheme or 'file'
-    thing = schemes.get(scheme) or schemes['file']
+    thing = schemes.get(scheme)
     try:
         return thing(path)
     except TypeError:
         return thing
 
 def islocal(repo):
     '''return true if repo or path is local'''
     if isinstance(repo, str):



More information about the Mercurial-devel mailing list