comparison tests/test_tags.py @ 536:460eb781d840

Handle subdirectory tags in stupid mode (issue119) Current solution add an alternate behaviour to svnmeta.split_branch_path(), which unfortunately looks like the expected behaviour. Other calls will be changed to make it the default behaviour.
author Patrick Mezard <pmezard@gmail.com>
date Sat, 30 Jan 2010 10:01:03 +0100
parents 76e9504db03b
children d380e7e4175a
comparison
equal deleted inserted replaced
535:715d2e3e153b 536:460eb781d840
233 expected = expected.splitlines() 233 expected = expected.splitlines()
234 output = output.splitlines() 234 output = output.splitlines()
235 diff = difflib.unified_diff(expected, output, 'expected', 'output') 235 diff = difflib.unified_diff(expected, output, 'expected', 'output')
236 self.assert_(False, '\n' + '\n'.join(diff)) 236 self.assert_(False, '\n' + '\n'.join(diff))
237 237
238 def test_tagging_into_tag(self, expected=None, stupid=False): 238 def test_tagging_into_tag(self, stupid=False):
239 expected = """\ 239 expected = """\
240 node: hg=test@2:svn=branches/test@4 240 node: hg=test@2:svn=branches/test@4
241 First tag. 241 First tag.
242 test-0.1: hg=test@1:svn=branches/test@3 242 test-0.1: hg=test@1:svn=branches/test@3
243 243
244 node: hg=test@3:svn=branches/test@5 244 node: hg=test@3:svn=branches/test@5
245 Weird tag. 245 Weird tag.
246 test-0.1: hg=test@1:svn=branches/test@3 246 test-0.1: hg=test@1:svn=branches/test@3
247 test-0.1/test: hg=test@1:svn=branches/test@3 247 test-0.1/test: hg=test@1:svn=branches/test@3
248 """ 248 """
249 self._test_tags('renametagdir.svndump', expected) 249 self._test_tags('renametagdir.svndump', expected, stupid=stupid)
250 250
251 def test_tagging_into_tag_stupid(self): 251 def test_tagging_into_tag_stupid(self):
252 # This test exposed existing flaws with tag handling in stupid mode. 252 self.test_tagging_into_tag(True)
253 # They will be resolved in the future.
254 expected = """\
255 node: hg=test@2:svn=branches/test@4
256 First tag.
257 test-0.1: hg=test@1:svn=branches/test@3
258
259 node: hg=test@4:svn=branches/test@4
260 Weird tag.
261 test-0.1: hg=test@1:svn=branches/test@3
262 test-0.1: hg=test@3:svn=tags/test-0.1@5
263
264 node: hg=test@5:svn=branches/test@5
265 Weird tag.
266 test-0.1: hg=test@1:svn=branches/test@3
267 test-0.1: hg=test@3:svn=tags/test-0.1@5
268 test-0.1/test: hg=test@1:svn=branches/test@3
269 """
270 self._test_tags('renametagdir.svndump', expected, True)
271 253
272 254
273 def suite(): 255 def suite():
274 return unittest.TestLoader().loadTestsFromTestCase(TestTags) 256 return unittest.TestLoader().loadTestsFromTestCase(TestTags)