comparison tests/test_externals.py @ 315:963d27a0b1c2

svnexternals: do not use peg revisions as --rev replacements Peg revisions are now parsed separately. If a revision is supplied but not a peg revision, we used the former as peg revision, as subversion seems to do.
author Patrick Mezard <pmezard@gmail.com>
date Sun, 03 May 2009 21:42:44 -0500
parents ba8e91a7c077
children 46e69be8e2c8
comparison
equal deleted inserted replaced
314:2257bfc01749 315:963d27a0b1c2
31 31
32 def test_parsedefinitions(self): 32 def test_parsedefinitions(self):
33 # Taken from svn book 33 # Taken from svn book
34 samples = [ 34 samples = [
35 ('third-party/sounds http://svn.example.com/repos/sounds', 35 ('third-party/sounds http://svn.example.com/repos/sounds',
36 ('third-party/sounds', None, 'http://svn.example.com/repos/sounds')), 36 ('third-party/sounds', None, 'http://svn.example.com/repos/sounds', None)),
37 ('third-party/skins -r148 http://svn.example.com/skinproj', 37 ('third-party/skins -r148 http://svn.example.com/skinproj',
38 ('third-party/skins', '148', 'http://svn.example.com/skinproj')), 38 ('third-party/skins', '148', 'http://svn.example.com/skinproj', None)),
39 ('third-party/skins -r 148 http://svn.example.com/skinproj', 39 ('third-party/skins -r 148 http://svn.example.com/skinproj',
40 ('third-party/skins', '148', 'http://svn.example.com/skinproj')), 40 ('third-party/skins', '148', 'http://svn.example.com/skinproj', None)),
41 ('http://svn.example.com/repos/sounds third-party/sounds', 41 ('http://svn.example.com/repos/sounds third-party/sounds',
42 ('third-party/sounds', None, 'http://svn.example.com/repos/sounds')), 42 ('third-party/sounds', None, 'http://svn.example.com/repos/sounds', None)),
43 ('-r148 http://svn.example.com/skinproj third-party/skins', 43 ('-r148 http://svn.example.com/skinproj third-party/skins',
44 ('third-party/skins', '148', 'http://svn.example.com/skinproj')), 44 ('third-party/skins', '148', 'http://svn.example.com/skinproj', None)),
45 ('-r 148 http://svn.example.com/skinproj third-party/skins', 45 ('-r 148 http://svn.example.com/skinproj third-party/skins',
46 ('third-party/skins', '148', 'http://svn.example.com/skinproj')), 46 ('third-party/skins', '148', 'http://svn.example.com/skinproj', None)),
47 ('http://svn.example.com/skin-maker@21 third-party/skins/toolkit', 47 ('http://svn.example.com/skin-maker@21 third-party/skins/toolkit',
48 ('third-party/skins/toolkit', '21', 'http://svn.example.com/skin-maker')), 48 ('third-party/skins/toolkit', None, 'http://svn.example.com/skin-maker', '21')),
49 ] 49 ]
50 50
51 for line, expected in samples: 51 for line, expected in samples:
52 self.assertEqual(expected, svnexternals.parsedefinition(line)) 52 self.assertEqual(expected, svnexternals.parsedefinition(line))
53 53
58 ^/externals/project1 deps/project1 58 ^/externals/project1 deps/project1
59 """ 59 """
60 self.assertEqual(ref0, repo[0]['.hgsvnexternals'].data()) 60 self.assertEqual(ref0, repo[0]['.hgsvnexternals'].data())
61 ref1 = """[.] 61 ref1 = """[.]
62 ^/externals/project1 deps/project1 62 ^/externals/project1 deps/project1
63 ^/externals/project2 deps/project2 63 -r2 ^/externals/project2@2 deps/project2
64 """ 64 """
65 self.assertEqual(ref1, repo[1]['.hgsvnexternals'].data()) 65 self.assertEqual(ref1, repo[1]['.hgsvnexternals'].data())
66 66
67 ref2 = """[.] 67 ref2 = """[.]
68 ^/externals/project2 deps/project2 68 -r2 ^/externals/project2@2 deps/project2
69 [subdir] 69 [subdir]
70 ^/externals/project1 deps/project1 70 ^/externals/project1 deps/project1
71 [subdir2] 71 [subdir2]
72 ^/externals/project1 deps/project1 72 ^/externals/project1 deps/project1
73 """ 73 """
74 actual = repo[2]['.hgsvnexternals'].data() 74 actual = repo[2]['.hgsvnexternals'].data()
75 self.assertEqual(ref2, actual) 75 self.assertEqual(ref2, actual)
76 76
77 ref3 = """[.] 77 ref3 = """[.]
78 ^/externals/project2 deps/project2 78 -r2 ^/externals/project2@2 deps/project2
79 [subdir] 79 [subdir]
80 ^/externals/project1 deps/project1 80 ^/externals/project1 deps/project1
81 """ 81 """
82 self.assertEqual(ref3, repo[3]['.hgsvnexternals'].data()) 82 self.assertEqual(ref3, repo[3]['.hgsvnexternals'].data())
83 83
85 ^/externals/project1 deps/project1 85 ^/externals/project1 deps/project1
86 """ 86 """
87 self.assertEqual(ref4, repo[4]['.hgsvnexternals'].data()) 87 self.assertEqual(ref4, repo[4]['.hgsvnexternals'].data())
88 88
89 ref5 = """[.] 89 ref5 = """[.]
90 ^/externals/project2 deps/project2 90 -r2 ^/externals/project2@2 deps/project2
91 [subdir2] 91 [subdir2]
92 ^/externals/project1 deps/project1 92 ^/externals/project1 deps/project1
93 """ 93 """
94 self.assertEqual(ref5, repo[5]['.hgsvnexternals'].data()) 94 self.assertEqual(ref5, repo[5]['.hgsvnexternals'].data())
95 95
96 ref6 = """[.] 96 ref6 = """[.]
97 ^/externals/project2 deps/project2 97 -r2 ^/externals/project2@2 deps/project2
98 """ 98 """
99 self.assertEqual(ref6, repo[6]['.hgsvnexternals'].data()) 99 self.assertEqual(ref6, repo[6]['.hgsvnexternals'].data())
100 100
101 def test_externals_stupid(self): 101 def test_externals_stupid(self):
102 self.test_externals(True) 102 self.test_externals(True)