# HG changeset patch # User Vadim Gelfer # Date 2006-07-11 22:52:36 # Node ID edb66cb05deda698131442f1a750d48795e8120f # Parent bdf9d809467c372def90cf88008b5182d8befee5 parse url schemes more strictly. previous code mistook repo named "hg" for scheme named "hg". diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -58,11 +58,14 @@ schemes = { } 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)