Show More
@@ -1,54 +1,87 b'' | |||
|
1 | #!/bin/sh | |
|
2 | ||
|
3 | cp "$TESTDIR"/printenv.py . | |
|
4 | ||
|
5 | hg init test | |
|
6 | cd test | |
|
7 | echo a > a | |
|
8 | hg ci -Ama | |
|
9 | 1 | |
|
10 | cd .. | |
|
11 | hg clone test test2 | |
|
12 |
cd test |
|
|
13 |
echo a |
|
|
14 |
hg ci - |
|
|
2 | $ cp "$TESTDIR"/printenv.py . | |
|
3 | $ hg init test | |
|
4 | $ cd test | |
|
5 | $ echo a > a | |
|
6 | $ hg ci -Ama | |
|
7 | adding a | |
|
8 | $ cd .. | |
|
9 | $ hg clone test test2 | |
|
10 | updating to branch default | |
|
11 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
12 | $ cd test2 | |
|
13 | $ echo a >> a | |
|
14 | $ hg ci -mb | |
|
15 | $ req() { | |
|
16 | > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
|
17 | > cat hg.pid >> $DAEMON_PIDS | |
|
18 | > hg --cwd ../test2 push http://localhost:$HGPORT/ | |
|
19 | > kill `cat hg.pid` | |
|
20 | > echo % serve errors | |
|
21 | > cat errors.log | |
|
22 | > } | |
|
23 | $ cd ../test | |
|
15 | 24 | |
|
16 | req() { | |
|
17 | hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
|
18 | cat hg.pid >> $DAEMON_PIDS | |
|
19 | hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/," | |
|
20 | kill `cat hg.pid` | |
|
21 | echo % serve errors | |
|
22 | cat errors.log | |
|
23 | } | |
|
25 | expect ssl error | |
|
26 | ||
|
27 | $ req | |
|
28 | pushing to http://localhost:*/ (glob) | |
|
29 | searching for changes | |
|
30 | remote: ssl required | |
|
31 | % serve errors | |
|
32 | ||
|
33 | expect authorization error | |
|
24 | 34 | |
|
25 | cd ../test | |
|
35 | $ echo '[web]' > .hg/hgrc | |
|
36 | $ echo 'push_ssl = false' >> .hg/hgrc | |
|
37 | $ req | |
|
38 | pushing to http://localhost:*/ (glob) | |
|
39 | searching for changes | |
|
40 | abort: authorization failed | |
|
41 | % serve errors | |
|
42 | ||
|
43 | expect authorization error: must have authorized user | |
|
26 | 44 | |
|
27 | echo % expect ssl error | |
|
28 | req | |
|
45 | $ echo 'allow_push = unperson' >> .hg/hgrc | |
|
46 | $ req | |
|
47 | pushing to http://localhost:*/ (glob) | |
|
48 | searching for changes | |
|
49 | abort: authorization failed | |
|
50 | % serve errors | |
|
29 | 51 | |
|
30 | echo % expect authorization error | |
|
31 | echo '[web]' > .hg/hgrc | |
|
32 | echo 'push_ssl = false' >> .hg/hgrc | |
|
33 | req | |
|
34 | ||
|
35 | echo % expect authorization error: must have authorized user | |
|
36 | echo 'allow_push = unperson' >> .hg/hgrc | |
|
37 | req | |
|
52 | expect success | |
|
38 | 53 | |
|
39 | echo % expect success | |
|
40 |
echo ' |
|
|
41 | echo '[hooks]' >> .hg/hgrc | |
|
42 | echo 'changegroup = python ../printenv.py changegroup 0' >> .hg/hgrc | |
|
43 | req | |
|
54 | $ echo 'allow_push = *' >> .hg/hgrc | |
|
55 | $ echo '[hooks]' >> .hg/hgrc | |
|
56 | $ echo 'changegroup = python ../printenv.py changegroup 0' >> .hg/hgrc | |
|
57 | $ req | |
|
58 | pushing to http://localhost:*/ (glob) | |
|
59 | searching for changes | |
|
60 | remote: adding changesets | |
|
61 | remote: adding manifests | |
|
62 | remote: adding file changes | |
|
63 | remote: added 1 changesets with 1 changes to 1 files | |
|
64 | remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http | |
|
65 | % serve errors | |
|
66 | $ hg rollback | |
|
67 | rolling back to revision 0 (undo serve) | |
|
68 | ||
|
69 | expect authorization error: all users denied | |
|
44 | 70 | |
|
45 | hg rollback | |
|
46 | echo % expect authorization error: all users denied | |
|
47 |
echo ' |
|
|
48 | echo 'push_ssl = false' >> .hg/hgrc | |
|
49 | echo 'deny_push = *' >> .hg/hgrc | |
|
50 | req | |
|
71 | $ echo '[web]' > .hg/hgrc | |
|
72 | $ echo 'push_ssl = false' >> .hg/hgrc | |
|
73 | $ echo 'deny_push = *' >> .hg/hgrc | |
|
74 | $ req | |
|
75 | pushing to http://localhost:*/ (glob) | |
|
76 | searching for changes | |
|
77 | abort: authorization failed | |
|
78 | % serve errors | |
|
51 | 79 | |
|
52 |
|
|
|
53 | echo 'deny_push = unperson' >> .hg/hgrc | |
|
54 | req | |
|
80 | expect authorization error: some users denied, users must be authenticated | |
|
81 | ||
|
82 | $ echo 'deny_push = unperson' >> .hg/hgrc | |
|
83 | $ req | |
|
84 | pushing to http://localhost:*/ (glob) | |
|
85 | searching for changes | |
|
86 | abort: authorization failed | |
|
87 | % serve errors |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now