convert: fix svn file:// URL generation under Windows
authorPatrick Mezard <pmezard@gmail.com>
Sun, 11 Nov 2007 14:17:30 +0100
changeset 5535 7501ef26402b
parent 5533 6cf7d7fe7d3d
child 5536 fdee5d614fcc
convert: fix svn file:// URL generation under Windows
hgext/convert/subversion.py
--- 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)