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