parse url schemes more strictly.
previous code mistook repo named "hg" for scheme named "hg".
--- a/mercurial/hg.py Tue Jul 11 15:51:16 2006 -0700
+++ b/mercurial/hg.py Tue Jul 11 15:52:36 2006 -0700
@@ -58,11 +58,14 @@
}
def repository(ui, path=None, create=0):
- if not path: path = ''
- scheme = path
- if scheme:
- scheme = scheme.split(":", 1)[0]
- ctor = schemes.get(scheme) or schemes['file']
+ scheme = None
+ if path:
+ c = path.find(':')
+ if c > 0:
+ scheme = schemes.get(path[:c])
+ else:
+ path = ''
+ ctor = scheme or schemes['file']
if create:
try:
return ctor(ui, path, create)