##// END OF EJS Templates
convert: backout b75a04502ced and 9616b03113ce - tagmap...
Mads Kiilerich -
r21076:5236c7a7 default
parent child Browse files
Show More
@@ -146,10 +146,6 b' def convert(ui, src, dest=None, revmapfi'
146 you want to close a branch. Each entry contains a revision or hash
146 you want to close a branch. Each entry contains a revision or hash
147 separated by white space.
147 separated by white space.
148
148
149 The tagmap is a file that exactly analogous to the branchmap. This will
150 rename tags on the fly and prevent the 'update tags' commit usually found
151 at the end of a convert process.
152
153 Mercurial Source
149 Mercurial Source
154 ################
150 ################
155
151
@@ -330,8 +326,6 b' cmdtable = {'
330 _('change branch names while converting'), _('FILE')),
326 _('change branch names while converting'), _('FILE')),
331 ('', 'closemap', '',
327 ('', 'closemap', '',
332 _('closes given revs'), _('FILE')),
328 _('closes given revs'), _('FILE')),
333 ('', 'tagmap', '',
334 _('change tag names while converting'), _('FILE')),
335 ('', 'branchsort', None, _('try to sort changesets by branches')),
329 ('', 'branchsort', None, _('try to sort changesets by branches')),
336 ('', 'datesort', None, _('try to sort changesets by date')),
330 ('', 'datesort', None, _('try to sort changesets by date')),
337 ('', 'sourcesort', None, _('preserve source changesets order')),
331 ('', 'sourcesort', None, _('preserve source changesets order')),
@@ -204,8 +204,7 b' class converter_sink(object):'
204 mapping equivalent authors identifiers for each system."""
204 mapping equivalent authors identifiers for each system."""
205 return None
205 return None
206
206
207 def putcommit(self, files, copies, parents, commit, source,
207 def putcommit(self, files, copies, parents, commit, source, revmap):
208 revmap, tagmap):
209 """Create a revision with all changed files listed in 'files'
208 """Create a revision with all changed files listed in 'files'
210 and having listed parents. 'commit' is a commit object
209 and having listed parents. 'commit' is a commit object
211 containing at a minimum the author, date, and message for this
210 containing at a minimum the author, date, and message for this
@@ -121,7 +121,6 b' class converter(object):'
121 self.splicemap = self.parsesplicemap(opts.get('splicemap'))
121 self.splicemap = self.parsesplicemap(opts.get('splicemap'))
122 self.branchmap = mapfile(ui, opts.get('branchmap'))
122 self.branchmap = mapfile(ui, opts.get('branchmap'))
123 self.closemap = self.parseclosemap(opts.get('closemap'))
123 self.closemap = self.parseclosemap(opts.get('closemap'))
124 self.tagmap = mapfile(ui, opts.get('tagmap'))
125
124
126 def parseclosemap(self, path):
125 def parseclosemap(self, path):
127 """ check and validate the closemap format and
126 """ check and validate the closemap format and
@@ -449,7 +448,7 b' class converter(object):'
449 commit.extra['close'] = 1
448 commit.extra['close'] = 1
450
449
451 newnode = self.dest.putcommit(files, copies, parents, commit,
450 newnode = self.dest.putcommit(files, copies, parents, commit,
452 source, self.map, self.tagmap)
451 source, self.map)
453 source.close()
452 source.close()
454 self.source.converted(rev, newnode)
453 self.source.converted(rev, newnode)
455 self.map[rev] = newnode
454 self.map[rev] = newnode
@@ -485,9 +484,6 b' class converter(object):'
485 self.ui.progress(_('converting'), None)
484 self.ui.progress(_('converting'), None)
486
485
487 tags = self.source.gettags()
486 tags = self.source.gettags()
488 tags = dict((self.tagmap.get(k, k), v)
489 for k, v in tags.iteritems())
490
491 ctags = {}
487 ctags = {}
492 for k in tags:
488 for k in tags:
493 v = tags[k]
489 v = tags[k]
@@ -116,7 +116,7 b' class mercurial_sink(converter_sink):'
116 self.repo.pull(prepo, [prepo.lookup(h) for h in heads])
116 self.repo.pull(prepo, [prepo.lookup(h) for h in heads])
117 self.before()
117 self.before()
118
118
119 def _rewritetags(self, source, revmap, tagmap, data):
119 def _rewritetags(self, source, revmap, data):
120 fp = cStringIO.StringIO()
120 fp = cStringIO.StringIO()
121 for line in data.splitlines():
121 for line in data.splitlines():
122 s = line.split(' ', 1)
122 s = line.split(' ', 1)
@@ -125,18 +125,17 b' class mercurial_sink(converter_sink):'
125 revid = revmap.get(source.lookuprev(s[0]))
125 revid = revmap.get(source.lookuprev(s[0]))
126 if not revid:
126 if not revid:
127 continue
127 continue
128 fp.write('%s %s\n' % (revid, tagmap.get(s[1], s[1])))
128 fp.write('%s %s\n' % (revid, s[1]))
129 return fp.getvalue()
129 return fp.getvalue()
130
130
131 def putcommit(self, files, copies, parents, commit, source,
131 def putcommit(self, files, copies, parents, commit, source, revmap):
132 revmap, tagmap):
133
132
134 files = dict(files)
133 files = dict(files)
135 def getfilectx(repo, memctx, f):
134 def getfilectx(repo, memctx, f):
136 v = files[f]
135 v = files[f]
137 data, mode = source.getfile(f, v)
136 data, mode = source.getfile(f, v)
138 if f == '.hgtags':
137 if f == '.hgtags':
139 data = self._rewritetags(source, revmap, tagmap, data)
138 data = self._rewritetags(source, revmap, data)
140 return context.memfilectx(f, data, 'l' in mode, 'x' in mode,
139 return context.memfilectx(f, data, 'l' in mode, 'x' in mode,
141 copies.get(f))
140 copies.get(f))
142
141
@@ -1227,8 +1227,7 b' class svn_sink(converter_sink, commandli'
1227 def revid(self, rev):
1227 def revid(self, rev):
1228 return u"svn:%s@%s" % (self.uuid, rev)
1228 return u"svn:%s@%s" % (self.uuid, rev)
1229
1229
1230 def putcommit(self, files, copies, parents, commit, source,
1230 def putcommit(self, files, copies, parents, commit, source, revmap):
1231 revmap, tagmap):
1232 for parent in parents:
1231 for parent in parents:
1233 try:
1232 try:
1234 return self.revid(self.childmap[parent])
1233 return self.revid(self.childmap[parent])
@@ -126,10 +126,6 b''
126 you want to close a branch. Each entry contains a revision or hash
126 you want to close a branch. Each entry contains a revision or hash
127 separated by white space.
127 separated by white space.
128
128
129 The tagmap is a file that exactly analogous to the branchmap. This will
130 rename tags on the fly and prevent the 'update tags' commit usually found
131 at the end of a convert process.
132
133 Mercurial Source
129 Mercurial Source
134 ################
130 ################
135
131
@@ -276,7 +272,6 b''
276 --splicemap FILE splice synthesized history into place
272 --splicemap FILE splice synthesized history into place
277 --branchmap FILE change branch names while converting
273 --branchmap FILE change branch names while converting
278 --closemap FILE closes given revs
274 --closemap FILE closes given revs
279 --tagmap FILE change tag names while converting
280 --branchsort try to sort changesets by branches
275 --branchsort try to sort changesets by branches
281 --datesort try to sort changesets by date
276 --datesort try to sort changesets by date
282 --sourcesort preserve source changesets order
277 --sourcesort preserve source changesets order
General Comments 0
You need to be logged in to leave comments. Login now