comparison tests/test_fetch_mappings.py @ 960:502613f6b583

editor: ignore added or copied files excluded by a filemap Files brought by a copied add_directory() were processed despite being excluded by the filemap. This was also the case with added files. The conversion was still correct because they were eventually filtered out in the replay.convert_rev() but processing them in itself may be problematic. Filemaps are often use to exclude large binary files and before this change, some of them could be marked as missing and be fetched before being discarded. A test configuration entry named hgsubversion.failoninvalidreplayfile was added to help testing this case. It should become the default behaviour in the future.
author Patrick Mezard <patrick@mezard.eu>
date Sun, 14 Oct 2012 15:51:12 +0200
parents 1f77bd6ec0e5
children 8648ccfb8325
comparison
equal deleted inserted replaced
959:8b2480175bae 960:502613f6b583
106 filemap = open(self.filemap, 'w') 106 filemap = open(self.filemap, 'w')
107 filemap.write(filemapcontent) 107 filemap.write(filemapcontent)
108 filemap.close() 108 filemap.close()
109 ui = self.ui(stupid) 109 ui = self.ui(stupid)
110 ui.setconfig('hgsubversion', 'filemap', self.filemap) 110 ui.setconfig('hgsubversion', 'filemap', self.filemap)
111 ui.setconfig('hgsubversion', 'failoninvalidreplayfile', 'true')
112 ui.setconfig('hgsubversion', 'failonmissing', 'true')
111 commands.clone(ui, test_util.fileurl(repo_path), 113 commands.clone(ui, test_util.fileurl(repo_path),
112 self.wc_path, filemap=self.filemap) 114 self.wc_path, filemap=self.filemap)
113 return self.repo 115 return self.repo
114 116
115 def test_file_map(self, stupid=False): 117 def test_file_map(self, stupid=False):
141 self.assertEqual(self.repo[0].manifest().keys(), 143 self.assertEqual(self.repo[0].manifest().keys(),
142 ['alpha', 'beta']) 144 ['alpha', 'beta'])
143 self.assertEqual(self.repo['default'].manifest().keys(), 145 self.assertEqual(self.repo['default'].manifest().keys(),
144 ['alpha', 'beta']) 146 ['alpha', 'beta'])
145 147
148 def test_file_map_copy(self):
149 repo = self._loadwithfilemap('copies.svndump', "exclude dir2\n")
150 self.assertEqual(['dir/a'], list(repo['tip']))
151
146 def test_branchmap(self, stupid=False): 152 def test_branchmap(self, stupid=False):
147 repo_path = self.load_svndump('branchmap.svndump') 153 repo_path = self.load_svndump('branchmap.svndump')
148 branchmap = open(self.branchmap, 'w') 154 branchmap = open(self.branchmap, 'w')
149 branchmap.write("badname = good-name # stuffy\n") 155 branchmap.write("badname = good-name # stuffy\n")
150 branchmap.write("feature = default\n") 156 branchmap.write("feature = default\n")