Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 2555:d6605381c6df
hg.py: move exception handling code to try to avoid hiding errors
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Sun, 02 Jul 2006 22:39:39 -0300 |
parents | e1831f06eef1 |
children | 0875cda033fd |
comparison
equal
deleted
inserted
replaced
2554:8264c2034970 | 2555:d6605381c6df |
---|---|
61 if not path: path = '' | 61 if not path: path = '' |
62 scheme = path | 62 scheme = path |
63 if scheme: | 63 if scheme: |
64 c = scheme.find(':') | 64 c = scheme.find(':') |
65 scheme = c >= 0 and scheme[:c] | 65 scheme = c >= 0 and scheme[:c] |
66 try: | 66 ctor = schemes.get(scheme) or schemes['file'] |
67 ctor = schemes.get(scheme) or schemes['file'] | 67 if create: |
68 if create: | 68 try: |
69 return ctor(ui, path, create) | 69 return ctor(ui, path, create) |
70 return ctor(ui, path) | 70 except TypeError: |
71 except TypeError: | 71 raise util.Abort(_('cannot create new repository over "%s" protocol') % |
72 raise util.Abort(_('cannot create new repository over "%s" protocol') % | 72 scheme) |
73 scheme) | 73 return ctor(ui, path) |