Mercurial > hgsubversion
comparison tests/test_externals.py @ 795:6f0b0a47938c
test_externals: flag another case as using hgsub, use assertMultiLineEqual
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Wed, 23 Mar 2011 22:21:06 -0500 |
parents | ba65c0b01d4f |
children | e9af7eba88db |
comparison
equal
deleted
inserted
replaced
794:c32c92fdca5b | 795:6f0b0a47938c |
---|---|
78 repo = self._load_fixture_and_fetch('externals.svndump', stupid=stupid) | 78 repo = self._load_fixture_and_fetch('externals.svndump', stupid=stupid) |
79 | 79 |
80 ref0 = """[.] | 80 ref0 = """[.] |
81 ^/externals/project1 deps/project1 | 81 ^/externals/project1 deps/project1 |
82 """ | 82 """ |
83 self.assertEqual(ref0, repo[0]['.hgsvnexternals'].data()) | 83 self.assertMultiLineEqual(ref0, repo[0]['.hgsvnexternals'].data()) |
84 ref1 = """\ | 84 ref1 = """\ |
85 [.] | 85 [.] |
86 # A comment, then an empty line, then a blank line | 86 # A comment, then an empty line, then a blank line |
87 | 87 |
88 ^/externals/project1 deps/project1 | 88 ^/externals/project1 deps/project1 |
89 | 89 |
90 -r2 ^/externals/project2@2 deps/project2 | 90 -r2 ^/externals/project2@2 deps/project2 |
91 """ | 91 """ |
92 self.assertEqual(ref1, repo[1]['.hgsvnexternals'].data()) | 92 self.assertMultiLineEqual(ref1, repo[1]['.hgsvnexternals'].data()) |
93 | 93 |
94 ref2 = """[.] | 94 ref2 = """[.] |
95 -r2 ^/externals/project2@2 deps/project2 | 95 -r2 ^/externals/project2@2 deps/project2 |
96 [subdir] | 96 [subdir] |
97 ^/externals/project1 deps/project1 | 97 ^/externals/project1 deps/project1 |
151 checkdeps(['subdir/deps/project1', 'deps/project2'], | 151 checkdeps(['subdir/deps/project1', 'deps/project2'], |
152 ['subdir2/deps/project1'], repo, 3) | 152 ['subdir2/deps/project1'], repo, 3) |
153 checkdeps(['subdir/deps/project1'], ['deps/project2'], repo, 4) | 153 checkdeps(['subdir/deps/project1'], ['deps/project2'], repo, 4) |
154 | 154 |
155 def test_hgsub(self, stupid=False): | 155 def test_hgsub(self, stupid=False): |
156 if subrepo is None: | |
157 return | |
156 repo = self._load_fixture_and_fetch('externals.svndump', | 158 repo = self._load_fixture_and_fetch('externals.svndump', |
157 externals='subrepos', | 159 externals='subrepos', |
158 stupid=stupid) | 160 stupid=stupid) |
159 self.assertEqual("""\ | 161 self.assertEqual("""\ |
160 deps/project1 = [hgsubversion] :^/externals/project1 deps/project1 | 162 deps/project1 = [hgsubversion] :^/externals/project1 deps/project1 |
181 2 deps/project2 | 183 2 deps/project2 |
182 HEAD subdir/deps/project1 | 184 HEAD subdir/deps/project1 |
183 HEAD subdir2/deps/project1 | 185 HEAD subdir2/deps/project1 |
184 """, repo[2]['.hgsubstate'].data()) | 186 """, repo[2]['.hgsubstate'].data()) |
185 | 187 |
186 self.assertEqual("""\ | 188 self.assertMultiLineEqual("""\ |
187 deps/project2 = [hgsubversion] :-r{REV} ^/externals/project2@2 deps/project2 | 189 deps/project2 = [hgsubversion] :-r{REV} ^/externals/project2@2 deps/project2 |
188 subdir/deps/project1 = [hgsubversion] subdir:^/externals/project1 deps/project1 | 190 subdir/deps/project1 = [hgsubversion] subdir:^/externals/project1 deps/project1 |
189 """, repo[3]['.hgsub'].data()) | 191 """, repo[3]['.hgsub'].data()) |
190 self.assertEqual("""\ | 192 self.assertEqual("""\ |
191 2 deps/project2 | 193 2 deps/project2 |
257 # Test update --clean, used to crash | 259 # Test update --clean, used to crash |
258 repo.wwrite('subdir/deps/project1/a', 'foobar', '') | 260 repo.wwrite('subdir/deps/project1/a', 'foobar', '') |
259 commands.update(ui, repo, node='4', clean=True) | 261 commands.update(ui, repo, node='4', clean=True) |
260 | 262 |
261 def test_mergeexternals(self, stupid=False): | 263 def test_mergeexternals(self, stupid=False): |
264 if subrepo is None: | |
265 return | |
262 repo = self._load_fixture_and_fetch('mergeexternals.svndump', | 266 repo = self._load_fixture_and_fetch('mergeexternals.svndump', |
263 externals='subrepos', | 267 externals='subrepos', |
264 stupid=stupid) | 268 stupid=stupid) |
265 # Check merged directories externals are fine | 269 # Check merged directories externals are fine |
266 self.assertEqual("""\ | 270 self.assertEqual("""\ |