# HG changeset patch # User Patrick Mezard # Date 1208205093 -7200 # Node ID e7810e61f7c106bf0ea7f6a80e9d14b63d94965b # Parent 009f69a5e2517d5069422d5d5e6f3318af7bd8c1 convert: more cleanup in svn directory copy handling diff -r 009f69a5e251 -r e7810e61f7c1 hgext/convert/subversion.py --- a/hgext/convert/subversion.py Mon Apr 14 22:31:33 2008 +0200 +++ b/hgext/convert/subversion.py Mon Apr 14 22:31:33 2008 +0200 @@ -675,26 +675,28 @@ # Copies here (must copy all from source) # Probably not a real problem for us if # source does not exist - if ent.copyfrom_path: - copyfrompath = self.getrelpath(ent.copyfrom_path.decode(self.encoding)) - if copyfrompath: - copyfrom[path] = ent - self.ui.debug("mark %s came from %s:%d\n" - % (path, copyfrompath, ent.copyfrom_rev)) + if not ent.copyfrom_path: + continue + copyfrompath = self.getrelpath(ent.copyfrom_path.decode(self.encoding)) + if not copyfrompath: + continue + copyfrom[path] = ent + self.ui.debug("mark %s came from %s:%d\n" + % (path, copyfrompath, ent.copyfrom_rev)) - # Good, /probably/ a regular copy. Really should check - # to see whether the parent revision actually contains - # the directory in question. - children = self._find_children(ent.copyfrom_path, ent.copyfrom_rev) - children.sort() - for child in children: - entrypath = self.getrelpath("/" + child) - if not entrypath: - continue - entry = entrypath.decode(self.encoding) - copytopath = path + entry[len(copyfrompath):] - copytopath = self.getrelpath(copytopath) - copies[self.recode(copytopath)] = self.recode(entry) + # Good, /probably/ a regular copy. Really should check + # to see whether the parent revision actually contains + # the directory in question. + children = self._find_children(ent.copyfrom_path, ent.copyfrom_rev) + children.sort() + for child in children: + entrypath = self.getrelpath("/" + child) + if not entrypath: + continue + entry = entrypath.decode(self.encoding) + copytopath = path + entry[len(copyfrompath):] + copytopath = self.getrelpath(copytopath) + copies[self.recode(copytopath)] = self.recode(entry) return (util.unique(entries), copies)