diff tests/test_fetch_mappings.py @ 851:9ce00cb1d676

Merge alternate tunnel schemes.
author Augie Fackler <durin42@gmail.com>
date Sat, 25 Feb 2012 14:51:22 -0600
parents 4e203a47102a
children 20e73b5ab6f7
line wrap: on
line diff
--- a/tests/test_fetch_mappings.py
+++ b/tests/test_fetch_mappings.py
@@ -26,7 +26,7 @@ class MapTests(test_util.TestBase):
     @property
     def branchmap(self):
         return os.path.join(self.tmpdir, 'branchmap')
-	
+
     @property
     def tagmap(self):
         return os.path.join(self.tmpdir, 'tagmap')
@@ -96,8 +96,8 @@ class MapTests(test_util.TestBase):
         test = maps.AuthorMap(self.ui(), self.authors)
         fromself = set(test)
         test.load(orig)
-        all = set(test)
-        self.assertEqual(fromself.symmetric_difference(all), set())
+        all_tests = set(test)
+        self.assertEqual(fromself.symmetric_difference(all_tests), set())
 
     def test_file_map(self, stupid=False):
         test_util.load_svndump_fixture(self.repo_path, 'replace_trunk_with_branch.svndump')
@@ -112,7 +112,8 @@ class MapTests(test_util.TestBase):
         self.assertEqual(node.hex(self.repo['default'].node()), 'e524296152246b3837fe9503c83b727075835155')
 
     def test_file_map_stupid(self):
-        self.test_file_map(True)
+        # TODO: re-enable test if we ever reinstate this feature
+        self.assertRaises(hgutil.Abort, self.test_file_map, True)
 
     def test_file_map_exclude(self, stupid=False):
         test_util.load_svndump_fixture(self.repo_path, 'replace_trunk_with_branch.svndump')
@@ -127,7 +128,27 @@ class MapTests(test_util.TestBase):
         self.assertEqual(node.hex(self.repo['default'].node()), 'b37a3c0297b71f989064d9b545b5a478bbed7cc1')
 
     def test_file_map_exclude_stupid(self):
-        self.test_file_map_exclude(True)
+        # 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.write("exclude gamma\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)
+        # The exclusion of alpha is overridden by the later rule to
+        # include all of '.', whereas gamma should remain excluded
+        # because it's excluded after the root directory.
+        self.assertEqual(self.repo[0].manifest().keys(),
+                         ['alpha', 'beta'])
+        self.assertEqual(self.repo['default'].manifest().keys(),
+                         ['alpha', 'beta'])
 
     def test_branchmap(self, stupid=False):
         test_util.load_svndump_fixture(self.repo_path, 'branchmap.svndump')