Mercurial > hgsubversion
comparison tests/test_fetch_mappings.py @ 179:a336e3e82648
Fetch: add a filemap argument for use in converting old repositories to
Mercurial.
author | Graham Booker <gbooker@cod3r.com> |
---|---|
date | Sat, 03 Jan 2009 20:15:03 -0600 |
parents | 4f26fa049452 |
children | 907c160c6289 |
comparison
equal
deleted
inserted
replaced
178:33ebdcb75bcd | 179:a336e3e82648 |
---|---|
2 """ | 2 """ |
3 import os | 3 import os |
4 import unittest | 4 import unittest |
5 | 5 |
6 from mercurial import ui | 6 from mercurial import ui |
7 from mercurial import node | |
7 | 8 |
8 import test_util | 9 import test_util |
9 import fetch_command | 10 import fetch_command |
10 | 11 |
11 class MapTests(test_util.TestBase): | 12 class MapTests(test_util.TestBase): |
50 self.assertEqual(self.repo['tip'].user(), | 51 self.assertEqual(self.repo['tip'].user(), |
51 'Testy <test@test>') | 52 'Testy <test@test>') |
52 | 53 |
53 def test_author_map_closing_author_stupid(self): | 54 def test_author_map_closing_author_stupid(self): |
54 self.test_author_map_closing_author(True) | 55 self.test_author_map_closing_author(True) |
56 | |
57 def test_file_map(self, stupid=False): | |
58 test_util.load_svndump_fixture(self.repo_path, 'replace_trunk_with_branch.svndump') | |
59 filemap = open(self.filemap, 'w') | |
60 filemap.write("include alpha\n") | |
61 filemap.close() | |
62 fetch_command.fetch_revisions(ui.ui(), | |
63 svn_url=test_util.fileurl(self.repo_path), | |
64 hg_repo_path=self.wc_path, | |
65 stupid=stupid, | |
66 filemap=self.filemap) | |
67 self.assertEqual(node.hex(self.repo[0].node()), '88e2c7492d83e4bf30fbb2dcbf6aa24d60ac688d') | |
68 self.assertEqual(node.hex(self.repo['default'].node()), 'e524296152246b3837fe9503c83b727075835155') | |
69 | |
70 def test_file_map_stupid(self): | |
71 self.test_file_map(True) | |
72 | |
73 def test_file_map_exclude(self, stupid=False): | |
74 test_util.load_svndump_fixture(self.repo_path, 'replace_trunk_with_branch.svndump') | |
75 filemap = open(self.filemap, 'w') | |
76 filemap.write("exclude alpha\n") | |
77 filemap.close() | |
78 fetch_command.fetch_revisions(ui.ui(), | |
79 svn_url=test_util.fileurl(self.repo_path), | |
80 hg_repo_path=self.wc_path, | |
81 stupid=stupid, | |
82 filemap=self.filemap) | |
83 self.assertEqual(node.hex(self.repo[0].node()), '2c48f3525926ab6c8b8424bcf5eb34b149b61841') | |
84 self.assertEqual(node.hex(self.repo['default'].node()), '86fc12d173716139d5bd1d36866038d355009f45') | |
85 | |
86 def test_file_map_exclude_stupid(self): | |
87 self.test_file_map_exclude(True) | |
55 | 88 |
56 | 89 |
57 def suite(): | 90 def suite(): |
58 return unittest.TestLoader().loadTestsFromTestCase(MapTests) | 91 return unittest.TestLoader().loadTestsFromTestCase(MapTests) |