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