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