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