Show More
@@ -63,13 +63,13 b' class converter_source(object):' | |||||
63 |
|
63 | |||
64 | self.encoding = 'utf-8' |
|
64 | self.encoding = 'utf-8' | |
65 |
|
65 | |||
66 | def checkhexformat(self, revstr): |
|
66 | def checkhexformat(self, revstr, mapname='splicemap'): | |
67 | """ fails if revstr is not a 40 byte hex. mercurial and git both uses |
|
67 | """ fails if revstr is not a 40 byte hex. mercurial and git both uses | |
68 | such format for their revision numbering |
|
68 | such format for their revision numbering | |
69 | """ |
|
69 | """ | |
70 | if not re.match(r'[0-9a-fA-F]{40,40}$', revstr): |
|
70 | if not re.match(r'[0-9a-fA-F]{40,40}$', revstr): | |
71 |
raise util.Abort(_('s |
|
71 | raise util.Abort(_('%s entry %s is not a valid revision' | |
72 | ' identifier') % revstr) |
|
72 | ' identifier') % (mapname, revstr)) | |
73 |
|
73 | |||
74 | def before(self): |
|
74 | def before(self): | |
75 | pass |
|
75 | pass | |
@@ -172,7 +172,7 b' class converter_source(object):' | |||||
172 | """ |
|
172 | """ | |
173 | return {} |
|
173 | return {} | |
174 |
|
174 | |||
175 | def checkrevformat(self, revstr): |
|
175 | def checkrevformat(self, revstr, mapname='splicemap'): | |
176 | """revstr is a string that describes a revision in the given |
|
176 | """revstr is a string that describes a revision in the given | |
177 | source control system. Return true if revstr has correct |
|
177 | source control system. Return true if revstr has correct | |
178 | format. |
|
178 | format. |
@@ -297,7 +297,7 b' class convert_git(converter_source):' | |||||
297 |
|
297 | |||
298 | return bookmarks |
|
298 | return bookmarks | |
299 |
|
299 | |||
300 | def checkrevformat(self, revstr): |
|
300 | def checkrevformat(self, revstr, mapname='splicemap'): | |
301 | """ git revision string is a 40 byte hex """ |
|
301 | """ git revision string is a 40 byte hex """ | |
302 | self.checkhexformat(revstr) |
|
302 | self.checkhexformat(revstr, mapname) | |
303 |
|
303 |
@@ -423,6 +423,6 b' class mercurial_source(converter_source)' | |||||
423 | def getbookmarks(self): |
|
423 | def getbookmarks(self): | |
424 | return bookmarks.listbookmarks(self.repo) |
|
424 | return bookmarks.listbookmarks(self.repo) | |
425 |
|
425 | |||
426 | def checkrevformat(self, revstr): |
|
426 | def checkrevformat(self, revstr, mapname='splicemap'): | |
427 | """ Mercurial, revision string is a 40 byte hex """ |
|
427 | """ Mercurial, revision string is a 40 byte hex """ | |
428 | self.checkhexformat(revstr) |
|
428 | self.checkhexformat(revstr, mapname) |
@@ -454,13 +454,13 b' class svn_source(converter_source):' | |||||
454 | del self.commits[rev] |
|
454 | del self.commits[rev] | |
455 | return commit |
|
455 | return commit | |
456 |
|
456 | |||
457 | def checkrevformat(self, revstr): |
|
457 | def checkrevformat(self, revstr, mapname='splicemap'): | |
458 | """ fails if revision format does not match the correct format""" |
|
458 | """ fails if revision format does not match the correct format""" | |
459 | if not re.match(r'svn:[0-9a-f]{8,8}-[0-9a-f]{4,4}-' |
|
459 | if not re.match(r'svn:[0-9a-f]{8,8}-[0-9a-f]{4,4}-' | |
460 | '[0-9a-f]{4,4}-[0-9a-f]{4,4}-[0-9a-f]' |
|
460 | '[0-9a-f]{4,4}-[0-9a-f]{4,4}-[0-9a-f]' | |
461 | '{12,12}(.*)\@[0-9]+$',revstr): |
|
461 | '{12,12}(.*)\@[0-9]+$',revstr): | |
462 |
raise util.Abort(_('s |
|
462 | raise util.Abort(_('%s entry %s is not a valid revision' | |
463 | ' identifier') % revstr) |
|
463 | ' identifier') % (mapname, revstr)) | |
464 |
|
464 | |||
465 | def gettags(self): |
|
465 | def gettags(self): | |
466 | tags = {} |
|
466 | tags = {} |
General Comments 0
You need to be logged in to leave comments.
Login now