diff tests/test_fetch_mappings.py @ 847:0de18c5c2e35

Respect filemap rule order (rules that come first are overridden by rules that come later)
author Vitaliy Filippov <vitalif@yourcmc.ru>
date Sat, 28 Jan 2012 02:18:25 +0400
parents 312b37bc5e20
children 4e203a47102a
line wrap: on
line diff
--- a/tests/test_fetch_mappings.py
+++ b/tests/test_fetch_mappings.py
@@ -131,6 +131,19 @@ class MapTests(test_util.TestBase):
         # TODO: re-enable test if we ever reinstate this feature
         self.assertRaises(hgutil.Abort, self.test_file_map_exclude, True)
 
+    def test_file_map_rule_order(self):
+        test_util.load_svndump_fixture(self.repo_path, 'replace_trunk_with_branch.svndump')
+        filemap = open(self.filemap, 'w')
+        filemap.write("exclude alpha\n")
+        filemap.write("include .\n")
+        filemap.close()
+        ui = self.ui(False)
+        ui.setconfig('hgsubversion', 'filemap', self.filemap)
+        commands.clone(ui, test_util.fileurl(self.repo_path),
+                       self.wc_path, filemap=self.filemap)
+        self.assertEqual(node.hex(self.repo[0].node()), '2cd09772e0f6ddf2d13c60ef3c1be11ad5a7dfae')
+        self.assertEqual(node.hex(self.repo['default'].node()), '8a525ca0671f456e6b1417187bf86c6115d2cb78')
+
     def test_branchmap(self, stupid=False):
         test_util.load_svndump_fixture(self.repo_path, 'branchmap.svndump')
         branchmap = open(self.branchmap, 'w')