equal
deleted
inserted
replaced
56 'ssh': ssh_, |
56 'ssh': ssh_, |
57 'static-http': static_http, |
57 'static-http': static_http, |
58 } |
58 } |
59 |
59 |
60 def repository(ui, path=None, create=0): |
60 def repository(ui, path=None, create=0): |
61 if not path: path = '' |
61 scheme = None |
62 scheme = path |
62 if path: |
63 if scheme: |
63 c = path.find(':') |
64 scheme = scheme.split(":", 1)[0] |
64 if c > 0: |
65 ctor = schemes.get(scheme) or schemes['file'] |
65 scheme = schemes.get(path[:c]) |
|
66 else: |
|
67 path = '' |
|
68 ctor = scheme or schemes['file'] |
66 if create: |
69 if create: |
67 try: |
70 try: |
68 return ctor(ui, path, create) |
71 return ctor(ui, path, create) |
69 except TypeError: |
72 except TypeError: |
70 raise util.Abort(_('cannot create new repository over "%s" protocol') % |
73 raise util.Abort(_('cannot create new repository over "%s" protocol') % |