diff hgext/convert/common.py @ 20373:e8203629371b

convert: add mapname parameter to checkrevformat Upcoming patches will add new map files so we change the calling sequence of checkrevformat so that error messages will let the user know which file has the wrong rev format.
author Sean Farley <sean.michael.farley@gmail.com>
date Tue, 21 Jan 2014 11:34:55 -0600
parents 83973dc1bfe9
children 9616b03113ce
line wrap: on
line diff
--- a/hgext/convert/common.py	Thu Apr 18 10:05:50 2013 -0500
+++ b/hgext/convert/common.py	Tue Jan 21 11:34:55 2014 -0600
@@ -63,13 +63,13 @@
 
         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
@@ -172,7 +172,7 @@
         """
         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.