##// END OF EJS Templates
convert: backout 81cf597dafa9 and a3545c3104aa -closemap...
Mads Kiilerich -
r21077:78b15ad2 default
parent child Browse files
Show More
@@ -142,10 +142,6 b' def convert(ui, src, dest=None, revmapfi'
142 142 branch names. This can be used to (for instance) move code in one
143 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
146 you want to close a branch. Each entry contains a revision or hash
147 separated by white space.
148
149 145 Mercurial Source
150 146 ################
151 147
@@ -324,8 +320,6 b' cmdtable = {'
324 320 _('splice synthesized history into place'), _('FILE')),
325 321 ('', 'branchmap', '',
326 322 _('change branch names while converting'), _('FILE')),
327 ('', 'closemap', '',
328 _('closes given revs'), _('FILE')),
329 323 ('', 'branchsort', None, _('try to sort changesets by branches')),
330 324 ('', 'datesort', None, _('try to sort changesets by date')),
331 325 ('', 'sourcesort', None, _('preserve source changesets order')),
@@ -120,42 +120,6 b' class converter(object):'
120 120
121 121 self.splicemap = self.parsesplicemap(opts.get('splicemap'))
122 122 self.branchmap = mapfile(ui, opts.get('branchmap'))
123 self.closemap = self.parseclosemap(opts.get('closemap'))
124
125 def parseclosemap(self, path):
126 """ check and validate the closemap format and
127 return a list of revs to close.
128 Format checking has two parts.
129 1. generic format which is same across all source types
130 2. specific format checking which may be different for
131 different source type. This logic is implemented in
132 checkrevformat function in source files like
133 hg.py, subversion.py etc.
134 """
135
136 if not path:
137 return []
138 m = []
139 try:
140 fp = open(path, 'r')
141 for i, line in enumerate(fp):
142 line = line.splitlines()[0].rstrip()
143 if not line:
144 # Ignore blank lines
145 continue
146 # split line
147 lex = shlex.shlex(line, posix=True)
148 lex.whitespace_split = True
149 lex.whitespace += ','
150 line = list(lex)
151 for part in line:
152 self.source.checkrevformat(part, 'closemap')
153 m.extend(line)
154 # if file does not exist or error reading, exit
155 except IOError:
156 raise util.Abort(_('closemap file not found or error reading %s:')
157 % path)
158 return m
159 123
160 124 def parsesplicemap(self, path):
161 125 """ check and validate the splicemap format and
@@ -444,9 +408,6 b' class converter(object):'
444 408 except KeyError:
445 409 parents = [b[0] for b in pbranches]
446 410 source = progresssource(self.ui, self.source, len(files))
447 if self.closemap and rev in self.closemap:
448 commit.extra['close'] = 1
449
450 411 newnode = self.dest.putcommit(files, copies, parents, commit,
451 412 source, self.map)
452 413 source.close()
@@ -122,10 +122,6 b''
122 122 can be used to (for instance) move code in one repository from "default"
123 123 to a named branch.
124 124
125 The closemap is a file that allows closing of a branch. This is useful if
126 you want to close a branch. Each entry contains a revision or hash
127 separated by white space.
128
129 125 Mercurial Source
130 126 ################
131 127
@@ -271,7 +267,6 b''
271 267 --filemap FILE remap file names using contents of file
272 268 --splicemap FILE splice synthesized history into place
273 269 --branchmap FILE change branch names while converting
274 --closemap FILE closes given revs
275 270 --branchsort try to sort changesets by branches
276 271 --datesort try to sort changesets by date
277 272 --sourcesort preserve source changesets order
General Comments 0
You need to be logged in to leave comments. Login now