convert/svn: handle non-local svn destination paths (issue3142)
test-convert-svn-sink.t still pass and I tested pushing to an svn+ssh
repository
--- 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)