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