diff 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
line wrap: on
line diff
--- a/tests/test_fetch_mappings.py
+++ b/tests/test_fetch_mappings.py
@@ -12,6 +12,7 @@ from mercurial import util as hgutil
 
 from hgsubversion import maps
 from hgsubversion import svncommands
+from hgsubversion import util
 
 class MapTests(test_util.TestBase):
     @property
@@ -306,5 +307,31 @@ class MapTests(test_util.TestBase):
     def test_tagren_changed_stupid(self):
         self.test_tagren_changed(True)
 
+    def test_empty_log_message(self, stupid=False):
+        repo = self._load_fixture_and_fetch('empty-log-message.svndump',
+                                            stupid=stupid)
+
+        self.assertEqual(repo['tip'].description(), '...')
+
+        test_util.rmtree(self.wc_path)
+
+        ui = self.ui(stupid)
+        ui.setconfig('hgsubversion', 'defaultmessage', 'blyf')
+        commands.clone(ui, test_util.fileurl(self.repo_path), self.wc_path)
+
+        self.assertEqual(self.repo['tip'].description(), 'blyf')
+
+        test_util.rmtree(self.wc_path)
+
+        ui = self.ui(stupid)
+        ui.setconfig('hgsubversion', 'defaultmessage', '')
+        commands.clone(ui, test_util.fileurl(self.repo_path), self.wc_path)
+
+        self.assertEqual(self.repo['tip'].description(), '')
+
+
+    def test_empty_log_message_stupid(self):
+        self.test_empty_log_message(True)
+
 def suite():
     return unittest.TestLoader().loadTestsFromTestCase(MapTests)