##// END OF EJS Templates
convert: document splicemap, allow setting of multiple parents
Bryan O'Sullivan -
r6143:5b159ebb default
parent child Browse files
Show More
@@ -67,6 +67,17 b' def convert(ui, src, dest=None, revmapfi'
67 67 subdirectory into the root of the repository, use '.' as the path to
68 68 rename to.
69 69
70 The splicemap is a file that allows insertion of synthetic
71 history, letting you specify the parents of a revision. This is
72 useful if you want to e.g. give a Subversion merge two parents, or
73 graft two disconnected series of history together. Each entry
74 contains a key, followed by a space, followed by one or two
75 values, separated by spaces. The key is the revision ID in the
76 source revision control system whose parents should be modified
77 (same format as a key in .hg/shamap). The values are the revision
78 IDs (in either the source or destination revision control system)
79 that should be used as the new parents for that node.
80
70 81 Back end options:
71 82
72 83 --config convert.hg.clonebranches=False (boolean)
@@ -100,6 +111,7 b' cmdtable = {'
100 111 ('', 'filemap', '', 'remap file names using contents of file'),
101 112 ('r', 'rev', '', 'import up to target revision REV'),
102 113 ('s', 'source-type', '', 'source repository type'),
114 ('', 'splicemap', '', 'splice synthesized history into place'),
103 115 ('', 'datesort', None, 'try to sort changesets by date')],
104 116 'hg convert [OPTION]... SOURCE [DEST [MAPFILE]]'),
105 117 "debugsvnlog":
@@ -84,7 +84,7 b' class converter(object):'
84 84 self.readauthormap(opts.get('authors'))
85 85 self.authorfile = self.dest.authorfile()
86 86
87 self.splicemap = mapfile(ui, ui.config('convert', 'splicemap'))
87 self.splicemap = mapfile(ui, opts.get('splicemap'))
88 88
89 89 def walktree(self, heads):
90 90 '''Return a mapping that identifies the uncommitted parents of every
@@ -252,9 +252,10 b' class converter(object):'
252 252 self.dest.copyfile(copyf, f)
253 253
254 254 try:
255 parents = [self.splicemap[rev]]
256 self.ui.debug('spliced in %s as parents of %s\n' %
257 (parents, rev))
255 parents = self.splicemap[rev].replace(',', ' ').split()
256 self.ui.status('spliced in %s as parents of %s\n' %
257 (parents, rev))
258 parents = [self.map.get(p, p) for p in parents]
258 259 except KeyError:
259 260 parents = [b[0] for b in pbranches]
260 261 newnode = self.dest.putcommit(filenames, parents, commit)
General Comments 0
You need to be logged in to leave comments. Login now