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