comparison hgext/convert/__init__.py @ 21076:5236c7a72a2d

convert: backout b75a04502ced and 9616b03113ce - tagmap Tagmap solves a very specific use case. It would be better to have a more generic solution than to have to maintain this forever. Tagmap has not been released yet and removing it now will not break any backward compatibility contract. There is no test coverage for tagmap but it seems like the same can be achieved with a (relatively) simple and much more powerful custom extension: import hgext.convert.hg def f(tag): return tag.replace('some', 'other') class source(hgext.convert.hg.mercurial_source): def gettags(self): return dict((f(tag), node) for tag, node in in super(source, self).gettags().items()) def getfile(self, name, rev): data, flags = super(source, self).getfile(name, rev) if name == '.hgtags': data = ''.join(l[:41] + f(l[41:]) + '\n' for l in data.splitlines()) return data, flags hgext.convert.hg.mercurial_source = source
author Mads Kiilerich <madski@unity3d.com>
date Wed, 16 Apr 2014 01:09:49 +0200
parents 7731a2281cf0
children 78b15ad2f968
comparison
equal deleted inserted replaced
21075:438803e4bd97 21076:5236c7a72a2d
143 repository from "default" to a named branch. 143 repository from "default" to a named branch.
144 144
145 The closemap is a file that allows closing of a branch. This is useful if 145 The closemap is a file that allows closing of a branch. This is useful if
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
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 148
153 Mercurial Source 149 Mercurial Source
154 ################ 150 ################
155 151
156 The Mercurial source recognizes the following configuration 152 The Mercurial source recognizes the following configuration
328 _('splice synthesized history into place'), _('FILE')), 324 _('splice synthesized history into place'), _('FILE')),
329 ('', 'branchmap', '', 325 ('', 'branchmap', '',
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')),
338 ('', 'closesort', None, _('try to reorder closed revisions'))], 332 ('', 'closesort', None, _('try to reorder closed revisions'))],
339 _('hg convert [OPTION]... SOURCE [DEST [REVMAP]]')), 333 _('hg convert [OPTION]... SOURCE [DEST [REVMAP]]')),