# HG changeset patch # User Thomas Arendsen Hein # Date 1258559240 -3600 # Node ID 7bb004fc14ecadc355cf5a65b9b055ffe7ef0f92 # Parent 7e7d56fe4833124f271e4f3b1877cbfc00444f34 Extend test-branchmap to test c51494c53841 (encoding fallback in branchmap to maintain compatibility with 1.3.x) diff -r 7e7d56fe4833 -r 7bb004fc14ec tests/test-branchmap --- 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 < 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 diff -r 7e7d56fe4833 -r 7bb004fc14ec tests/test-branchmap.out --- 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