##// END OF EJS Templates
test-clonebundles.t: add test for incremental pull...
Gregory Szorc -
r26854:cb4b0ec5 stable
parent child Browse files
Show More
@@ -1,431 +1,456 b''
1 Set up a server
1 Set up a server
2
2
3 $ hg init server
3 $ hg init server
4 $ cd server
4 $ cd server
5 $ cat >> .hg/hgrc << EOF
5 $ cat >> .hg/hgrc << EOF
6 > [extensions]
6 > [extensions]
7 > clonebundles =
7 > clonebundles =
8 > EOF
8 > EOF
9
9
10 $ touch foo
10 $ touch foo
11 $ hg -q commit -A -m 'add foo'
11 $ hg -q commit -A -m 'add foo'
12 $ touch bar
12 $ touch bar
13 $ hg -q commit -A -m 'add bar'
13 $ hg -q commit -A -m 'add bar'
14
14
15 $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
15 $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
16 $ cat hg.pid >> $DAEMON_PIDS
16 $ cat hg.pid >> $DAEMON_PIDS
17 $ cd ..
17 $ cd ..
18
18
19 Feature disabled by default
19 Feature disabled by default
20 (client should not request manifest)
20 (client should not request manifest)
21
21
22 $ hg clone -U http://localhost:$HGPORT feature-disabled
22 $ hg clone -U http://localhost:$HGPORT feature-disabled
23 requesting all changes
23 requesting all changes
24 adding changesets
24 adding changesets
25 adding manifests
25 adding manifests
26 adding file changes
26 adding file changes
27 added 2 changesets with 2 changes to 2 files
27 added 2 changesets with 2 changes to 2 files
28
28
29 $ cat server/access.log
29 $ cat server/access.log
30 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
30 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
31 * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
31 * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
32 * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=phase%2Cbookmarks (glob)
32 * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=phase%2Cbookmarks (glob)
33 * - - [*] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases (glob)
33 * - - [*] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases (glob)
34
34
35 $ cat >> $HGRCPATH << EOF
35 $ cat >> $HGRCPATH << EOF
36 > [experimental]
36 > [experimental]
37 > clonebundles = true
37 > clonebundles = true
38 > EOF
38 > EOF
39
39
40 Missing manifest should not result in server lookup
40 Missing manifest should not result in server lookup
41
41
42 $ hg --verbose clone -U http://localhost:$HGPORT no-manifest
42 $ hg --verbose clone -U http://localhost:$HGPORT no-manifest
43 requesting all changes
43 requesting all changes
44 adding changesets
44 adding changesets
45 adding manifests
45 adding manifests
46 adding file changes
46 adding file changes
47 added 2 changesets with 2 changes to 2 files
47 added 2 changesets with 2 changes to 2 files
48
48
49 $ tail -4 server/access.log
49 $ tail -4 server/access.log
50 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
50 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
51 * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
51 * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
52 * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=phase%2Cbookmarks (glob)
52 * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=phase%2Cbookmarks (glob)
53 * - - [*] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases (glob)
53 * - - [*] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases (glob)
54
54
55 Empty manifest file results in retrieval
55 Empty manifest file results in retrieval
56 (the extension only checks if the manifest file exists)
56 (the extension only checks if the manifest file exists)
57
57
58 $ touch server/.hg/clonebundles.manifest
58 $ touch server/.hg/clonebundles.manifest
59 $ hg --verbose clone -U http://localhost:$HGPORT empty-manifest
59 $ hg --verbose clone -U http://localhost:$HGPORT empty-manifest
60 no clone bundles available on remote; falling back to regular clone
60 no clone bundles available on remote; falling back to regular clone
61 requesting all changes
61 requesting all changes
62 adding changesets
62 adding changesets
63 adding manifests
63 adding manifests
64 adding file changes
64 adding file changes
65 added 2 changesets with 2 changes to 2 files
65 added 2 changesets with 2 changes to 2 files
66
66
67 Server advertises presence of feature to client requesting full clone
67 Server advertises presence of feature to client requesting full clone
68
68
69 $ hg --config experimental.clonebundles=false clone -U http://localhost:$HGPORT advertise-on-clone
69 $ hg --config experimental.clonebundles=false clone -U http://localhost:$HGPORT advertise-on-clone
70 requesting all changes
70 requesting all changes
71 remote: this server supports the experimental "clone bundles" feature that should enable faster and more reliable cloning
71 remote: this server supports the experimental "clone bundles" feature that should enable faster and more reliable cloning
72 remote: help test it by setting the "experimental.clonebundles" config flag to "true"
72 remote: help test it by setting the "experimental.clonebundles" config flag to "true"
73 adding changesets
73 adding changesets
74 adding manifests
74 adding manifests
75 adding file changes
75 adding file changes
76 added 2 changesets with 2 changes to 2 files
76 added 2 changesets with 2 changes to 2 files
77
77
78 Manifest file with invalid URL aborts
78 Manifest file with invalid URL aborts
79
79
80 $ echo 'http://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest
80 $ echo 'http://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest
81 $ hg clone http://localhost:$HGPORT 404-url
81 $ hg clone http://localhost:$HGPORT 404-url
82 applying clone bundle from http://does.not.exist/bundle.hg
82 applying clone bundle from http://does.not.exist/bundle.hg
83 error fetching bundle: * not known (glob)
83 error fetching bundle: * not known (glob)
84 abort: error applying bundle
84 abort: error applying bundle
85 (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false")
85 (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false")
86 [255]
86 [255]
87
87
88 Server is not running aborts
88 Server is not running aborts
89
89
90 $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest
90 $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest
91 $ hg clone http://localhost:$HGPORT server-not-runner
91 $ hg clone http://localhost:$HGPORT server-not-runner
92 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
92 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
93 error fetching bundle: Connection refused
93 error fetching bundle: Connection refused
94 abort: error applying bundle
94 abort: error applying bundle
95 (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false")
95 (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false")
96 [255]
96 [255]
97
97
98 Server returns 404
98 Server returns 404
99
99
100 $ python $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
100 $ python $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
101 $ cat http.pid >> $DAEMON_PIDS
101 $ cat http.pid >> $DAEMON_PIDS
102 $ hg clone http://localhost:$HGPORT running-404
102 $ hg clone http://localhost:$HGPORT running-404
103 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
103 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
104 HTTP error fetching bundle: HTTP Error 404: File not found
104 HTTP error fetching bundle: HTTP Error 404: File not found
105 abort: error applying bundle
105 abort: error applying bundle
106 (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false")
106 (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false")
107 [255]
107 [255]
108
108
109 We can override failure to fall back to regular clone
109 We can override failure to fall back to regular clone
110
110
111 $ hg --config ui.clonebundlefallback=true clone -U http://localhost:$HGPORT 404-fallback
111 $ hg --config ui.clonebundlefallback=true clone -U http://localhost:$HGPORT 404-fallback
112 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
112 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
113 HTTP error fetching bundle: HTTP Error 404: File not found
113 HTTP error fetching bundle: HTTP Error 404: File not found
114 falling back to normal clone
114 falling back to normal clone
115 requesting all changes
115 requesting all changes
116 adding changesets
116 adding changesets
117 adding manifests
117 adding manifests
118 adding file changes
118 adding file changes
119 added 2 changesets with 2 changes to 2 files
119 added 2 changesets with 2 changes to 2 files
120
120
121 Bundle with partial content works
121 Bundle with partial content works
122
122
123 $ hg -R server bundle --type gzip-v1 --base null -r 53245c60e682 partial.hg
123 $ hg -R server bundle --type gzip-v1 --base null -r 53245c60e682 partial.hg
124 1 changesets found
124 1 changesets found
125
125
126 We verify exact bundle content as an extra check against accidental future
126 We verify exact bundle content as an extra check against accidental future
127 changes. If this output changes, we could break old clients.
127 changes. If this output changes, we could break old clients.
128
128
129 $ f --size --hexdump partial.hg
129 $ f --size --hexdump partial.hg
130 partial.hg: size=208
130 partial.hg: size=208
131 0000: 48 47 31 30 47 5a 78 9c 63 60 60 98 17 ac 12 93 |HG10GZx.c``.....|
131 0000: 48 47 31 30 47 5a 78 9c 63 60 60 98 17 ac 12 93 |HG10GZx.c``.....|
132 0010: f0 ac a9 23 45 70 cb bf 0d 5f 59 4e 4a 7f 79 21 |...#Ep..._YNJ.y!|
132 0010: f0 ac a9 23 45 70 cb bf 0d 5f 59 4e 4a 7f 79 21 |...#Ep..._YNJ.y!|
133 0020: 9b cc 40 24 20 a0 d7 ce 2c d1 38 25 cd 24 25 d5 |..@$ ...,.8%.$%.|
133 0020: 9b cc 40 24 20 a0 d7 ce 2c d1 38 25 cd 24 25 d5 |..@$ ...,.8%.$%.|
134 0030: d8 c2 22 cd 38 d9 24 cd 22 d5 c8 22 cd 24 cd 32 |..".8.$."..".$.2|
134 0030: d8 c2 22 cd 38 d9 24 cd 22 d5 c8 22 cd 24 cd 32 |..".8.$."..".$.2|
135 0040: d1 c2 d0 c4 c8 d2 32 d1 38 39 29 c9 34 cd d4 80 |......2.89).4...|
135 0040: d1 c2 d0 c4 c8 d2 32 d1 38 39 29 c9 34 cd d4 80 |......2.89).4...|
136 0050: ab 24 b5 b8 84 cb 40 c1 80 2b 2d 3f 9f 8b 2b 31 |.$....@..+-?..+1|
136 0050: ab 24 b5 b8 84 cb 40 c1 80 2b 2d 3f 9f 8b 2b 31 |.$....@..+-?..+1|
137 0060: 25 45 01 c8 80 9a d2 9b 65 fb e5 9e 45 bf 8d 7f |%E......e...E...|
137 0060: 25 45 01 c8 80 9a d2 9b 65 fb e5 9e 45 bf 8d 7f |%E......e...E...|
138 0070: 9f c6 97 9f 2b 44 34 67 d9 ec 8e 0f a0 92 0b 75 |....+D4g.......u|
138 0070: 9f c6 97 9f 2b 44 34 67 d9 ec 8e 0f a0 92 0b 75 |....+D4g.......u|
139 0080: 41 d6 24 59 18 a4 a4 9a a6 18 1a 5b 98 9b 5a 98 |A.$Y.......[..Z.|
139 0080: 41 d6 24 59 18 a4 a4 9a a6 18 1a 5b 98 9b 5a 98 |A.$Y.......[..Z.|
140 0090: 9a 18 26 9b a6 19 98 1a 99 99 26 a6 18 9a 98 24 |..&.......&....$|
140 0090: 9a 18 26 9b a6 19 98 1a 99 99 26 a6 18 9a 98 24 |..&.......&....$|
141 00a0: 26 59 a6 25 5a 98 a5 18 a6 24 71 41 35 b1 43 dc |&Y.%Z....$qA5.C.|
141 00a0: 26 59 a6 25 5a 98 a5 18 a6 24 71 41 35 b1 43 dc |&Y.%Z....$qA5.C.|
142 00b0: 96 b0 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a |.....E..V....R..|
142 00b0: 96 b0 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a |.....E..V....R..|
143 00c0: 78 ed fc d5 76 f1 36 95 dc 05 07 00 ad 39 5e d3 |x...v.6......9^.|
143 00c0: 78 ed fc d5 76 f1 36 95 dc 05 07 00 ad 39 5e d3 |x...v.6......9^.|
144
144
145 $ echo "http://localhost:$HGPORT1/partial.hg" > server/.hg/clonebundles.manifest
145 $ echo "http://localhost:$HGPORT1/partial.hg" > server/.hg/clonebundles.manifest
146 $ hg clone -U http://localhost:$HGPORT partial-bundle
146 $ hg clone -U http://localhost:$HGPORT partial-bundle
147 applying clone bundle from http://localhost:$HGPORT1/partial.hg
147 applying clone bundle from http://localhost:$HGPORT1/partial.hg
148 adding changesets
148 adding changesets
149 adding manifests
149 adding manifests
150 adding file changes
150 adding file changes
151 added 1 changesets with 1 changes to 1 files
151 added 1 changesets with 1 changes to 1 files
152 finished applying clone bundle
152 finished applying clone bundle
153 searching for changes
153 searching for changes
154 adding changesets
154 adding changesets
155 adding manifests
155 adding manifests
156 adding file changes
156 adding file changes
157 added 1 changesets with 1 changes to 1 files
157 added 1 changesets with 1 changes to 1 files
158
158
159 Incremental pull doesn't fetch bundle
160
161 $ hg clone -r 53245c60e682 -U http://localhost:$HGPORT partial-clone
162 adding changesets
163 adding manifests
164 adding file changes
165 added 1 changesets with 1 changes to 1 files
166
167 $ cd partial-clone
168 $ hg pull
169 pulling from http://localhost:$HGPORT/
170 applying clone bundle from http://localhost:$HGPORT1/partial.hg
171 adding changesets
172 adding manifests
173 adding file changes
174 added 0 changesets with 0 changes to 1 files
175 finished applying clone bundle
176 searching for changes
177 adding changesets
178 adding manifests
179 adding file changes
180 added 1 changesets with 1 changes to 1 files
181 (run 'hg update' to get a working copy)
182 $ cd ..
183
159 Bundle with full content works
184 Bundle with full content works
160
185
161 $ hg -R server bundle --type gzip-v2 --base null -r tip full.hg
186 $ hg -R server bundle --type gzip-v2 --base null -r tip full.hg
162 2 changesets found
187 2 changesets found
163
188
164 Again, we perform an extra check against bundle content changes. If this content
189 Again, we perform an extra check against bundle content changes. If this content
165 changes, clone bundles produced by new Mercurial versions may not be readable
190 changes, clone bundles produced by new Mercurial versions may not be readable
166 by old clients.
191 by old clients.
167
192
168 $ f --size --hexdump full.hg
193 $ f --size --hexdump full.hg
169 full.hg: size=408
194 full.hg: size=408
170 0000: 48 47 32 30 00 00 00 0e 43 6f 6d 70 72 65 73 73 |HG20....Compress|
195 0000: 48 47 32 30 00 00 00 0e 43 6f 6d 70 72 65 73 73 |HG20....Compress|
171 0010: 69 6f 6e 3d 47 5a 78 9c 63 60 60 90 e5 76 f6 70 |ion=GZx.c``..v.p|
196 0010: 69 6f 6e 3d 47 5a 78 9c 63 60 60 90 e5 76 f6 70 |ion=GZx.c``..v.p|
172 0020: f4 73 77 75 0f f2 0f 0d 60 00 02 46 06 76 a6 b2 |.swu....`..F.v..|
197 0020: f4 73 77 75 0f f2 0f 0d 60 00 02 46 06 76 a6 b2 |.swu....`..F.v..|
173 0030: d4 a2 e2 cc fc 3c 03 23 06 06 e6 7d 40 b1 4d c1 |.....<.#...}@.M.|
198 0030: d4 a2 e2 cc fc 3c 03 23 06 06 e6 7d 40 b1 4d c1 |.....<.#...}@.M.|
174 0040: 2a 31 09 cf 9a 3a 52 04 b7 fc db f0 95 e5 a4 f4 |*1...:R.........|
199 0040: 2a 31 09 cf 9a 3a 52 04 b7 fc db f0 95 e5 a4 f4 |*1...:R.........|
175 0050: 97 17 b2 c9 0c 14 00 02 e6 d9 99 25 1a a7 a4 99 |...........%....|
200 0050: 97 17 b2 c9 0c 14 00 02 e6 d9 99 25 1a a7 a4 99 |...........%....|
176 0060: a4 a4 1a 5b 58 a4 19 27 9b a4 59 a4 1a 59 a4 99 |...[X..'..Y..Y..|
201 0060: a4 a4 1a 5b 58 a4 19 27 9b a4 59 a4 1a 59 a4 99 |...[X..'..Y..Y..|
177 0070: a4 59 26 5a 18 9a 18 59 5a 26 1a 27 27 25 99 a6 |.Y&Z...YZ&.''%..|
202 0070: a4 59 26 5a 18 9a 18 59 5a 26 1a 27 27 25 99 a6 |.Y&Z...YZ&.''%..|
178 0080: 99 1a 70 95 a4 16 97 70 19 28 18 70 a5 e5 e7 73 |..p....p.(.p...s|
203 0080: 99 1a 70 95 a4 16 97 70 19 28 18 70 a5 e5 e7 73 |..p....p.(.p...s|
179 0090: 71 25 a6 a4 28 00 19 40 13 0e ac fa df ab ff 7b |q%..(..@.......{|
204 0090: 71 25 a6 a4 28 00 19 40 13 0e ac fa df ab ff 7b |q%..(..@.......{|
180 00a0: 3f fb 92 dc 8b 1f 62 bb 9e b7 d7 d9 87 3d 5a 44 |?.....b......=ZD|
205 00a0: 3f fb 92 dc 8b 1f 62 bb 9e b7 d7 d9 87 3d 5a 44 |?.....b......=ZD|
181 00b0: ac 2f b0 a9 c3 66 1e 54 b9 26 08 a7 1a 1b 1a a7 |./...f.T.&......|
206 00b0: ac 2f b0 a9 c3 66 1e 54 b9 26 08 a7 1a 1b 1a a7 |./...f.T.&......|
182 00c0: 25 1b 9a 1b 99 19 9a 5a 18 9b a6 18 19 00 dd 67 |%......Z.......g|
207 00c0: 25 1b 9a 1b 99 19 9a 5a 18 9b a6 18 19 00 dd 67 |%......Z.......g|
183 00d0: 61 61 98 06 f4 80 49 4a 8a 65 52 92 41 9a 81 81 |aa....IJ.eR.A...|
208 00d0: 61 61 98 06 f4 80 49 4a 8a 65 52 92 41 9a 81 81 |aa....IJ.eR.A...|
184 00e0: a5 11 17 50 31 30 58 19 cc 80 98 25 29 b1 08 c4 |...P10X....%)...|
209 00e0: a5 11 17 50 31 30 58 19 cc 80 98 25 29 b1 08 c4 |...P10X....%)...|
185 00f0: 37 07 79 19 88 d9 41 ee 07 8a 41 cd 5d 98 65 fb |7.y...A...A.].e.|
210 00f0: 37 07 79 19 88 d9 41 ee 07 8a 41 cd 5d 98 65 fb |7.y...A...A.].e.|
186 0100: e5 9e 45 bf 8d 7f 9f c6 97 9f 2b 44 34 67 d9 ec |..E.......+D4g..|
211 0100: e5 9e 45 bf 8d 7f 9f c6 97 9f 2b 44 34 67 d9 ec |..E.......+D4g..|
187 0110: 8e 0f a0 61 a8 eb 82 82 2e c9 c2 20 25 d5 34 c5 |...a....... %.4.|
212 0110: 8e 0f a0 61 a8 eb 82 82 2e c9 c2 20 25 d5 34 c5 |...a....... %.4.|
188 0120: d0 d8 c2 dc d4 c2 d4 c4 30 d9 34 cd c0 d4 c8 cc |........0.4.....|
213 0120: d0 d8 c2 dc d4 c2 d4 c4 30 d9 34 cd c0 d4 c8 cc |........0.4.....|
189 0130: 34 31 c5 d0 c4 24 31 c9 32 2d d1 c2 2c c5 30 25 |41...$1.2-..,.0%|
214 0130: 34 31 c5 d0 c4 24 31 c9 32 2d d1 c2 2c c5 30 25 |41...$1.2-..,.0%|
190 0140: 09 e4 ee 85 8f 85 ff 88 ab 89 36 c7 2a c4 47 34 |..........6.*.G4|
215 0140: 09 e4 ee 85 8f 85 ff 88 ab 89 36 c7 2a c4 47 34 |..........6.*.G4|
191 0150: fe f8 ec 7b 73 37 3f c3 24 62 1d 8d 4d 1d 9e 40 |...{s7?.$b..M..@|
216 0150: fe f8 ec 7b 73 37 3f c3 24 62 1d 8d 4d 1d 9e 40 |...{s7?.$b..M..@|
192 0160: 06 3b 10 14 36 a4 38 10 04 d8 21 01 5a b2 83 f7 |.;..6.8...!.Z...|
217 0160: 06 3b 10 14 36 a4 38 10 04 d8 21 01 5a b2 83 f7 |.;..6.8...!.Z...|
193 0170: e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a 78 ed fc d5 |.E..V....R..x...|
218 0170: e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a 78 ed fc d5 |.E..V....R..x...|
194 0180: 76 f1 36 25 81 49 c0 ad 30 c0 0e 49 8f 54 b7 9e |v.6%.I..0..I.T..|
219 0180: 76 f1 36 25 81 49 c0 ad 30 c0 0e 49 8f 54 b7 9e |v.6%.I..0..I.T..|
195 0190: d4 1c 09 00 bb 8d f0 bd |........|
220 0190: d4 1c 09 00 bb 8d f0 bd |........|
196
221
197 $ echo "http://localhost:$HGPORT1/full.hg" > server/.hg/clonebundles.manifest
222 $ echo "http://localhost:$HGPORT1/full.hg" > server/.hg/clonebundles.manifest
198 $ hg clone -U http://localhost:$HGPORT full-bundle
223 $ hg clone -U http://localhost:$HGPORT full-bundle
199 applying clone bundle from http://localhost:$HGPORT1/full.hg
224 applying clone bundle from http://localhost:$HGPORT1/full.hg
200 adding changesets
225 adding changesets
201 adding manifests
226 adding manifests
202 adding file changes
227 adding file changes
203 added 2 changesets with 2 changes to 2 files
228 added 2 changesets with 2 changes to 2 files
204 finished applying clone bundle
229 finished applying clone bundle
205 searching for changes
230 searching for changes
206 no changes found
231 no changes found
207
232
208 Entry with unknown BUNDLESPEC is filtered and not used
233 Entry with unknown BUNDLESPEC is filtered and not used
209
234
210 $ cat > server/.hg/clonebundles.manifest << EOF
235 $ cat > server/.hg/clonebundles.manifest << EOF
211 > http://bad.entry1 BUNDLESPEC=UNKNOWN
236 > http://bad.entry1 BUNDLESPEC=UNKNOWN
212 > http://bad.entry2 BUNDLESPEC=xz-v1
237 > http://bad.entry2 BUNDLESPEC=xz-v1
213 > http://bad.entry3 BUNDLESPEC=none-v100
238 > http://bad.entry3 BUNDLESPEC=none-v100
214 > http://localhost:$HGPORT1/full.hg BUNDLESPEC=gzip-v2
239 > http://localhost:$HGPORT1/full.hg BUNDLESPEC=gzip-v2
215 > EOF
240 > EOF
216
241
217 $ hg clone -U http://localhost:$HGPORT filter-unknown-type
242 $ hg clone -U http://localhost:$HGPORT filter-unknown-type
218 applying clone bundle from http://localhost:$HGPORT1/full.hg
243 applying clone bundle from http://localhost:$HGPORT1/full.hg
219 adding changesets
244 adding changesets
220 adding manifests
245 adding manifests
221 adding file changes
246 adding file changes
222 added 2 changesets with 2 changes to 2 files
247 added 2 changesets with 2 changes to 2 files
223 finished applying clone bundle
248 finished applying clone bundle
224 searching for changes
249 searching for changes
225 no changes found
250 no changes found
226
251
227 Automatic fallback when all entries are filtered
252 Automatic fallback when all entries are filtered
228
253
229 $ cat > server/.hg/clonebundles.manifest << EOF
254 $ cat > server/.hg/clonebundles.manifest << EOF
230 > http://bad.entry BUNDLESPEC=UNKNOWN
255 > http://bad.entry BUNDLESPEC=UNKNOWN
231 > EOF
256 > EOF
232
257
233 $ hg clone -U http://localhost:$HGPORT filter-all
258 $ hg clone -U http://localhost:$HGPORT filter-all
234 no compatible clone bundles available on server; falling back to regular clone
259 no compatible clone bundles available on server; falling back to regular clone
235 (you may want to report this to the server operator)
260 (you may want to report this to the server operator)
236 requesting all changes
261 requesting all changes
237 adding changesets
262 adding changesets
238 adding manifests
263 adding manifests
239 adding file changes
264 adding file changes
240 added 2 changesets with 2 changes to 2 files
265 added 2 changesets with 2 changes to 2 files
241
266
242 URLs requiring SNI are filtered in Python <2.7.9
267 URLs requiring SNI are filtered in Python <2.7.9
243
268
244 $ cp full.hg sni.hg
269 $ cp full.hg sni.hg
245 $ cat > server/.hg/clonebundles.manifest << EOF
270 $ cat > server/.hg/clonebundles.manifest << EOF
246 > http://localhost:$HGPORT1/sni.hg REQUIRESNI=true
271 > http://localhost:$HGPORT1/sni.hg REQUIRESNI=true
247 > http://localhost:$HGPORT1/full.hg
272 > http://localhost:$HGPORT1/full.hg
248 > EOF
273 > EOF
249
274
250 #if sslcontext
275 #if sslcontext
251 Python 2.7.9+ support SNI
276 Python 2.7.9+ support SNI
252
277
253 $ hg clone -U http://localhost:$HGPORT sni-supported
278 $ hg clone -U http://localhost:$HGPORT sni-supported
254 applying clone bundle from http://localhost:$HGPORT1/sni.hg
279 applying clone bundle from http://localhost:$HGPORT1/sni.hg
255 adding changesets
280 adding changesets
256 adding manifests
281 adding manifests
257 adding file changes
282 adding file changes
258 added 2 changesets with 2 changes to 2 files
283 added 2 changesets with 2 changes to 2 files
259 finished applying clone bundle
284 finished applying clone bundle
260 searching for changes
285 searching for changes
261 no changes found
286 no changes found
262 #else
287 #else
263 Python <2.7.9 will filter SNI URLs
288 Python <2.7.9 will filter SNI URLs
264
289
265 $ hg clone -U http://localhost:$HGPORT sni-unsupported
290 $ hg clone -U http://localhost:$HGPORT sni-unsupported
266 applying clone bundle from http://localhost:$HGPORT1/full.hg
291 applying clone bundle from http://localhost:$HGPORT1/full.hg
267 adding changesets
292 adding changesets
268 adding manifests
293 adding manifests
269 adding file changes
294 adding file changes
270 added 2 changesets with 2 changes to 2 files
295 added 2 changesets with 2 changes to 2 files
271 finished applying clone bundle
296 finished applying clone bundle
272 searching for changes
297 searching for changes
273 no changes found
298 no changes found
274 #endif
299 #endif
275
300
276 Stream clone bundles are supported
301 Stream clone bundles are supported
277
302
278 $ hg -R server debugcreatestreamclonebundle packed.hg
303 $ hg -R server debugcreatestreamclonebundle packed.hg
279 writing 613 bytes for 4 files
304 writing 613 bytes for 4 files
280 bundle requirements: revlogv1
305 bundle requirements: revlogv1
281
306
282 No bundle spec should work
307 No bundle spec should work
283
308
284 $ cat > server/.hg/clonebundles.manifest << EOF
309 $ cat > server/.hg/clonebundles.manifest << EOF
285 > http://localhost:$HGPORT1/packed.hg
310 > http://localhost:$HGPORT1/packed.hg
286 > EOF
311 > EOF
287
312
288 $ hg clone -U http://localhost:$HGPORT stream-clone-no-spec
313 $ hg clone -U http://localhost:$HGPORT stream-clone-no-spec
289 applying clone bundle from http://localhost:$HGPORT1/packed.hg
314 applying clone bundle from http://localhost:$HGPORT1/packed.hg
290 4 files to transfer, 613 bytes of data
315 4 files to transfer, 613 bytes of data
291 transferred 613 bytes in *.* seconds (*) (glob)
316 transferred 613 bytes in *.* seconds (*) (glob)
292 finished applying clone bundle
317 finished applying clone bundle
293 searching for changes
318 searching for changes
294 no changes found
319 no changes found
295
320
296 Bundle spec without parameters should work
321 Bundle spec without parameters should work
297
322
298 $ cat > server/.hg/clonebundles.manifest << EOF
323 $ cat > server/.hg/clonebundles.manifest << EOF
299 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1
324 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1
300 > EOF
325 > EOF
301
326
302 $ hg clone -U http://localhost:$HGPORT stream-clone-vanilla-spec
327 $ hg clone -U http://localhost:$HGPORT stream-clone-vanilla-spec
303 applying clone bundle from http://localhost:$HGPORT1/packed.hg
328 applying clone bundle from http://localhost:$HGPORT1/packed.hg
304 4 files to transfer, 613 bytes of data
329 4 files to transfer, 613 bytes of data
305 transferred 613 bytes in *.* seconds (*) (glob)
330 transferred 613 bytes in *.* seconds (*) (glob)
306 finished applying clone bundle
331 finished applying clone bundle
307 searching for changes
332 searching for changes
308 no changes found
333 no changes found
309
334
310 Bundle spec with format requirements should work
335 Bundle spec with format requirements should work
311
336
312 $ cat > server/.hg/clonebundles.manifest << EOF
337 $ cat > server/.hg/clonebundles.manifest << EOF
313 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1
338 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1
314 > EOF
339 > EOF
315
340
316 $ hg clone -U http://localhost:$HGPORT stream-clone-supported-requirements
341 $ hg clone -U http://localhost:$HGPORT stream-clone-supported-requirements
317 applying clone bundle from http://localhost:$HGPORT1/packed.hg
342 applying clone bundle from http://localhost:$HGPORT1/packed.hg
318 4 files to transfer, 613 bytes of data
343 4 files to transfer, 613 bytes of data
319 transferred 613 bytes in *.* seconds (*) (glob)
344 transferred 613 bytes in *.* seconds (*) (glob)
320 finished applying clone bundle
345 finished applying clone bundle
321 searching for changes
346 searching for changes
322 no changes found
347 no changes found
323
348
324 Stream bundle spec with unknown requirements should be filtered out
349 Stream bundle spec with unknown requirements should be filtered out
325
350
326 $ cat > server/.hg/clonebundles.manifest << EOF
351 $ cat > server/.hg/clonebundles.manifest << EOF
327 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42
352 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42
328 > EOF
353 > EOF
329
354
330 $ hg clone -U http://localhost:$HGPORT stream-clone-unsupported-requirements
355 $ hg clone -U http://localhost:$HGPORT stream-clone-unsupported-requirements
331 no compatible clone bundles available on server; falling back to regular clone
356 no compatible clone bundles available on server; falling back to regular clone
332 (you may want to report this to the server operator)
357 (you may want to report this to the server operator)
333 requesting all changes
358 requesting all changes
334 adding changesets
359 adding changesets
335 adding manifests
360 adding manifests
336 adding file changes
361 adding file changes
337 added 2 changesets with 2 changes to 2 files
362 added 2 changesets with 2 changes to 2 files
338
363
339 Set up manifest for testing preferences
364 Set up manifest for testing preferences
340 (Remember, the TYPE does not have to match reality - the URL is
365 (Remember, the TYPE does not have to match reality - the URL is
341 important)
366 important)
342
367
343 $ cp full.hg gz-a.hg
368 $ cp full.hg gz-a.hg
344 $ cp full.hg gz-b.hg
369 $ cp full.hg gz-b.hg
345 $ cp full.hg bz2-a.hg
370 $ cp full.hg bz2-a.hg
346 $ cp full.hg bz2-b.hg
371 $ cp full.hg bz2-b.hg
347 $ cat > server/.hg/clonebundles.manifest << EOF
372 $ cat > server/.hg/clonebundles.manifest << EOF
348 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 extra=a
373 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 extra=a
349 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2 extra=a
374 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2 extra=a
350 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
375 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
351 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
376 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
352 > EOF
377 > EOF
353
378
354 Preferring an undefined attribute will take first entry
379 Preferring an undefined attribute will take first entry
355
380
356 $ hg --config experimental.clonebundleprefers=foo=bar clone -U http://localhost:$HGPORT prefer-foo
381 $ hg --config experimental.clonebundleprefers=foo=bar clone -U http://localhost:$HGPORT prefer-foo
357 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
382 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
358 adding changesets
383 adding changesets
359 adding manifests
384 adding manifests
360 adding file changes
385 adding file changes
361 added 2 changesets with 2 changes to 2 files
386 added 2 changesets with 2 changes to 2 files
362 finished applying clone bundle
387 finished applying clone bundle
363 searching for changes
388 searching for changes
364 no changes found
389 no changes found
365
390
366 Preferring bz2 type will download first entry of that type
391 Preferring bz2 type will download first entry of that type
367
392
368 $ hg --config experimental.clonebundleprefers=COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-bz
393 $ hg --config experimental.clonebundleprefers=COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-bz
369 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
394 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
370 adding changesets
395 adding changesets
371 adding manifests
396 adding manifests
372 adding file changes
397 adding file changes
373 added 2 changesets with 2 changes to 2 files
398 added 2 changesets with 2 changes to 2 files
374 finished applying clone bundle
399 finished applying clone bundle
375 searching for changes
400 searching for changes
376 no changes found
401 no changes found
377
402
378 Preferring multiple values of an option works
403 Preferring multiple values of an option works
379
404
380 $ hg --config experimental.clonebundleprefers=COMPRESSION=unknown,COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-multiple-bz
405 $ hg --config experimental.clonebundleprefers=COMPRESSION=unknown,COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-multiple-bz
381 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
406 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
382 adding changesets
407 adding changesets
383 adding manifests
408 adding manifests
384 adding file changes
409 adding file changes
385 added 2 changesets with 2 changes to 2 files
410 added 2 changesets with 2 changes to 2 files
386 finished applying clone bundle
411 finished applying clone bundle
387 searching for changes
412 searching for changes
388 no changes found
413 no changes found
389
414
390 Sorting multiple values should get us back to original first entry
415 Sorting multiple values should get us back to original first entry
391
416
392 $ hg --config experimental.clonebundleprefers=BUNDLESPEC=unknown,BUNDLESPEC=gzip-v2,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-multiple-gz
417 $ hg --config experimental.clonebundleprefers=BUNDLESPEC=unknown,BUNDLESPEC=gzip-v2,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-multiple-gz
393 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
418 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
394 adding changesets
419 adding changesets
395 adding manifests
420 adding manifests
396 adding file changes
421 adding file changes
397 added 2 changesets with 2 changes to 2 files
422 added 2 changesets with 2 changes to 2 files
398 finished applying clone bundle
423 finished applying clone bundle
399 searching for changes
424 searching for changes
400 no changes found
425 no changes found
401
426
402 Preferring multiple attributes has correct order
427 Preferring multiple attributes has correct order
403
428
404 $ hg --config experimental.clonebundleprefers=extra=b,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-separate-attributes
429 $ hg --config experimental.clonebundleprefers=extra=b,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-separate-attributes
405 applying clone bundle from http://localhost:$HGPORT1/bz2-b.hg
430 applying clone bundle from http://localhost:$HGPORT1/bz2-b.hg
406 adding changesets
431 adding changesets
407 adding manifests
432 adding manifests
408 adding file changes
433 adding file changes
409 added 2 changesets with 2 changes to 2 files
434 added 2 changesets with 2 changes to 2 files
410 finished applying clone bundle
435 finished applying clone bundle
411 searching for changes
436 searching for changes
412 no changes found
437 no changes found
413
438
414 Test where attribute is missing from some entries
439 Test where attribute is missing from some entries
415
440
416 $ cat > server/.hg/clonebundles.manifest << EOF
441 $ cat > server/.hg/clonebundles.manifest << EOF
417 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
442 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
418 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2
443 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2
419 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
444 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
420 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
445 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
421 > EOF
446 > EOF
422
447
423 $ hg --config experimental.clonebundleprefers=extra=b clone -U http://localhost:$HGPORT prefer-partially-defined-attribute
448 $ hg --config experimental.clonebundleprefers=extra=b clone -U http://localhost:$HGPORT prefer-partially-defined-attribute
424 applying clone bundle from http://localhost:$HGPORT1/gz-b.hg
449 applying clone bundle from http://localhost:$HGPORT1/gz-b.hg
425 adding changesets
450 adding changesets
426 adding manifests
451 adding manifests
427 adding file changes
452 adding file changes
428 added 2 changesets with 2 changes to 2 files
453 added 2 changesets with 2 changes to 2 files
429 finished applying clone bundle
454 finished applying clone bundle
430 searching for changes
455 searching for changes
431 no changes found
456 no changes found
General Comments 0
You need to be logged in to leave comments. Login now