Extend test-branchmap to test c51494c53841 stable
authorThomas Arendsen Hein <thomas@intevation.de>
Wed, 18 Nov 2009 16:47:20 +0100
branchstable
changeset 9879 7bb004fc14ec
parent 9878 7e7d56fe4833
child 9880 a1886801d466
child 9891 5c5a08d6f85d
Extend test-branchmap to test c51494c53841 (encoding fallback in branchmap to maintain compatibility with 1.3.x)
tests/test-branchmap
tests/test-branchmap.out
--- a/tests/test-branchmap	Wed Nov 18 15:20:08 2009 +0100
+++ b/tests/test-branchmap	Wed Nov 18 16:47:20 2009 +0100
@@ -21,3 +21,38 @@
 hg -R a --encoding utf-8 log
 
 kill `cat hg.pid`
+
+
+# verify 7e7d56fe4833 (encoding fallback in branchmap to maintain compatibility with 1.3.x)
+
+cat <<EOF > oldhg
+import sys
+from mercurial import ui, hg, commands
+
+class StdoutWrapper(object):
+    def __init__(self, stdout):
+        self._file = stdout
+
+    def write(self, data):
+        if data == '47\n':
+            # latin1 encoding is one %xx (3 bytes) shorter
+            data = '44\n'
+        elif data.startswith('%C3%A6 '):
+            # translate to latin1 encoding
+            data = '%%E6 %s' % data[7:]
+        self._file.write(data)
+
+    def __getattr__(self, name):
+        return getattr(self._file, name)
+
+sys.stdout = StdoutWrapper(sys.stdout)
+sys.stderr = StdoutWrapper(sys.stderr)
+
+myui = ui.ui()
+repo = hg.repository(myui, 'a')
+commands.serve(myui, repo, stdio=True)
+EOF
+
+echo baz >> b/foo
+hg -R b ci -m baz
+hg push -R b -e 'python oldhg' ssh://dummy/ --encoding latin1
--- a/tests/test-branchmap.out	Wed Nov 18 15:20:08 2009 +0100
+++ b/tests/test-branchmap.out	Wed Nov 18 16:47:20 2009 +0100
@@ -34,3 +34,9 @@
 date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     foo
 
+pushing to ssh://dummy/
+searching for changes
+remote: adding changesets
+remote: adding manifests
+remote: adding file changes
+remote: added 1 changesets with 1 changes to 1 files