##// 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 subdirectory into the root of the repository, use '.' as the path to
67 subdirectory into the root of the repository, use '.' as the path to
68 rename to.
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 Back end options:
81 Back end options:
71
82
72 --config convert.hg.clonebranches=False (boolean)
83 --config convert.hg.clonebranches=False (boolean)
@@ -100,6 +111,7 b' cmdtable = {'
100 ('', 'filemap', '', 'remap file names using contents of file'),
111 ('', 'filemap', '', 'remap file names using contents of file'),
101 ('r', 'rev', '', 'import up to target revision REV'),
112 ('r', 'rev', '', 'import up to target revision REV'),
102 ('s', 'source-type', '', 'source repository type'),
113 ('s', 'source-type', '', 'source repository type'),
114 ('', 'splicemap', '', 'splice synthesized history into place'),
103 ('', 'datesort', None, 'try to sort changesets by date')],
115 ('', 'datesort', None, 'try to sort changesets by date')],
104 'hg convert [OPTION]... SOURCE [DEST [MAPFILE]]'),
116 'hg convert [OPTION]... SOURCE [DEST [MAPFILE]]'),
105 "debugsvnlog":
117 "debugsvnlog":
@@ -84,7 +84,7 b' class converter(object):'
84 self.readauthormap(opts.get('authors'))
84 self.readauthormap(opts.get('authors'))
85 self.authorfile = self.dest.authorfile()
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 def walktree(self, heads):
89 def walktree(self, heads):
90 '''Return a mapping that identifies the uncommitted parents of every
90 '''Return a mapping that identifies the uncommitted parents of every
@@ -252,9 +252,10 b' class converter(object):'
252 self.dest.copyfile(copyf, f)
252 self.dest.copyfile(copyf, f)
253
253
254 try:
254 try:
255 parents = [self.splicemap[rev]]
255 parents = self.splicemap[rev].replace(',', ' ').split()
256 self.ui.debug('spliced in %s as parents of %s\n' %
256 self.ui.status('spliced in %s as parents of %s\n' %
257 (parents, rev))
257 (parents, rev))
258 parents = [self.map.get(p, p) for p in parents]
258 except KeyError:
259 except KeyError:
259 parents = [b[0] for b in pbranches]
260 parents = [b[0] for b in pbranches]
260 newnode = self.dest.putcommit(filenames, parents, commit)
261 newnode = self.dest.putcommit(filenames, parents, commit)
General Comments 0
You need to be logged in to leave comments. Login now