diff hgext/convert/subversion.py @ 5535:7501ef26402b

convert: fix svn file:// URL generation under Windows
author Patrick Mezard <pmezard@gmail.com>
date Sun, 11 Nov 2007 14:17:30 +0100
parents 6ffca2bf23da
children fdee5d614fcc
line wrap: on
line diff
--- a/hgext/convert/subversion.py	Mon Nov 12 10:49:26 2007 -0800
+++ b/hgext/convert/subversion.py	Sun Nov 11 14:17:30 2007 +0100
@@ -720,14 +720,19 @@
             self.wc = path
             self.run0('update')
         else:
+            wcpath = os.path.join(os.getcwd(), os.path.basename(path) + '-wc')
+
             if os.path.isdir(os.path.dirname(path)):
                 if not os.path.exists(os.path.join(path, 'db', 'fs-type')):
                     ui.status(_('initializing svn repo %r\n') %
                               os.path.basename(path))
                     commandline(ui, 'svnadmin').run0('create', path)
                     created = path
+                path = path.replace('\\', '/')
+                if not path.startswith('/'):
+                    path = '/' + path
                 path = 'file://' + path
-            wcpath = os.path.join(os.getcwd(), os.path.basename(path) + '-wc')
+            
             ui.status(_('initializing svn wc %r\n') % os.path.basename(wcpath))
             self.run0('checkout', path, wcpath)