# HG changeset patch # User Alexis S. L. Carvalho # Date 1151890779 10800 # Node ID d6605381c6dfa640d38bc4a8464e5ee99b604cdc # Parent 8264c20349708db40781575fbb01b3775d1f68fe hg.py: move exception handling code to try to avoid hiding errors diff -r 8264c2034970 -r d6605381c6df mercurial/hg.py --- a/mercurial/hg.py Mon Jul 03 14:30:38 2006 -0700 +++ b/mercurial/hg.py Sun Jul 02 22:39:39 2006 -0300 @@ -63,11 +63,11 @@ if scheme: c = scheme.find(':') scheme = c >= 0 and scheme[:c] - try: - ctor = schemes.get(scheme) or schemes['file'] - if create: + ctor = schemes.get(scheme) or schemes['file'] + if create: + try: return ctor(ui, path, create) - return ctor(ui, path) - except TypeError: - raise util.Abort(_('cannot create new repository over "%s" protocol') % - scheme) + except TypeError: + raise util.Abort(_('cannot create new repository over "%s" protocol') % + scheme) + return ctor(ui, path)