Show More
@@ -1,155 +1,155 b'' | |||
|
1 | 1 | $ hg init repo |
|
2 | 2 | $ cd repo |
|
3 | 3 | $ echo foo > foo |
|
4 | 4 | $ hg ci -qAm 'add foo' |
|
5 | 5 | $ echo >> foo |
|
6 | 6 | $ hg ci -m 'change foo' |
|
7 | 7 | $ hg up -qC 0 |
|
8 | 8 | $ echo bar > bar |
|
9 | 9 | $ hg ci -qAm 'add bar' |
|
10 | 10 | |
|
11 | 11 | $ hg log |
|
12 | 12 | changeset: 2:effea6de0384 |
|
13 | 13 | tag: tip |
|
14 | 14 | parent: 0:bbd179dfa0a7 |
|
15 | 15 | user: test |
|
16 | 16 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
17 | 17 | summary: add bar |
|
18 | 18 | |
|
19 | 19 | changeset: 1:ed1b79f46b9a |
|
20 | 20 | user: test |
|
21 | 21 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
22 | 22 | summary: change foo |
|
23 | 23 | |
|
24 | 24 | changeset: 0:bbd179dfa0a7 |
|
25 | 25 | user: test |
|
26 | 26 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
27 | 27 | summary: add foo |
|
28 | 28 | |
|
29 | 29 | $ cd .. |
|
30 | 30 | |
|
31 | 31 | Test pullbundle functionality |
|
32 | 32 | |
|
33 | 33 | $ cd repo |
|
34 | 34 | $ cat <<EOF > .hg/hgrc |
|
35 | 35 | > [server] |
|
36 | 36 | > pullbundle = True |
|
37 | 37 | > [extensions] |
|
38 | 38 | > blackbox = |
|
39 | 39 | > EOF |
|
40 | 40 | $ hg bundle --base null -r 0 .hg/0.hg |
|
41 | 41 | 1 changesets found |
|
42 | 42 | $ hg bundle --base 0 -r 1 .hg/1.hg |
|
43 | 43 | 1 changesets found |
|
44 | 44 | $ hg bundle --base 1 -r 2 .hg/2.hg |
|
45 | 45 | 1 changesets found |
|
46 | 46 | $ cat <<EOF > .hg/pullbundles.manifest |
|
47 | 47 | > 2.hg heads=effea6de0384e684f44435651cb7bd70b8735bd4 bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa |
|
48 | 48 | > 1.hg heads=ed1b79f46b9a29f5a6efa59cf12fcfca43bead5a bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa |
|
49 | 49 | > 0.hg heads=bbd179dfa0a71671c253b3ae0aa1513b60d199fa |
|
50 | 50 | > EOF |
|
51 | 51 | $ hg --config blackbox.track=debug --debug serve -p $HGPORT2 -d --pid-file=../repo.pid |
|
52 |
listening at http:// |
|
|
52 | listening at http://*:$HGPORT2/ (bound to $LOCALIP:$HGPORT2) (glob) (?) | |
|
53 | 53 | $ cat ../repo.pid >> $DAEMON_PIDS |
|
54 | 54 | $ cd .. |
|
55 | 55 | $ hg clone -r 0 http://localhost:$HGPORT2/ repo.pullbundle |
|
56 | 56 | adding changesets |
|
57 | 57 | adding manifests |
|
58 | 58 | adding file changes |
|
59 | 59 | added 1 changesets with 1 changes to 1 files |
|
60 | 60 | new changesets bbd179dfa0a7 |
|
61 | 61 | updating to branch default |
|
62 | 62 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
63 | 63 | $ cd repo.pullbundle |
|
64 | 64 | $ hg pull -r 1 |
|
65 | 65 | pulling from http://localhost:$HGPORT2/ |
|
66 | 66 | searching for changes |
|
67 | 67 | adding changesets |
|
68 | 68 | adding manifests |
|
69 | 69 | adding file changes |
|
70 | 70 | added 1 changesets with 1 changes to 1 files |
|
71 | 71 | new changesets ed1b79f46b9a |
|
72 | 72 | (run 'hg update' to get a working copy) |
|
73 | 73 | $ hg pull -r 2 |
|
74 | 74 | pulling from http://localhost:$HGPORT2/ |
|
75 | 75 | searching for changes |
|
76 | 76 | adding changesets |
|
77 | 77 | adding manifests |
|
78 | 78 | adding file changes |
|
79 | 79 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
80 | 80 | new changesets effea6de0384 |
|
81 | 81 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
82 | 82 | $ cd .. |
|
83 | 83 | $ killdaemons.py |
|
84 | 84 | $ grep 'sending pullbundle ' repo/.hg/blackbox.log |
|
85 | 85 | * sending pullbundle "0.hg" (glob) |
|
86 | 86 | * sending pullbundle "1.hg" (glob) |
|
87 | 87 | * sending pullbundle "2.hg" (glob) |
|
88 | 88 | $ rm repo/.hg/blackbox.log |
|
89 | 89 | |
|
90 | 90 | Test pullbundle functionality for incremental pulls |
|
91 | 91 | |
|
92 | 92 | $ cd repo |
|
93 | 93 | $ hg --config blackbox.track=debug --debug serve -p $HGPORT2 -d --pid-file=../repo.pid |
|
94 |
listening at http:// |
|
|
94 | listening at http://*:$HGPORT2/ (bound to $LOCALIP:$HGPORT2) (glob) (?) | |
|
95 | 95 | $ cat ../repo.pid >> $DAEMON_PIDS |
|
96 | 96 | $ cd .. |
|
97 | 97 | $ hg clone http://localhost:$HGPORT2/ repo.pullbundle2 |
|
98 | 98 | requesting all changes |
|
99 | 99 | adding changesets |
|
100 | 100 | adding manifests |
|
101 | 101 | adding file changes |
|
102 | 102 | added 1 changesets with 1 changes to 1 files |
|
103 | 103 | adding changesets |
|
104 | 104 | adding manifests |
|
105 | 105 | adding file changes |
|
106 | 106 | added 1 changesets with 1 changes to 1 files |
|
107 | 107 | adding changesets |
|
108 | 108 | adding manifests |
|
109 | 109 | adding file changes |
|
110 | 110 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
111 | 111 | new changesets bbd179dfa0a7:ed1b79f46b9a |
|
112 | 112 | updating to branch default |
|
113 | 113 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
114 | 114 | $ killdaemons.py |
|
115 | 115 | $ grep 'sending pullbundle ' repo/.hg/blackbox.log |
|
116 | 116 | * sending pullbundle "0.hg" (glob) |
|
117 | 117 | * sending pullbundle "2.hg" (glob) |
|
118 | 118 | * sending pullbundle "1.hg" (glob) |
|
119 | 119 | $ rm repo/.hg/blackbox.log |
|
120 | 120 | |
|
121 | 121 | Test recovery from misconfigured server sending no new data |
|
122 | 122 | |
|
123 | 123 | $ cd repo |
|
124 | 124 | $ cat <<EOF > .hg/pullbundles.manifest |
|
125 | 125 | > 0.hg heads=ed1b79f46b9a29f5a6efa59cf12fcfca43bead5a bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa |
|
126 | 126 | > 0.hg heads=bbd179dfa0a71671c253b3ae0aa1513b60d199fa |
|
127 | 127 | > EOF |
|
128 | 128 | $ hg --config blackbox.track=debug --debug serve -p $HGPORT2 -d --pid-file=../repo.pid |
|
129 |
listening at http:// |
|
|
129 | listening at http://*:$HGPORT2/ (bound to $LOCALIP:$HGPORT2) (glob) (?) | |
|
130 | 130 | $ cat ../repo.pid >> $DAEMON_PIDS |
|
131 | 131 | $ cd .. |
|
132 | 132 | $ hg clone -r 0 http://localhost:$HGPORT2/ repo.pullbundle3 |
|
133 | 133 | adding changesets |
|
134 | 134 | adding manifests |
|
135 | 135 | adding file changes |
|
136 | 136 | added 1 changesets with 1 changes to 1 files |
|
137 | 137 | new changesets bbd179dfa0a7 |
|
138 | 138 | updating to branch default |
|
139 | 139 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
140 | 140 | $ cd repo.pullbundle3 |
|
141 | 141 | $ hg pull -r 1 |
|
142 | 142 | pulling from http://localhost:$HGPORT2/ |
|
143 | 143 | searching for changes |
|
144 | 144 | adding changesets |
|
145 | 145 | adding manifests |
|
146 | 146 | adding file changes |
|
147 | 147 | added 0 changesets with 0 changes to 1 files |
|
148 | 148 | abort: 00changelog.i@ed1b79f46b9a: no node! |
|
149 | 149 | [255] |
|
150 | 150 | $ cd .. |
|
151 | 151 | $ killdaemons.py |
|
152 | 152 | $ grep 'sending pullbundle ' repo/.hg/blackbox.log |
|
153 | 153 | * sending pullbundle "0.hg" (glob) |
|
154 | 154 | * sending pullbundle "0.hg" (glob) |
|
155 | 155 | $ rm repo/.hg/blackbox.log |
@@ -1,382 +1,382 b'' | |||
|
1 | 1 | #require killdaemons |
|
2 | 2 | |
|
3 | 3 | #testcases bundle1 bundle2 |
|
4 | 4 | |
|
5 | 5 | #if bundle1 |
|
6 | 6 | $ cat << EOF >> $HGRCPATH |
|
7 | 7 | > [devel] |
|
8 | 8 | > # This test is dedicated to interaction through old bundle |
|
9 | 9 | > legacy.exchange = bundle1 |
|
10 | 10 | > EOF |
|
11 | 11 | #endif |
|
12 | 12 | |
|
13 | 13 | $ hg init test |
|
14 | 14 | $ cd test |
|
15 | 15 | $ echo a > a |
|
16 | 16 | $ hg ci -Ama |
|
17 | 17 | adding a |
|
18 | 18 | $ cd .. |
|
19 | 19 | $ hg clone test test2 |
|
20 | 20 | updating to branch default |
|
21 | 21 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
22 | 22 | $ cd test2 |
|
23 | 23 | $ echo a >> a |
|
24 | 24 | $ hg ci -mb |
|
25 | 25 | $ req() { |
|
26 | 26 | > hg $1 serve -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
27 | 27 | > cat hg.pid >> $DAEMON_PIDS |
|
28 | 28 | > hg --cwd ../test2 push http://localhost:$HGPORT/ |
|
29 | 29 | > exitstatus=$? |
|
30 | 30 | > killdaemons.py |
|
31 | 31 | > echo % serve errors |
|
32 | 32 | > cat errors.log |
|
33 | 33 | > return $exitstatus |
|
34 | 34 | > } |
|
35 | 35 | $ cd ../test |
|
36 | 36 | |
|
37 | 37 | expect ssl error |
|
38 | 38 | |
|
39 | 39 | $ req |
|
40 | 40 | pushing to http://localhost:$HGPORT/ |
|
41 | 41 | searching for changes |
|
42 | 42 | abort: HTTP Error 403: ssl required |
|
43 | 43 | % serve errors |
|
44 | 44 | [255] |
|
45 | 45 | |
|
46 | 46 | expect authorization error |
|
47 | 47 | |
|
48 | 48 | $ echo '[web]' > .hg/hgrc |
|
49 | 49 | $ echo 'push_ssl = false' >> .hg/hgrc |
|
50 | 50 | $ req |
|
51 | 51 | pushing to http://localhost:$HGPORT/ |
|
52 | 52 | searching for changes |
|
53 | 53 | abort: authorization failed |
|
54 | 54 | % serve errors |
|
55 | 55 | [255] |
|
56 | 56 | |
|
57 | 57 | expect authorization error: must have authorized user |
|
58 | 58 | |
|
59 | 59 | $ echo 'allow_push = unperson' >> .hg/hgrc |
|
60 | 60 | $ req |
|
61 | 61 | pushing to http://localhost:$HGPORT/ |
|
62 | 62 | searching for changes |
|
63 | 63 | abort: authorization failed |
|
64 | 64 | % serve errors |
|
65 | 65 | [255] |
|
66 | 66 | |
|
67 | 67 | expect success |
|
68 | 68 | |
|
69 | 69 | $ cat > $TESTTMP/hook.sh <<'EOF' |
|
70 | 70 | > echo "phase-move: $HG_NODE: $HG_OLDPHASE -> $HG_PHASE" |
|
71 | 71 | > EOF |
|
72 | 72 | |
|
73 | 73 | #if bundle1 |
|
74 | 74 | $ cat >> .hg/hgrc <<EOF |
|
75 | 75 | > allow_push = * |
|
76 | 76 | > [hooks] |
|
77 | 77 | > changegroup = sh -c "printenv.py changegroup 0" |
|
78 | 78 | > pushkey = sh -c "printenv.py pushkey 0" |
|
79 | 79 | > txnclose-phase.test = sh $TESTTMP/hook.sh |
|
80 | 80 | > EOF |
|
81 | 81 | $ req "--debug --config extensions.blackbox=" |
|
82 |
listening at http:// |
|
|
82 | listening at http://*:$HGPORT/ (bound to $LOCALIP:$HGPORT) (glob) (?) | |
|
83 | 83 | pushing to http://localhost:$HGPORT/ |
|
84 | 84 | searching for changes |
|
85 | 85 | remote: redirecting incoming bundle to */hg-unbundle-* (glob) |
|
86 | 86 | remote: adding changesets |
|
87 | 87 | remote: add changeset ba677d0156c1 |
|
88 | 88 | remote: adding manifests |
|
89 | 89 | remote: adding file changes |
|
90 | 90 | remote: adding a revisions |
|
91 | 91 | remote: added 1 changesets with 1 changes to 1 files |
|
92 | 92 | remote: updating the branch cache |
|
93 | 93 | remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh |
|
94 | 94 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public |
|
95 | 95 | remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh |
|
96 | 96 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public |
|
97 | 97 | remote: running hook changegroup: sh -c "printenv.py changegroup 0" |
|
98 | 98 | remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) |
|
99 | 99 | % serve errors |
|
100 | 100 | $ hg rollback |
|
101 | 101 | repository tip rolled back to revision 0 (undo serve) |
|
102 | 102 | $ req "--debug --config server.streamunbundle=True --config extensions.blackbox=" |
|
103 |
listening at http:// |
|
|
103 | listening at http://*:$HGPORT/ (bound to $LOCALIP:$HGPORT) (glob) (?) | |
|
104 | 104 | pushing to http://localhost:$HGPORT/ |
|
105 | 105 | searching for changes |
|
106 | 106 | remote: adding changesets |
|
107 | 107 | remote: add changeset ba677d0156c1 |
|
108 | 108 | remote: adding manifests |
|
109 | 109 | remote: adding file changes |
|
110 | 110 | remote: adding a revisions |
|
111 | 111 | remote: added 1 changesets with 1 changes to 1 files |
|
112 | 112 | remote: updating the branch cache |
|
113 | 113 | remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh |
|
114 | 114 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public |
|
115 | 115 | remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh |
|
116 | 116 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public |
|
117 | 117 | remote: running hook changegroup: sh -c "printenv.py changegroup 0" |
|
118 | 118 | remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) |
|
119 | 119 | % serve errors |
|
120 | 120 | $ hg rollback |
|
121 | 121 | repository tip rolled back to revision 0 (undo serve) |
|
122 | 122 | #endif |
|
123 | 123 | |
|
124 | 124 | #if bundle2 |
|
125 | 125 | $ cat >> .hg/hgrc <<EOF |
|
126 | 126 | > allow_push = * |
|
127 | 127 | > [hooks] |
|
128 | 128 | > changegroup = sh -c "printenv.py changegroup 0" |
|
129 | 129 | > pushkey = sh -c "printenv.py pushkey 0" |
|
130 | 130 | > txnclose-phase.test = sh $TESTTMP/hook.sh |
|
131 | 131 | > EOF |
|
132 | 132 | $ req |
|
133 | 133 | pushing to http://localhost:$HGPORT/ |
|
134 | 134 | searching for changes |
|
135 | 135 | remote: adding changesets |
|
136 | 136 | remote: adding manifests |
|
137 | 137 | remote: adding file changes |
|
138 | 138 | remote: added 1 changesets with 1 changes to 1 files |
|
139 | 139 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public |
|
140 | 140 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public |
|
141 | 141 | remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) |
|
142 | 142 | % serve errors |
|
143 | 143 | $ hg rollback |
|
144 | 144 | repository tip rolled back to revision 0 (undo serve) |
|
145 | 145 | #endif |
|
146 | 146 | |
|
147 | 147 | expect success, server lacks the httpheader capability |
|
148 | 148 | |
|
149 | 149 | $ CAP=httpheader |
|
150 | 150 | $ . "$TESTDIR/notcapable" |
|
151 | 151 | $ req |
|
152 | 152 | pushing to http://localhost:$HGPORT/ |
|
153 | 153 | searching for changes |
|
154 | 154 | remote: adding changesets |
|
155 | 155 | remote: adding manifests |
|
156 | 156 | remote: adding file changes |
|
157 | 157 | remote: added 1 changesets with 1 changes to 1 files |
|
158 | 158 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public |
|
159 | 159 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public |
|
160 | 160 | remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) (bundle1 !) |
|
161 | 161 | remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) (bundle2 !) |
|
162 | 162 | % serve errors |
|
163 | 163 | $ hg rollback |
|
164 | 164 | repository tip rolled back to revision 0 (undo serve) |
|
165 | 165 | |
|
166 | 166 | expect success, server lacks the unbundlehash capability |
|
167 | 167 | |
|
168 | 168 | $ CAP=unbundlehash |
|
169 | 169 | $ . "$TESTDIR/notcapable" |
|
170 | 170 | $ req |
|
171 | 171 | pushing to http://localhost:$HGPORT/ |
|
172 | 172 | searching for changes |
|
173 | 173 | remote: adding changesets |
|
174 | 174 | remote: adding manifests |
|
175 | 175 | remote: adding file changes |
|
176 | 176 | remote: added 1 changesets with 1 changes to 1 files |
|
177 | 177 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public |
|
178 | 178 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public |
|
179 | 179 | remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) (bundle1 !) |
|
180 | 180 | remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) (bundle2 !) |
|
181 | 181 | % serve errors |
|
182 | 182 | $ hg rollback |
|
183 | 183 | repository tip rolled back to revision 0 (undo serve) |
|
184 | 184 | |
|
185 | 185 | expect success, pre-d1b16a746db6 server supports the unbundle capability, but |
|
186 | 186 | has no parameter |
|
187 | 187 | |
|
188 | 188 | $ cat <<EOF > notcapable-unbundleparam.py |
|
189 | 189 | > from mercurial import extensions, httppeer |
|
190 | 190 | > def capable(orig, self, name): |
|
191 | 191 | > if name == 'unbundle': |
|
192 | 192 | > return True |
|
193 | 193 | > return orig(self, name) |
|
194 | 194 | > def uisetup(ui): |
|
195 | 195 | > extensions.wrapfunction(httppeer.httppeer, 'capable', capable) |
|
196 | 196 | > EOF |
|
197 | 197 | $ cp $HGRCPATH $HGRCPATH.orig |
|
198 | 198 | $ cat <<EOF >> $HGRCPATH |
|
199 | 199 | > [extensions] |
|
200 | 200 | > notcapable-unbundleparam = `pwd`/notcapable-unbundleparam.py |
|
201 | 201 | > EOF |
|
202 | 202 | $ req |
|
203 | 203 | pushing to http://localhost:$HGPORT/ |
|
204 | 204 | searching for changes |
|
205 | 205 | remote: adding changesets |
|
206 | 206 | remote: adding manifests |
|
207 | 207 | remote: adding file changes |
|
208 | 208 | remote: added 1 changesets with 1 changes to 1 files |
|
209 | 209 | remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public |
|
210 | 210 | remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public |
|
211 | 211 | remote: changegroup hook: * (glob) |
|
212 | 212 | % serve errors |
|
213 | 213 | $ hg rollback |
|
214 | 214 | repository tip rolled back to revision 0 (undo serve) |
|
215 | 215 | $ mv $HGRCPATH.orig $HGRCPATH |
|
216 | 216 | |
|
217 | 217 | Test pushing to a publishing repository with a failing prepushkey hook |
|
218 | 218 | |
|
219 | 219 | $ cat > .hg/hgrc <<EOF |
|
220 | 220 | > [web] |
|
221 | 221 | > push_ssl = false |
|
222 | 222 | > allow_push = * |
|
223 | 223 | > [hooks] |
|
224 | 224 | > prepushkey = sh -c "printenv.py prepushkey 1" |
|
225 | 225 | > [devel] |
|
226 | 226 | > legacy.exchange=phases |
|
227 | 227 | > EOF |
|
228 | 228 | |
|
229 | 229 | #if bundle1 |
|
230 | 230 | Bundle1 works because a) phases are updated as part of changegroup application |
|
231 | 231 | and b) client checks phases after the "unbundle" command. Since it sees no |
|
232 | 232 | phase changes are necessary, it doesn't send the "pushkey" command and the |
|
233 | 233 | prepushkey hook never has to fire. |
|
234 | 234 | |
|
235 | 235 | $ req |
|
236 | 236 | pushing to http://localhost:$HGPORT/ |
|
237 | 237 | searching for changes |
|
238 | 238 | remote: adding changesets |
|
239 | 239 | remote: adding manifests |
|
240 | 240 | remote: adding file changes |
|
241 | 241 | remote: added 1 changesets with 1 changes to 1 files |
|
242 | 242 | % serve errors |
|
243 | 243 | |
|
244 | 244 | #endif |
|
245 | 245 | |
|
246 | 246 | #if bundle2 |
|
247 | 247 | Bundle2 sends a "pushkey" bundle2 part. This runs as part of the transaction |
|
248 | 248 | and fails the entire push. |
|
249 | 249 | $ req |
|
250 | 250 | pushing to http://localhost:$HGPORT/ |
|
251 | 251 | searching for changes |
|
252 | 252 | remote: adding changesets |
|
253 | 253 | remote: adding manifests |
|
254 | 254 | remote: adding file changes |
|
255 | 255 | remote: added 1 changesets with 1 changes to 1 files |
|
256 | 256 | remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) |
|
257 | 257 | remote: pushkey-abort: prepushkey hook exited with status 1 |
|
258 | 258 | remote: transaction abort! |
|
259 | 259 | remote: rollback completed |
|
260 | 260 | abort: updating ba677d0156c1 to public failed |
|
261 | 261 | % serve errors |
|
262 | 262 | [255] |
|
263 | 263 | |
|
264 | 264 | #endif |
|
265 | 265 | |
|
266 | 266 | Now remove the failing prepushkey hook. |
|
267 | 267 | |
|
268 | 268 | $ cat >> .hg/hgrc <<EOF |
|
269 | 269 | > [hooks] |
|
270 | 270 | > prepushkey = sh -c "printenv.py prepushkey 0" |
|
271 | 271 | > EOF |
|
272 | 272 | |
|
273 | 273 | We don't need to test bundle1 because it succeeded above. |
|
274 | 274 | |
|
275 | 275 | #if bundle2 |
|
276 | 276 | $ req |
|
277 | 277 | pushing to http://localhost:$HGPORT/ |
|
278 | 278 | searching for changes |
|
279 | 279 | remote: adding changesets |
|
280 | 280 | remote: adding manifests |
|
281 | 281 | remote: adding file changes |
|
282 | 282 | remote: added 1 changesets with 1 changes to 1 files |
|
283 | 283 | remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) |
|
284 | 284 | % serve errors |
|
285 | 285 | #endif |
|
286 | 286 | |
|
287 | 287 | $ hg --config extensions.strip= strip -r 1: |
|
288 | 288 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/ba677d0156c1-eea704d7-backup.hg |
|
289 | 289 | |
|
290 | 290 | Now do a variant of the above, except on a non-publishing repository |
|
291 | 291 | |
|
292 | 292 | $ cat >> .hg/hgrc <<EOF |
|
293 | 293 | > [phases] |
|
294 | 294 | > publish = false |
|
295 | 295 | > [hooks] |
|
296 | 296 | > prepushkey = sh -c "printenv.py prepushkey 1" |
|
297 | 297 | > EOF |
|
298 | 298 | |
|
299 | 299 | #if bundle1 |
|
300 | 300 | $ req |
|
301 | 301 | pushing to http://localhost:$HGPORT/ |
|
302 | 302 | searching for changes |
|
303 | 303 | remote: adding changesets |
|
304 | 304 | remote: adding manifests |
|
305 | 305 | remote: adding file changes |
|
306 | 306 | remote: added 1 changesets with 1 changes to 1 files |
|
307 | 307 | remote: prepushkey hook: HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 |
|
308 | 308 | remote: pushkey-abort: prepushkey hook exited with status 1 |
|
309 | 309 | updating ba677d0156c1 to public failed! |
|
310 | 310 | % serve errors |
|
311 | 311 | #endif |
|
312 | 312 | |
|
313 | 313 | #if bundle2 |
|
314 | 314 | $ req |
|
315 | 315 | pushing to http://localhost:$HGPORT/ |
|
316 | 316 | searching for changes |
|
317 | 317 | remote: adding changesets |
|
318 | 318 | remote: adding manifests |
|
319 | 319 | remote: adding file changes |
|
320 | 320 | remote: added 1 changesets with 1 changes to 1 files |
|
321 | 321 | remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) |
|
322 | 322 | remote: pushkey-abort: prepushkey hook exited with status 1 |
|
323 | 323 | remote: transaction abort! |
|
324 | 324 | remote: rollback completed |
|
325 | 325 | abort: updating ba677d0156c1 to public failed |
|
326 | 326 | % serve errors |
|
327 | 327 | [255] |
|
328 | 328 | #endif |
|
329 | 329 | |
|
330 | 330 | Make phases updates work |
|
331 | 331 | |
|
332 | 332 | $ cat >> .hg/hgrc <<EOF |
|
333 | 333 | > [hooks] |
|
334 | 334 | > prepushkey = sh -c "printenv.py prepushkey 0" |
|
335 | 335 | > EOF |
|
336 | 336 | |
|
337 | 337 | #if bundle1 |
|
338 | 338 | $ req |
|
339 | 339 | pushing to http://localhost:$HGPORT/ |
|
340 | 340 | searching for changes |
|
341 | 341 | no changes found |
|
342 | 342 | remote: prepushkey hook: HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 |
|
343 | 343 | % serve errors |
|
344 | 344 | [1] |
|
345 | 345 | #endif |
|
346 | 346 | |
|
347 | 347 | #if bundle2 |
|
348 | 348 | $ req |
|
349 | 349 | pushing to http://localhost:$HGPORT/ |
|
350 | 350 | searching for changes |
|
351 | 351 | remote: adding changesets |
|
352 | 352 | remote: adding manifests |
|
353 | 353 | remote: adding file changes |
|
354 | 354 | remote: added 1 changesets with 1 changes to 1 files |
|
355 | 355 | remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) |
|
356 | 356 | % serve errors |
|
357 | 357 | #endif |
|
358 | 358 | |
|
359 | 359 | $ hg --config extensions.strip= strip -r 1: |
|
360 | 360 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/ba677d0156c1-eea704d7-backup.hg |
|
361 | 361 | |
|
362 | 362 | #if bundle2 |
|
363 | 363 | |
|
364 | 364 | $ cat > .hg/hgrc <<EOF |
|
365 | 365 | > [web] |
|
366 | 366 | > push_ssl = false |
|
367 | 367 | > allow_push = * |
|
368 | 368 | > [experimental] |
|
369 | 369 | > httppostargs=true |
|
370 | 370 | > EOF |
|
371 | 371 | $ req |
|
372 | 372 | pushing to http://localhost:$HGPORT/ |
|
373 | 373 | searching for changes |
|
374 | 374 | remote: adding changesets |
|
375 | 375 | remote: adding manifests |
|
376 | 376 | remote: adding file changes |
|
377 | 377 | remote: added 1 changesets with 1 changes to 1 files |
|
378 | 378 | % serve errors |
|
379 | 379 | |
|
380 | 380 | #endif |
|
381 | 381 | |
|
382 | 382 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now