# HG changeset patch # User Bryan O'Sullivan # Date 2008-02-19 18:53:40 # Node ID 5b159ebb19cf9e2fddd008012e836e3d720a167f # Parent 50a277e6ceaeaa5f890cacc9dcab745a4387dd58 convert: document splicemap, allow setting of multiple parents diff --git a/hgext/convert/__init__.py b/hgext/convert/__init__.py --- a/hgext/convert/__init__.py +++ b/hgext/convert/__init__.py @@ -67,6 +67,17 @@ def convert(ui, src, dest=None, revmapfi subdirectory into the root of the repository, use '.' as the path to rename to. + The splicemap is a file that allows insertion of synthetic + history, letting you specify the parents of a revision. This is + useful if you want to e.g. give a Subversion merge two parents, or + graft two disconnected series of history together. Each entry + contains a key, followed by a space, followed by one or two + values, separated by spaces. The key is the revision ID in the + source revision control system whose parents should be modified + (same format as a key in .hg/shamap). The values are the revision + IDs (in either the source or destination revision control system) + that should be used as the new parents for that node. + Back end options: --config convert.hg.clonebranches=False (boolean) @@ -100,6 +111,7 @@ cmdtable = { ('', 'filemap', '', 'remap file names using contents of file'), ('r', 'rev', '', 'import up to target revision REV'), ('s', 'source-type', '', 'source repository type'), + ('', 'splicemap', '', 'splice synthesized history into place'), ('', 'datesort', None, 'try to sort changesets by date')], 'hg convert [OPTION]... SOURCE [DEST [MAPFILE]]'), "debugsvnlog": diff --git a/hgext/convert/convcmd.py b/hgext/convert/convcmd.py --- a/hgext/convert/convcmd.py +++ b/hgext/convert/convcmd.py @@ -84,7 +84,7 @@ class converter(object): self.readauthormap(opts.get('authors')) self.authorfile = self.dest.authorfile() - self.splicemap = mapfile(ui, ui.config('convert', 'splicemap')) + self.splicemap = mapfile(ui, opts.get('splicemap')) def walktree(self, heads): '''Return a mapping that identifies the uncommitted parents of every @@ -252,9 +252,10 @@ class converter(object): self.dest.copyfile(copyf, f) try: - parents = [self.splicemap[rev]] - self.ui.debug('spliced in %s as parents of %s\n' % - (parents, rev)) + parents = self.splicemap[rev].replace(',', ' ').split() + self.ui.status('spliced in %s as parents of %s\n' % + (parents, rev)) + parents = [self.map.get(p, p) for p in parents] except KeyError: parents = [b[0] for b in pbranches] newnode = self.dest.putcommit(filenames, parents, commit)