comparison 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
comparison
equal deleted inserted replaced
5533:6cf7d7fe7d3d 5535:7501ef26402b
718 created = False 718 created = False
719 if os.path.isfile(os.path.join(path, '.svn', 'entries')): 719 if os.path.isfile(os.path.join(path, '.svn', 'entries')):
720 self.wc = path 720 self.wc = path
721 self.run0('update') 721 self.run0('update')
722 else: 722 else:
723 wcpath = os.path.join(os.getcwd(), os.path.basename(path) + '-wc')
724
723 if os.path.isdir(os.path.dirname(path)): 725 if os.path.isdir(os.path.dirname(path)):
724 if not os.path.exists(os.path.join(path, 'db', 'fs-type')): 726 if not os.path.exists(os.path.join(path, 'db', 'fs-type')):
725 ui.status(_('initializing svn repo %r\n') % 727 ui.status(_('initializing svn repo %r\n') %
726 os.path.basename(path)) 728 os.path.basename(path))
727 commandline(ui, 'svnadmin').run0('create', path) 729 commandline(ui, 'svnadmin').run0('create', path)
728 created = path 730 created = path
731 path = path.replace('\\', '/')
732 if not path.startswith('/'):
733 path = '/' + path
729 path = 'file://' + path 734 path = 'file://' + path
730 wcpath = os.path.join(os.getcwd(), os.path.basename(path) + '-wc') 735
731 ui.status(_('initializing svn wc %r\n') % os.path.basename(wcpath)) 736 ui.status(_('initializing svn wc %r\n') % os.path.basename(wcpath))
732 self.run0('checkout', path, wcpath) 737 self.run0('checkout', path, wcpath)
733 738
734 self.wc = wcpath 739 self.wc = wcpath
735 self.opener = util.opener(self.wc) 740 self.opener = util.opener(self.wc)