Mercurial > hgsubversion
comparison tests/test_fetch_mappings.py @ 735:c2b9e08ecf10
maps: map a missing author to '(no author)'
"None" doesn't really make much sense, so we use what 'svn log' shows
instead. This also fixes mapping this author to something else.
| author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
|---|---|
| date | Sat, 09 Oct 2010 16:20:52 -0500 |
| parents | 467b95348e6a |
| children | 13a2137d3c15 |
comparison
equal
deleted
inserted
replaced
| 734:e24fb3e27ec9 | 735:c2b9e08ecf10 |
|---|---|
| 62 self.assertEqual(self.repo['tip'].user(), | 62 self.assertEqual(self.repo['tip'].user(), |
| 63 'Testy <test@test>') | 63 'Testy <test@test>') |
| 64 | 64 |
| 65 def test_author_map_closing_author_stupid(self): | 65 def test_author_map_closing_author_stupid(self): |
| 66 self.test_author_map_closing_author(True) | 66 self.test_author_map_closing_author(True) |
| 67 | |
| 68 def test_author_map_no_author(self, stupid=False): | |
| 69 self._load_fixture_and_fetch('no-author.svndump') | |
| 70 users = set(self.repo[r].user() for r in self.repo) | |
| 71 expected_users = ['(no author)@%s' % self.repo.svnmeta().uuid] | |
| 72 self.assertEqual(sorted(users), expected_users) | |
| 73 test_util.rmtree(self.wc_path) | |
| 74 | |
| 75 authormap = open(self.authors, 'w') | |
| 76 authormap.write("(no author)=Testy <test@example.com>") | |
| 77 authormap.close() | |
| 78 ui = self.ui(stupid) | |
| 79 ui.setconfig('hgsubversion', 'authormap', self.authors) | |
| 80 commands.clone(ui, test_util.fileurl(self.repo_path), | |
| 81 self.wc_path, authors=self.authors) | |
| 82 users = set(self.repo[r].user() for r in self.repo) | |
| 83 expected_users = ['Testy <test@example.com>'] | |
| 84 self.assertEqual(sorted(users), expected_users) | |
| 85 | |
| 86 def test_author_map_no_author_stupid(self): | |
| 87 self.test_author_map_no_author(True) | |
| 67 | 88 |
| 68 def test_author_map_no_overwrite(self): | 89 def test_author_map_no_overwrite(self): |
| 69 cwd = os.path.dirname(__file__) | 90 cwd = os.path.dirname(__file__) |
| 70 orig = os.path.join(cwd, 'fixtures', 'author-map-test.txt') | 91 orig = os.path.join(cwd, 'fixtures', 'author-map-test.txt') |
| 71 new = open(self.authors, 'w') | 92 new = open(self.authors, 'w') |
