##// END OF EJS Templates
requirements: also add a generaldelta constant...
Raphaël Gomès -
r47372:f4c325bf default
parent child Browse files
Show More
@@ -9,6 +9,7 b' from .thirdparty import attr'
9
9
10 from . import (
10 from . import (
11 error,
11 error,
12 requirements as requirementsmod,
12 sslutil,
13 sslutil,
13 util,
14 util,
14 )
15 )
@@ -164,7 +165,7 b' def parsebundlespec(repo, spec, strict=T'
164 compression = spec
165 compression = spec
165 version = b'v1'
166 version = b'v1'
166 # Generaldelta repos require v2.
167 # Generaldelta repos require v2.
167 if b'generaldelta' in repo.requirements:
168 if requirementsmod.GENERALDELTA_REQUIREMENT in repo.requirements:
168 version = b'v2'
169 version = b'v2'
169 # Modern compression engines require v2.
170 # Modern compression engines require v2.
170 if compression not in _bundlespecv1compengines:
171 if compression not in _bundlespecv1compengines:
@@ -1549,7 +1549,7 b' def safeversion(repo):'
1549 # will support. For example, all hg versions that support generaldelta also
1549 # will support. For example, all hg versions that support generaldelta also
1550 # support changegroup 02.
1550 # support changegroup 02.
1551 versions = supportedoutgoingversions(repo)
1551 versions = supportedoutgoingversions(repo)
1552 if b'generaldelta' in repo.requirements:
1552 if requirements.GENERALDELTA_REQUIREMENT in repo.requirements:
1553 versions.discard(b'01')
1553 versions.discard(b'01')
1554 assert versions
1554 assert versions
1555 return min(versions)
1555 return min(versions)
@@ -1003,7 +1003,7 b' def resolverevlogstorevfsoptions(ui, req'
1003 if requirementsmod.REVLOGV2_REQUIREMENT in requirements:
1003 if requirementsmod.REVLOGV2_REQUIREMENT in requirements:
1004 options[b'revlogv2'] = True
1004 options[b'revlogv2'] = True
1005
1005
1006 if b'generaldelta' in requirements:
1006 if requirementsmod.GENERALDELTA_REQUIREMENT in requirements:
1007 options[b'generaldelta'] = True
1007 options[b'generaldelta'] = True
1008
1008
1009 # experimental config: format.chunkcachesize
1009 # experimental config: format.chunkcachesize
@@ -1200,7 +1200,7 b' class localrepository(object):'
1200 # chains), and the code was deleted in 4.6.
1200 # chains), and the code was deleted in 4.6.
1201 supportedformats = {
1201 supportedformats = {
1202 requirementsmod.REVLOGV1_REQUIREMENT,
1202 requirementsmod.REVLOGV1_REQUIREMENT,
1203 b'generaldelta',
1203 requirementsmod.GENERALDELTA_REQUIREMENT,
1204 requirementsmod.TREEMANIFEST_REQUIREMENT,
1204 requirementsmod.TREEMANIFEST_REQUIREMENT,
1205 requirementsmod.COPIESSDC_REQUIREMENT,
1205 requirementsmod.COPIESSDC_REQUIREMENT,
1206 requirementsmod.REVLOGV2_REQUIREMENT,
1206 requirementsmod.REVLOGV2_REQUIREMENT,
@@ -3442,7 +3442,7 b' def newreporequirements(ui, createopts):'
3442 requirements.add(b'exp-compression-%s' % compengine)
3442 requirements.add(b'exp-compression-%s' % compengine)
3443
3443
3444 if scmutil.gdinitconfig(ui):
3444 if scmutil.gdinitconfig(ui):
3445 requirements.add(b'generaldelta')
3445 requirements.add(requirementsmod.GENERALDELTA_REQUIREMENT)
3446 if ui.configbool(b'format', b'sparse-revlog'):
3446 if ui.configbool(b'format', b'sparse-revlog'):
3447 requirements.add(requirementsmod.SPARSEREVLOG_REQUIREMENT)
3447 requirements.add(requirementsmod.SPARSEREVLOG_REQUIREMENT)
3448
3448
@@ -3460,7 +3460,7 b' def newreporequirements(ui, createopts):'
3460 if revlogv2 == b'enable-unstable-format-and-corrupt-my-data':
3460 if revlogv2 == b'enable-unstable-format-and-corrupt-my-data':
3461 requirements.remove(requirementsmod.REVLOGV1_REQUIREMENT)
3461 requirements.remove(requirementsmod.REVLOGV1_REQUIREMENT)
3462 # generaldelta is implied by revlogv2.
3462 # generaldelta is implied by revlogv2.
3463 requirements.discard(b'generaldelta')
3463 requirements.discard(requirementsmod.GENERALDELTA_REQUIREMENT)
3464 requirements.add(requirementsmod.REVLOGV2_REQUIREMENT)
3464 requirements.add(requirementsmod.REVLOGV2_REQUIREMENT)
3465 # experimental config: format.internal-phase
3465 # experimental config: format.internal-phase
3466 if ui.configbool(b'format', b'internal-phase'):
3466 if ui.configbool(b'format', b'internal-phase'):
@@ -7,6 +7,8 b''
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 GENERALDELTA_REQUIREMENT = b'generaldelta'
11
10 # When narrowing is finalized and no longer subject to format changes,
12 # When narrowing is finalized and no longer subject to format changes,
11 # we should move this to just "narrow" or similar.
13 # we should move this to just "narrow" or similar.
12 NARROW_REQUIREMENT = b'narrowhg-experimental'
14 NARROW_REQUIREMENT = b'narrowhg-experimental'
@@ -20,7 +20,7 b' from ..utils import compression'
20
20
21 # list of requirements that request a clone of all revlog if added/removed
21 # list of requirements that request a clone of all revlog if added/removed
22 RECLONES_REQUIREMENTS = {
22 RECLONES_REQUIREMENTS = {
23 b'generaldelta',
23 requirements.GENERALDELTA_REQUIREMENT,
24 requirements.SPARSEREVLOG_REQUIREMENT,
24 requirements.SPARSEREVLOG_REQUIREMENT,
25 }
25 }
26
26
@@ -236,7 +236,7 b' class dotencode(requirementformatvariant'
236 class generaldelta(requirementformatvariant):
236 class generaldelta(requirementformatvariant):
237 name = b'generaldelta'
237 name = b'generaldelta'
238
238
239 _requirement = b'generaldelta'
239 _requirement = requirements.GENERALDELTA_REQUIREMENT
240
240
241 default = True
241 default = True
242
242
@@ -936,7 +936,7 b' def supporteddestrequirements(repo):'
936 supported = {
936 supported = {
937 b'dotencode',
937 b'dotencode',
938 b'fncache',
938 b'fncache',
939 b'generaldelta',
939 requirements.GENERALDELTA_REQUIREMENT,
940 requirements.REVLOGV1_REQUIREMENT,
940 requirements.REVLOGV1_REQUIREMENT,
941 b'store',
941 b'store',
942 requirements.SPARSEREVLOG_REQUIREMENT,
942 requirements.SPARSEREVLOG_REQUIREMENT,
@@ -967,7 +967,7 b' def allowednewrequirements(repo):'
967 supported = {
967 supported = {
968 b'dotencode',
968 b'dotencode',
969 b'fncache',
969 b'fncache',
970 b'generaldelta',
970 requirements.GENERALDELTA_REQUIREMENT,
971 requirements.SPARSEREVLOG_REQUIREMENT,
971 requirements.SPARSEREVLOG_REQUIREMENT,
972 requirements.SIDEDATA_REQUIREMENT,
972 requirements.SIDEDATA_REQUIREMENT,
973 requirements.COPIESSDC_REQUIREMENT,
973 requirements.COPIESSDC_REQUIREMENT,
@@ -109,7 +109,7 b' def bundle1allowed(repo, action):'
109 4. server.bundle1
109 4. server.bundle1
110 """
110 """
111 ui = repo.ui
111 ui = repo.ui
112 gd = b'generaldelta' in repo.requirements
112 gd = requirementsmod.GENERALDELTA_REQUIREMENT in repo.requirements
113
113
114 if gd:
114 if gd:
115 v = ui.configbool(b'server', b'bundle1gd.%s' % action)
115 v = ui.configbool(b'server', b'bundle1gd.%s' % action)
General Comments 0
You need to be logged in to leave comments. Login now