##// END OF EJS Templates
tests: port inline Python in test-http-branchmap.t to Python 3...
Augie Fackler -
r36293:1e0c9f9f default
parent child Browse files
Show More
@@ -1,97 +1,97 b''
1 #require killdaemons
1 #require killdaemons
2
2
3 $ hgserve() {
3 $ hgserve() {
4 > hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid \
4 > hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid \
5 > -E errors.log -v $@ > startup.log
5 > -E errors.log -v $@ > startup.log
6 > # Grepping hg serve stdout would hang on Windows
6 > # Grepping hg serve stdout would hang on Windows
7 > grep -v 'listening at' startup.log
7 > grep -v 'listening at' startup.log
8 > cat hg.pid >> "$DAEMON_PIDS"
8 > cat hg.pid >> "$DAEMON_PIDS"
9 > }
9 > }
10 $ hg init a
10 $ hg init a
11 $ hg --encoding utf-8 -R a branch Γ¦
11 $ hg --encoding utf-8 -R a branch Γ¦
12 marked working directory as branch \xc3\xa6 (esc)
12 marked working directory as branch \xc3\xa6 (esc)
13 (branches are permanent and global, did you want a bookmark?)
13 (branches are permanent and global, did you want a bookmark?)
14 $ echo foo > a/foo
14 $ echo foo > a/foo
15 $ hg -R a ci -Am foo
15 $ hg -R a ci -Am foo
16 adding foo
16 adding foo
17 $ hgserve -R a --config web.push_ssl=False --config web.allow_push=* --encoding latin1
17 $ hgserve -R a --config web.push_ssl=False --config web.allow_push=* --encoding latin1
18 $ hg --encoding utf-8 clone http://localhost:$HGPORT1 b
18 $ hg --encoding utf-8 clone http://localhost:$HGPORT1 b
19 requesting all changes
19 requesting all changes
20 adding changesets
20 adding changesets
21 adding manifests
21 adding manifests
22 adding file changes
22 adding file changes
23 added 1 changesets with 1 changes to 1 files
23 added 1 changesets with 1 changes to 1 files
24 new changesets 867c11ce77b8
24 new changesets 867c11ce77b8
25 updating to branch \xc3\xa6 (esc)
25 updating to branch \xc3\xa6 (esc)
26 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
26 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
27 $ hg --encoding utf-8 -R b log
27 $ hg --encoding utf-8 -R b log
28 changeset: 0:867c11ce77b8
28 changeset: 0:867c11ce77b8
29 branch: \xc3\xa6 (esc)
29 branch: \xc3\xa6 (esc)
30 tag: tip
30 tag: tip
31 user: test
31 user: test
32 date: Thu Jan 01 00:00:00 1970 +0000
32 date: Thu Jan 01 00:00:00 1970 +0000
33 summary: foo
33 summary: foo
34
34
35 $ echo bar >> b/foo
35 $ echo bar >> b/foo
36 $ hg -R b ci -m bar
36 $ hg -R b ci -m bar
37 $ hg --encoding utf-8 -R b push
37 $ hg --encoding utf-8 -R b push
38 pushing to http://localhost:$HGPORT1/
38 pushing to http://localhost:$HGPORT1/
39 searching for changes
39 searching for changes
40 remote: adding changesets
40 remote: adding changesets
41 remote: adding manifests
41 remote: adding manifests
42 remote: adding file changes
42 remote: adding file changes
43 remote: added 1 changesets with 1 changes to 1 files
43 remote: added 1 changesets with 1 changes to 1 files
44 $ hg -R a --encoding utf-8 log
44 $ hg -R a --encoding utf-8 log
45 changeset: 1:58e7c90d67cb
45 changeset: 1:58e7c90d67cb
46 branch: \xc3\xa6 (esc)
46 branch: \xc3\xa6 (esc)
47 tag: tip
47 tag: tip
48 user: test
48 user: test
49 date: Thu Jan 01 00:00:00 1970 +0000
49 date: Thu Jan 01 00:00:00 1970 +0000
50 summary: bar
50 summary: bar
51
51
52 changeset: 0:867c11ce77b8
52 changeset: 0:867c11ce77b8
53 branch: \xc3\xa6 (esc)
53 branch: \xc3\xa6 (esc)
54 user: test
54 user: test
55 date: Thu Jan 01 00:00:00 1970 +0000
55 date: Thu Jan 01 00:00:00 1970 +0000
56 summary: foo
56 summary: foo
57
57
58 $ killdaemons.py hg.pid
58 $ killdaemons.py hg.pid
59
59
60 verify 7e7d56fe4833 (encoding fallback in branchmap to maintain compatibility with 1.3.x)
60 verify 7e7d56fe4833 (encoding fallback in branchmap to maintain compatibility with 1.3.x)
61
61
62 $ cat <<EOF > oldhg
62 $ cat <<EOF > oldhg
63 > import sys
63 > import sys
64 > from mercurial import ui, hg, commands
64 > from mercurial import ui, hg, commands
65 >
65 >
66 > class StdoutWrapper(object):
66 > class StdoutWrapper(object):
67 > def __init__(self, stdout):
67 > def __init__(self, stdout):
68 > self._file = stdout
68 > self._file = stdout
69 >
69 >
70 > def write(self, data):
70 > def write(self, data):
71 > if data == '47\n':
71 > if data == b'47\n':
72 > # latin1 encoding is one %xx (3 bytes) shorter
72 > # latin1 encoding is one %xx (3 bytes) shorter
73 > data = '44\n'
73 > data = b'44\n'
74 > elif data.startswith('%C3%A6 '):
74 > elif data.startswith(b'%C3%A6 '):
75 > # translate to latin1 encoding
75 > # translate to latin1 encoding
76 > data = '%%E6 %s' % data[7:]
76 > data = b'%%E6 %s' % data[7:]
77 > self._file.write(data)
77 > self._file.write(data)
78 >
78 >
79 > def __getattr__(self, name):
79 > def __getattr__(self, name):
80 > return getattr(self._file, name)
80 > return getattr(self._file, name)
81 >
81 >
82 > sys.stdout = StdoutWrapper(sys.stdout)
82 > sys.stdout = StdoutWrapper(getattr(sys.stdout, 'buffer', sys.stdout))
83 > sys.stderr = StdoutWrapper(sys.stderr)
83 > sys.stderr = StdoutWrapper(getattr(sys.stderr, 'buffer', sys.stderr))
84 >
84 >
85 > myui = ui.ui.load()
85 > myui = ui.ui.load()
86 > repo = hg.repository(myui, 'a')
86 > repo = hg.repository(myui, b'a')
87 > commands.serve(myui, repo, stdio=True, cmdserver=False)
87 > commands.serve(myui, repo, stdio=True, cmdserver=False)
88 > EOF
88 > EOF
89 $ echo baz >> b/foo
89 $ echo baz >> b/foo
90 $ hg -R b ci -m baz
90 $ hg -R b ci -m baz
91 $ hg push -R b -e "\"$PYTHON\" oldhg" ssh://dummy/ --encoding latin1
91 $ hg push -R b -e "\"$PYTHON\" oldhg" ssh://dummy/ --encoding latin1
92 pushing to ssh://dummy/
92 pushing to ssh://dummy/
93 searching for changes
93 searching for changes
94 remote: adding changesets
94 remote: adding changesets
95 remote: adding manifests
95 remote: adding manifests
96 remote: adding file changes
96 remote: adding file changes
97 remote: added 1 changesets with 1 changes to 1 files
97 remote: added 1 changesets with 1 changes to 1 files
General Comments 0
You need to be logged in to leave comments. Login now