Mercurial > hgsubversion
comparison tests/test_fetch_renames.py @ 513:5c8a48828ae9
test renames: remove redundant code
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Thu, 24 Dec 2009 14:46:03 -0600 |
parents | 5e0dfe59d4c3 |
children | d2ef7220a079 |
comparison
equal
deleted
inserted
replaced
512:c421e6bf0d95 | 513:5c8a48828ae9 |
---|---|
3 | 3 |
4 import test_util | 4 import test_util |
5 | 5 |
6 | 6 |
7 class TestFetchRenames(test_util.TestBase): | 7 class TestFetchRenames(test_util.TestBase): |
8 def _load_fixture_and_fetch(self, fixture_name, stupid): | |
9 return test_util.load_fixture_and_fetch(fixture_name, self.repo_path, | |
10 self.wc_path, stupid=stupid) | |
11 | |
12 def _debug_print_copies(self, repo): | 8 def _debug_print_copies(self, repo): |
13 w = sys.stderr.write | 9 w = sys.stderr.write |
14 for rev in repo: | 10 for rev in repo: |
15 ctx = repo[rev] | 11 ctx = repo[rev] |
16 w('%d - %s\n' % (ctx.rev(), ctx.branch())) | 12 w('%d - %s\n' % (ctx.rev(), ctx.branch())) |
17 for f in ctx: | 13 for f in ctx: |
18 fctx = ctx[f] | 14 fctx = ctx[f] |
19 w('%s: %r %r\n' % (f, fctx.data(), fctx.renamed())) | 15 w('%s: %r %r\n' % (f, fctx.data(), fctx.renamed())) |
20 | 16 |
21 def _test_rename(self, stupid): | 17 def _test_rename(self, stupid): |
22 repo = self._load_fixture_and_fetch('renames.svndump', stupid) | 18 repo = self._load_fixture_and_fetch('renames.svndump', stupid=stupid) |
23 # self._debug_print_copies(repo) | 19 # self._debug_print_copies(repo) |
24 | 20 |
25 # Map revnum to mappings of dest name to (source name, dest content) | 21 # Map revnum to mappings of dest name to (source name, dest content) |
26 copies = { | 22 copies = { |
27 4: { | 23 4: { |
63 | 59 |
64 def test_rename_stupid(self): | 60 def test_rename_stupid(self): |
65 self._test_rename(True) | 61 self._test_rename(True) |
66 | 62 |
67 def _test_case(self, stupid): | 63 def _test_case(self, stupid): |
68 repo = self._load_fixture_and_fetch('filecase.svndump', stupid) | 64 repo = self._load_fixture_and_fetch('filecase.svndump', stupid=stupid) |
69 files = { | 65 files = { |
70 0: ['A', 'a', 'e/a', 'b', 'd/a', 'D/a', 'f/a', 'F'], | 66 0: ['A', 'a', 'e/a', 'b', 'd/a', 'D/a', 'f/a', 'F'], |
71 1: ['A', 'a', 'E/a', 'B', 'd/A', 'D/a', 'f/a', 'F'], | 67 1: ['A', 'a', 'E/a', 'B', 'd/A', 'D/a', 'f/a', 'F'], |
72 } | 68 } |
73 for rev in repo: | 69 for rev in repo: |