##// END OF EJS Templates
convert: allow the converter_source to say "skip this revision"...
Alexis S. L. Carvalho -
r5374:e7108742 default
parent child Browse files
Show More
@@ -5,7 +5,7 b''
5 # This software may be used and distributed according to the terms
5 # This software may be used and distributed according to the terms
6 # of the GNU General Public License, incorporated herein by reference.
6 # of the GNU General Public License, incorporated herein by reference.
7
7
8 from common import NoRepo, converter_source, converter_sink
8 from common import NoRepo, SKIPREV, converter_source, converter_sink
9 from cvs import convert_cvs
9 from cvs import convert_cvs
10 from darcs import darcs_source
10 from darcs import darcs_source
11 from git import convert_git
11 from git import convert_git
@@ -202,7 +202,15 b' class converter(object):'
202 do_copies = hasattr(self.dest, 'copyfile')
202 do_copies = hasattr(self.dest, 'copyfile')
203 filenames = []
203 filenames = []
204
204
205 files, copies = self.source.getchanges(rev)
205 changes = self.source.getchanges(rev)
206 if isinstance(changes, basestring):
207 if changes == SKIPREV:
208 dest = SKIPREV
209 else:
210 dest = self.map[changes]
211 self.mapentry(rev, dest)
212 return
213 files, copies = changes
206 parents = [self.map[r] for r in commit.parents]
214 parents = [self.map[r] for r in commit.parents]
207 if commit.parents:
215 if commit.parents:
208 prev = commit.parents[0]
216 prev = commit.parents[0]
@@ -263,7 +271,7 b' class converter(object):'
263 ctags = {}
271 ctags = {}
264 for k in tags:
272 for k in tags:
265 v = tags[k]
273 v = tags[k]
266 if v in self.map:
274 if self.map.get(v, SKIPREV) != SKIPREV:
267 ctags[k] = self.map[v]
275 ctags[k] = self.map[v]
268
276
269 if c and ctags:
277 if c and ctags:
@@ -17,6 +17,8 b' def decodeargs(s):'
17
17
18 class NoRepo(Exception): pass
18 class NoRepo(Exception): pass
19
19
20 SKIPREV = 'hg-convert-skipped-revision'
21
20 class commit(object):
22 class commit(object):
21 def __init__(self, author, date, desc, parents, branch=None, rev=None):
23 def __init__(self, author, date, desc, parents, branch=None, rev=None):
22 self.author = author
24 self.author = author
General Comments 0
You need to be logged in to leave comments. Login now