Show More
@@ -1,163 +1,165 b'' | |||||
1 | $ "$TESTDIR/hghave" killdaemons || exit 80 |
|
1 | $ "$TESTDIR/hghave" killdaemons || exit 80 | |
2 |
|
2 | |||
3 | $ hg init test |
|
3 | $ hg init test | |
4 | $ cd test |
|
4 | $ cd test | |
5 | $ echo a > a |
|
5 | $ echo a > a | |
6 | $ hg ci -Ama |
|
6 | $ hg ci -Ama | |
7 | adding a |
|
7 | adding a | |
8 | $ cd .. |
|
8 | $ cd .. | |
9 | $ hg clone test test2 |
|
9 | $ hg clone test test2 | |
10 | updating to branch default |
|
10 | updating to branch default | |
11 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
11 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
12 | $ cd test2 |
|
12 | $ cd test2 | |
13 | $ echo a >> a |
|
13 | $ echo a >> a | |
14 | $ hg ci -mb |
|
14 | $ hg ci -mb | |
15 | $ req() { |
|
15 | $ req() { | |
16 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
16 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
17 | > cat hg.pid >> $DAEMON_PIDS |
|
17 | > cat hg.pid >> $DAEMON_PIDS | |
18 | > hg --cwd ../test2 push http://localhost:$HGPORT/ |
|
18 | > hg --cwd ../test2 push http://localhost:$HGPORT/ | |
19 | > exitstatus=$? |
|
19 | > exitstatus=$? | |
20 | > "$TESTDIR/killdaemons.py" $DAEMON_PIDS |
|
20 | > "$TESTDIR/killdaemons.py" $DAEMON_PIDS | |
21 | > echo % serve errors |
|
21 | > echo % serve errors | |
22 | > cat errors.log |
|
22 | > cat errors.log | |
23 | > return $exitstatus |
|
23 | > return $exitstatus | |
24 | > } |
|
24 | > } | |
25 | $ cd ../test |
|
25 | $ cd ../test | |
26 |
|
26 | |||
27 | expect ssl error |
|
27 | expect ssl error | |
28 |
|
28 | |||
29 | $ req |
|
29 | $ req | |
30 | pushing to http://localhost:$HGPORT/ |
|
30 | pushing to http://localhost:$HGPORT/ | |
31 | searching for changes |
|
31 | searching for changes | |
32 | abort: HTTP Error 403: ssl required |
|
32 | abort: HTTP Error 403: ssl required | |
33 | % serve errors |
|
33 | % serve errors | |
34 | [255] |
|
34 | [255] | |
35 |
|
35 | |||
36 | expect authorization error |
|
36 | expect authorization error | |
37 |
|
37 | |||
38 | $ echo '[web]' > .hg/hgrc |
|
38 | $ echo '[web]' > .hg/hgrc | |
39 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
39 | $ echo 'push_ssl = false' >> .hg/hgrc | |
40 | $ req |
|
40 | $ req | |
41 | pushing to http://localhost:$HGPORT/ |
|
41 | pushing to http://localhost:$HGPORT/ | |
42 | searching for changes |
|
42 | searching for changes | |
43 | abort: authorization failed |
|
43 | abort: authorization failed | |
44 | % serve errors |
|
44 | % serve errors | |
45 | [255] |
|
45 | [255] | |
46 |
|
46 | |||
47 | expect authorization error: must have authorized user |
|
47 | expect authorization error: must have authorized user | |
48 |
|
48 | |||
49 | $ echo 'allow_push = unperson' >> .hg/hgrc |
|
49 | $ echo 'allow_push = unperson' >> .hg/hgrc | |
50 | $ req |
|
50 | $ req | |
51 | pushing to http://localhost:$HGPORT/ |
|
51 | pushing to http://localhost:$HGPORT/ | |
52 | searching for changes |
|
52 | searching for changes | |
53 | abort: authorization failed |
|
53 | abort: authorization failed | |
54 | % serve errors |
|
54 | % serve errors | |
55 | [255] |
|
55 | [255] | |
56 |
|
56 | |||
57 | expect success |
|
57 | expect success | |
58 |
|
58 | |||
59 | $ echo 'allow_push = *' >> .hg/hgrc |
|
59 | $ echo 'allow_push = *' >> .hg/hgrc | |
60 | $ echo '[hooks]' >> .hg/hgrc |
|
60 | $ echo '[hooks]' >> .hg/hgrc | |
61 | $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup 0" >> .hg/hgrc |
|
61 | $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup 0" >> .hg/hgrc | |
62 | $ echo "pushkey = python \"$TESTDIR/printenv.py\" pushkey 0" >> .hg/hgrc |
|
62 | $ echo "pushkey = python \"$TESTDIR/printenv.py\" pushkey 0" >> .hg/hgrc | |
63 | $ req |
|
63 | $ req | |
64 | pushing to http://localhost:$HGPORT/ |
|
64 | pushing to http://localhost:$HGPORT/ | |
65 | searching for changes |
|
65 | searching for changes | |
66 | remote: adding changesets |
|
66 | remote: adding changesets | |
67 | remote: adding manifests |
|
67 | remote: adding manifests | |
68 | remote: adding file changes |
|
68 | remote: adding file changes | |
69 | remote: added 1 changesets with 1 changes to 1 files |
|
69 | remote: added 1 changesets with 1 changes to 1 files | |
70 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob) |
|
70 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob) | |
71 | remote: pushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1 |
|
71 | remote: pushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1 | |
72 | % serve errors |
|
72 | % serve errors | |
73 | $ hg rollback |
|
73 | $ hg rollback | |
74 | repository tip rolled back to revision 0 (undo serve) |
|
74 | repository tip rolled back to revision 0 (undo serve) | |
75 |
|
75 | |||
76 | expect success, server lacks the httpheader capability |
|
76 | expect success, server lacks the httpheader capability | |
77 |
|
77 | |||
78 | $ CAP=httpheader |
|
78 | $ CAP=httpheader | |
79 | $ . "$TESTDIR/notcapable" |
|
79 | $ . "$TESTDIR/notcapable" | |
80 | $ req |
|
80 | $ req | |
81 | pushing to http://localhost:$HGPORT/ |
|
81 | pushing to http://localhost:$HGPORT/ | |
82 | searching for changes |
|
82 | searching for changes | |
83 | remote: adding changesets |
|
83 | remote: adding changesets | |
84 | remote: adding manifests |
|
84 | remote: adding manifests | |
85 | remote: adding file changes |
|
85 | remote: adding file changes | |
86 | remote: added 1 changesets with 1 changes to 1 files |
|
86 | remote: added 1 changesets with 1 changes to 1 files | |
87 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob) |
|
87 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob) | |
88 | remote: pushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1 |
|
88 | remote: pushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1 | |
89 | % serve errors |
|
89 | % serve errors | |
90 | $ hg rollback |
|
90 | $ hg rollback | |
91 | repository tip rolled back to revision 0 (undo serve) |
|
91 | repository tip rolled back to revision 0 (undo serve) | |
92 |
|
92 | |||
93 | expect success, server lacks the unbundlehash capability |
|
93 | expect success, server lacks the unbundlehash capability | |
94 |
|
94 | |||
95 | $ CAP=unbundlehash |
|
95 | $ CAP=unbundlehash | |
96 | $ . "$TESTDIR/notcapable" |
|
96 | $ . "$TESTDIR/notcapable" | |
97 | $ req |
|
97 | $ req | |
98 | pushing to http://localhost:$HGPORT/ |
|
98 | pushing to http://localhost:$HGPORT/ | |
99 | searching for changes |
|
99 | searching for changes | |
100 | remote: adding changesets |
|
100 | remote: adding changesets | |
101 | remote: adding manifests |
|
101 | remote: adding manifests | |
102 | remote: adding file changes |
|
102 | remote: adding file changes | |
103 | remote: added 1 changesets with 1 changes to 1 files |
|
103 | remote: added 1 changesets with 1 changes to 1 files | |
104 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob) |
|
104 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob) | |
105 | remote: pushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1 |
|
105 | remote: pushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1 | |
106 | % serve errors |
|
106 | % serve errors | |
107 | $ hg rollback |
|
107 | $ hg rollback | |
108 | repository tip rolled back to revision 0 (undo serve) |
|
108 | repository tip rolled back to revision 0 (undo serve) | |
109 |
|
109 | |||
110 | expect push success, phase change failure |
|
110 | expect push success, phase change failure | |
111 |
|
111 | |||
112 |
$ |
|
112 | $ cat > .hg/hgrc <<EOF | |
113 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
113 | > [web] | |
114 | $ echo 'allow_push = *' >> .hg/hgrc |
|
114 | > push_ssl = false | |
115 | $ echo '[hooks]' >> .hg/hgrc |
|
115 | > allow_push = * | |
116 | $ echo 'prepushkey = python "$TESTDIR/printenv.py" prepushkey 1' >> .hg/hgrc |
|
116 | > [hooks] | |
|
117 | > prepushkey = python "$TESTDIR/printenv.py" prepushkey 1 | |||
|
118 | > EOF | |||
117 | $ req |
|
119 | $ req | |
118 | pushing to http://localhost:$HGPORT/ |
|
120 | pushing to http://localhost:$HGPORT/ | |
119 | searching for changes |
|
121 | searching for changes | |
120 | remote: adding changesets |
|
122 | remote: adding changesets | |
121 | remote: adding manifests |
|
123 | remote: adding manifests | |
122 | remote: adding file changes |
|
124 | remote: adding file changes | |
123 | remote: added 1 changesets with 1 changes to 1 files |
|
125 | remote: added 1 changesets with 1 changes to 1 files | |
124 | remote: prepushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 |
|
126 | remote: prepushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 | |
125 | updating ba677d0156c1 to public failed! |
|
127 | updating ba677d0156c1 to public failed! | |
126 | % serve errors |
|
128 | % serve errors | |
127 |
|
129 | |||
128 | expect phase change success |
|
130 | expect phase change success | |
129 |
|
131 | |||
130 |
$ echo |
|
132 | $ echo "prepushkey = python \"$TESTDIR/printenv.py\" prepushkey 0" >> .hg/hgrc | |
131 | $ req |
|
133 | $ req | |
132 | pushing to http://localhost:$HGPORT/ |
|
134 | pushing to http://localhost:$HGPORT/ | |
133 | searching for changes |
|
135 | searching for changes | |
134 | no changes found |
|
136 | no changes found | |
135 | remote: prepushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 |
|
137 | remote: prepushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 | |
136 | % serve errors |
|
138 | % serve errors | |
137 | [1] |
|
139 | [1] | |
138 | $ hg rollback |
|
140 | $ hg rollback | |
139 | repository tip rolled back to revision 0 (undo serve) |
|
141 | repository tip rolled back to revision 0 (undo serve) | |
140 |
|
142 | |||
141 | expect authorization error: all users denied |
|
143 | expect authorization error: all users denied | |
142 |
|
144 | |||
143 | $ echo '[web]' > .hg/hgrc |
|
145 | $ echo '[web]' > .hg/hgrc | |
144 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
146 | $ echo 'push_ssl = false' >> .hg/hgrc | |
145 | $ echo 'deny_push = *' >> .hg/hgrc |
|
147 | $ echo 'deny_push = *' >> .hg/hgrc | |
146 | $ req |
|
148 | $ req | |
147 | pushing to http://localhost:$HGPORT/ |
|
149 | pushing to http://localhost:$HGPORT/ | |
148 | searching for changes |
|
150 | searching for changes | |
149 | abort: authorization failed |
|
151 | abort: authorization failed | |
150 | % serve errors |
|
152 | % serve errors | |
151 | [255] |
|
153 | [255] | |
152 |
|
154 | |||
153 | expect authorization error: some users denied, users must be authenticated |
|
155 | expect authorization error: some users denied, users must be authenticated | |
154 |
|
156 | |||
155 | $ echo 'deny_push = unperson' >> .hg/hgrc |
|
157 | $ echo 'deny_push = unperson' >> .hg/hgrc | |
156 | $ req |
|
158 | $ req | |
157 | pushing to http://localhost:$HGPORT/ |
|
159 | pushing to http://localhost:$HGPORT/ | |
158 | searching for changes |
|
160 | searching for changes | |
159 | abort: authorization failed |
|
161 | abort: authorization failed | |
160 | % serve errors |
|
162 | % serve errors | |
161 | [255] |
|
163 | [255] | |
162 |
|
164 | |||
163 | $ cd .. |
|
165 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now