comparison hgext/convert/subversion.py @ 6491:2bdd43246c95

convert: check svn branches are directories
author Patrick Mezard <pmezard@gmail.com>
date Mon, 07 Apr 2008 11:59:20 +0200
parents c237b27e1350
children 43d14cbd69b7 c19c26718d22
comparison
equal deleted inserted replaced
6489:204a2ca249b6 6491:2bdd43246c95
245 except SubversionException, err: 245 except SubversionException, err:
246 return False 246 return False
247 247
248 def getheads(self): 248 def getheads(self):
249 249
250 def isdir(path, revnum):
251 kind = svn.ra.check_path(self.ra, path, revnum)
252 return kind == svn.core.svn_node_dir
253
250 def getcfgpath(name, rev): 254 def getcfgpath(name, rev):
251 cfgpath = self.ui.config('convert', 'svn.' + name) 255 cfgpath = self.ui.config('convert', 'svn.' + name)
252 if cfgpath is not None and cfgpath.strip() == '': 256 if cfgpath is not None and cfgpath.strip() == '':
253 return None 257 return None
254 path = (cfgpath or name).strip('/') 258 path = (cfgpath or name).strip('/')
286 rpath = self.url.strip('/') 290 rpath = self.url.strip('/')
287 branchnames = svn.client.ls(rpath + '/' + branches, rev, False, 291 branchnames = svn.client.ls(rpath + '/' + branches, rev, False,
288 self.ctx) 292 self.ctx)
289 for branch in branchnames.keys(): 293 for branch in branchnames.keys():
290 module = '%s/%s/%s' % (oldmodule, branches, branch) 294 module = '%s/%s/%s' % (oldmodule, branches, branch)
295 if not isdir(module, self.last_changed):
296 continue
291 brevid = self.latest(module, self.last_changed) 297 brevid = self.latest(module, self.last_changed)
292 if not brevid: 298 if not brevid:
293 self.ui.note(_('ignoring empty branch %s\n') % 299 self.ui.note(_('ignoring empty branch %s\n') %
294 branch.encode(self.encoding)) 300 branch.encode(self.encoding))
295 continue 301 continue