diff hgext/convert/common.py @ 19122:83973dc1bfe9

splicemap: improve error handling when source is subversion (issue2084) Implemented error handling on splicemap file when source is subversion (This checks are similar to when source is hg or git). The revision string is expected to be of svn:<uuid><path>@<number> format. the test case has been enhanced to check this format.
author Ben Goswami <bengoswami@fb.com>
date Thu, 25 Apr 2013 18:01:00 -0700
parents 58e782f076e7
children e8203629371b
line wrap: on
line diff
--- a/hgext/convert/common.py	Thu Apr 25 16:02:58 2013 -0700
+++ b/hgext/convert/common.py	Thu Apr 25 18:01:00 2013 -0700
@@ -67,8 +67,7 @@
         """ fails if revstr is not a 40 byte hex. mercurial and git both uses
             such format for their revision numbering
         """
-        matchobj = re.match(r'[0-9a-fA-F]{40,40}$', revstr)
-        if matchobj is None:
+        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)