diff 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
line wrap: on
line diff
--- a/tests/test_fetch_mappings.py
+++ b/tests/test_fetch_mappings.py
@@ -108,6 +108,8 @@ class MapTests(test_util.TestBase):
         filemap.close()
         ui = self.ui(stupid)
         ui.setconfig('hgsubversion', 'filemap', self.filemap)
+        ui.setconfig('hgsubversion', 'failoninvalidreplayfile', 'true')
+        ui.setconfig('hgsubversion', 'failonmissing', 'true')
         commands.clone(ui, test_util.fileurl(repo_path),
                        self.wc_path, filemap=self.filemap)
         return self.repo
@@ -143,6 +145,10 @@ class MapTests(test_util.TestBase):
         self.assertEqual(self.repo['default'].manifest().keys(),
                          ['alpha', 'beta'])
 
+    def test_file_map_copy(self):
+        repo = self._loadwithfilemap('copies.svndump', "exclude dir2\n")
+        self.assertEqual(['dir/a'], list(repo['tip']))
+
     def test_branchmap(self, stupid=False):
         repo_path = self.load_svndump('branchmap.svndump')
         branchmap = open(self.branchmap, 'w')