Mercurial > public > mercurial-scm > hg
diff hgext/convert/subversion.py @ 6546:075b2c9aed37
convert: fix svn file copy detection code
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Mon, 14 Apr 2008 22:31:34 +0200 |
parents | a7492fb2107b |
children | 2af1b9de62b3 0bb76d168437 |
line wrap: on
line diff
--- a/hgext/convert/subversion.py Mon Apr 14 22:31:34 2008 +0200 +++ b/hgext/convert/subversion.py Mon Apr 14 22:31:34 2008 +0200 @@ -553,20 +553,19 @@ kind = svn.ra.check_path(self.ra, entrypath, revnum) if kind == svn.core.svn_node_file: entries.append(self.recode(entry)) - - if not ent.copyfrom_path: + if not ent.copyfrom_path or not parents: continue - copyfrom_path = self.getrelpath(ent.copyfrom_path) + # Copy sources not in parent revisions cannot be represented, + # ignore their origin for now + pmodule, prevnum = self.revsplit(parents[0])[1:] + if ent.copyfrom_rev < prevnum: + continue + copyfrom_path = self.getrelpath(ent.copyfrom_path, pmodule) if not copyfrom_path: continue self.ui.debug("copied to %s from %s@%s\n" % (entrypath, copyfrom_path, ent.copyfrom_rev)) - # It's probably important for hg that the source - # exists in the revision's parent, not just the - # ent.copyfrom_rev - fromkind = svn.ra.check_path(self.ra, copyfrom_path, ent.copyfrom_rev) - if fromkind != 0: - copies[self.recode(entry)] = self.recode(copyfrom_path) + copies[self.recode(entry)] = self.recode(copyfrom_path) elif kind == 0: # gone, but had better be a deleted *file* self.ui.debug("gone from %s\n" % ent.copyfrom_rev)