comparison hgext/convert/subversion.py @ 5074:4cef0b93969d

convert: svn: hoist up branch creation check
author Brendan Cully <brendan@kublai.com>
date Sun, 05 Aug 2007 10:23:45 -0700
parents eb81294cf970
children 514c06098e9c
comparison
equal deleted inserted replaced
5073:eb81294cf970 5074:4cef0b93969d
375 except IndexError: 375 except IndexError:
376 branch = None 376 branch = None
377 377
378 orig_paths = orig_paths.items() 378 orig_paths = orig_paths.items()
379 orig_paths.sort() 379 orig_paths.sort()
380
381 # check whether this revision is the start of a branch
382 path, ent = orig_paths and orig_paths[0] or (None, None)
383 if ent and path == self.module:
384 if ent.copyfrom_path:
385 # ent.copyfrom_rev may not be the actual last revision
386 prev = self.latest(ent.copyfrom_path, ent.copyfrom_rev)
387 self.modulemap[prev] = ent.copyfrom_path
388 parents = [self.revid(prev, ent.copyfrom_path)]
389 self.ui.note('found parent of branch %s at %d: %s\n' % \
390 (self.module, prev, ent.copyfrom_path))
391 else:
392 self.ui.debug("No copyfrom path, don't know what to do.\n")
393
380 for path, ent in orig_paths: 394 for path, ent in orig_paths:
381 # self.ui.write("path %s\n" % path) 395 # self.ui.write("path %s\n" % path)
382 if path == self.module: # Follow branching back in history
383 if ent:
384 if ent.copyfrom_path:
385 # ent.copyfrom_rev may not be the actual last revision
386 prev = self.latest(ent.copyfrom_path, ent.copyfrom_rev)
387 self.modulemap[prev] = ent.copyfrom_path
388 parents = [self.revid(prev, ent.copyfrom_path)]
389 self.ui.note('found parent of branch %s at %d: %s\n' % \
390 (self.module, prev, ent.copyfrom_path))
391 else:
392 self.ui.debug("No copyfrom path, don't know what to do.\n")
393 # Maybe it was added and there is no more history.
394 entrypath = get_entry_from_path(path, module=self.module) 396 entrypath = get_entry_from_path(path, module=self.module)
395 # self.ui.write("entrypath %s\n" % entrypath) 397 # self.ui.write("entrypath %s\n" % entrypath)
396 if entrypath is None: 398 if entrypath is None:
397 # Outside our area of interest 399 # Outside our area of interest
398 self.ui.debug("boring@%s: %s\n" % (revnum, path)) 400 self.ui.debug("boring@%s: %s\n" % (revnum, path))