comparison mercurial/upgrade.py @ 44841:526d69eeea31

upgrade: support upgrade and downgrade from persistent nodemap The requirements is now recognised and dealt with and the associated files properly handled. The persistent nodemap should be ready for usage in the field now. Differential Revision: https://phab.mercurial-scm.org/D8431
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 14 Apr 2020 06:09:14 +0200
parents ea9563e9e65a
children 4c1d39215034
comparison
equal deleted inserted replaced
44840:4ba2a6ffcf24 44841:526d69eeea31
76 """ 76 """
77 supported = { 77 supported = {
78 localrepo.SPARSEREVLOG_REQUIREMENT, 78 localrepo.SPARSEREVLOG_REQUIREMENT,
79 localrepo.SIDEDATA_REQUIREMENT, 79 localrepo.SIDEDATA_REQUIREMENT,
80 localrepo.COPIESSDC_REQUIREMENT, 80 localrepo.COPIESSDC_REQUIREMENT,
81 localrepo.NODEMAP_REQUIREMENT,
81 } 82 }
82 for name in compression.compengines: 83 for name in compression.compengines:
83 engine = compression.compengines[name] 84 engine = compression.compengines[name]
84 if engine.available() and engine.revlogheader(): 85 if engine.available() and engine.revlogheader():
85 supported.add(b'exp-compression-%s' % name) 86 supported.add(b'exp-compression-%s' % name)
103 b'revlogv1', 104 b'revlogv1',
104 b'store', 105 b'store',
105 localrepo.SPARSEREVLOG_REQUIREMENT, 106 localrepo.SPARSEREVLOG_REQUIREMENT,
106 localrepo.SIDEDATA_REQUIREMENT, 107 localrepo.SIDEDATA_REQUIREMENT,
107 localrepo.COPIESSDC_REQUIREMENT, 108 localrepo.COPIESSDC_REQUIREMENT,
109 localrepo.NODEMAP_REQUIREMENT,
108 } 110 }
109 for name in compression.compengines: 111 for name in compression.compengines:
110 engine = compression.compengines[name] 112 engine = compression.compengines[name]
111 if engine.available() and engine.revlogheader(): 113 if engine.available() and engine.revlogheader():
112 supported.add(b'exp-compression-%s' % name) 114 supported.add(b'exp-compression-%s' % name)
130 b'fncache', 132 b'fncache',
131 b'generaldelta', 133 b'generaldelta',
132 localrepo.SPARSEREVLOG_REQUIREMENT, 134 localrepo.SPARSEREVLOG_REQUIREMENT,
133 localrepo.SIDEDATA_REQUIREMENT, 135 localrepo.SIDEDATA_REQUIREMENT,
134 localrepo.COPIESSDC_REQUIREMENT, 136 localrepo.COPIESSDC_REQUIREMENT,
137 localrepo.NODEMAP_REQUIREMENT,
135 } 138 }
136 for name in compression.compengines: 139 for name in compression.compengines:
137 engine = compression.compengines[name] 140 engine = compression.compengines[name]
138 if engine.available() and engine.revlogheader(): 141 if engine.available() and engine.revlogheader():
139 supported.add(b'exp-compression-%s' % name) 142 supported.add(b'exp-compression-%s' % name)
988 st: ``stat`` data structure for ``path`` 991 st: ``stat`` data structure for ``path``
989 992
990 Function should return ``True`` if the file is to be copied. 993 Function should return ``True`` if the file is to be copied.
991 """ 994 """
992 # Skip revlogs. 995 # Skip revlogs.
993 if path.endswith((b'.i', b'.d')): 996 if path.endswith((b'.i', b'.d', b'.n', b'.nd')):
994 return False 997 return False
995 # Skip transaction related files. 998 # Skip transaction related files.
996 if path.startswith(b'undo'): 999 if path.startswith(b'undo'):
997 return False 1000 return False
998 # Only copy regular files. 1001 # Only copy regular files.