Mercurial > hgsubversion
comparison tests/test_fetch_mappings.py @ 1255:139a44a63090 stable 1.7
Merge default into stable for a release.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Wed, 05 Nov 2014 12:48:59 -0500 |
parents | 77bd24841a5f |
children | 57d65269d30c 253b2ab253a1 |
comparison
equal
deleted
inserted
replaced
1230:807c443928d4 | 1255:139a44a63090 |
---|---|
82 self.assertEqual(sorted(users), expected_users) | 82 self.assertEqual(sorted(users), expected_users) |
83 | 83 |
84 def test_author_map_no_overwrite(self): | 84 def test_author_map_no_overwrite(self): |
85 cwd = os.path.dirname(__file__) | 85 cwd = os.path.dirname(__file__) |
86 orig = os.path.join(cwd, 'fixtures', 'author-map-test.txt') | 86 orig = os.path.join(cwd, 'fixtures', 'author-map-test.txt') |
87 new = open(self.authors, 'w') | 87 # create a fake hgsubversion repo |
88 repopath = os.path.join(self.wc_path, '.hg') | |
89 repopath = os.path.join(repopath, 'svn') | |
90 if not os.path.isdir(repopath): | |
91 os.makedirs(repopath) | |
92 new = open(os.path.join(repopath, 'authors'), 'w') | |
88 new.write(open(orig).read()) | 93 new.write(open(orig).read()) |
89 new.close() | 94 new.close() |
90 test = maps.AuthorMap(self.ui(), self.authors) | 95 test = maps.AuthorMap(self.repo.svnmeta(skiperrorcheck=True)) |
91 fromself = set(test) | 96 fromself = set(test) |
92 test.load(orig) | 97 test.load(orig) |
93 all_tests = set(test) | 98 all_tests = set(test) |
94 self.assertEqual(fromself.symmetric_difference(all_tests), set()) | 99 self.assertEqual(fromself.symmetric_difference(all_tests), set()) |
95 | 100 |
283 repo = self.repo | 288 repo = self.repo |
284 | 289 |
285 for r in repo: | 290 for r in repo: |
286 self.assertEquals(verify.verify(ui, repo, rev=r), 0) | 291 self.assertEquals(verify.verify(ui, repo, rev=r), 0) |
287 | 292 |
288 def test_branchmap_no_replacement(self): | |
289 ''' | |
290 test that empty mappings are rejected | |
291 | |
292 Empty mappings are lines like 'this ='. The most sensible thing to do | |
293 is to not convert the 'this' branches. Until we can do that, we settle | |
294 with aborting. | |
295 ''' | |
296 repo_path = self.load_svndump('propset-branch.svndump') | |
297 branchmap = open(self.branchmap, 'w') | |
298 branchmap.write("closeme =\n") | |
299 branchmap.close() | |
300 self.assertRaises(hgutil.Abort, | |
301 maps.BranchMap, self.ui(), self.branchmap) | |
302 | |
303 def test_tagmap(self): | 293 def test_tagmap(self): |
304 repo_path = self.load_svndump('basic_tag_tests.svndump') | 294 repo_path = self.load_svndump('basic_tag_tests.svndump') |
305 tagmap = open(self.tagmap, 'w') | 295 tagmap = open(self.tagmap, 'w') |
306 tagmap.write("tag_r3 = 3.x # stuffy\n") | 296 tagmap.write("tag_r3 = 3.x # stuffy\n") |
307 tagmap.write("copied_tag = \n") | 297 tagmap.write("copied_tag = \n") |