# HG changeset patch # User Bryan O'Sullivan # Date 1201900263 28800 # Node ID 3f9ce63da18c22180f60c964f5b03ede7919f586 # Parent b913d3aacddcec52732381839a0987719c39d217 convert: allow synthetic history to be spliced in. Useful for recreating history in the face of SVN lossage. diff -r b913d3aacddc -r 3f9ce63da18c hgext/convert/common.py --- a/hgext/convert/common.py Fri Feb 01 13:09:45 2008 -0800 +++ b/hgext/convert/common.py Fri Feb 01 13:11:03 2008 -0800 @@ -311,6 +311,8 @@ self._read() def _read(self): + if self.path is None: + return try: fp = open(self.path, 'r') except IOError, err: diff -r b913d3aacddc -r 3f9ce63da18c hgext/convert/convcmd.py --- 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