hgext/convert/subversion.py
branchstable
changeset 17247 6d51a0c71d4e
parent 17053 0e4171fdb9d4
child 17424 e7cfe3587ea4
child 17479 17c3dbf3026f
--- a/hgext/convert/subversion.py	Wed Jul 25 16:50:22 2012 +0200
+++ b/hgext/convert/subversion.py	Thu Jul 26 12:07:55 2012 +0200
@@ -1020,26 +1020,25 @@
         self.wc = None
         self.cwd = os.getcwd()
 
-        path = os.path.realpath(path)
-
         created = False
         if os.path.isfile(os.path.join(path, '.svn', 'entries')):
-            self.wc = path
+            self.wc = os.path.realpath(path)
             self.run0('update')
         else:
-            wcpath = os.path.join(os.getcwd(), os.path.basename(path) + '-wc')
+            if not re.search(r'^(file|http|https|svn|svn\+ssh)\://', path):
+                path = os.path.realpath(path)
+                if os.path.isdir(os.path.dirname(path)):
+                    if not os.path.exists(os.path.join(path, 'db', 'fs-type')):
+                        ui.status(_('initializing svn repository %r\n') %
+                                  os.path.basename(path))
+                        commandline(ui, 'svnadmin').run0('create', path)
+                        created = path
+                    path = util.normpath(path)
+                    if not path.startswith('/'):
+                        path = '/' + path
+                    path = 'file://' + path
 
-            if os.path.isdir(os.path.dirname(path)):
-                if not os.path.exists(os.path.join(path, 'db', 'fs-type')):
-                    ui.status(_('initializing svn repository %r\n') %
-                              os.path.basename(path))
-                    commandline(ui, 'svnadmin').run0('create', path)
-                    created = path
-                path = util.normpath(path)
-                if not path.startswith('/'):
-                    path = '/' + path
-                path = 'file://' + path
-
+            wcpath = os.path.join(os.getcwd(), os.path.basename(path) + '-wc')
             ui.status(_('initializing svn working copy %r\n')
                       % os.path.basename(wcpath))
             self.run0('checkout', path, wcpath)