comparison 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
comparison
equal deleted inserted replaced
635:e2c3349b2cca 636:d4f433ee709a
3 import os 3 import os
4 import unittest 4 import unittest
5 5
6 from mercurial import commands 6 from mercurial import commands
7 from mercurial import node 7 from mercurial import node
8 from mercurial import util as hgutil
8 9
9 import test_util 10 import test_util
10 11
11 from hgsubversion import maps 12 from hgsubversion import maps
12 13
149 150
150 def test_branchmap_empty_commit_stupid(self): 151 def test_branchmap_empty_commit_stupid(self):
151 '''test mapping an empty commit on a renamed branch (stupid)''' 152 '''test mapping an empty commit on a renamed branch (stupid)'''
152 self.test_branchmap_empty_commit(True) 153 self.test_branchmap_empty_commit(True)
153 154
155 def test_branchmap_no_replacement(self):
156 '''
157 test that empty mappings are rejected
158
159 Empty mappings are lines like 'this ='. The most sensible thing to do
160 is to not convert the 'this' branches. Until we can do that, we settle
161 with aborting.
162 '''
163 test_util.load_svndump_fixture(self.repo_path, 'propset-branch.svndump')
164 branchmap = open(self.branchmap, 'w')
165 branchmap.write("closeme =\n")
166 branchmap.close()
167 self.assertRaises(hgutil.Abort,
168 maps.BranchMap, self.ui(), self.branchmap)
169
154 def suite(): 170 def suite():
155 return unittest.TestLoader().loadTestsFromTestCase(MapTests) 171 return unittest.TestLoader().loadTestsFromTestCase(MapTests)