Mercurial > hg
diff hgext/convert/filemap.py @ 17174:32b2e6d641e4 stable
convert: make filemap renames consistently override revision renames
When the source repository had a revision renaming "$new -> $old",
but the filemap a "$old -> $new" rename, the converted revision could
use either $new (deleting the file) or $old (keeping the file) when
getting the file data, depending on the lexicographical order of
those names. So the resulting revision would leave some files
untouched (as expected), but delete others arbitrarely.
author | Wagner Bruna <wbruna@yahoo.com> |
---|---|
date | Fri, 06 Jul 2012 01:14:02 -0300 |
parents | 3992c7df85f2 |
children | f76e2196ee70 |
line wrap: on
line diff
--- a/hgext/convert/filemap.py Mon Jul 09 17:51:46 2012 +0200 +++ b/hgext/convert/filemap.py Fri Jul 06 01:14:02 2012 -0300 @@ -348,12 +348,13 @@ # original filename in the rev part of the return value. changes, copies = self.base.getchanges(rev) newnames = {} - files = [] + files = {} for f, r in changes: newf = self.filemapper(f) - if newf: - files.append((newf, (f, r))) + if newf and (newf != f or newf not in files): + files[newf] = (f, r) newnames[f] = newf + files = sorted(files.items()) ncopies = {} for c in copies: