##// END OF EJS Templates
splicemap: improve error handling when source is subversion (issue2084)...
Ben Goswami -
r19122:83973dc1 default
parent child Browse files
Show More
@@ -67,8 +67,7 b' class converter_source(object):'
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 matchobj = re.match(r'[0-9a-fA-F]{40,40}$', revstr)
70 if not re.match(r'[0-9a-fA-F]{40,40}$', revstr):
71 if matchobj is None:
72 raise util.Abort(_('splicemap entry %s is not a valid revision'
71 raise util.Abort(_('splicemap entry %s is not a valid revision'
73 ' identifier') % revstr)
72 ' identifier') % revstr)
74
73
@@ -452,6 +452,14 b' class svn_source(converter_source):'
452 del self.commits[rev]
452 del self.commits[rev]
453 return commit
453 return commit
454
454
455 def checkrevformat(self, revstr):
456 """ fails if revision format does not match the correct format"""
457 if not re.match(r'svn:[0-9a-f]{8,8}-[0-9a-f]{4,4}-'
458 '[0-9a-f]{4,4}-[0-9a-f]{4,4}-[0-9a-f]'
459 '{12,12}(.*)\@[0-9]+$',revstr):
460 raise util.Abort(_('splicemap entry %s is not a valid revision'
461 ' identifier') % revstr)
462
455 def gettags(self):
463 def gettags(self):
456 tags = {}
464 tags = {}
457 if self.tags is None:
465 if self.tags is None:
@@ -16,6 +16,8 b''
16 #else
16 #else
17 $ SVNREPOURL=file://`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
17 $ SVNREPOURL=file://`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
18 #endif
18 #endif
19 $ INVALIDREVISIONID=svn:x2147622-4a9f-4db4-a8d3-13562ff547b2/proj%20B/mytrunk@1
20 $ VALIDREVISIONID=svn:a2147622-4a9f-4db4-a8d3-13562ff547b2/proj%20B/mytrunk/mytrunk@1
19
21
20 Now test that it works with trunk/tags layout, but no branches yet.
22 Now test that it works with trunk/tags layout, but no branches yet.
21
23
@@ -168,6 +170,15 b' Test filemap'
168 |
170 |
169 o 0 second letter files: letter2.txt
171 o 0 second letter files: letter2.txt
170
172
173 test invalid splicemap1
174
175 $ cat > splicemap <<EOF
176 > $INVALIDREVISIONID $VALIDREVISIONID
177 > EOF
178 $ hg convert --splicemap splicemap "$SVNREPOURL/proj%20B/mytrunk" smap
179 initializing destination smap repository
180 abort: splicemap entry svn:x2147622-4a9f-4db4-a8d3-13562ff547b2/proj%20B/mytrunk@1 is not a valid revision identifier
181 [255]
171
182
172 Test stop revision
183 Test stop revision
173 $ hg convert --rev 1 "$SVNREPOURL/proj%20B/mytrunk" stoprev
184 $ hg convert --rev 1 "$SVNREPOURL/proj%20B/mytrunk" stoprev
General Comments 0
You need to be logged in to leave comments. Login now