Comments
Patch
@@ -61,17 +61,17 @@ class converter_source(object):
self.path = path
self.rev = rev
self.encoding = 'utf-8'
- def checkhexformat(self, revstr):
+ def checkhexformat(self, revstr, mapname='splicemap'):
""" fails if revstr is not a 40 byte hex. mercurial and git both uses
such format for their revision numbering
"""
if not re.match(r'[0-9a-fA-F]{40,40}$', revstr):
- raise util.Abort(_('splicemap entry %s is not a valid revision'
- ' identifier') % revstr)
+ raise util.Abort(_('%s entry %s is not a valid revision'
+ ' identifier') % (mapname, revstr))
def before(self):
pass
def after(self):
@@ -170,11 +170,11 @@ class converter_source(object):
Bookmark names are to be UTF-8 strings.
"""
return {}
- def checkrevformat(self, revstr):
+ def checkrevformat(self, revstr, mapname='splicemap'):
"""revstr is a string that describes a revision in the given
source control system. Return true if revstr has correct
format.
"""
return True
@@ -295,9 +295,9 @@ class convert_git(converter_source):
except Exception:
pass
return bookmarks
- def checkrevformat(self, revstr):
+ def checkrevformat(self, revstr, mapname='splicemap'):
""" git revision string is a 40 byte hex """
- self.checkhexformat(revstr)
+ self.checkhexformat(revstr, mapname)
@@ -421,8 +421,8 @@ class mercurial_source(converter_source)
return None
def getbookmarks(self):
return bookmarks.listbookmarks(self.repo)
- def checkrevformat(self, revstr):
+ def checkrevformat(self, revstr, mapname='splicemap'):
""" Mercurial, revision string is a 40 byte hex """
- self.checkhexformat(revstr)
+ self.checkhexformat(revstr, mapname)
@@ -452,17 +452,17 @@ class svn_source(converter_source):
commit = self.commits[rev]
# caller caches the result, so free it here to release memory
del self.commits[rev]
return commit
- def checkrevformat(self, revstr):
+ def checkrevformat(self, revstr, mapname='splicemap'):
""" fails if revision format does not match the correct format"""
if not re.match(r'svn:[0-9a-f]{8,8}-[0-9a-f]{4,4}-'
'[0-9a-f]{4,4}-[0-9a-f]{4,4}-[0-9a-f]'
'{12,12}(.*)\@[0-9]+$',revstr):
- raise util.Abort(_('splicemap entry %s is not a valid revision'
- ' identifier') % revstr)
+ raise util.Abort(_('%s entry %s is not a valid revision'
+ ' identifier') % (mapname, revstr))
def gettags(self):
tags = {}
if self.tags is None:
return tags