Show More
@@ -1,40 +1,40 b'' | |||
|
1 | 1 | #!/bin/bash -eu |
|
2 | 2 | |
|
3 | 3 | . $(dirname $0)/packagelib.sh |
|
4 | 4 | |
|
5 | 5 | BUILDDIR=$(dirname $0) |
|
6 | 6 | export ROOTDIR=$(cd $BUILDDIR/../.. > /dev/null; pwd) |
|
7 | 7 | |
|
8 | 8 | DISTID="$1" |
|
9 | 9 | CODENAME="$2" |
|
10 | 10 | PLATFORM="$1-$2" |
|
11 | 11 | shift; shift # extra params are passed to build process |
|
12 | 12 | |
|
13 | 13 | OUTPUTDIR=${OUTPUTDIR:=$ROOTDIR/packages/$PLATFORM} |
|
14 | 14 | CONTAINER=hg-docker-$PLATFORM |
|
15 | 15 | |
|
16 | 16 | DOCKER=$($BUILDDIR/hg-docker docker-path) |
|
17 | 17 | |
|
18 | 18 | $BUILDDIR/hg-docker build \ |
|
19 | 19 | --build-arg CODENAME=$CODENAME \ |
|
20 | 20 | $BUILDDIR/docker/$DISTID.template \ |
|
21 | 21 | $CONTAINER |
|
22 | 22 | |
|
23 | 23 | # debuild only appears to be able to save built debs etc to .., so we |
|
24 | 24 | # have to share the .. of the current directory with the docker |
|
25 | 25 | # container and hope it's writable. Whee. |
|
26 | 26 | dn=$(basename $ROOTDIR) |
|
27 | 27 | |
|
28 | 28 | DBUILDUSER=build |
|
29 | 29 | |
|
30 | 30 | if [ $(uname) = "Darwin" ] ; then |
|
31 | 31 | $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \ |
|
32 | 32 | sh -c "cd /mnt/$dn && make clean && make local" |
|
33 | 33 | fi |
|
34 | 34 | $DOCKER run -u $DBUILDUSER --rm -v $ROOTDIR/..:/mnt $CONTAINER \ |
|
35 | 35 | sh -c "cd /mnt/$dn && DEB_BUILD_OPTIONS='${DEB_BUILD_OPTIONS:=}' contrib/packaging/builddeb --build --distid $DISTID --codename $CODENAME $@" |
|
36 | contrib/packaging/builddeb --cleanup --distid $DISTID --codename $CODENAME | |
|
36 | (cd $ROOTDIR && contrib/packaging/builddeb --cleanup --distid $DISTID --codename $CODENAME) | |
|
37 | 37 | if [ $(uname) = "Darwin" ] ; then |
|
38 | 38 | $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \ |
|
39 | 39 | sh -c "cd /mnt/$dn && make clean" |
|
40 | 40 | fi |
@@ -1,559 +1,560 b'' | |||
|
1 | 1 | #require no-reposimplestore no-chg |
|
2 | 2 | |
|
3 | 3 | Set up a server |
|
4 | 4 | |
|
5 | 5 | $ hg init server |
|
6 | 6 | $ cd server |
|
7 | 7 | $ cat >> .hg/hgrc << EOF |
|
8 | 8 | > [extensions] |
|
9 | 9 | > clonebundles = |
|
10 | 10 | > EOF |
|
11 | 11 | |
|
12 | 12 | $ touch foo |
|
13 | 13 | $ hg -q commit -A -m 'add foo' |
|
14 | 14 | $ touch bar |
|
15 | 15 | $ hg -q commit -A -m 'add bar' |
|
16 | 16 | |
|
17 | 17 | $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log |
|
18 | 18 | $ cat hg.pid >> $DAEMON_PIDS |
|
19 | 19 | $ cd .. |
|
20 | 20 | |
|
21 | 21 | Missing manifest should not result in server lookup |
|
22 | 22 | |
|
23 | 23 | $ hg --verbose clone -U http://localhost:$HGPORT no-manifest |
|
24 | 24 | requesting all changes |
|
25 | 25 | adding changesets |
|
26 | 26 | adding manifests |
|
27 | 27 | adding file changes |
|
28 | 28 | added 2 changesets with 2 changes to 2 files |
|
29 | 29 | new changesets 53245c60e682:aaff8d2ffbbf |
|
30 | 30 | |
|
31 | 31 | $ cat server/access.log |
|
32 | 32 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
33 | 33 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
34 | 34 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
35 | 35 | |
|
36 | 36 | Empty manifest file results in retrieval |
|
37 | 37 | (the extension only checks if the manifest file exists) |
|
38 | 38 | |
|
39 | 39 | $ touch server/.hg/clonebundles.manifest |
|
40 | 40 | $ hg --verbose clone -U http://localhost:$HGPORT empty-manifest |
|
41 | 41 | no clone bundles available on remote; falling back to regular clone |
|
42 | 42 | requesting all changes |
|
43 | 43 | adding changesets |
|
44 | 44 | adding manifests |
|
45 | 45 | adding file changes |
|
46 | 46 | added 2 changesets with 2 changes to 2 files |
|
47 | 47 | new changesets 53245c60e682:aaff8d2ffbbf |
|
48 | 48 | |
|
49 | 49 | Manifest file with invalid URL aborts |
|
50 | 50 | |
|
51 | 51 | $ echo 'http://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest |
|
52 | 52 | $ hg clone http://localhost:$HGPORT 404-url |
|
53 | 53 | applying clone bundle from http://does.not.exist/bundle.hg |
|
54 | 54 | error fetching bundle: (.* not known|(\[Errno -?\d+])? No address associated with hostname) (re) (no-windows !) |
|
55 | 55 | error fetching bundle: [Errno 11004] getaddrinfo failed (windows !) |
|
56 | 56 | abort: error applying bundle |
|
57 | 57 | (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false") |
|
58 | 58 | [255] |
|
59 | 59 | |
|
60 | 60 | Server is not running aborts |
|
61 | 61 | |
|
62 | 62 | $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest |
|
63 | 63 | $ hg clone http://localhost:$HGPORT server-not-runner |
|
64 | 64 | applying clone bundle from http://localhost:$HGPORT1/bundle.hg |
|
65 | 65 | error fetching bundle: (.* refused.*|Protocol not supported|(.* )?Cannot assign requested address) (re) |
|
66 | 66 | abort: error applying bundle |
|
67 | 67 | (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false") |
|
68 | 68 | [255] |
|
69 | 69 | |
|
70 | 70 | Server returns 404 |
|
71 | 71 | |
|
72 | 72 | $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid |
|
73 | 73 | $ cat http.pid >> $DAEMON_PIDS |
|
74 | 74 | $ hg clone http://localhost:$HGPORT running-404 |
|
75 | 75 | applying clone bundle from http://localhost:$HGPORT1/bundle.hg |
|
76 | 76 | HTTP error fetching bundle: HTTP Error 404: File not found |
|
77 | 77 | abort: error applying bundle |
|
78 | 78 | (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false") |
|
79 | 79 | [255] |
|
80 | 80 | |
|
81 | 81 | We can override failure to fall back to regular clone |
|
82 | 82 | |
|
83 | 83 | $ hg --config ui.clonebundlefallback=true clone -U http://localhost:$HGPORT 404-fallback |
|
84 | 84 | applying clone bundle from http://localhost:$HGPORT1/bundle.hg |
|
85 | 85 | HTTP error fetching bundle: HTTP Error 404: File not found |
|
86 | 86 | falling back to normal clone |
|
87 | 87 | requesting all changes |
|
88 | 88 | adding changesets |
|
89 | 89 | adding manifests |
|
90 | 90 | adding file changes |
|
91 | 91 | added 2 changesets with 2 changes to 2 files |
|
92 | 92 | new changesets 53245c60e682:aaff8d2ffbbf |
|
93 | 93 | |
|
94 | 94 | Bundle with partial content works |
|
95 | 95 | |
|
96 | 96 | $ hg -R server bundle --type gzip-v1 --base null -r 53245c60e682 partial.hg |
|
97 | 97 | 1 changesets found |
|
98 | 98 | |
|
99 | 99 | We verify exact bundle content as an extra check against accidental future |
|
100 | 100 | changes. If this output changes, we could break old clients. |
|
101 | 101 | |
|
102 | 102 | $ f --size --hexdump partial.hg |
|
103 | 103 | partial.hg: size=207 |
|
104 | 104 | 0000: 48 47 31 30 47 5a 78 9c 63 60 60 98 17 ac 12 93 |HG10GZx.c``.....| |
|
105 | 105 | 0010: f0 ac a9 23 45 70 cb bf 0d 5f 59 4e 4a 7f 79 21 |...#Ep..._YNJ.y!| |
|
106 | 106 | 0020: 9b cc 40 24 20 a0 d7 ce 2c d1 38 25 cd 24 25 d5 |..@$ ...,.8%.$%.| |
|
107 | 107 | 0030: d8 c2 22 cd 38 d9 24 cd 22 d5 c8 22 cd 24 cd 32 |..".8.$."..".$.2| |
|
108 | 108 | 0040: d1 c2 d0 c4 c8 d2 32 d1 38 39 29 c9 34 cd d4 80 |......2.89).4...| |
|
109 | 109 | 0050: ab 24 b5 b8 84 cb 40 c1 80 2b 2d 3f 9f 8b 2b 31 |.$....@..+-?..+1| |
|
110 | 110 | 0060: 25 45 01 c8 80 9a d2 9b 65 fb e5 9e 45 bf 8d 7f |%E......e...E...| |
|
111 | 111 | 0070: 9f c6 97 9f 2b 44 34 67 d9 ec 8e 0f a0 92 0b 75 |....+D4g.......u| |
|
112 | 112 | 0080: 41 d6 24 59 18 a4 a4 9a a6 18 1a 5b 98 9b 5a 98 |A.$Y.......[..Z.| |
|
113 | 113 | 0090: 9a 18 26 9b a6 19 98 1a 99 99 26 a6 18 9a 98 24 |..&.......&....$| |
|
114 | 114 | 00a0: 26 59 a6 25 5a 98 a5 18 a6 24 71 41 35 b1 43 dc |&Y.%Z....$qA5.C.| |
|
115 | 115 | 00b0: 16 b2 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a |.....E..V....R..| |
|
116 | 116 | 00c0: 78 ed fc d5 76 f1 36 35 dc 05 00 36 ed 5e c7 |x...v.65...6.^.| |
|
117 | 117 | |
|
118 | 118 | $ echo "http://localhost:$HGPORT1/partial.hg" > server/.hg/clonebundles.manifest |
|
119 | 119 | $ hg clone -U http://localhost:$HGPORT partial-bundle |
|
120 | 120 | applying clone bundle from http://localhost:$HGPORT1/partial.hg |
|
121 | 121 | adding changesets |
|
122 | 122 | adding manifests |
|
123 | 123 | adding file changes |
|
124 | 124 | added 1 changesets with 1 changes to 1 files |
|
125 | 125 | finished applying clone bundle |
|
126 | 126 | searching for changes |
|
127 | 127 | adding changesets |
|
128 | 128 | adding manifests |
|
129 | 129 | adding file changes |
|
130 | 130 | added 1 changesets with 1 changes to 1 files |
|
131 | 131 | new changesets aaff8d2ffbbf |
|
132 | 132 | 1 local changesets published |
|
133 | 133 | |
|
134 | 134 | Incremental pull doesn't fetch bundle |
|
135 | 135 | |
|
136 | 136 | $ hg clone -r 53245c60e682 -U http://localhost:$HGPORT partial-clone |
|
137 | 137 | adding changesets |
|
138 | 138 | adding manifests |
|
139 | 139 | adding file changes |
|
140 | 140 | added 1 changesets with 1 changes to 1 files |
|
141 | 141 | new changesets 53245c60e682 |
|
142 | 142 | |
|
143 | 143 | $ cd partial-clone |
|
144 | 144 | $ hg pull |
|
145 | 145 | pulling from http://localhost:$HGPORT/ |
|
146 | 146 | searching for changes |
|
147 | 147 | adding changesets |
|
148 | 148 | adding manifests |
|
149 | 149 | adding file changes |
|
150 | 150 | added 1 changesets with 1 changes to 1 files |
|
151 | 151 | new changesets aaff8d2ffbbf |
|
152 | 152 | (run 'hg update' to get a working copy) |
|
153 | 153 | $ cd .. |
|
154 | 154 | |
|
155 | 155 | Bundle with full content works |
|
156 | 156 | |
|
157 | 157 | $ hg -R server bundle --type gzip-v2 --base null -r tip full.hg |
|
158 | 158 | 2 changesets found |
|
159 | 159 | |
|
160 | 160 | Again, we perform an extra check against bundle content changes. If this content |
|
161 | 161 | changes, clone bundles produced by new Mercurial versions may not be readable |
|
162 | 162 | by old clients. |
|
163 | 163 | |
|
164 | 164 | $ f --size --hexdump full.hg |
|
165 | 165 | full.hg: size=442 |
|
166 | 166 | 0000: 48 47 32 30 00 00 00 0e 43 6f 6d 70 72 65 73 73 |HG20....Compress| |
|
167 | 167 | 0010: 69 6f 6e 3d 47 5a 78 9c 63 60 60 d0 e4 76 f6 70 |ion=GZx.c``..v.p| |
|
168 | 168 | 0020: f4 73 77 75 0f f2 0f 0d 60 00 02 46 46 76 26 4e |.swu....`..FFv&N| |
|
169 | 169 | 0030: c6 b2 d4 a2 e2 cc fc 3c 03 a3 bc a4 e4 8c c4 bc |.......<........| |
|
170 | 170 | 0040: f4 d4 62 23 06 06 e6 19 40 f9 4d c1 2a 31 09 cf |..b#....@.M.*1..| |
|
171 | 171 | 0050: 9a 3a 52 04 b7 fc db f0 95 e5 a4 f4 97 17 b2 c9 |.:R.............| |
|
172 | 172 | 0060: 0c 14 00 02 e6 d9 99 25 1a a7 a4 99 a4 a4 1a 5b |.......%.......[| |
|
173 | 173 | 0070: 58 a4 19 27 9b a4 59 a4 1a 59 a4 99 a4 59 26 5a |X..'..Y..Y...Y&Z| |
|
174 | 174 | 0080: 18 9a 18 59 5a 26 1a 27 27 25 99 a6 99 1a 70 95 |...YZ&.''%....p.| |
|
175 | 175 | 0090: a4 16 97 70 19 28 18 70 a5 e5 e7 73 71 25 a6 a4 |...p.(.p...sq%..| |
|
176 | 176 | 00a0: 28 00 19 20 17 af fa df ab ff 7b 3f fb 92 dc 8b |(.. ......{?....| |
|
177 | 177 | 00b0: 1f 62 bb 9e b7 d7 d9 87 3d 5a 44 89 2f b0 99 87 |.b......=ZD./...| |
|
178 | 178 | 00c0: ec e2 54 63 43 e3 b4 64 43 73 23 33 43 53 0b 63 |..TcC..dCs#3CS.c| |
|
179 | 179 | 00d0: d3 14 23 03 a0 fb 2c 2c 0c d3 80 1e 30 49 49 b1 |..#...,,....0II.| |
|
180 | 180 | 00e0: 4c 4a 32 48 33 30 b0 34 42 b8 38 29 b1 08 e2 62 |LJ2H30.4B.8)...b| |
|
181 | 181 | 00f0: 20 03 6a ca c2 2c db 2f f7 2c fa 6d fc fb 34 be | .j..,./.,.m..4.| |
|
182 | 182 | 0100: fc 5c 21 a2 39 cb 66 77 7c 00 0d c3 59 17 14 58 |.\!.9.fw|...Y..X| |
|
183 | 183 | 0110: 49 16 06 29 a9 a6 29 86 c6 16 e6 a6 16 a6 26 86 |I..)..).......&.| |
|
184 | 184 | 0120: c9 a6 69 06 a6 46 66 a6 89 29 86 26 26 89 49 96 |..i..Ff..).&&.I.| |
|
185 | 185 | 0130: 69 89 16 66 29 86 29 49 5c 20 07 3e 16 fe 23 ae |i..f).)I\ .>..#.| |
|
186 | 186 | 0140: 26 da 1c ab 10 1f d1 f8 e3 b3 ef cd dd fc 0c 93 |&...............| |
|
187 | 187 | 0150: 88 75 34 36 75 04 82 55 17 14 36 a4 38 10 04 d8 |.u46u..U..6.8...| |
|
188 | 188 | 0160: 21 01 9a b1 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 |!......E..V....R| |
|
189 | 189 | 0170: d7 8a 78 ed fc d5 76 f1 36 25 81 89 c7 ad ec 90 |..x...v.6%......| |
|
190 | 190 | 0180: 54 47 75 2b 89 48 b1 b2 62 c9 89 c9 19 a9 56 45 |TGu+.H..b.....VE| |
|
191 | 191 | 0190: a9 65 ba 49 45 89 79 c9 19 ba 60 01 a0 14 23 58 |.e.IE.y...`...#X| |
|
192 | 192 | 01a0: 81 35 c8 7d 40 cc 04 e2 a4 a4 a6 25 96 e6 94 60 |.5.}@......%...`| |
|
193 | 193 | 01b0: 33 17 5f 54 00 00 d3 1b 0d 4c |3._T.....L| |
|
194 | 194 | |
|
195 | 195 | $ echo "http://localhost:$HGPORT1/full.hg" > server/.hg/clonebundles.manifest |
|
196 | 196 | $ hg clone -U http://localhost:$HGPORT full-bundle |
|
197 | 197 | applying clone bundle from http://localhost:$HGPORT1/full.hg |
|
198 | 198 | adding changesets |
|
199 | 199 | adding manifests |
|
200 | 200 | adding file changes |
|
201 | 201 | added 2 changesets with 2 changes to 2 files |
|
202 | 202 | finished applying clone bundle |
|
203 | 203 | searching for changes |
|
204 | 204 | no changes found |
|
205 | 205 | 2 local changesets published |
|
206 | 206 | |
|
207 | 207 | Feature works over SSH |
|
208 | 208 | |
|
209 | 209 | $ hg clone -U -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/server ssh-full-clone |
|
210 | 210 | applying clone bundle from http://localhost:$HGPORT1/full.hg |
|
211 | 211 | adding changesets |
|
212 | 212 | adding manifests |
|
213 | 213 | adding file changes |
|
214 | 214 | added 2 changesets with 2 changes to 2 files |
|
215 | 215 | finished applying clone bundle |
|
216 | 216 | searching for changes |
|
217 | 217 | no changes found |
|
218 | 218 | 2 local changesets published |
|
219 | 219 | |
|
220 | 220 | Entry with unknown BUNDLESPEC is filtered and not used |
|
221 | 221 | |
|
222 | 222 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
223 | 223 | > http://bad.entry1 BUNDLESPEC=UNKNOWN |
|
224 | 224 | > http://bad.entry2 BUNDLESPEC=xz-v1 |
|
225 | 225 | > http://bad.entry3 BUNDLESPEC=none-v100 |
|
226 | 226 | > http://localhost:$HGPORT1/full.hg BUNDLESPEC=gzip-v2 |
|
227 | 227 | > EOF |
|
228 | 228 | |
|
229 | 229 | $ hg clone -U http://localhost:$HGPORT filter-unknown-type |
|
230 | 230 | applying clone bundle from http://localhost:$HGPORT1/full.hg |
|
231 | 231 | adding changesets |
|
232 | 232 | adding manifests |
|
233 | 233 | adding file changes |
|
234 | 234 | added 2 changesets with 2 changes to 2 files |
|
235 | 235 | finished applying clone bundle |
|
236 | 236 | searching for changes |
|
237 | 237 | no changes found |
|
238 | 238 | 2 local changesets published |
|
239 | 239 | |
|
240 | 240 | Automatic fallback when all entries are filtered |
|
241 | 241 | |
|
242 | 242 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
243 | 243 | > http://bad.entry BUNDLESPEC=UNKNOWN |
|
244 | 244 | > EOF |
|
245 | 245 | |
|
246 | 246 | $ hg clone -U http://localhost:$HGPORT filter-all |
|
247 | 247 | no compatible clone bundles available on server; falling back to regular clone |
|
248 | 248 | (you may want to report this to the server operator) |
|
249 | 249 | requesting all changes |
|
250 | 250 | adding changesets |
|
251 | 251 | adding manifests |
|
252 | 252 | adding file changes |
|
253 | 253 | added 2 changesets with 2 changes to 2 files |
|
254 | 254 | new changesets 53245c60e682:aaff8d2ffbbf |
|
255 | 255 | |
|
256 | 256 | URLs requiring SNI are filtered in Python <2.7.9 |
|
257 | 257 | |
|
258 | 258 | $ cp full.hg sni.hg |
|
259 | 259 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
260 | 260 | > http://localhost:$HGPORT1/sni.hg REQUIRESNI=true |
|
261 | 261 | > http://localhost:$HGPORT1/full.hg |
|
262 | 262 | > EOF |
|
263 | 263 | |
|
264 | 264 | #if sslcontext |
|
265 | 265 | Python 2.7.9+ support SNI |
|
266 | 266 | |
|
267 | 267 | $ hg clone -U http://localhost:$HGPORT sni-supported |
|
268 | 268 | applying clone bundle from http://localhost:$HGPORT1/sni.hg |
|
269 | 269 | adding changesets |
|
270 | 270 | adding manifests |
|
271 | 271 | adding file changes |
|
272 | 272 | added 2 changesets with 2 changes to 2 files |
|
273 | 273 | finished applying clone bundle |
|
274 | 274 | searching for changes |
|
275 | 275 | no changes found |
|
276 | 276 | 2 local changesets published |
|
277 | 277 | #else |
|
278 | 278 | Python <2.7.9 will filter SNI URLs |
|
279 | 279 | |
|
280 | 280 | $ hg clone -U http://localhost:$HGPORT sni-unsupported |
|
281 | 281 | applying clone bundle from http://localhost:$HGPORT1/full.hg |
|
282 | 282 | adding changesets |
|
283 | 283 | adding manifests |
|
284 | 284 | adding file changes |
|
285 | 285 | added 2 changesets with 2 changes to 2 files |
|
286 | 286 | finished applying clone bundle |
|
287 | 287 | searching for changes |
|
288 | 288 | no changes found |
|
289 | 2 local changesets published | |
|
289 | 290 | #endif |
|
290 | 291 | |
|
291 | 292 | Stream clone bundles are supported |
|
292 | 293 | |
|
293 | 294 | $ hg -R server debugcreatestreamclonebundle packed.hg |
|
294 | 295 | writing 613 bytes for 4 files |
|
295 | 296 | bundle requirements: generaldelta, revlogv1 |
|
296 | 297 | |
|
297 | 298 | No bundle spec should work |
|
298 | 299 | |
|
299 | 300 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
300 | 301 | > http://localhost:$HGPORT1/packed.hg |
|
301 | 302 | > EOF |
|
302 | 303 | |
|
303 | 304 | $ hg clone -U http://localhost:$HGPORT stream-clone-no-spec |
|
304 | 305 | applying clone bundle from http://localhost:$HGPORT1/packed.hg |
|
305 | 306 | 4 files to transfer, 613 bytes of data |
|
306 | 307 | transferred 613 bytes in *.* seconds (*) (glob) |
|
307 | 308 | finished applying clone bundle |
|
308 | 309 | searching for changes |
|
309 | 310 | no changes found |
|
310 | 311 | |
|
311 | 312 | Bundle spec without parameters should work |
|
312 | 313 | |
|
313 | 314 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
314 | 315 | > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1 |
|
315 | 316 | > EOF |
|
316 | 317 | |
|
317 | 318 | $ hg clone -U http://localhost:$HGPORT stream-clone-vanilla-spec |
|
318 | 319 | applying clone bundle from http://localhost:$HGPORT1/packed.hg |
|
319 | 320 | 4 files to transfer, 613 bytes of data |
|
320 | 321 | transferred 613 bytes in *.* seconds (*) (glob) |
|
321 | 322 | finished applying clone bundle |
|
322 | 323 | searching for changes |
|
323 | 324 | no changes found |
|
324 | 325 | |
|
325 | 326 | Bundle spec with format requirements should work |
|
326 | 327 | |
|
327 | 328 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
328 | 329 | > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1 |
|
329 | 330 | > EOF |
|
330 | 331 | |
|
331 | 332 | $ hg clone -U http://localhost:$HGPORT stream-clone-supported-requirements |
|
332 | 333 | applying clone bundle from http://localhost:$HGPORT1/packed.hg |
|
333 | 334 | 4 files to transfer, 613 bytes of data |
|
334 | 335 | transferred 613 bytes in *.* seconds (*) (glob) |
|
335 | 336 | finished applying clone bundle |
|
336 | 337 | searching for changes |
|
337 | 338 | no changes found |
|
338 | 339 | |
|
339 | 340 | Stream bundle spec with unknown requirements should be filtered out |
|
340 | 341 | |
|
341 | 342 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
342 | 343 | > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42 |
|
343 | 344 | > EOF |
|
344 | 345 | |
|
345 | 346 | $ hg clone -U http://localhost:$HGPORT stream-clone-unsupported-requirements |
|
346 | 347 | no compatible clone bundles available on server; falling back to regular clone |
|
347 | 348 | (you may want to report this to the server operator) |
|
348 | 349 | requesting all changes |
|
349 | 350 | adding changesets |
|
350 | 351 | adding manifests |
|
351 | 352 | adding file changes |
|
352 | 353 | added 2 changesets with 2 changes to 2 files |
|
353 | 354 | new changesets 53245c60e682:aaff8d2ffbbf |
|
354 | 355 | |
|
355 | 356 | Set up manifest for testing preferences |
|
356 | 357 | (Remember, the TYPE does not have to match reality - the URL is |
|
357 | 358 | important) |
|
358 | 359 | |
|
359 | 360 | $ cp full.hg gz-a.hg |
|
360 | 361 | $ cp full.hg gz-b.hg |
|
361 | 362 | $ cp full.hg bz2-a.hg |
|
362 | 363 | $ cp full.hg bz2-b.hg |
|
363 | 364 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
364 | 365 | > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 extra=a |
|
365 | 366 | > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2 extra=a |
|
366 | 367 | > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b |
|
367 | 368 | > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b |
|
368 | 369 | > EOF |
|
369 | 370 | |
|
370 | 371 | Preferring an undefined attribute will take first entry |
|
371 | 372 | |
|
372 | 373 | $ hg --config ui.clonebundleprefers=foo=bar clone -U http://localhost:$HGPORT prefer-foo |
|
373 | 374 | applying clone bundle from http://localhost:$HGPORT1/gz-a.hg |
|
374 | 375 | adding changesets |
|
375 | 376 | adding manifests |
|
376 | 377 | adding file changes |
|
377 | 378 | added 2 changesets with 2 changes to 2 files |
|
378 | 379 | finished applying clone bundle |
|
379 | 380 | searching for changes |
|
380 | 381 | no changes found |
|
381 | 382 | 2 local changesets published |
|
382 | 383 | |
|
383 | 384 | Preferring bz2 type will download first entry of that type |
|
384 | 385 | |
|
385 | 386 | $ hg --config ui.clonebundleprefers=COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-bz |
|
386 | 387 | applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg |
|
387 | 388 | adding changesets |
|
388 | 389 | adding manifests |
|
389 | 390 | adding file changes |
|
390 | 391 | added 2 changesets with 2 changes to 2 files |
|
391 | 392 | finished applying clone bundle |
|
392 | 393 | searching for changes |
|
393 | 394 | no changes found |
|
394 | 395 | 2 local changesets published |
|
395 | 396 | |
|
396 | 397 | Preferring multiple values of an option works |
|
397 | 398 | |
|
398 | 399 | $ hg --config ui.clonebundleprefers=COMPRESSION=unknown,COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-multiple-bz |
|
399 | 400 | applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg |
|
400 | 401 | adding changesets |
|
401 | 402 | adding manifests |
|
402 | 403 | adding file changes |
|
403 | 404 | added 2 changesets with 2 changes to 2 files |
|
404 | 405 | finished applying clone bundle |
|
405 | 406 | searching for changes |
|
406 | 407 | no changes found |
|
407 | 408 | 2 local changesets published |
|
408 | 409 | |
|
409 | 410 | Sorting multiple values should get us back to original first entry |
|
410 | 411 | |
|
411 | 412 | $ hg --config ui.clonebundleprefers=BUNDLESPEC=unknown,BUNDLESPEC=gzip-v2,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-multiple-gz |
|
412 | 413 | applying clone bundle from http://localhost:$HGPORT1/gz-a.hg |
|
413 | 414 | adding changesets |
|
414 | 415 | adding manifests |
|
415 | 416 | adding file changes |
|
416 | 417 | added 2 changesets with 2 changes to 2 files |
|
417 | 418 | finished applying clone bundle |
|
418 | 419 | searching for changes |
|
419 | 420 | no changes found |
|
420 | 421 | 2 local changesets published |
|
421 | 422 | |
|
422 | 423 | Preferring multiple attributes has correct order |
|
423 | 424 | |
|
424 | 425 | $ hg --config ui.clonebundleprefers=extra=b,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-separate-attributes |
|
425 | 426 | applying clone bundle from http://localhost:$HGPORT1/bz2-b.hg |
|
426 | 427 | adding changesets |
|
427 | 428 | adding manifests |
|
428 | 429 | adding file changes |
|
429 | 430 | added 2 changesets with 2 changes to 2 files |
|
430 | 431 | finished applying clone bundle |
|
431 | 432 | searching for changes |
|
432 | 433 | no changes found |
|
433 | 434 | 2 local changesets published |
|
434 | 435 | |
|
435 | 436 | Test where attribute is missing from some entries |
|
436 | 437 | |
|
437 | 438 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
438 | 439 | > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 |
|
439 | 440 | > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2 |
|
440 | 441 | > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b |
|
441 | 442 | > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b |
|
442 | 443 | > EOF |
|
443 | 444 | |
|
444 | 445 | $ hg --config ui.clonebundleprefers=extra=b clone -U http://localhost:$HGPORT prefer-partially-defined-attribute |
|
445 | 446 | applying clone bundle from http://localhost:$HGPORT1/gz-b.hg |
|
446 | 447 | adding changesets |
|
447 | 448 | adding manifests |
|
448 | 449 | adding file changes |
|
449 | 450 | added 2 changesets with 2 changes to 2 files |
|
450 | 451 | finished applying clone bundle |
|
451 | 452 | searching for changes |
|
452 | 453 | no changes found |
|
453 | 454 | 2 local changesets published |
|
454 | 455 | |
|
455 | 456 | Test interaction between clone bundles and --stream |
|
456 | 457 | |
|
457 | 458 | A manifest with just a gzip bundle |
|
458 | 459 | |
|
459 | 460 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
460 | 461 | > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 |
|
461 | 462 | > EOF |
|
462 | 463 | |
|
463 | 464 | $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip |
|
464 | 465 | no compatible clone bundles available on server; falling back to regular clone |
|
465 | 466 | (you may want to report this to the server operator) |
|
466 | 467 | streaming all changes |
|
467 | 468 | 4 files to transfer, 613 bytes of data |
|
468 | 469 | transferred 613 bytes in * seconds (*) (glob) |
|
469 | 470 | searching for changes |
|
470 | 471 | no changes found |
|
471 | 472 | |
|
472 | 473 | A manifest with a stream clone but no BUNDLESPEC |
|
473 | 474 | |
|
474 | 475 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
475 | 476 | > http://localhost:$HGPORT1/packed.hg |
|
476 | 477 | > EOF |
|
477 | 478 | |
|
478 | 479 | $ hg clone -U --stream http://localhost:$HGPORT uncompressed-no-bundlespec |
|
479 | 480 | no compatible clone bundles available on server; falling back to regular clone |
|
480 | 481 | (you may want to report this to the server operator) |
|
481 | 482 | streaming all changes |
|
482 | 483 | 4 files to transfer, 613 bytes of data |
|
483 | 484 | transferred 613 bytes in * seconds (*) (glob) |
|
484 | 485 | searching for changes |
|
485 | 486 | no changes found |
|
486 | 487 | |
|
487 | 488 | A manifest with a gzip bundle and a stream clone |
|
488 | 489 | |
|
489 | 490 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
490 | 491 | > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 |
|
491 | 492 | > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1 |
|
492 | 493 | > EOF |
|
493 | 494 | |
|
494 | 495 | $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip-packed |
|
495 | 496 | applying clone bundle from http://localhost:$HGPORT1/packed.hg |
|
496 | 497 | 4 files to transfer, 613 bytes of data |
|
497 | 498 | transferred 613 bytes in * seconds (*) (glob) |
|
498 | 499 | finished applying clone bundle |
|
499 | 500 | searching for changes |
|
500 | 501 | no changes found |
|
501 | 502 | |
|
502 | 503 | A manifest with a gzip bundle and stream clone with supported requirements |
|
503 | 504 | |
|
504 | 505 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
505 | 506 | > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 |
|
506 | 507 | > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1 |
|
507 | 508 | > EOF |
|
508 | 509 | |
|
509 | 510 | $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip-packed-requirements |
|
510 | 511 | applying clone bundle from http://localhost:$HGPORT1/packed.hg |
|
511 | 512 | 4 files to transfer, 613 bytes of data |
|
512 | 513 | transferred 613 bytes in * seconds (*) (glob) |
|
513 | 514 | finished applying clone bundle |
|
514 | 515 | searching for changes |
|
515 | 516 | no changes found |
|
516 | 517 | |
|
517 | 518 | A manifest with a gzip bundle and a stream clone with unsupported requirements |
|
518 | 519 | |
|
519 | 520 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
520 | 521 | > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 |
|
521 | 522 | > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42 |
|
522 | 523 | > EOF |
|
523 | 524 | |
|
524 | 525 | $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip-packed-unsupported-requirements |
|
525 | 526 | no compatible clone bundles available on server; falling back to regular clone |
|
526 | 527 | (you may want to report this to the server operator) |
|
527 | 528 | streaming all changes |
|
528 | 529 | 4 files to transfer, 613 bytes of data |
|
529 | 530 | transferred 613 bytes in * seconds (*) (glob) |
|
530 | 531 | searching for changes |
|
531 | 532 | no changes found |
|
532 | 533 | |
|
533 | 534 | Test clone bundle retrieved through bundle2 |
|
534 | 535 | |
|
535 | 536 | $ cat << EOF >> $HGRCPATH |
|
536 | 537 | > [extensions] |
|
537 | 538 | > largefiles= |
|
538 | 539 | > EOF |
|
539 | 540 | $ killdaemons.py |
|
540 | 541 | $ hg -R server serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log |
|
541 | 542 | $ cat hg.pid >> $DAEMON_PIDS |
|
542 | 543 | |
|
543 | 544 | $ hg -R server debuglfput gz-a.hg |
|
544 | 545 | 1f74b3d08286b9b3a16fb3fa185dd29219cbc6ae |
|
545 | 546 | |
|
546 | 547 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
547 | 548 | > largefile://1f74b3d08286b9b3a16fb3fa185dd29219cbc6ae BUNDLESPEC=gzip-v2 |
|
548 | 549 | > EOF |
|
549 | 550 | |
|
550 | 551 | $ hg clone -U http://localhost:$HGPORT largefile-provided --traceback |
|
551 | 552 | applying clone bundle from largefile://1f74b3d08286b9b3a16fb3fa185dd29219cbc6ae |
|
552 | 553 | adding changesets |
|
553 | 554 | adding manifests |
|
554 | 555 | adding file changes |
|
555 | 556 | added 2 changesets with 2 changes to 2 files |
|
556 | 557 | finished applying clone bundle |
|
557 | 558 | searching for changes |
|
558 | 559 | no changes found |
|
559 | 560 | 2 local changesets published |
General Comments 0
You need to be logged in to leave comments.
Login now