Mercurial > hgsubversion
diff tests/test_fetch_mappings.py @ 866:20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
author | Patrick Mezard <patrick@mezard.eu> |
---|---|
date | Thu, 19 Apr 2012 18:29:28 +0200 |
parents | 4e203a47102a |
children | 50c13e01c7e3 |
line wrap: on
line diff
--- a/tests/test_fetch_mappings.py +++ b/tests/test_fetch_mappings.py @@ -32,14 +32,14 @@ class MapTests(test_util.TestBase): return os.path.join(self.tmpdir, 'tagmap') def test_author_map(self, stupid=False): - test_util.load_svndump_fixture(self.repo_path, 'replace_trunk_with_branch.svndump') + repo_path = self.load_svndump('replace_trunk_with_branch.svndump') authormap = open(self.authors, 'w') authormap.write('Augie=Augie Fackler <durin42@gmail.com> # stuffy\n') authormap.write("Augie Fackler <durin42@gmail.com>\n") authormap.close() ui = self.ui(stupid) ui.setconfig('hgsubversion', 'authormap', self.authors) - commands.clone(ui, test_util.fileurl(self.repo_path), + commands.clone(ui, test_util.fileurl(repo_path), self.wc_path, authors=self.authors) self.assertEqual(self.repo[0].user(), 'Augie Fackler <durin42@gmail.com>') @@ -50,13 +50,13 @@ class MapTests(test_util.TestBase): self.test_author_map(True) def test_author_map_closing_author(self, stupid=False): - test_util.load_svndump_fixture(self.repo_path, 'replace_trunk_with_branch.svndump') + repo_path = self.load_svndump('replace_trunk_with_branch.svndump') authormap = open(self.authors, 'w') authormap.write("evil=Testy <test@test>") authormap.close() ui = self.ui(stupid) ui.setconfig('hgsubversion', 'authormap', self.authors) - commands.clone(ui, test_util.fileurl(self.repo_path), + commands.clone(ui, test_util.fileurl(repo_path), self.wc_path, authors=self.authors) self.assertEqual(self.repo[0].user(), 'Augie@5b65bade-98f3-4993-a01f-b7a6710da339') @@ -100,13 +100,13 @@ class MapTests(test_util.TestBase): self.assertEqual(fromself.symmetric_difference(all_tests), set()) def test_file_map(self, stupid=False): - test_util.load_svndump_fixture(self.repo_path, 'replace_trunk_with_branch.svndump') + repo_path = self.load_svndump('replace_trunk_with_branch.svndump') filemap = open(self.filemap, 'w') filemap.write("include alpha\n") filemap.close() ui = self.ui(stupid) ui.setconfig('hgsubversion', 'filemap', self.filemap) - commands.clone(ui, test_util.fileurl(self.repo_path), + commands.clone(ui, test_util.fileurl(repo_path), self.wc_path, filemap=self.filemap) self.assertEqual(node.hex(self.repo[0].node()), '88e2c7492d83e4bf30fbb2dcbf6aa24d60ac688d') self.assertEqual(node.hex(self.repo['default'].node()), 'e524296152246b3837fe9503c83b727075835155') @@ -116,13 +116,13 @@ class MapTests(test_util.TestBase): self.assertRaises(hgutil.Abort, self.test_file_map, True) def test_file_map_exclude(self, stupid=False): - test_util.load_svndump_fixture(self.repo_path, 'replace_trunk_with_branch.svndump') + repo_path = self.load_svndump('replace_trunk_with_branch.svndump') filemap = open(self.filemap, 'w') filemap.write("exclude alpha\n") filemap.close() ui = self.ui(stupid) ui.setconfig('hgsubversion', 'filemap', self.filemap) - commands.clone(ui, test_util.fileurl(self.repo_path), + commands.clone(ui, test_util.fileurl(repo_path), self.wc_path, filemap=self.filemap) self.assertEqual(node.hex(self.repo[0].node()), '2c48f3525926ab6c8b8424bcf5eb34b149b61841') self.assertEqual(node.hex(self.repo['default'].node()), 'b37a3c0297b71f989064d9b545b5a478bbed7cc1') @@ -132,7 +132,7 @@ class MapTests(test_util.TestBase): self.assertRaises(hgutil.Abort, self.test_file_map_exclude, True) def test_file_map_rule_order(self): - test_util.load_svndump_fixture(self.repo_path, 'replace_trunk_with_branch.svndump') + repo_path = self.load_svndump('replace_trunk_with_branch.svndump') filemap = open(self.filemap, 'w') filemap.write("exclude alpha\n") filemap.write("include .\n") @@ -140,7 +140,7 @@ class MapTests(test_util.TestBase): filemap.close() ui = self.ui(False) ui.setconfig('hgsubversion', 'filemap', self.filemap) - commands.clone(ui, test_util.fileurl(self.repo_path), + commands.clone(ui, test_util.fileurl(repo_path), self.wc_path, filemap=self.filemap) # The exclusion of alpha is overridden by the later rule to # include all of '.', whereas gamma should remain excluded @@ -151,14 +151,14 @@ class MapTests(test_util.TestBase): ['alpha', 'beta']) def test_branchmap(self, stupid=False): - test_util.load_svndump_fixture(self.repo_path, 'branchmap.svndump') + repo_path = self.load_svndump('branchmap.svndump') branchmap = open(self.branchmap, 'w') branchmap.write("badname = good-name # stuffy\n") branchmap.write("feature = default\n") branchmap.close() ui = self.ui(stupid) ui.setconfig('hgsubversion', 'branchmap', self.branchmap) - commands.clone(ui, test_util.fileurl(self.repo_path), + commands.clone(ui, test_util.fileurl(repo_path), self.wc_path, branchmap=self.branchmap) branches = set(self.repo[i].branch() for i in self.repo) self.assert_('badname' not in branches) @@ -170,13 +170,13 @@ class MapTests(test_util.TestBase): def test_branchmap_tagging(self, stupid=False): '''test tagging a renamed branch, which used to raise an exception''' - test_util.load_svndump_fixture(self.repo_path, 'commit-to-tag.svndump') + repo_path = self.load_svndump('commit-to-tag.svndump') branchmap = open(self.branchmap, 'w') branchmap.write("magic = art\n") branchmap.close() ui = self.ui(stupid) ui.setconfig('hgsubversion', 'branchmap', self.branchmap) - commands.clone(ui, test_util.fileurl(self.repo_path), + commands.clone(ui, test_util.fileurl(repo_path), self.wc_path, branchmap=self.branchmap) branches = set(self.repo[i].branch() for i in self.repo) self.assertEquals(sorted(branches), ['art', 'closeme']) @@ -186,13 +186,13 @@ class MapTests(test_util.TestBase): def test_branchmap_empty_commit(self, stupid=False): '''test mapping an empty commit on a renamed branch''' - test_util.load_svndump_fixture(self.repo_path, 'propset-branch.svndump') + repo_path = self.load_svndump('propset-branch.svndump') branchmap = open(self.branchmap, 'w') branchmap.write("the-branch = bob\n") branchmap.close() ui = self.ui(stupid) ui.setconfig('hgsubversion', 'branchmap', self.branchmap) - commands.clone(ui, test_util.fileurl(self.repo_path), + commands.clone(ui, test_util.fileurl(repo_path), self.wc_path, branchmap=self.branchmap) branches = set(self.repo[i].branch() for i in self.repo) self.assertEquals(sorted(branches), ['bob', 'default']) @@ -203,14 +203,14 @@ class MapTests(test_util.TestBase): def test_branchmap_combine(self, stupid=False): '''test combining two branches, but retaining heads''' - test_util.load_svndump_fixture(self.repo_path, 'branchmap.svndump') + repo_path = self.load_svndump('branchmap.svndump') branchmap = open(self.branchmap, 'w') branchmap.write("badname = default\n") branchmap.write("feature = default\n") branchmap.close() ui = self.ui(stupid) ui.setconfig('hgsubversion', 'branchmap', self.branchmap) - commands.clone(ui, test_util.fileurl(self.repo_path), + commands.clone(ui, test_util.fileurl(repo_path), self.wc_path, branchmap=self.branchmap) branches = set(self.repo[i].branch() for i in self.repo) self.assertEquals(sorted(branches), ['default']) @@ -228,14 +228,14 @@ class MapTests(test_util.TestBase): def test_branchmap_rebuildmeta(self, stupid=False): '''test rebuildmeta on a branchmapped clone''' - test_util.load_svndump_fixture(self.repo_path, 'branchmap.svndump') + repo_path = self.load_svndump('branchmap.svndump') branchmap = open(self.branchmap, 'w') branchmap.write("badname = dit\n") branchmap.write("feature = dah\n") branchmap.close() ui = self.ui(stupid) ui.setconfig('hgsubversion', 'branchmap', self.branchmap) - commands.clone(ui, test_util.fileurl(self.repo_path), + commands.clone(ui, test_util.fileurl(repo_path), self.wc_path, branchmap=self.branchmap) originfo = self.repo.svnmeta().branches @@ -244,7 +244,7 @@ class MapTests(test_util.TestBase): src, dest = test_util.hgclone(ui, self.wc_path, self.wc_path + '_clone', update=False) svncommands.rebuildmeta(ui, dest, - args=[test_util.fileurl(self.repo_path)]) + args=[test_util.fileurl(repo_path)]) # just check the keys; assume the contents are unaffected by the branch # map and thus properly tested by other tests @@ -257,14 +257,14 @@ class MapTests(test_util.TestBase): def test_branchmap_verify(self, stupid=False): '''test verify on a branchmapped clone''' - test_util.load_svndump_fixture(self.repo_path, 'branchmap.svndump') + repo_path = self.load_svndump('branchmap.svndump') branchmap = open(self.branchmap, 'w') branchmap.write("badname = dit\n") branchmap.write("feature = dah\n") branchmap.close() ui = self.ui(stupid) ui.setconfig('hgsubversion', 'branchmap', self.branchmap) - commands.clone(ui, test_util.fileurl(self.repo_path), + commands.clone(ui, test_util.fileurl(repo_path), self.wc_path, branchmap=self.branchmap) repo = self.repo @@ -283,7 +283,7 @@ class MapTests(test_util.TestBase): is to not convert the 'this' branches. Until we can do that, we settle with aborting. ''' - test_util.load_svndump_fixture(self.repo_path, 'propset-branch.svndump') + repo_path = self.load_svndump('propset-branch.svndump') branchmap = open(self.branchmap, 'w') branchmap.write("closeme =\n") branchmap.close() @@ -291,8 +291,7 @@ class MapTests(test_util.TestBase): maps.BranchMap, self.ui(), self.branchmap) def test_tagmap(self, stupid=False): - test_util.load_svndump_fixture(self.repo_path, - 'basic_tag_tests.svndump') + repo_path = self.load_svndump('basic_tag_tests.svndump') tagmap = open(self.tagmap, 'w') tagmap.write("tag_r3 = 3.x # stuffy\n") tagmap.write("copied_tag = \n") @@ -300,7 +299,7 @@ class MapTests(test_util.TestBase): ui = self.ui(stupid) ui.setconfig('hgsubversion', 'tagmap', self.tagmap) - commands.clone(ui, test_util.fileurl(self.repo_path), + commands.clone(ui, test_util.fileurl(repo_path), self.wc_path, tagmap=self.tagmap) tags = self.repo.tags() assert 'tag_r3' not in tags @@ -311,8 +310,7 @@ class MapTests(test_util.TestBase): self.test_tagmap(True) def test_tagren_changed(self, stupid=False): - test_util.load_svndump_fixture(self.repo_path, - 'commit-to-tag.svndump') + repo_path = self.load_svndump('commit-to-tag.svndump') tagmap = open(self.tagmap, 'w') tagmap.write("edit-at-create = edit-past\n") tagmap.write("also-edit = \n") @@ -321,7 +319,7 @@ class MapTests(test_util.TestBase): ui = self.ui(stupid) ui.setconfig('hgsubversion', 'tagmap', self.tagmap) - commands.clone(ui, test_util.fileurl(self.repo_path), + commands.clone(ui, test_util.fileurl(repo_path), self.wc_path, tagmap=self.tagmap) tags = self.repo.tags()