comparison tests/test-http-branchmap.t @ 12447:f5f90d3808e2

tests: unify test-http-branchmap
author Matt Mackall <mpm@selenic.com>
date Sun, 26 Sep 2010 13:43:08 -0500
parents tests/test-http-branchmap@9f10adb70a04
children d08bb64888bc
comparison
equal deleted inserted replaced
12446:df57227a72bf 12447:f5f90d3808e2
1
2 $ hgserve() {
3 > hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -E errors.log -v $@
4 > cat hg.pid >> "$DAEMON_PIDS"
5 > }
6 $ hg init a
7 $ hg --encoding utf-8 -R a branch æ
8 marked working directory as branch æ
9 $ echo foo > a/foo
10 $ hg -R a ci -Am foo
11 adding foo
12 $ hgserve -R a --config web.push_ssl=False --config web.allow_push=* --encoding latin1
13 listening at http://localhost*/ (bound to 127.0.0.1:*) (glob)
14 $ hg --encoding utf-8 clone http://localhost:$HGPORT1 b
15 requesting all changes
16 adding changesets
17 adding manifests
18 adding file changes
19 added 1 changesets with 1 changes to 1 files
20 updating to branch æ
21 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
22 $ hg --encoding utf-8 -R b log
23 changeset: 0:867c11ce77b8
24 branch: æ
25 tag: tip
26 user: test
27 date: Thu Jan 01 00:00:00 1970 +0000
28 summary: foo
29
30 $ echo bar >> b/foo
31 $ hg -R b ci -m bar
32 $ hg --encoding utf-8 -R b push
33 pushing to http://localhost:* (glob)
34 searching for changes
35 remote: adding changesets
36 remote: adding manifests
37 remote: adding file changes
38 remote: added 1 changesets with 1 changes to 1 files
39 $ hg -R a --encoding utf-8 log
40 changeset: 1:58e7c90d67cb
41 branch: æ
42 tag: tip
43 user: test
44 date: Thu Jan 01 00:00:00 1970 +0000
45 summary: bar
46
47 changeset: 0:867c11ce77b8
48 branch: æ
49 user: test
50 date: Thu Jan 01 00:00:00 1970 +0000
51 summary: foo
52
53 $ kill `cat hg.pid`
54
55 verify 7e7d56fe4833 (encoding fallback in branchmap to maintain compatibility with 1.3.x)
56
57 $ cat <<EOF > oldhg
58 > import sys
59 > from mercurial import ui, hg, commands
60 >
61 > class StdoutWrapper(object):
62 > def __init__(self, stdout):
63 > self._file = stdout
64 >
65 > def write(self, data):
66 > if data == '47\n':
67 > # latin1 encoding is one %xx (3 bytes) shorter
68 > data = '44\n'
69 > elif data.startswith('%C3%A6 '):
70 > # translate to latin1 encoding
71 > data = '%%E6 %s' % data[7:]
72 > self._file.write(data)
73 >
74 > def __getattr__(self, name):
75 > return getattr(self._file, name)
76 >
77 > sys.stdout = StdoutWrapper(sys.stdout)
78 > sys.stderr = StdoutWrapper(sys.stderr)
79 >
80 > myui = ui.ui()
81 > repo = hg.repository(myui, 'a')
82 > commands.serve(myui, repo, stdio=True)
83 > EOF
84 $ echo baz >> b/foo
85 $ hg -R b ci -m baz
86 $ hg push -R b -e 'python oldhg' ssh://dummy/ --encoding latin1
87 pushing to ssh://dummy/
88 searching for changes
89 remote: adding changesets
90 remote: adding manifests
91 remote: adding file changes
92 remote: added 1 changesets with 1 changes to 1 files