comparison tests/test_fetch_mappings.py @ 769:cc1d4aa3ba41

configurable substitution for empty commit message (fixes #195) The value of the default commit message is now configurable by setting 'hgsubversion.defaultmessage'. In addition, the log output is made consistent with the result of the conversion.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Sun, 28 Nov 2010 03:47:04 +0100
parents 13a2137d3c15
children 4dfc41b15d9a
comparison
equal deleted inserted replaced
768:13a2137d3c15 769:cc1d4aa3ba41
10 from mercurial import node 10 from mercurial import node
11 from mercurial import util as hgutil 11 from mercurial import util as hgutil
12 12
13 from hgsubversion import maps 13 from hgsubversion import maps
14 from hgsubversion import svncommands 14 from hgsubversion import svncommands
15 from hgsubversion import util
15 16
16 class MapTests(test_util.TestBase): 17 class MapTests(test_util.TestBase):
17 @property 18 @property
18 def authors(self): 19 def authors(self):
19 return os.path.join(self.tmpdir, 'authormap') 20 return os.path.join(self.tmpdir, 'authormap')
304 tags = self.repo.tags() 305 tags = self.repo.tags()
305 306
306 def test_tagren_changed_stupid(self): 307 def test_tagren_changed_stupid(self):
307 self.test_tagren_changed(True) 308 self.test_tagren_changed(True)
308 309
310 def test_empty_log_message(self, stupid=False):
311 repo = self._load_fixture_and_fetch('empty-log-message.svndump',
312 stupid=stupid)
313
314 self.assertEqual(repo['tip'].description(), '...')
315
316 test_util.rmtree(self.wc_path)
317
318 ui = self.ui(stupid)
319 ui.setconfig('hgsubversion', 'defaultmessage', 'blyf')
320 commands.clone(ui, test_util.fileurl(self.repo_path), self.wc_path)
321
322 self.assertEqual(self.repo['tip'].description(), 'blyf')
323
324 test_util.rmtree(self.wc_path)
325
326 ui = self.ui(stupid)
327 ui.setconfig('hgsubversion', 'defaultmessage', '')
328 commands.clone(ui, test_util.fileurl(self.repo_path), self.wc_path)
329
330 self.assertEqual(self.repo['tip'].description(), '')
331
332
333 def test_empty_log_message_stupid(self):
334 self.test_empty_log_message(True)
335
309 def suite(): 336 def suite():
310 return unittest.TestLoader().loadTestsFromTestCase(MapTests) 337 return unittest.TestLoader().loadTestsFromTestCase(MapTests)