comparison tests/test_fetch_mappings.py @ 848:4e203a47102a

filemap tests: check the attributes we care about, rather than shas Also made the test a little bit more extensive to satisfy my own paranoia about the feature behavior.
author Augie Fackler <durin42@gmail.com>
date Tue, 31 Jan 2012 08:15:37 -0600
parents 0de18c5c2e35
children 20e73b5ab6f7
comparison
equal deleted inserted replaced
847:0de18c5c2e35 848:4e203a47102a
134 def test_file_map_rule_order(self): 134 def test_file_map_rule_order(self):
135 test_util.load_svndump_fixture(self.repo_path, 'replace_trunk_with_branch.svndump') 135 test_util.load_svndump_fixture(self.repo_path, 'replace_trunk_with_branch.svndump')
136 filemap = open(self.filemap, 'w') 136 filemap = open(self.filemap, 'w')
137 filemap.write("exclude alpha\n") 137 filemap.write("exclude alpha\n")
138 filemap.write("include .\n") 138 filemap.write("include .\n")
139 filemap.write("exclude gamma\n")
139 filemap.close() 140 filemap.close()
140 ui = self.ui(False) 141 ui = self.ui(False)
141 ui.setconfig('hgsubversion', 'filemap', self.filemap) 142 ui.setconfig('hgsubversion', 'filemap', self.filemap)
142 commands.clone(ui, test_util.fileurl(self.repo_path), 143 commands.clone(ui, test_util.fileurl(self.repo_path),
143 self.wc_path, filemap=self.filemap) 144 self.wc_path, filemap=self.filemap)
144 self.assertEqual(node.hex(self.repo[0].node()), '2cd09772e0f6ddf2d13c60ef3c1be11ad5a7dfae') 145 # The exclusion of alpha is overridden by the later rule to
145 self.assertEqual(node.hex(self.repo['default'].node()), '8a525ca0671f456e6b1417187bf86c6115d2cb78') 146 # include all of '.', whereas gamma should remain excluded
147 # because it's excluded after the root directory.
148 self.assertEqual(self.repo[0].manifest().keys(),
149 ['alpha', 'beta'])
150 self.assertEqual(self.repo['default'].manifest().keys(),
151 ['alpha', 'beta'])
146 152
147 def test_branchmap(self, stupid=False): 153 def test_branchmap(self, stupid=False):
148 test_util.load_svndump_fixture(self.repo_path, 'branchmap.svndump') 154 test_util.load_svndump_fixture(self.repo_path, 'branchmap.svndump')
149 branchmap = open(self.branchmap, 'w') 155 branchmap = open(self.branchmap, 'w')
150 branchmap.write("badname = good-name # stuffy\n") 156 branchmap.write("badname = good-name # stuffy\n")