changeset 2595 | edb66cb05ded |
parent 2579 | 0875cda033fd |
child 2597 | 5ba8be56fa8f |
--- 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)