Mercurial > hg
diff hgext/convert/convcmd.py @ 5996:3f9ce63da18c
convert: allow synthetic history to be spliced in.
Useful for recreating history in the face of SVN lossage.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Fri, 01 Feb 2008 13:11:03 -0800 |
parents | 0162c6cc045e |
children | df659eb23360 |
line wrap: on
line diff
--- a/hgext/convert/convcmd.py Fri Feb 01 13:09:45 2008 -0800 +++ b/hgext/convert/convcmd.py Fri Feb 01 13:11:03 2008 -0800 @@ -74,6 +74,8 @@ self.readauthormap(opts.get('authors')) self.authorfile = self.dest.authorfile() + self.splicemap = mapfile(ui, ui.config('convert', 'splicemap')) + def walktree(self, heads): '''Return a mapping that identifies the uncommitted parents of every uncommitted changeset.''' @@ -224,7 +226,12 @@ # Merely marks that a copy happened. self.dest.copyfile(copyf, f) - parents = [b[0] for b in pbranches] + try: + parents = [self.splicemap[rev]] + self.ui.debug('spliced in %s as parents of %s\n' % + (parents, rev)) + except KeyError: + parents = [b[0] for b in pbranches] newnode = self.dest.putcommit(filenames, parents, commit) self.source.converted(rev, newnode) self.map[rev] = newnode