##// END OF EJS Templates
requirements: add constant for revlog v1 requirement...
Raphaël Gomès -
r47371:ee91966a default
parent child Browse files
Show More
@@ -22,6 +22,7 b' from . import ('
22 22 narrowspec,
23 23 phases,
24 24 pycompat,
25 requirements as requirementsmod,
25 26 setdiscovery,
26 27 )
27 28 from .interfaces import repository
@@ -183,7 +184,7 b' def _checkuserawstorefiledata(pullop):'
183 184
184 185 # TODO This is super hacky. There needs to be a storage API for this. We
185 186 # also need to check for compatibility with the remote.
186 if b'revlogv1' not in repo.requirements:
187 if requirementsmod.REVLOGV1_REQUIREMENT not in repo.requirements:
187 188 return False
188 189
189 190 return True
@@ -974,7 +974,7 b' def resolvestorevfsoptions(ui, requireme'
974 974 # opener options for it because those options wouldn't do anything
975 975 # meaningful on such old repos.
976 976 if (
977 b'revlogv1' in requirements
977 requirementsmod.REVLOGV1_REQUIREMENT in requirements
978 978 or requirementsmod.REVLOGV2_REQUIREMENT in requirements
979 979 ):
980 980 options.update(resolverevlogstorevfsoptions(ui, requirements, features))
@@ -998,7 +998,7 b' def resolverevlogstorevfsoptions(ui, req'
998 998 options = {}
999 999 options[b'flagprocessors'] = {}
1000 1000
1001 if b'revlogv1' in requirements:
1001 if requirementsmod.REVLOGV1_REQUIREMENT in requirements:
1002 1002 options[b'revlogv1'] = True
1003 1003 if requirementsmod.REVLOGV2_REQUIREMENT in requirements:
1004 1004 options[b'revlogv2'] = True
@@ -1199,7 +1199,7 b' class localrepository(object):'
1199 1199 # being successful (repository sizes went up due to worse delta
1200 1200 # chains), and the code was deleted in 4.6.
1201 1201 supportedformats = {
1202 b'revlogv1',
1202 requirementsmod.REVLOGV1_REQUIREMENT,
1203 1203 b'generaldelta',
1204 1204 requirementsmod.TREEMANIFEST_REQUIREMENT,
1205 1205 requirementsmod.COPIESSDC_REQUIREMENT,
@@ -3410,7 +3410,7 b' def newreporequirements(ui, createopts):'
3410 3410 % createopts[b'backend']
3411 3411 )
3412 3412
3413 requirements = {b'revlogv1'}
3413 requirements = {requirementsmod.REVLOGV1_REQUIREMENT}
3414 3414 if ui.configbool(b'format', b'usestore'):
3415 3415 requirements.add(b'store')
3416 3416 if ui.configbool(b'format', b'usefncache'):
@@ -3458,7 +3458,7 b' def newreporequirements(ui, createopts):'
3458 3458
3459 3459 revlogv2 = ui.config(b'experimental', b'revlogv2')
3460 3460 if revlogv2 == b'enable-unstable-format-and-corrupt-my-data':
3461 requirements.remove(b'revlogv1')
3461 requirements.remove(requirementsmod.REVLOGV1_REQUIREMENT)
3462 3462 # generaldelta is implied by revlogv2.
3463 3463 requirements.discard(b'generaldelta')
3464 3464 requirements.add(requirementsmod.REVLOGV2_REQUIREMENT)
@@ -21,6 +21,8 b" INTERNAL_PHASE_REQUIREMENT = b'internal-"
21 21 # Stores manifest in Tree structure
22 22 TREEMANIFEST_REQUIREMENT = b'treemanifest'
23 23
24 REVLOGV1_REQUIREMENT = b'revlogv1'
25
24 26 # Increment the sub-version when the revlog v2 format changes to lock out old
25 27 # clients.
26 28 REVLOGV2_REQUIREMENT = b'exp-revlogv2.1'
@@ -20,6 +20,7 b' from . import ('
20 20 narrowspec,
21 21 phases,
22 22 pycompat,
23 requirements as requirementsmod,
23 24 scmutil,
24 25 store,
25 26 util,
@@ -83,7 +84,7 b' def canperformstreamclone(pullop, bundle'
83 84 # is advertised and contains a comma-delimited list of requirements.
84 85 requirements = set()
85 86 if remote.capable(b'stream'):
86 requirements.add(b'revlogv1')
87 requirements.add(requirementsmod.REVLOGV1_REQUIREMENT)
87 88 else:
88 89 streamreqs = remote.capable(b'streamreqs')
89 90 # This is weird and shouldn't happen with modern servers.
@@ -857,7 +857,7 b' def requiredsourcerequirements(repo):'
857 857 """
858 858 return {
859 859 # Introduced in Mercurial 0.9.2.
860 b'revlogv1',
860 requirements.REVLOGV1_REQUIREMENT,
861 861 # Introduced in Mercurial 0.9.2.
862 862 b'store',
863 863 }
@@ -937,7 +937,7 b' def supporteddestrequirements(repo):'
937 937 b'dotencode',
938 938 b'fncache',
939 939 b'generaldelta',
940 b'revlogv1',
940 requirements.REVLOGV1_REQUIREMENT,
941 941 b'store',
942 942 requirements.SPARSEREVLOG_REQUIREMENT,
943 943 requirements.SIDEDATA_REQUIREMENT,
@@ -27,6 +27,7 b' from . import ('
27 27 exchange,
28 28 pushkey as pushkeymod,
29 29 pycompat,
30 requirements as requirementsmod,
30 31 streamclone,
31 32 util,
32 33 wireprototypes,
@@ -310,7 +311,7 b' def _capabilities(repo, proto):'
310 311 caps.append(b'stream-preferred')
311 312 requiredformats = repo.requirements & repo.supportedformats
312 313 # if our local revlogs are just revlogv1, add 'stream' cap
313 if not requiredformats - {b'revlogv1'}:
314 if not requiredformats - {requirementsmod.REVLOGV1_REQUIREMENT}:
314 315 caps.append(b'stream')
315 316 # otherwise, add 'streamreqs' detailing our local revlog format
316 317 else:
General Comments 0
You need to be logged in to leave comments. Login now