hgext/convert/subversion.py
branchstable
changeset 17247 6d51a0c71d4e
parent 17053 0e4171fdb9d4
child 17424 e7cfe3587ea4
child 17479 17c3dbf3026f
equal deleted inserted replaced
17246:bf5bb38bcc7c 17247:6d51a0c71d4e
  1018         self.delexec = []
  1018         self.delexec = []
  1019         self.copies = []
  1019         self.copies = []
  1020         self.wc = None
  1020         self.wc = None
  1021         self.cwd = os.getcwd()
  1021         self.cwd = os.getcwd()
  1022 
  1022 
  1023         path = os.path.realpath(path)
       
  1024 
       
  1025         created = False
  1023         created = False
  1026         if os.path.isfile(os.path.join(path, '.svn', 'entries')):
  1024         if os.path.isfile(os.path.join(path, '.svn', 'entries')):
  1027             self.wc = path
  1025             self.wc = os.path.realpath(path)
  1028             self.run0('update')
  1026             self.run0('update')
  1029         else:
  1027         else:
       
  1028             if not re.search(r'^(file|http|https|svn|svn\+ssh)\://', path):
       
  1029                 path = os.path.realpath(path)
       
  1030                 if os.path.isdir(os.path.dirname(path)):
       
  1031                     if not os.path.exists(os.path.join(path, 'db', 'fs-type')):
       
  1032                         ui.status(_('initializing svn repository %r\n') %
       
  1033                                   os.path.basename(path))
       
  1034                         commandline(ui, 'svnadmin').run0('create', path)
       
  1035                         created = path
       
  1036                     path = util.normpath(path)
       
  1037                     if not path.startswith('/'):
       
  1038                         path = '/' + path
       
  1039                     path = 'file://' + path
       
  1040 
  1030             wcpath = os.path.join(os.getcwd(), os.path.basename(path) + '-wc')
  1041             wcpath = os.path.join(os.getcwd(), os.path.basename(path) + '-wc')
  1031 
       
  1032             if os.path.isdir(os.path.dirname(path)):
       
  1033                 if not os.path.exists(os.path.join(path, 'db', 'fs-type')):
       
  1034                     ui.status(_('initializing svn repository %r\n') %
       
  1035                               os.path.basename(path))
       
  1036                     commandline(ui, 'svnadmin').run0('create', path)
       
  1037                     created = path
       
  1038                 path = util.normpath(path)
       
  1039                 if not path.startswith('/'):
       
  1040                     path = '/' + path
       
  1041                 path = 'file://' + path
       
  1042 
       
  1043             ui.status(_('initializing svn working copy %r\n')
  1042             ui.status(_('initializing svn working copy %r\n')
  1044                       % os.path.basename(wcpath))
  1043                       % os.path.basename(wcpath))
  1045             self.run0('checkout', path, wcpath)
  1044             self.run0('checkout', path, wcpath)
  1046 
  1045 
  1047             self.wc = wcpath
  1046             self.wc = wcpath