Show More
@@ -1,58 +1,92 b'' | |||||
1 | #!/bin/sh |
|
|||
2 |
|
||||
3 | hgserve() |
|
|||
4 | { |
|
|||
5 | hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -E errors.log -v $@ \ |
|
|||
6 | | sed -e 's/:[0-9][0-9]*//g' -e 's/http:\/\/[^/]*\//http:\/\/localhost\//' |
|
|||
7 | cat hg.pid >> "$DAEMON_PIDS" |
|
|||
8 | } |
|
|||
9 |
|
1 | |||
10 | hg init a |
|
2 | $ hgserve() { | |
11 | hg --encoding utf-8 -R a branch æ |
|
3 | > hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -E errors.log -v $@ | |
12 | echo foo > a/foo |
|
4 | > cat hg.pid >> "$DAEMON_PIDS" | |
13 | hg -R a ci -Am foo |
|
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 | |||
14 |
|
29 | |||
15 | hgserve -R a --config web.push_ssl=False --config web.allow_push=* --encoding latin1 |
|
30 | $ echo bar >> b/foo | |
16 | hg --encoding utf-8 clone http://localhost:$HGPORT1 b |
|
31 | $ hg -R b ci -m bar | |
17 |
hg --encoding utf-8 -R b |
|
32 | $ hg --encoding utf-8 -R b push | |
18 | echo bar >> b/foo |
|
33 | pushing to http://localhost:* (glob) | |
19 | hg -R b ci -m bar |
|
34 | searching for changes | |
20 | hg --encoding utf-8 -R b push | sed "s/$HGPORT1/PORT/" |
|
35 | remote: adding changesets | |
21 | hg -R a --encoding utf-8 log |
|
36 | remote: adding manifests | |
22 |
|
37 | remote: adding file changes | ||
23 | kill `cat hg.pid` |
|
38 | remote: added 1 changesets with 1 changes to 1 files | |
24 |
|
39 | $ hg -R a --encoding utf-8 log | ||
25 |
|
40 | changeset: 1:58e7c90d67cb | ||
26 | # verify 7e7d56fe4833 (encoding fallback in branchmap to maintain compatibility with 1.3.x) |
|
41 | branch: æ | |
|
42 | tag: tip | |||
|
43 | user: test | |||
|
44 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
45 | summary: bar | |||
27 |
|
46 | |||
28 | cat <<EOF > oldhg |
|
47 | changeset: 0:867c11ce77b8 | |
29 | import sys |
|
48 | branch: æ | |
30 | from mercurial import ui, hg, commands |
|
49 | user: test | |
|
50 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
51 | summary: foo | |||
31 |
|
52 | |||
32 | class StdoutWrapper(object): |
|
53 | $ kill `cat hg.pid` | |
33 | def __init__(self, stdout): |
|
54 | ||
34 | self._file = stdout |
|
55 | verify 7e7d56fe4833 (encoding fallback in branchmap to maintain compatibility with 1.3.x) | |
35 |
|
56 | |||
36 | def write(self, data): |
|
57 | $ cat <<EOF > oldhg | |
37 | if data == '47\n': |
|
58 | > import sys | |
38 | # latin1 encoding is one %xx (3 bytes) shorter |
|
59 | > from mercurial import ui, hg, commands | |
39 | data = '44\n' |
|
60 | > | |
40 | elif data.startswith('%C3%A6 '): |
|
61 | > class StdoutWrapper(object): | |
41 | # translate to latin1 encoding |
|
62 | > def __init__(self, stdout): | |
42 | data = '%%E6 %s' % data[7:] |
|
63 | > self._file = stdout | |
43 | self._file.write(data) |
|
64 | > | |
44 |
|
65 | > def write(self, data): | ||
45 | def __getattr__(self, name): |
|
66 | > if data == '47\n': | |
46 | return getattr(self._file, name) |
|
67 | > # latin1 encoding is one %xx (3 bytes) shorter | |
47 |
|
68 | > data = '44\n' | ||
48 | sys.stdout = StdoutWrapper(sys.stdout) |
|
69 | > elif data.startswith('%C3%A6 '): | |
49 | sys.stderr = StdoutWrapper(sys.stderr) |
|
70 | > # translate to latin1 encoding | |
50 |
|
71 | > data = '%%E6 %s' % data[7:] | ||
51 | myui = ui.ui() |
|
72 | > self._file.write(data) | |
52 | repo = hg.repository(myui, 'a') |
|
73 | > | |
53 | commands.serve(myui, repo, stdio=True) |
|
74 | > def __getattr__(self, name): | |
54 | EOF |
|
75 | > return getattr(self._file, name) | |
55 |
|
76 | > | ||
56 | echo baz >> b/foo |
|
77 | > sys.stdout = StdoutWrapper(sys.stdout) | |
57 | hg -R b ci -m baz |
|
78 | > sys.stderr = StdoutWrapper(sys.stderr) | |
58 | hg push -R b -e 'python oldhg' ssh://dummy/ --encoding latin1 |
|
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 |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now