diff tests/test_fetch_mappings.py @ 636:d4f433ee709a

branchmap: reject empty mappings
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Sat, 10 Jul 2010 14:48:57 +0200
parents e2c3349b2cca
children b2c8c2079822
line wrap: on
line diff
--- a/tests/test_fetch_mappings.py
+++ b/tests/test_fetch_mappings.py
@@ -5,6 +5,7 @@ import unittest
 
 from mercurial import commands
 from mercurial import node
+from mercurial import util as hgutil
 
 import test_util
 
@@ -151,5 +152,20 @@ class MapTests(test_util.TestBase):
         '''test mapping an empty commit on a renamed branch (stupid)'''
         self.test_branchmap_empty_commit(True)
 
+    def test_branchmap_no_replacement(self):
+        '''
+        test that empty mappings are rejected
+
+        Empty mappings are lines like 'this ='. The most sensible thing to do
+        is to not convert the 'this' branches. Until we can do that, we settle
+        with aborting.
+        '''
+        test_util.load_svndump_fixture(self.repo_path, 'propset-branch.svndump')
+        branchmap = open(self.branchmap, 'w')
+        branchmap.write("closeme =\n")
+        branchmap.close()
+        self.assertRaises(hgutil.Abort,
+                          maps.BranchMap, self.ui(), self.branchmap)
+
 def suite():
     return unittest.TestLoader().loadTestsFromTestCase(MapTests)