Show More
@@ -1,7 +1,7 b'' | |||||
1 | # This software may be used and distributed according to the terms of the |
|
1 | # This software may be used and distributed according to the terms of the | |
2 | # GNU General Public License version 2 or any later version. |
|
2 | # GNU General Public License version 2 or any later version. | |
3 |
|
3 | |||
4 |
"""advertise pre-generated bundles to seed clones |
|
4 | """advertise pre-generated bundles to seed clones | |
5 |
|
5 | |||
6 | "clonebundles" is a server-side extension used to advertise the existence |
|
6 | "clonebundles" is a server-side extension used to advertise the existence | |
7 | of pre-generated, externally hosted bundle files to clients that are |
|
7 | of pre-generated, externally hosted bundle files to clients that are | |
@@ -160,16 +160,6 b' message informing them how to bypass the' | |||||
160 | occurs. So server operators should prepare for some people to follow these |
|
160 | occurs. So server operators should prepare for some people to follow these | |
161 | instructions when a failure occurs, thus driving more load to the original |
|
161 | instructions when a failure occurs, thus driving more load to the original | |
162 | Mercurial server when the bundle hosting service fails. |
|
162 | Mercurial server when the bundle hosting service fails. | |
163 |
|
||||
164 | The following config options influence the behavior of the clone bundles |
|
|||
165 | feature: |
|
|||
166 |
|
||||
167 | ui.clonebundlefallback |
|
|||
168 | Whether to automatically fall back to a traditional clone in case of |
|
|||
169 | clone bundles failure. Defaults to false for reasons described above. |
|
|||
170 |
|
||||
171 | experimental.clonebundles |
|
|||
172 | Whether the clone bundles feature is enabled on clients. Defaults to true. |
|
|||
173 | """ |
|
163 | """ | |
174 |
|
164 | |||
175 | from mercurial import ( |
|
165 | from mercurial import ( |
@@ -1677,7 +1677,7 b' def _maybeapplyclonebundle(pullop):' | |||||
1677 | repo = pullop.repo |
|
1677 | repo = pullop.repo | |
1678 | remote = pullop.remote |
|
1678 | remote = pullop.remote | |
1679 |
|
1679 | |||
1680 |
if not repo.ui.configbool(' |
|
1680 | if not repo.ui.configbool('ui', 'clonebundles', True): | |
1681 | return |
|
1681 | return | |
1682 |
|
1682 | |||
1683 | # Only run if local repo is empty. |
|
1683 | # Only run if local repo is empty. | |
@@ -1733,7 +1733,7 b' def _maybeapplyclonebundle(pullop):' | |||||
1733 | hint=_('if this error persists, consider contacting ' |
|
1733 | hint=_('if this error persists, consider contacting ' | |
1734 | 'the server operator or disable clone ' |
|
1734 | 'the server operator or disable clone ' | |
1735 | 'bundles via ' |
|
1735 | 'bundles via ' | |
1736 |
'"--config |
|
1736 | '"--config ui.clonebundles=false"')) | |
1737 |
|
1737 | |||
1738 | def parseclonebundlesmanifest(repo, s): |
|
1738 | def parseclonebundlesmanifest(repo, s): | |
1739 | """Parses the raw text of a clone bundles manifest. |
|
1739 | """Parses the raw text of a clone bundles manifest. |
@@ -1487,6 +1487,16 b' User interface controls.' | |||||
1487 | default ``USER@HOST`` is used instead. |
|
1487 | default ``USER@HOST`` is used instead. | |
1488 | (default: False) |
|
1488 | (default: False) | |
1489 |
|
1489 | |||
|
1490 | ``clonebundles`` | |||
|
1491 | Whether the "clone bundles" feature is enabled. | |||
|
1492 | ||||
|
1493 | When enabled, :hg:`clone` may download and apply a server-advertised | |||
|
1494 | bundle file from a URL instead of using the normal exchange mechanism. | |||
|
1495 | ||||
|
1496 | This can likely result in faster and more reliable clones. | |||
|
1497 | ||||
|
1498 | (default: True) | |||
|
1499 | ||||
1490 | ``clonebundlefallback`` |
|
1500 | ``clonebundlefallback`` | |
1491 | Whether failure to apply an advertised "clone bundle" from a server |
|
1501 | Whether failure to apply an advertised "clone bundle" from a server | |
1492 | should result in fallback to a regular clone. |
|
1502 | should result in fallback to a regular clone. |
@@ -20,27 +20,6 b' Set up a server' | |||||
20 | $ cat hg.pid >> $DAEMON_PIDS |
|
20 | $ cat hg.pid >> $DAEMON_PIDS | |
21 | $ cd .. |
|
21 | $ cd .. | |
22 |
|
22 | |||
23 | Feature disabled by default |
|
|||
24 | (client should not request manifest) |
|
|||
25 |
|
||||
26 | $ hg clone -U http://localhost:$HGPORT feature-disabled |
|
|||
27 | requesting all changes |
|
|||
28 | adding changesets |
|
|||
29 | adding manifests |
|
|||
30 | adding file changes |
|
|||
31 | added 2 changesets with 2 changes to 2 files |
|
|||
32 |
|
||||
33 | $ cat server/access.log |
|
|||
34 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
|||
35 | * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) |
|
|||
36 | * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%252C03%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) |
|
|||
37 | * - - [*] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases (glob) |
|
|||
38 |
|
||||
39 | $ cat >> $HGRCPATH << EOF |
|
|||
40 | > [experimental] |
|
|||
41 | > clonebundles = true |
|
|||
42 | > EOF |
|
|||
43 |
|
||||
44 | Missing manifest should not result in server lookup |
|
23 | Missing manifest should not result in server lookup | |
45 |
|
24 | |||
46 | $ hg --verbose clone -U http://localhost:$HGPORT no-manifest |
|
25 | $ hg --verbose clone -U http://localhost:$HGPORT no-manifest | |
@@ -50,7 +29,7 b' Missing manifest should not result in se' | |||||
50 | adding file changes |
|
29 | adding file changes | |
51 | added 2 changesets with 2 changes to 2 files |
|
30 | added 2 changesets with 2 changes to 2 files | |
52 |
|
31 | |||
53 |
$ |
|
32 | $ cat server/access.log | |
54 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
33 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) | |
55 | * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) |
|
34 | * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) | |
56 | * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%252C03%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) |
|
35 | * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%252C03%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) | |
@@ -75,7 +54,7 b' Manifest file with invalid URL aborts' | |||||
75 | applying clone bundle from http://does.not.exist/bundle.hg |
|
54 | applying clone bundle from http://does.not.exist/bundle.hg | |
76 | error fetching bundle: (.* not known|getaddrinfo failed) (re) |
|
55 | error fetching bundle: (.* not known|getaddrinfo failed) (re) | |
77 | abort: error applying bundle |
|
56 | abort: error applying bundle | |
78 |
(if this error persists, consider contacting the server operator or disable clone bundles via "--config |
|
57 | (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false") | |
79 | [255] |
|
58 | [255] | |
80 |
|
59 | |||
81 | Server is not running aborts |
|
60 | Server is not running aborts | |
@@ -85,7 +64,7 b' Server is not running aborts' | |||||
85 | applying clone bundle from http://localhost:$HGPORT1/bundle.hg |
|
64 | applying clone bundle from http://localhost:$HGPORT1/bundle.hg | |
86 | error fetching bundle: * refused* (glob) |
|
65 | error fetching bundle: * refused* (glob) | |
87 | abort: error applying bundle |
|
66 | abort: error applying bundle | |
88 |
(if this error persists, consider contacting the server operator or disable clone bundles via "--config |
|
67 | (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false") | |
89 | [255] |
|
68 | [255] | |
90 |
|
69 | |||
91 | Server returns 404 |
|
70 | Server returns 404 | |
@@ -96,7 +75,7 b' Server returns 404' | |||||
96 | applying clone bundle from http://localhost:$HGPORT1/bundle.hg |
|
75 | applying clone bundle from http://localhost:$HGPORT1/bundle.hg | |
97 | HTTP error fetching bundle: HTTP Error 404: File not found |
|
76 | HTTP error fetching bundle: HTTP Error 404: File not found | |
98 | abort: error applying bundle |
|
77 | abort: error applying bundle | |
99 |
(if this error persists, consider contacting the server operator or disable clone bundles via "--config |
|
78 | (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false") | |
100 | [255] |
|
79 | [255] | |
101 |
|
80 | |||
102 | We can override failure to fall back to regular clone |
|
81 | We can override failure to fall back to regular clone |
@@ -252,7 +252,6 b' Test extension help:' | |||||
252 | censor erase file content at a given revision |
|
252 | censor erase file content at a given revision | |
253 | churn command to display statistics about repository history |
|
253 | churn command to display statistics about repository history | |
254 | clonebundles advertise pre-generated bundles to seed clones |
|
254 | clonebundles advertise pre-generated bundles to seed clones | |
255 | (experimental) |
|
|||
256 | color colorize output from some commands |
|
255 | color colorize output from some commands | |
257 | convert import revisions from foreign VCS repositories into |
|
256 | convert import revisions from foreign VCS repositories into | |
258 | Mercurial |
|
257 | Mercurial | |
@@ -1309,7 +1308,7 b' Test keyword search help' | |||||
1309 |
|
1308 | |||
1310 | Extensions: |
|
1309 | Extensions: | |
1311 |
|
1310 | |||
1312 |
clonebundles advertise pre-generated bundles to seed clones |
|
1311 | clonebundles advertise pre-generated bundles to seed clones | |
1313 | prefixedname matched against word "clone" |
|
1312 | prefixedname matched against word "clone" | |
1314 | relink recreates hardlinks between repository clones |
|
1313 | relink recreates hardlinks between repository clones | |
1315 |
|
1314 |
General Comments 0
You need to be logged in to leave comments.
Login now