Mercurial > hgsubversion
comparison tests/test_fetch_mappings.py @ 639:b2c8c2079822
tests: add test for combining two branches using the branchmap
| author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
|---|---|
| date | Tue, 13 Jul 2010 13:18:08 +0200 |
| parents | d4f433ee709a |
| children | 67513cca972f |
comparison
equal
deleted
inserted
replaced
| 638:ea0f42e0004d | 639:b2c8c2079822 |
|---|---|
| 150 | 150 |
| 151 def test_branchmap_empty_commit_stupid(self): | 151 def test_branchmap_empty_commit_stupid(self): |
| 152 '''test mapping an empty commit on a renamed branch (stupid)''' | 152 '''test mapping an empty commit on a renamed branch (stupid)''' |
| 153 self.test_branchmap_empty_commit(True) | 153 self.test_branchmap_empty_commit(True) |
| 154 | 154 |
| 155 def test_branchmap_combine(self, stupid=False): | |
| 156 '''test combining two branches, but retaining heads''' | |
| 157 test_util.load_svndump_fixture(self.repo_path, 'branchmap.svndump') | |
| 158 branchmap = open(self.branchmap, 'w') | |
| 159 branchmap.write("badname = default\n") | |
| 160 branchmap.write("feature = default\n") | |
| 161 branchmap.close() | |
| 162 ui = self.ui(stupid) | |
| 163 ui.setconfig('hgsubversion', 'branchmap', self.branchmap) | |
| 164 commands.clone(ui, test_util.fileurl(self.repo_path), | |
| 165 self.wc_path, branchmap=self.branchmap) | |
| 166 branches = set(self.repo[i].branch() for i in self.repo) | |
| 167 self.assertEquals(sorted(branches), ['default']) | |
| 168 self.assertEquals(len(self.repo.heads()), 2) | |
| 169 self.assertEquals(len(self.repo.branchheads('default')), 2) | |
| 170 | |
| 171 # test that the mapping does not affect branch info | |
| 172 branches = self.repo.svnmeta().branches | |
| 173 self.assertEquals(sorted(branches.keys()), | |
| 174 [None, 'badname', 'feature']) | |
| 175 | |
| 176 def test_branchmap_combine_stupid(self): | |
| 177 '''test combining two branches, but retaining heads (stupid)''' | |
| 178 self.test_branchmap_combine(True) | |
| 179 | |
| 155 def test_branchmap_no_replacement(self): | 180 def test_branchmap_no_replacement(self): |
| 156 ''' | 181 ''' |
| 157 test that empty mappings are rejected | 182 test that empty mappings are rejected |
| 158 | 183 |
| 159 Empty mappings are lines like 'this ='. The most sensible thing to do | 184 Empty mappings are lines like 'this ='. The most sensible thing to do |
