Mercurial > hgsubversion
comparison tests/test_utility_commands.py @ 199:91db8fc049b0
Add a genignore utility command that generates an hgignore file by scraping svn:ignore properties.
| author | Augie Fackler <durin42@gmail.com> |
|---|---|
| date | Tue, 24 Feb 2009 14:30:21 -0600 |
| parents | 906d3f302b45 |
| children | 4c3bad24f950 |
comparison
equal
deleted
inserted
replaced
| 198:df4611050286 | 199:91db8fc049b0 |
|---|---|
| 153 u = ui.ui() | 153 u = ui.ui() |
| 154 utility_commands.print_wc_url(u, self.repo, self.wc_path) | 154 utility_commands.print_wc_url(u, self.repo, self.wc_path) |
| 155 expected = test_util.fileurl(self.repo_path) + '\n' | 155 expected = test_util.fileurl(self.repo_path) + '\n' |
| 156 self.assertEqual(u.stream.getvalue(), expected) | 156 self.assertEqual(u.stream.getvalue(), expected) |
| 157 | 157 |
| 158 def test_genignore(self): | |
| 159 """Verify url gets normalized on initial clone. | |
| 160 """ | |
| 161 test_util.load_svndump_fixture(self.repo_path, 'ignores.svndump') | |
| 162 fetch_command.fetch_revisions(ui.ui(), | |
| 163 svn_url=test_util.fileurl(self.repo_path)+'/', | |
| 164 hg_repo_path=self.wc_path, | |
| 165 stupid=False) | |
| 166 hg.update(self.repo, 'tip') | |
| 167 u = ui.ui() | |
| 168 utility_commands.generate_ignore(u, self.repo, self.wc_path) | |
| 169 self.assertEqual(open(os.path.join(self.wc_path, '.hgignore')).read(), | |
| 170 '.hgignore\nsyntax:glob\nblah\notherblah\nbaz/magic\n') | |
| 171 | |
| 158 | 172 |
| 159 def suite(): | 173 def suite(): |
| 160 all = [unittest.TestLoader().loadTestsFromTestCase(UtilityTests), | 174 all = [unittest.TestLoader().loadTestsFromTestCase(UtilityTests), |
| 161 ] | 175 ] |
| 162 return unittest.TestSuite(all) | 176 return unittest.TestSuite(all) |
