comparison tests/test_fetch_mappings.py @ 729:467b95348e6a

implement tag renames This uses a separate map, since the purpose is very different from the purpose of the TagMap that we currently have. It seemed to me that unifying both will only serve to make the implementation more complicated. The name TagRenames is not that elegant, but I didn't have any better idea. Feel free to change.
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Fri, 08 Oct 2010 19:07:04 +0200
parents 841399d10c79
children c2b9e08ecf10
comparison
equal deleted inserted replaced
728:cfefeefad199 729:467b95348e6a
23 return os.path.join(self.tmpdir, 'filemap') 23 return os.path.join(self.tmpdir, 'filemap')
24 24
25 @property 25 @property
26 def branchmap(self): 26 def branchmap(self):
27 return os.path.join(self.tmpdir, 'branchmap') 27 return os.path.join(self.tmpdir, 'branchmap')
28
29 @property
30 def tagmap(self):
31 return os.path.join(self.tmpdir, 'tagmap')
28 32
29 def test_author_map(self, stupid=False): 33 def test_author_map(self, stupid=False):
30 test_util.load_svndump_fixture(self.repo_path, 'replace_trunk_with_branch.svndump') 34 test_util.load_svndump_fixture(self.repo_path, 'replace_trunk_with_branch.svndump')
31 authormap = open(self.authors, 'w') 35 authormap = open(self.authors, 'w')
32 authormap.write('Augie=Augie Fackler <durin42@gmail.com> # stuffy\n') 36 authormap.write('Augie=Augie Fackler <durin42@gmail.com> # stuffy\n')
241 branchmap.write("closeme =\n") 245 branchmap.write("closeme =\n")
242 branchmap.close() 246 branchmap.close()
243 self.assertRaises(hgutil.Abort, 247 self.assertRaises(hgutil.Abort,
244 maps.BranchMap, self.ui(), self.branchmap) 248 maps.BranchMap, self.ui(), self.branchmap)
245 249
250 def test_tagmap(self, stupid=False):
251 test_util.load_svndump_fixture(self.repo_path,
252 'basic_tag_tests.svndump')
253 tagmap = open(self.tagmap, 'w')
254 tagmap.write("tag_r3 = 3.x # stuffy\n")
255 tagmap.write("copied_tag = \n")
256 tagmap.close()
257
258 ui = self.ui(stupid)
259 ui.setconfig('hgsubversion', 'tagmap', self.tagmap)
260 commands.clone(ui, test_util.fileurl(self.repo_path),
261 self.wc_path, tagmap=self.tagmap)
262 tags = self.repo.tags()
263 assert 'tag_r3' not in tags
264 assert '3.x' in tags
265 assert 'copied_tag' not in tags
266
267 def test_tagmap_stupid(self):
268 self.test_tagmap(True)
269
270 def test_tagren_changed(self, stupid=False):
271 test_util.load_svndump_fixture(self.repo_path,
272 'commit-to-tag.svndump')
273 tagmap = open(self.tagmap, 'w')
274 tagmap.write("edit-at-create = edit-past\n")
275 tagmap.write("also-edit = \n")
276 tagmap.write("will-edit = edit-future\n")
277 tagmap.close()
278
279 ui = self.ui(stupid)
280 ui.setconfig('hgsubversion', 'tagmap', self.tagmap)
281 commands.clone(ui, test_util.fileurl(self.repo_path),
282 self.wc_path, tagmap=self.tagmap)
283 tags = self.repo.tags()
284
285 def test_tagren_changed_stupid(self):
286 self.test_tagren_changed(True)
287
246 def suite(): 288 def suite():
247 return unittest.TestLoader().loadTestsFromTestCase(MapTests) 289 return unittest.TestLoader().loadTestsFromTestCase(MapTests)