Mercurial > hgsubversion
comparison tests/test_fetch_command.py @ 59:430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
changes that fix problems when trunk is not the oldest branch. Also includes
fixes for copying from a tag that we chose not to create (eg tagging a vendor
branch) and includes tests for all of those things.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Tue, 04 Nov 2008 16:38:16 -0600 |
parents | af7ac6c03452 |
children | e319c9168910 |
comparison
equal
deleted
inserted
replaced
58:a8b9c7e7c2ac | 59:430af23bef4a |
---|---|
107 def test_file_renamed_in_from_outside_btt(self): | 107 def test_file_renamed_in_from_outside_btt(self): |
108 repo = self._load_fixture_and_fetch( | 108 repo = self._load_fixture_and_fetch( |
109 'file_renamed_in_from_outside_btt.svndump') | 109 'file_renamed_in_from_outside_btt.svndump') |
110 self.assert_('LICENSE.file' in repo['tip']) | 110 self.assert_('LICENSE.file' in repo['tip']) |
111 | 111 |
112 def test_oldest_not_trunk_and_tag_vendor_branch(self): | |
113 repo = self._load_fixture_and_fetch( | |
114 'tagged_vendor_and_oldest_not_trunk.svndump') | |
115 self.assertEqual(node.hex(repo['oldest'].node()), | |
116 'd73002bcdeffe389a8df81ee43303d36e79e8ca4') | |
117 self.assertEqual(repo['tip'].parents()[0].parents()[0], | |
118 repo['oldest']) | |
119 self.assertEqual(node.hex(repo['tip'].node()), | |
120 '9cf09e6ff7fa938188c3bcc9dd87abd7842c080c') | |
121 #'1316ef606dda89354ee8c4df725e6264177b5129') | |
122 | |
123 | |
112 class TestStupidPull(unittest.TestCase): | 124 class TestStupidPull(unittest.TestCase): |
113 def setUp(self): | 125 def setUp(self): |
114 self.oldwd = os.getcwd() | 126 self.oldwd = os.getcwd() |
115 self.tmpdir = tempfile.mkdtemp('svnwrap_test') | 127 self.tmpdir = tempfile.mkdtemp('svnwrap_test') |
116 self.repo_path = '%s/testrepo' % self.tmpdir | 128 self.repo_path = '%s/testrepo' % self.tmpdir |
138 '9dfb0a19494f45c36e22f3c6d1b21d80638a7f6e') | 150 '9dfb0a19494f45c36e22f3c6d1b21d80638a7f6e') |
139 self.assertEqual(len(repo['tip'].parents()), 1) | 151 self.assertEqual(len(repo['tip'].parents()), 1) |
140 self.assertEqual(repo['tip'], repo['default']) | 152 self.assertEqual(repo['tip'], repo['default']) |
141 self.assertEqual(len(repo.heads()), 2) | 153 self.assertEqual(len(repo.heads()), 2) |
142 | 154 |
155 def test_oldest_not_trunk_and_tag_vendor_branch(self): | |
156 test_util.load_svndump_fixture(self.repo_path, | |
157 'tagged_vendor_and_oldest_not_trunk.svndump') | |
158 fetch_command.fetch_revisions(ui.ui(), | |
159 svn_url='file://%s' % self.repo_path, | |
160 hg_repo_path=self.wc_path, | |
161 stupid=True) | |
162 repo = hg.repository(ui.ui(), self.wc_path) | |
163 self.assertEqual(node.hex(repo['oldest'].node()), | |
164 'd73002bcdeffe389a8df81ee43303d36e79e8ca4') | |
165 self.assertEqual(repo['tip'].parents()[0].parents()[0], | |
166 repo['oldest']) | |
167 self.assertEqual(node.hex(repo['tip'].node()), | |
168 '9cf09e6ff7fa938188c3bcc9dd87abd7842c080c') | |
169 | |
143 def suite(): | 170 def suite(): |
144 all = [unittest.TestLoader().loadTestsFromTestCase(TestBasicRepoLayout), | 171 all = [unittest.TestLoader().loadTestsFromTestCase(TestBasicRepoLayout), |
145 unittest.TestLoader().loadTestsFromTestCase(TestStupidPull), | 172 unittest.TestLoader().loadTestsFromTestCase(TestStupidPull), |
146 ] | 173 ] |
147 return unittest.TestSuite(all) | 174 return unittest.TestSuite(all) |