diff tests/test_push_command.py @ 928:d99ed94f4760

wrappers: do not change encoding when pushing This causes problems on platforms where the encoding is actually different, if the manifest contains a path which no longer matches the checkout, a following bailifchanged() actually fails. This happens on Windows with a repository containing UTF-8 encoded filenames checked out on a cp1252 environment.
author Patrick Mezard <patrick@mezard.eu>
date Sun, 09 Sep 2012 14:54:43 +0200
parents 173065f9b715
children 8417be758047
line wrap: on
line diff
--- a/tests/test_push_command.py
+++ b/tests/test_push_command.py
@@ -491,6 +491,18 @@ class PushTests(test_util.TestBase):
             self.assertEqual([], os.listdir(
                 os.path.join(self.tmpdir, 'testrepo-1', 'db', 'transactions')))
 
+    def test_push_encoding(self):
+        self.test_push_two_revs()
+        # Writing then rebasing UTF-8 filenames in a cp1252 windows console
+        # used to fail because hg internal encoding was being changed during
+        # the interactions with subversion, *and during the rebase*, which
+        # confused the dirstate and made it believe the file was deleted.
+        fn = 'pi\xc3\xa8ce/test'
+        changes = [(fn, fn, 'a')]
+        par = self.repo['tip'].rev()
+        self.commitchanges(changes, parent=par)
+        self.pushrevisions()
+
 def suite():
     test_classes = [PushTests, ]
     all_tests = []