mercurial/hg.py
changeset 2555 d6605381c6df
parent 2549 e1831f06eef1
child 2579 0875cda033fd
--- 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)