comparison tests/test_fetch_renames.py @ 1106:5cb6c95e0283 stable

Merge default and stable so I can do stable releases again.
author Augie Fackler <raf@durin42.com>
date Tue, 11 Feb 2014 12:48:49 -0500
parents dc516f85b6c3
children 0d0132cba155
comparison
equal deleted inserted replaced
1020:b5b1fce26f1f 1106:5cb6c95e0283
2 2
3 import sys 3 import sys
4 import unittest 4 import unittest
5 5
6 class TestFetchRenames(test_util.TestBase): 6 class TestFetchRenames(test_util.TestBase):
7 stupid_mode_tests = True
8
7 def _debug_print_copies(self, repo): 9 def _debug_print_copies(self, repo):
8 w = sys.stderr.write 10 w = sys.stderr.write
9 for rev in repo: 11 for rev in repo:
10 ctx = repo[rev] 12 ctx = repo[rev]
11 w('%d - %s\n' % (ctx.rev(), ctx.branch())) 13 w('%d - %s\n' % (ctx.rev(), ctx.branch()))
12 for f in ctx: 14 for f in ctx:
13 fctx = ctx[f] 15 fctx = ctx[f]
14 w('%s: %r %r\n' % (f, fctx.data(), fctx.renamed())) 16 w('%s: %r %r\n' % (f, fctx.data(), fctx.renamed()))
15 17
16 def _test_rename(self, stupid): 18 def test_rename(self):
17 config = { 19 config = {
18 'hgsubversion.filestoresize': '0', 20 'hgsubversion.filestoresize': '0',
19 } 21 }
20 repo = self._load_fixture_and_fetch('renames.svndump', stupid=stupid, 22 repo = self._load_fixture_and_fetch('renames.svndump', config=config)
21 config=config)
22 23
23 # Map revnum to mappings of dest name to (source name, dest content) 24 # Map revnum to mappings of dest name to (source name, dest content)
24 copies = { 25 copies = {
25 4: { 26 4: {
26 'a1': ('a', 'a\n'), 27 'a1': ('a', 'a\n'),
54 self.assertEqual(cp[0], copymap[f][0]) 55 self.assertEqual(cp[0], copymap[f][0])
55 self.assertEqual(ctx[f].data(), copymap[f][1]) 56 self.assertEqual(ctx[f].data(), copymap[f][1])
56 57
57 self.assertEqual(repo['tip']['changed3'].data(), 'changed\nchanged3\n') 58 self.assertEqual(repo['tip']['changed3'].data(), 'changed\nchanged3\n')
58 59
59 def test_rename(self): 60 def test_case(self):
60 self._test_rename(False) 61 repo = self._load_fixture_and_fetch('filecase.svndump')
61
62 def test_rename_stupid(self):
63 self._test_rename(True)
64
65 def _test_case(self, stupid):
66 repo = self._load_fixture_and_fetch('filecase.svndump', stupid=stupid)
67 files = { 62 files = {
68 0: ['A', 'a', 'e/a', 'b', 'd/a', 'D/a', 'f/a', 'F'], 63 0: ['A', 'a', 'e/a', 'b', 'd/a', 'D/a', 'f/a', 'F'],
69 1: ['A', 'a', 'E/a', 'B', 'd/A', 'D/a', 'f/a', 'F'], 64 1: ['A', 'a', 'E/a', 'B', 'd/A', 'D/a', 'f/a', 'F'],
70 } 65 }
71 for rev in repo: 66 for rev in repo:
72 self.assertEqual(sorted(files[rev]), sorted(repo[rev].manifest())) 67 self.assertEqual(sorted(files[rev]), sorted(repo[rev].manifest()))
73
74 def test_case(self):
75 self._test_case(False)
76
77 def test_case_stupid(self):
78 self._test_case(True)
79
80 def suite():
81 all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestFetchRenames),
82 ]
83 return unittest.TestSuite(all_tests)