##// END OF EJS Templates
upgrade: rename finddeficiences() to find_format_upgrades()...
Pulkit Goyal -
r46822:53d083fa default
parent child Browse files
Show More
@@ -1,270 +1,265 b''
1 # upgrade.py - functions for in place upgrade of Mercurial repository
1 # upgrade.py - functions for in place upgrade of Mercurial repository
2 #
2 #
3 # Copyright (c) 2016-present, Gregory Szorc
3 # Copyright (c) 2016-present, Gregory Szorc
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 from .i18n import _
10 from .i18n import _
11 from . import (
11 from . import (
12 error,
12 error,
13 hg,
13 hg,
14 localrepo,
14 localrepo,
15 pycompat,
15 pycompat,
16 )
16 )
17
17
18 from .upgrade_utils import (
18 from .upgrade_utils import (
19 actions as upgrade_actions,
19 actions as upgrade_actions,
20 engine as upgrade_engine,
20 engine as upgrade_engine,
21 )
21 )
22
22
23 allformatvariant = upgrade_actions.allformatvariant
23 allformatvariant = upgrade_actions.allformatvariant
24
24
25 # search without '-' to support older form on newer client.
25 # search without '-' to support older form on newer client.
26 #
26 #
27 # We don't enforce backward compatibility for debug command so this
27 # We don't enforce backward compatibility for debug command so this
28 # might eventually be dropped. However, having to use two different
28 # might eventually be dropped. However, having to use two different
29 # forms in script when comparing result is anoying enough to add
29 # forms in script when comparing result is anoying enough to add
30 # backward compatibility for a while.
30 # backward compatibility for a while.
31 legacy_opts_map = {
31 legacy_opts_map = {
32 b'redeltaparent': b're-delta-parent',
32 b'redeltaparent': b're-delta-parent',
33 b'redeltamultibase': b're-delta-multibase',
33 b'redeltamultibase': b're-delta-multibase',
34 b'redeltaall': b're-delta-all',
34 b'redeltaall': b're-delta-all',
35 b'redeltafulladd': b're-delta-fulladd',
35 b'redeltafulladd': b're-delta-fulladd',
36 }
36 }
37
37
38
38
39 def upgraderepo(
39 def upgraderepo(
40 ui,
40 ui,
41 repo,
41 repo,
42 run=False,
42 run=False,
43 optimize=None,
43 optimize=None,
44 backup=True,
44 backup=True,
45 manifest=None,
45 manifest=None,
46 changelog=None,
46 changelog=None,
47 filelogs=None,
47 filelogs=None,
48 ):
48 ):
49 """Upgrade a repository in place."""
49 """Upgrade a repository in place."""
50 if optimize is None:
50 if optimize is None:
51 optimize = []
51 optimize = []
52 optimize = {legacy_opts_map.get(o, o) for o in optimize}
52 optimize = {legacy_opts_map.get(o, o) for o in optimize}
53 repo = repo.unfiltered()
53 repo = repo.unfiltered()
54
54
55 revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS)
55 revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS)
56 specentries = (
56 specentries = (
57 (upgrade_engine.UPGRADE_CHANGELOG, changelog),
57 (upgrade_engine.UPGRADE_CHANGELOG, changelog),
58 (upgrade_engine.UPGRADE_MANIFEST, manifest),
58 (upgrade_engine.UPGRADE_MANIFEST, manifest),
59 (upgrade_engine.UPGRADE_FILELOGS, filelogs),
59 (upgrade_engine.UPGRADE_FILELOGS, filelogs),
60 )
60 )
61 specified = [(y, x) for (y, x) in specentries if x is not None]
61 specified = [(y, x) for (y, x) in specentries if x is not None]
62 if specified:
62 if specified:
63 # we have some limitation on revlogs to be recloned
63 # we have some limitation on revlogs to be recloned
64 if any(x for y, x in specified):
64 if any(x for y, x in specified):
65 revlogs = set()
65 revlogs = set()
66 for upgrade, enabled in specified:
66 for upgrade, enabled in specified:
67 if enabled:
67 if enabled:
68 revlogs.add(upgrade)
68 revlogs.add(upgrade)
69 else:
69 else:
70 # none are enabled
70 # none are enabled
71 for upgrade, __ in specified:
71 for upgrade, __ in specified:
72 revlogs.discard(upgrade)
72 revlogs.discard(upgrade)
73
73
74 # Ensure the repository can be upgraded.
74 # Ensure the repository can be upgraded.
75 upgrade_actions.check_source_requirements(repo)
75 upgrade_actions.check_source_requirements(repo)
76
76
77 default_options = localrepo.defaultcreateopts(repo.ui)
77 default_options = localrepo.defaultcreateopts(repo.ui)
78 newreqs = localrepo.newreporequirements(repo.ui, default_options)
78 newreqs = localrepo.newreporequirements(repo.ui, default_options)
79 newreqs.update(upgrade_actions.preservedrequirements(repo))
79 newreqs.update(upgrade_actions.preservedrequirements(repo))
80
80
81 upgrade_actions.check_requirements_changes(repo, newreqs)
81 upgrade_actions.check_requirements_changes(repo, newreqs)
82
82
83 # Find and validate all improvements that can be made.
83 # Find and validate all improvements that can be made.
84 alloptimizations = upgrade_actions.findoptimizations(repo)
84 alloptimizations = upgrade_actions.findoptimizations(repo)
85
85
86 # Apply and Validate arguments.
86 # Apply and Validate arguments.
87 optimizations = []
87 optimizations = []
88 for o in alloptimizations:
88 for o in alloptimizations:
89 if o.name in optimize:
89 if o.name in optimize:
90 optimizations.append(o)
90 optimizations.append(o)
91 optimize.discard(o.name)
91 optimize.discard(o.name)
92
92
93 if optimize: # anything left is unknown
93 if optimize: # anything left is unknown
94 raise error.Abort(
94 raise error.Abort(
95 _(b'unknown optimization action requested: %s')
95 _(b'unknown optimization action requested: %s')
96 % b', '.join(sorted(optimize)),
96 % b', '.join(sorted(optimize)),
97 hint=_(b'run without arguments to see valid optimizations'),
97 hint=_(b'run without arguments to see valid optimizations'),
98 )
98 )
99
99
100 deficiencies = upgrade_actions.finddeficiencies(repo)
100 format_upgrades = upgrade_actions.find_format_upgrades(repo)
101 actions = upgrade_actions.determineactions(
101 actions = upgrade_actions.determineactions(
102 repo, deficiencies, repo.requirements, newreqs
102 repo, format_upgrades, repo.requirements, newreqs
103 )
103 )
104 actions.extend(
104 actions.extend(
105 o
105 o
106 for o in sorted(optimizations)
106 for o in sorted(optimizations)
107 # determineactions could have added optimisation
107 # determineactions could have added optimisation
108 if o not in actions
108 if o not in actions
109 )
109 )
110
110
111 removedreqs = repo.requirements - newreqs
111 removedreqs = repo.requirements - newreqs
112 addedreqs = newreqs - repo.requirements
112 addedreqs = newreqs - repo.requirements
113
113
114 if revlogs != upgrade_engine.UPGRADE_ALL_REVLOGS:
114 if revlogs != upgrade_engine.UPGRADE_ALL_REVLOGS:
115 incompatible = upgrade_actions.RECLONES_REQUIREMENTS & (
115 incompatible = upgrade_actions.RECLONES_REQUIREMENTS & (
116 removedreqs | addedreqs
116 removedreqs | addedreqs
117 )
117 )
118 if incompatible:
118 if incompatible:
119 msg = _(
119 msg = _(
120 b'ignoring revlogs selection flags, format requirements '
120 b'ignoring revlogs selection flags, format requirements '
121 b'change: %s\n'
121 b'change: %s\n'
122 )
122 )
123 ui.warn(msg % b', '.join(sorted(incompatible)))
123 ui.warn(msg % b', '.join(sorted(incompatible)))
124 revlogs = upgrade_engine.UPGRADE_ALL_REVLOGS
124 revlogs = upgrade_engine.UPGRADE_ALL_REVLOGS
125
125
126 upgrade_op = upgrade_actions.UpgradeOperation(
126 upgrade_op = upgrade_actions.UpgradeOperation(
127 ui,
127 ui,
128 newreqs,
128 newreqs,
129 repo.requirements,
129 repo.requirements,
130 actions,
130 actions,
131 revlogs,
131 revlogs,
132 )
132 )
133
133
134 if not run:
134 if not run:
135 fromconfig = []
135 fromconfig = []
136 onlydefault = []
136 onlydefault = []
137
137
138 for d in deficiencies:
138 for d in format_upgrades:
139 if d.fromconfig(repo):
139 if d.fromconfig(repo):
140 fromconfig.append(d)
140 fromconfig.append(d)
141 elif d.default:
141 elif d.default:
142 onlydefault.append(d)
142 onlydefault.append(d)
143
143
144 if fromconfig or onlydefault:
144 if fromconfig or onlydefault:
145
145
146 if fromconfig:
146 if fromconfig:
147 ui.status(
147 ui.status(
148 _(
148 _(
149 b'repository lacks features recommended by '
149 b'repository lacks features recommended by '
150 b'current config options:\n\n'
150 b'current config options:\n\n'
151 )
151 )
152 )
152 )
153 for i in fromconfig:
153 for i in fromconfig:
154 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
154 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
155
155
156 if onlydefault:
156 if onlydefault:
157 ui.status(
157 ui.status(
158 _(
158 _(
159 b'repository lacks features used by the default '
159 b'repository lacks features used by the default '
160 b'config options:\n\n'
160 b'config options:\n\n'
161 )
161 )
162 )
162 )
163 for i in onlydefault:
163 for i in onlydefault:
164 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
164 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
165
165
166 ui.status(b'\n')
166 ui.status(b'\n')
167 else:
167 else:
168 ui.status(
168 ui.status(_(b'(no format upgrades found in existing repository)\n'))
169 _(
170 b'(no feature deficiencies found in existing '
171 b'repository)\n'
172 )
173 )
174
169
175 ui.status(
170 ui.status(
176 _(
171 _(
177 b'performing an upgrade with "--run" will make the following '
172 b'performing an upgrade with "--run" will make the following '
178 b'changes:\n\n'
173 b'changes:\n\n'
179 )
174 )
180 )
175 )
181
176
182 upgrade_op.print_requirements()
177 upgrade_op.print_requirements()
183 upgrade_op.print_optimisations()
178 upgrade_op.print_optimisations()
184 upgrade_op.print_upgrade_actions()
179 upgrade_op.print_upgrade_actions()
185 upgrade_op.print_affected_revlogs()
180 upgrade_op.print_affected_revlogs()
186
181
187 if upgrade_op.unused_optimizations:
182 if upgrade_op.unused_optimizations:
188 ui.status(
183 ui.status(
189 _(
184 _(
190 b'additional optimizations are available by specifying '
185 b'additional optimizations are available by specifying '
191 b'"--optimize <name>":\n\n'
186 b'"--optimize <name>":\n\n'
192 )
187 )
193 )
188 )
194 upgrade_op.print_unused_optimizations()
189 upgrade_op.print_unused_optimizations()
195 return
190 return
196
191
197 # Else we're in the run=true case.
192 # Else we're in the run=true case.
198 ui.write(_(b'upgrade will perform the following actions:\n\n'))
193 ui.write(_(b'upgrade will perform the following actions:\n\n'))
199 upgrade_op.print_requirements()
194 upgrade_op.print_requirements()
200 upgrade_op.print_optimisations()
195 upgrade_op.print_optimisations()
201 upgrade_op.print_upgrade_actions()
196 upgrade_op.print_upgrade_actions()
202 upgrade_op.print_affected_revlogs()
197 upgrade_op.print_affected_revlogs()
203
198
204 ui.status(_(b'beginning upgrade...\n'))
199 ui.status(_(b'beginning upgrade...\n'))
205 with repo.wlock(), repo.lock():
200 with repo.wlock(), repo.lock():
206 ui.status(_(b'repository locked and read-only\n'))
201 ui.status(_(b'repository locked and read-only\n'))
207 # Our strategy for upgrading the repository is to create a new,
202 # Our strategy for upgrading the repository is to create a new,
208 # temporary repository, write data to it, then do a swap of the
203 # temporary repository, write data to it, then do a swap of the
209 # data. There are less heavyweight ways to do this, but it is easier
204 # data. There are less heavyweight ways to do this, but it is easier
210 # to create a new repo object than to instantiate all the components
205 # to create a new repo object than to instantiate all the components
211 # (like the store) separately.
206 # (like the store) separately.
212 tmppath = pycompat.mkdtemp(prefix=b'upgrade.', dir=repo.path)
207 tmppath = pycompat.mkdtemp(prefix=b'upgrade.', dir=repo.path)
213 backuppath = None
208 backuppath = None
214 try:
209 try:
215 ui.status(
210 ui.status(
216 _(
211 _(
217 b'creating temporary repository to stage migrated '
212 b'creating temporary repository to stage migrated '
218 b'data: %s\n'
213 b'data: %s\n'
219 )
214 )
220 % tmppath
215 % tmppath
221 )
216 )
222
217
223 # clone ui without using ui.copy because repo.ui is protected
218 # clone ui without using ui.copy because repo.ui is protected
224 repoui = repo.ui.__class__(repo.ui)
219 repoui = repo.ui.__class__(repo.ui)
225 dstrepo = hg.repository(repoui, path=tmppath, create=True)
220 dstrepo = hg.repository(repoui, path=tmppath, create=True)
226
221
227 with dstrepo.wlock(), dstrepo.lock():
222 with dstrepo.wlock(), dstrepo.lock():
228 backuppath = upgrade_engine.upgrade(
223 backuppath = upgrade_engine.upgrade(
229 ui, repo, dstrepo, upgrade_op
224 ui, repo, dstrepo, upgrade_op
230 )
225 )
231 if not (backup or backuppath is None):
226 if not (backup or backuppath is None):
232 ui.status(
227 ui.status(
233 _(b'removing old repository content%s\n') % backuppath
228 _(b'removing old repository content%s\n') % backuppath
234 )
229 )
235 repo.vfs.rmtree(backuppath, forcibly=True)
230 repo.vfs.rmtree(backuppath, forcibly=True)
236 backuppath = None
231 backuppath = None
237
232
238 finally:
233 finally:
239 ui.status(_(b'removing temporary repository %s\n') % tmppath)
234 ui.status(_(b'removing temporary repository %s\n') % tmppath)
240 repo.vfs.rmtree(tmppath, forcibly=True)
235 repo.vfs.rmtree(tmppath, forcibly=True)
241
236
242 if backuppath and not ui.quiet:
237 if backuppath and not ui.quiet:
243 ui.warn(
238 ui.warn(
244 _(b'copy of old repository backed up at %s\n') % backuppath
239 _(b'copy of old repository backed up at %s\n') % backuppath
245 )
240 )
246 ui.warn(
241 ui.warn(
247 _(
242 _(
248 b'the old repository will not be deleted; remove '
243 b'the old repository will not be deleted; remove '
249 b'it to free up disk space once the upgraded '
244 b'it to free up disk space once the upgraded '
250 b'repository is verified\n'
245 b'repository is verified\n'
251 )
246 )
252 )
247 )
253
248
254 if upgrade_actions.sharesafe.name in addedreqs:
249 if upgrade_actions.sharesafe.name in addedreqs:
255 ui.warn(
250 ui.warn(
256 _(
251 _(
257 b'repository upgraded to share safe mode, existing'
252 b'repository upgraded to share safe mode, existing'
258 b' shares will still work in old non-safe mode. '
253 b' shares will still work in old non-safe mode. '
259 b'Re-share existing shares to use them in safe mode'
254 b'Re-share existing shares to use them in safe mode'
260 b' New shares will be created in safe mode.\n'
255 b' New shares will be created in safe mode.\n'
261 )
256 )
262 )
257 )
263 if upgrade_actions.sharesafe.name in removedreqs:
258 if upgrade_actions.sharesafe.name in removedreqs:
264 ui.warn(
259 ui.warn(
265 _(
260 _(
266 b'repository downgraded to not use share safe mode, '
261 b'repository downgraded to not use share safe mode, '
267 b'existing shares will not work and needs to'
262 b'existing shares will not work and needs to'
268 b' be reshared.\n'
263 b' be reshared.\n'
269 )
264 )
270 )
265 )
@@ -1,820 +1,820 b''
1 # upgrade.py - functions for in place upgrade of Mercurial repository
1 # upgrade.py - functions for in place upgrade of Mercurial repository
2 #
2 #
3 # Copyright (c) 2016-present, Gregory Szorc
3 # Copyright (c) 2016-present, Gregory Szorc
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 from ..i18n import _
10 from ..i18n import _
11 from .. import (
11 from .. import (
12 error,
12 error,
13 localrepo,
13 localrepo,
14 requirements,
14 requirements,
15 util,
15 util,
16 )
16 )
17
17
18 from ..utils import compression
18 from ..utils import compression
19
19
20 # list of requirements that request a clone of all revlog if added/removed
20 # list of requirements that request a clone of all revlog if added/removed
21 RECLONES_REQUIREMENTS = {
21 RECLONES_REQUIREMENTS = {
22 b'generaldelta',
22 b'generaldelta',
23 requirements.SPARSEREVLOG_REQUIREMENT,
23 requirements.SPARSEREVLOG_REQUIREMENT,
24 }
24 }
25
25
26
26
27 def preservedrequirements(repo):
27 def preservedrequirements(repo):
28 return set()
28 return set()
29
29
30
30
31 DEFICIENCY = b'deficiency'
31 DEFICIENCY = b'deficiency'
32 OPTIMISATION = b'optimization'
32 OPTIMISATION = b'optimization'
33
33
34
34
35 class improvement(object):
35 class improvement(object):
36 """Represents an improvement that can be made as part of an upgrade.
36 """Represents an improvement that can be made as part of an upgrade.
37
37
38 The following attributes are defined on each instance:
38 The following attributes are defined on each instance:
39
39
40 name
40 name
41 Machine-readable string uniquely identifying this improvement. It
41 Machine-readable string uniquely identifying this improvement. It
42 will be mapped to an action later in the upgrade process.
42 will be mapped to an action later in the upgrade process.
43
43
44 type
44 type
45 Either ``DEFICIENCY`` or ``OPTIMISATION``. A deficiency is an obvious
45 Either ``DEFICIENCY`` or ``OPTIMISATION``. A deficiency is an obvious
46 problem. An optimization is an action (sometimes optional) that
46 problem. An optimization is an action (sometimes optional) that
47 can be taken to further improve the state of the repository.
47 can be taken to further improve the state of the repository.
48
48
49 description
49 description
50 Message intended for humans explaining the improvement in more detail,
50 Message intended for humans explaining the improvement in more detail,
51 including the implications of it. For ``DEFICIENCY`` types, should be
51 including the implications of it. For ``DEFICIENCY`` types, should be
52 worded in the present tense. For ``OPTIMISATION`` types, should be
52 worded in the present tense. For ``OPTIMISATION`` types, should be
53 worded in the future tense.
53 worded in the future tense.
54
54
55 upgrademessage
55 upgrademessage
56 Message intended for humans explaining what an upgrade addressing this
56 Message intended for humans explaining what an upgrade addressing this
57 issue will do. Should be worded in the future tense.
57 issue will do. Should be worded in the future tense.
58 """
58 """
59
59
60 def __init__(self, name, type, description, upgrademessage):
60 def __init__(self, name, type, description, upgrademessage):
61 self.name = name
61 self.name = name
62 self.type = type
62 self.type = type
63 self.description = description
63 self.description = description
64 self.upgrademessage = upgrademessage
64 self.upgrademessage = upgrademessage
65
65
66 def __eq__(self, other):
66 def __eq__(self, other):
67 if not isinstance(other, improvement):
67 if not isinstance(other, improvement):
68 # This is what python tell use to do
68 # This is what python tell use to do
69 return NotImplemented
69 return NotImplemented
70 return self.name == other.name
70 return self.name == other.name
71
71
72 def __ne__(self, other):
72 def __ne__(self, other):
73 return not (self == other)
73 return not (self == other)
74
74
75 def __hash__(self):
75 def __hash__(self):
76 return hash(self.name)
76 return hash(self.name)
77
77
78
78
79 allformatvariant = []
79 allformatvariant = []
80
80
81
81
82 def registerformatvariant(cls):
82 def registerformatvariant(cls):
83 allformatvariant.append(cls)
83 allformatvariant.append(cls)
84 return cls
84 return cls
85
85
86
86
87 class formatvariant(improvement):
87 class formatvariant(improvement):
88 """an improvement subclass dedicated to repository format"""
88 """an improvement subclass dedicated to repository format"""
89
89
90 type = DEFICIENCY
90 type = DEFICIENCY
91 ### The following attributes should be defined for each class:
91 ### The following attributes should be defined for each class:
92
92
93 # machine-readable string uniquely identifying this improvement. it will be
93 # machine-readable string uniquely identifying this improvement. it will be
94 # mapped to an action later in the upgrade process.
94 # mapped to an action later in the upgrade process.
95 name = None
95 name = None
96
96
97 # message intended for humans explaining the improvement in more detail,
97 # message intended for humans explaining the improvement in more detail,
98 # including the implications of it ``DEFICIENCY`` types, should be worded
98 # including the implications of it ``DEFICIENCY`` types, should be worded
99 # in the present tense.
99 # in the present tense.
100 description = None
100 description = None
101
101
102 # message intended for humans explaining what an upgrade addressing this
102 # message intended for humans explaining what an upgrade addressing this
103 # issue will do. should be worded in the future tense.
103 # issue will do. should be worded in the future tense.
104 upgrademessage = None
104 upgrademessage = None
105
105
106 # value of current Mercurial default for new repository
106 # value of current Mercurial default for new repository
107 default = None
107 default = None
108
108
109 def __init__(self):
109 def __init__(self):
110 raise NotImplementedError()
110 raise NotImplementedError()
111
111
112 @staticmethod
112 @staticmethod
113 def fromrepo(repo):
113 def fromrepo(repo):
114 """current value of the variant in the repository"""
114 """current value of the variant in the repository"""
115 raise NotImplementedError()
115 raise NotImplementedError()
116
116
117 @staticmethod
117 @staticmethod
118 def fromconfig(repo):
118 def fromconfig(repo):
119 """current value of the variant in the configuration"""
119 """current value of the variant in the configuration"""
120 raise NotImplementedError()
120 raise NotImplementedError()
121
121
122
122
123 class requirementformatvariant(formatvariant):
123 class requirementformatvariant(formatvariant):
124 """formatvariant based on a 'requirement' name.
124 """formatvariant based on a 'requirement' name.
125
125
126 Many format variant are controlled by a 'requirement'. We define a small
126 Many format variant are controlled by a 'requirement'. We define a small
127 subclass to factor the code.
127 subclass to factor the code.
128 """
128 """
129
129
130 # the requirement that control this format variant
130 # the requirement that control this format variant
131 _requirement = None
131 _requirement = None
132
132
133 @staticmethod
133 @staticmethod
134 def _newreporequirements(ui):
134 def _newreporequirements(ui):
135 return localrepo.newreporequirements(
135 return localrepo.newreporequirements(
136 ui, localrepo.defaultcreateopts(ui)
136 ui, localrepo.defaultcreateopts(ui)
137 )
137 )
138
138
139 @classmethod
139 @classmethod
140 def fromrepo(cls, repo):
140 def fromrepo(cls, repo):
141 assert cls._requirement is not None
141 assert cls._requirement is not None
142 return cls._requirement in repo.requirements
142 return cls._requirement in repo.requirements
143
143
144 @classmethod
144 @classmethod
145 def fromconfig(cls, repo):
145 def fromconfig(cls, repo):
146 assert cls._requirement is not None
146 assert cls._requirement is not None
147 return cls._requirement in cls._newreporequirements(repo.ui)
147 return cls._requirement in cls._newreporequirements(repo.ui)
148
148
149
149
150 @registerformatvariant
150 @registerformatvariant
151 class fncache(requirementformatvariant):
151 class fncache(requirementformatvariant):
152 name = b'fncache'
152 name = b'fncache'
153
153
154 _requirement = b'fncache'
154 _requirement = b'fncache'
155
155
156 default = True
156 default = True
157
157
158 description = _(
158 description = _(
159 b'long and reserved filenames may not work correctly; '
159 b'long and reserved filenames may not work correctly; '
160 b'repository performance is sub-optimal'
160 b'repository performance is sub-optimal'
161 )
161 )
162
162
163 upgrademessage = _(
163 upgrademessage = _(
164 b'repository will be more resilient to storing '
164 b'repository will be more resilient to storing '
165 b'certain paths and performance of certain '
165 b'certain paths and performance of certain '
166 b'operations should be improved'
166 b'operations should be improved'
167 )
167 )
168
168
169
169
170 @registerformatvariant
170 @registerformatvariant
171 class dotencode(requirementformatvariant):
171 class dotencode(requirementformatvariant):
172 name = b'dotencode'
172 name = b'dotencode'
173
173
174 _requirement = b'dotencode'
174 _requirement = b'dotencode'
175
175
176 default = True
176 default = True
177
177
178 description = _(
178 description = _(
179 b'storage of filenames beginning with a period or '
179 b'storage of filenames beginning with a period or '
180 b'space may not work correctly'
180 b'space may not work correctly'
181 )
181 )
182
182
183 upgrademessage = _(
183 upgrademessage = _(
184 b'repository will be better able to store files '
184 b'repository will be better able to store files '
185 b'beginning with a space or period'
185 b'beginning with a space or period'
186 )
186 )
187
187
188
188
189 @registerformatvariant
189 @registerformatvariant
190 class generaldelta(requirementformatvariant):
190 class generaldelta(requirementformatvariant):
191 name = b'generaldelta'
191 name = b'generaldelta'
192
192
193 _requirement = b'generaldelta'
193 _requirement = b'generaldelta'
194
194
195 default = True
195 default = True
196
196
197 description = _(
197 description = _(
198 b'deltas within internal storage are unable to '
198 b'deltas within internal storage are unable to '
199 b'choose optimal revisions; repository is larger and '
199 b'choose optimal revisions; repository is larger and '
200 b'slower than it could be; interaction with other '
200 b'slower than it could be; interaction with other '
201 b'repositories may require extra network and CPU '
201 b'repositories may require extra network and CPU '
202 b'resources, making "hg push" and "hg pull" slower'
202 b'resources, making "hg push" and "hg pull" slower'
203 )
203 )
204
204
205 upgrademessage = _(
205 upgrademessage = _(
206 b'repository storage will be able to create '
206 b'repository storage will be able to create '
207 b'optimal deltas; new repository data will be '
207 b'optimal deltas; new repository data will be '
208 b'smaller and read times should decrease; '
208 b'smaller and read times should decrease; '
209 b'interacting with other repositories using this '
209 b'interacting with other repositories using this '
210 b'storage model should require less network and '
210 b'storage model should require less network and '
211 b'CPU resources, making "hg push" and "hg pull" '
211 b'CPU resources, making "hg push" and "hg pull" '
212 b'faster'
212 b'faster'
213 )
213 )
214
214
215
215
216 @registerformatvariant
216 @registerformatvariant
217 class sharesafe(requirementformatvariant):
217 class sharesafe(requirementformatvariant):
218 name = b'exp-sharesafe'
218 name = b'exp-sharesafe'
219 _requirement = requirements.SHARESAFE_REQUIREMENT
219 _requirement = requirements.SHARESAFE_REQUIREMENT
220
220
221 default = False
221 default = False
222
222
223 description = _(
223 description = _(
224 b'old shared repositories do not share source repository '
224 b'old shared repositories do not share source repository '
225 b'requirements and config. This leads to various problems '
225 b'requirements and config. This leads to various problems '
226 b'when the source repository format is upgraded or some new '
226 b'when the source repository format is upgraded or some new '
227 b'extensions are enabled.'
227 b'extensions are enabled.'
228 )
228 )
229
229
230 upgrademessage = _(
230 upgrademessage = _(
231 b'Upgrades a repository to share-safe format so that future '
231 b'Upgrades a repository to share-safe format so that future '
232 b'shares of this repository share its requirements and configs.'
232 b'shares of this repository share its requirements and configs.'
233 )
233 )
234
234
235
235
236 @registerformatvariant
236 @registerformatvariant
237 class sparserevlog(requirementformatvariant):
237 class sparserevlog(requirementformatvariant):
238 name = b'sparserevlog'
238 name = b'sparserevlog'
239
239
240 _requirement = requirements.SPARSEREVLOG_REQUIREMENT
240 _requirement = requirements.SPARSEREVLOG_REQUIREMENT
241
241
242 default = True
242 default = True
243
243
244 description = _(
244 description = _(
245 b'in order to limit disk reading and memory usage on older '
245 b'in order to limit disk reading and memory usage on older '
246 b'version, the span of a delta chain from its root to its '
246 b'version, the span of a delta chain from its root to its '
247 b'end is limited, whatever the relevant data in this span. '
247 b'end is limited, whatever the relevant data in this span. '
248 b'This can severly limit Mercurial ability to build good '
248 b'This can severly limit Mercurial ability to build good '
249 b'chain of delta resulting is much more storage space being '
249 b'chain of delta resulting is much more storage space being '
250 b'taken and limit reusability of on disk delta during '
250 b'taken and limit reusability of on disk delta during '
251 b'exchange.'
251 b'exchange.'
252 )
252 )
253
253
254 upgrademessage = _(
254 upgrademessage = _(
255 b'Revlog supports delta chain with more unused data '
255 b'Revlog supports delta chain with more unused data '
256 b'between payload. These gaps will be skipped at read '
256 b'between payload. These gaps will be skipped at read '
257 b'time. This allows for better delta chains, making a '
257 b'time. This allows for better delta chains, making a '
258 b'better compression and faster exchange with server.'
258 b'better compression and faster exchange with server.'
259 )
259 )
260
260
261
261
262 @registerformatvariant
262 @registerformatvariant
263 class sidedata(requirementformatvariant):
263 class sidedata(requirementformatvariant):
264 name = b'sidedata'
264 name = b'sidedata'
265
265
266 _requirement = requirements.SIDEDATA_REQUIREMENT
266 _requirement = requirements.SIDEDATA_REQUIREMENT
267
267
268 default = False
268 default = False
269
269
270 description = _(
270 description = _(
271 b'Allows storage of extra data alongside a revision, '
271 b'Allows storage of extra data alongside a revision, '
272 b'unlocking various caching options.'
272 b'unlocking various caching options.'
273 )
273 )
274
274
275 upgrademessage = _(b'Allows storage of extra data alongside a revision.')
275 upgrademessage = _(b'Allows storage of extra data alongside a revision.')
276
276
277
277
278 @registerformatvariant
278 @registerformatvariant
279 class persistentnodemap(requirementformatvariant):
279 class persistentnodemap(requirementformatvariant):
280 name = b'persistent-nodemap'
280 name = b'persistent-nodemap'
281
281
282 _requirement = requirements.NODEMAP_REQUIREMENT
282 _requirement = requirements.NODEMAP_REQUIREMENT
283
283
284 default = False
284 default = False
285
285
286 description = _(
286 description = _(
287 b'persist the node -> rev mapping on disk to speedup lookup'
287 b'persist the node -> rev mapping on disk to speedup lookup'
288 )
288 )
289
289
290 upgrademessage = _(b'Speedup revision lookup by node id.')
290 upgrademessage = _(b'Speedup revision lookup by node id.')
291
291
292
292
293 @registerformatvariant
293 @registerformatvariant
294 class copiessdc(requirementformatvariant):
294 class copiessdc(requirementformatvariant):
295 name = b'copies-sdc'
295 name = b'copies-sdc'
296
296
297 _requirement = requirements.COPIESSDC_REQUIREMENT
297 _requirement = requirements.COPIESSDC_REQUIREMENT
298
298
299 default = False
299 default = False
300
300
301 description = _(b'Stores copies information alongside changesets.')
301 description = _(b'Stores copies information alongside changesets.')
302
302
303 upgrademessage = _(
303 upgrademessage = _(
304 b'Allows to use more efficient algorithm to deal with ' b'copy tracing.'
304 b'Allows to use more efficient algorithm to deal with ' b'copy tracing.'
305 )
305 )
306
306
307
307
308 @registerformatvariant
308 @registerformatvariant
309 class removecldeltachain(formatvariant):
309 class removecldeltachain(formatvariant):
310 name = b'plain-cl-delta'
310 name = b'plain-cl-delta'
311
311
312 default = True
312 default = True
313
313
314 description = _(
314 description = _(
315 b'changelog storage is using deltas instead of '
315 b'changelog storage is using deltas instead of '
316 b'raw entries; changelog reading and any '
316 b'raw entries; changelog reading and any '
317 b'operation relying on changelog data are slower '
317 b'operation relying on changelog data are slower '
318 b'than they could be'
318 b'than they could be'
319 )
319 )
320
320
321 upgrademessage = _(
321 upgrademessage = _(
322 b'changelog storage will be reformated to '
322 b'changelog storage will be reformated to '
323 b'store raw entries; changelog reading will be '
323 b'store raw entries; changelog reading will be '
324 b'faster; changelog size may be reduced'
324 b'faster; changelog size may be reduced'
325 )
325 )
326
326
327 @staticmethod
327 @staticmethod
328 def fromrepo(repo):
328 def fromrepo(repo):
329 # Mercurial 4.0 changed changelogs to not use delta chains. Search for
329 # Mercurial 4.0 changed changelogs to not use delta chains. Search for
330 # changelogs with deltas.
330 # changelogs with deltas.
331 cl = repo.changelog
331 cl = repo.changelog
332 chainbase = cl.chainbase
332 chainbase = cl.chainbase
333 return all(rev == chainbase(rev) for rev in cl)
333 return all(rev == chainbase(rev) for rev in cl)
334
334
335 @staticmethod
335 @staticmethod
336 def fromconfig(repo):
336 def fromconfig(repo):
337 return True
337 return True
338
338
339
339
340 @registerformatvariant
340 @registerformatvariant
341 class compressionengine(formatvariant):
341 class compressionengine(formatvariant):
342 name = b'compression'
342 name = b'compression'
343 default = b'zlib'
343 default = b'zlib'
344
344
345 description = _(
345 description = _(
346 b'Compresion algorithm used to compress data. '
346 b'Compresion algorithm used to compress data. '
347 b'Some engine are faster than other'
347 b'Some engine are faster than other'
348 )
348 )
349
349
350 upgrademessage = _(
350 upgrademessage = _(
351 b'revlog content will be recompressed with the new algorithm.'
351 b'revlog content will be recompressed with the new algorithm.'
352 )
352 )
353
353
354 @classmethod
354 @classmethod
355 def fromrepo(cls, repo):
355 def fromrepo(cls, repo):
356 # we allow multiple compression engine requirement to co-exist because
356 # we allow multiple compression engine requirement to co-exist because
357 # strickly speaking, revlog seems to support mixed compression style.
357 # strickly speaking, revlog seems to support mixed compression style.
358 #
358 #
359 # The compression used for new entries will be "the last one"
359 # The compression used for new entries will be "the last one"
360 compression = b'zlib'
360 compression = b'zlib'
361 for req in repo.requirements:
361 for req in repo.requirements:
362 prefix = req.startswith
362 prefix = req.startswith
363 if prefix(b'revlog-compression-') or prefix(b'exp-compression-'):
363 if prefix(b'revlog-compression-') or prefix(b'exp-compression-'):
364 compression = req.split(b'-', 2)[2]
364 compression = req.split(b'-', 2)[2]
365 return compression
365 return compression
366
366
367 @classmethod
367 @classmethod
368 def fromconfig(cls, repo):
368 def fromconfig(cls, repo):
369 compengines = repo.ui.configlist(b'format', b'revlog-compression')
369 compengines = repo.ui.configlist(b'format', b'revlog-compression')
370 # return the first valid value as the selection code would do
370 # return the first valid value as the selection code would do
371 for comp in compengines:
371 for comp in compengines:
372 if comp in util.compengines:
372 if comp in util.compengines:
373 return comp
373 return comp
374
374
375 # no valide compression found lets display it all for clarity
375 # no valide compression found lets display it all for clarity
376 return b','.join(compengines)
376 return b','.join(compengines)
377
377
378
378
379 @registerformatvariant
379 @registerformatvariant
380 class compressionlevel(formatvariant):
380 class compressionlevel(formatvariant):
381 name = b'compression-level'
381 name = b'compression-level'
382 default = b'default'
382 default = b'default'
383
383
384 description = _(b'compression level')
384 description = _(b'compression level')
385
385
386 upgrademessage = _(b'revlog content will be recompressed')
386 upgrademessage = _(b'revlog content will be recompressed')
387
387
388 @classmethod
388 @classmethod
389 def fromrepo(cls, repo):
389 def fromrepo(cls, repo):
390 comp = compressionengine.fromrepo(repo)
390 comp = compressionengine.fromrepo(repo)
391 level = None
391 level = None
392 if comp == b'zlib':
392 if comp == b'zlib':
393 level = repo.ui.configint(b'storage', b'revlog.zlib.level')
393 level = repo.ui.configint(b'storage', b'revlog.zlib.level')
394 elif comp == b'zstd':
394 elif comp == b'zstd':
395 level = repo.ui.configint(b'storage', b'revlog.zstd.level')
395 level = repo.ui.configint(b'storage', b'revlog.zstd.level')
396 if level is None:
396 if level is None:
397 return b'default'
397 return b'default'
398 return bytes(level)
398 return bytes(level)
399
399
400 @classmethod
400 @classmethod
401 def fromconfig(cls, repo):
401 def fromconfig(cls, repo):
402 comp = compressionengine.fromconfig(repo)
402 comp = compressionengine.fromconfig(repo)
403 level = None
403 level = None
404 if comp == b'zlib':
404 if comp == b'zlib':
405 level = repo.ui.configint(b'storage', b'revlog.zlib.level')
405 level = repo.ui.configint(b'storage', b'revlog.zlib.level')
406 elif comp == b'zstd':
406 elif comp == b'zstd':
407 level = repo.ui.configint(b'storage', b'revlog.zstd.level')
407 level = repo.ui.configint(b'storage', b'revlog.zstd.level')
408 if level is None:
408 if level is None:
409 return b'default'
409 return b'default'
410 return bytes(level)
410 return bytes(level)
411
411
412
412
413 def finddeficiencies(repo):
413 def find_format_upgrades(repo):
414 """returns a list of deficiencies that the repo suffer from"""
414 """returns a list of format upgrades which can be perform on the repo"""
415 deficiencies = []
415 upgrades = []
416
416
417 # We could detect lack of revlogv1 and store here, but they were added
417 # We could detect lack of revlogv1 and store here, but they were added
418 # in 0.9.2 and we don't support upgrading repos without these
418 # in 0.9.2 and we don't support upgrading repos without these
419 # requirements, so let's not bother.
419 # requirements, so let's not bother.
420
420
421 for fv in allformatvariant:
421 for fv in allformatvariant:
422 if not fv.fromrepo(repo):
422 if not fv.fromrepo(repo):
423 deficiencies.append(fv)
423 upgrades.append(fv)
424
424
425 return deficiencies
425 return upgrades
426
426
427
427
428 ALL_OPTIMISATIONS = []
428 ALL_OPTIMISATIONS = []
429
429
430
430
431 def register_optimization(obj):
431 def register_optimization(obj):
432 ALL_OPTIMISATIONS.append(obj)
432 ALL_OPTIMISATIONS.append(obj)
433 return obj
433 return obj
434
434
435
435
436 register_optimization(
436 register_optimization(
437 improvement(
437 improvement(
438 name=b're-delta-parent',
438 name=b're-delta-parent',
439 type=OPTIMISATION,
439 type=OPTIMISATION,
440 description=_(
440 description=_(
441 b'deltas within internal storage will be recalculated to '
441 b'deltas within internal storage will be recalculated to '
442 b'choose an optimal base revision where this was not '
442 b'choose an optimal base revision where this was not '
443 b'already done; the size of the repository may shrink and '
443 b'already done; the size of the repository may shrink and '
444 b'various operations may become faster; the first time '
444 b'various operations may become faster; the first time '
445 b'this optimization is performed could slow down upgrade '
445 b'this optimization is performed could slow down upgrade '
446 b'execution considerably; subsequent invocations should '
446 b'execution considerably; subsequent invocations should '
447 b'not run noticeably slower'
447 b'not run noticeably slower'
448 ),
448 ),
449 upgrademessage=_(
449 upgrademessage=_(
450 b'deltas within internal storage will choose a new '
450 b'deltas within internal storage will choose a new '
451 b'base revision if needed'
451 b'base revision if needed'
452 ),
452 ),
453 )
453 )
454 )
454 )
455
455
456 register_optimization(
456 register_optimization(
457 improvement(
457 improvement(
458 name=b're-delta-multibase',
458 name=b're-delta-multibase',
459 type=OPTIMISATION,
459 type=OPTIMISATION,
460 description=_(
460 description=_(
461 b'deltas within internal storage will be recalculated '
461 b'deltas within internal storage will be recalculated '
462 b'against multiple base revision and the smallest '
462 b'against multiple base revision and the smallest '
463 b'difference will be used; the size of the repository may '
463 b'difference will be used; the size of the repository may '
464 b'shrink significantly when there are many merges; this '
464 b'shrink significantly when there are many merges; this '
465 b'optimization will slow down execution in proportion to '
465 b'optimization will slow down execution in proportion to '
466 b'the number of merges in the repository and the amount '
466 b'the number of merges in the repository and the amount '
467 b'of files in the repository; this slow down should not '
467 b'of files in the repository; this slow down should not '
468 b'be significant unless there are tens of thousands of '
468 b'be significant unless there are tens of thousands of '
469 b'files and thousands of merges'
469 b'files and thousands of merges'
470 ),
470 ),
471 upgrademessage=_(
471 upgrademessage=_(
472 b'deltas within internal storage will choose an '
472 b'deltas within internal storage will choose an '
473 b'optimal delta by computing deltas against multiple '
473 b'optimal delta by computing deltas against multiple '
474 b'parents; may slow down execution time '
474 b'parents; may slow down execution time '
475 b'significantly'
475 b'significantly'
476 ),
476 ),
477 )
477 )
478 )
478 )
479
479
480 register_optimization(
480 register_optimization(
481 improvement(
481 improvement(
482 name=b're-delta-all',
482 name=b're-delta-all',
483 type=OPTIMISATION,
483 type=OPTIMISATION,
484 description=_(
484 description=_(
485 b'deltas within internal storage will always be '
485 b'deltas within internal storage will always be '
486 b'recalculated without reusing prior deltas; this will '
486 b'recalculated without reusing prior deltas; this will '
487 b'likely make execution run several times slower; this '
487 b'likely make execution run several times slower; this '
488 b'optimization is typically not needed'
488 b'optimization is typically not needed'
489 ),
489 ),
490 upgrademessage=_(
490 upgrademessage=_(
491 b'deltas within internal storage will be fully '
491 b'deltas within internal storage will be fully '
492 b'recomputed; this will likely drastically slow down '
492 b'recomputed; this will likely drastically slow down '
493 b'execution time'
493 b'execution time'
494 ),
494 ),
495 )
495 )
496 )
496 )
497
497
498 register_optimization(
498 register_optimization(
499 improvement(
499 improvement(
500 name=b're-delta-fulladd',
500 name=b're-delta-fulladd',
501 type=OPTIMISATION,
501 type=OPTIMISATION,
502 description=_(
502 description=_(
503 b'every revision will be re-added as if it was new '
503 b'every revision will be re-added as if it was new '
504 b'content. It will go through the full storage '
504 b'content. It will go through the full storage '
505 b'mechanism giving extensions a chance to process it '
505 b'mechanism giving extensions a chance to process it '
506 b'(eg. lfs). This is similar to "re-delta-all" but even '
506 b'(eg. lfs). This is similar to "re-delta-all" but even '
507 b'slower since more logic is involved.'
507 b'slower since more logic is involved.'
508 ),
508 ),
509 upgrademessage=_(
509 upgrademessage=_(
510 b'each revision will be added as new content to the '
510 b'each revision will be added as new content to the '
511 b'internal storage; this will likely drastically slow '
511 b'internal storage; this will likely drastically slow '
512 b'down execution time, but some extensions might need '
512 b'down execution time, but some extensions might need '
513 b'it'
513 b'it'
514 ),
514 ),
515 )
515 )
516 )
516 )
517
517
518
518
519 def findoptimizations(repo):
519 def findoptimizations(repo):
520 """Determine optimisation that could be used during upgrade"""
520 """Determine optimisation that could be used during upgrade"""
521 # These are unconditionally added. There is logic later that figures out
521 # These are unconditionally added. There is logic later that figures out
522 # which ones to apply.
522 # which ones to apply.
523 return list(ALL_OPTIMISATIONS)
523 return list(ALL_OPTIMISATIONS)
524
524
525
525
526 def determineactions(repo, deficiencies, sourcereqs, destreqs):
526 def determineactions(repo, format_upgrades, sourcereqs, destreqs):
527 """Determine upgrade actions that will be performed.
527 """Determine upgrade actions that will be performed.
528
528
529 Given a list of improvements as returned by ``finddeficiencies`` and
529 Given a list of improvements as returned by ``find_format_upgrades`` and
530 ``findoptimizations``, determine the list of upgrade actions that
530 ``findoptimizations``, determine the list of upgrade actions that
531 will be performed.
531 will be performed.
532
532
533 The role of this function is to filter improvements if needed, apply
533 The role of this function is to filter improvements if needed, apply
534 recommended optimizations from the improvements list that make sense,
534 recommended optimizations from the improvements list that make sense,
535 etc.
535 etc.
536
536
537 Returns a list of action names.
537 Returns a list of action names.
538 """
538 """
539 newactions = []
539 newactions = []
540
540
541 for d in deficiencies:
541 for d in format_upgrades:
542 name = d._requirement
542 name = d._requirement
543
543
544 # If the action is a requirement that doesn't show up in the
544 # If the action is a requirement that doesn't show up in the
545 # destination requirements, prune the action.
545 # destination requirements, prune the action.
546 if name is not None and name not in destreqs:
546 if name is not None and name not in destreqs:
547 continue
547 continue
548
548
549 newactions.append(d)
549 newactions.append(d)
550
550
551 # FUTURE consider adding some optimizations here for certain transitions.
551 # FUTURE consider adding some optimizations here for certain transitions.
552 # e.g. adding generaldelta could schedule parent redeltas.
552 # e.g. adding generaldelta could schedule parent redeltas.
553
553
554 return newactions
554 return newactions
555
555
556
556
557 class UpgradeOperation(object):
557 class UpgradeOperation(object):
558 """represent the work to be done during an upgrade"""
558 """represent the work to be done during an upgrade"""
559
559
560 def __init__(
560 def __init__(
561 self,
561 self,
562 ui,
562 ui,
563 new_requirements,
563 new_requirements,
564 current_requirements,
564 current_requirements,
565 actions,
565 actions,
566 revlogs_to_process,
566 revlogs_to_process,
567 ):
567 ):
568 self.ui = ui
568 self.ui = ui
569 self.new_requirements = new_requirements
569 self.new_requirements = new_requirements
570 self.current_requirements = current_requirements
570 self.current_requirements = current_requirements
571 self.actions = actions
571 self.actions = actions
572 self._actions_names = set([a.name for a in actions])
572 self._actions_names = set([a.name for a in actions])
573 self.revlogs_to_process = revlogs_to_process
573 self.revlogs_to_process = revlogs_to_process
574 # requirements which will be added by the operation
574 # requirements which will be added by the operation
575 self._added_requirements = (
575 self._added_requirements = (
576 self.new_requirements - self.current_requirements
576 self.new_requirements - self.current_requirements
577 )
577 )
578 # requirements which will be removed by the operation
578 # requirements which will be removed by the operation
579 self._removed_requirements = (
579 self._removed_requirements = (
580 self.current_requirements - self.new_requirements
580 self.current_requirements - self.new_requirements
581 )
581 )
582 # requirements which will be preserved by the operation
582 # requirements which will be preserved by the operation
583 self._preserved_requirements = (
583 self._preserved_requirements = (
584 self.current_requirements & self.new_requirements
584 self.current_requirements & self.new_requirements
585 )
585 )
586 # optimizations which are not used and it's recommended that they
586 # optimizations which are not used and it's recommended that they
587 # should use them
587 # should use them
588 all_optimizations = findoptimizations(None)
588 all_optimizations = findoptimizations(None)
589 self.unused_optimizations = [
589 self.unused_optimizations = [
590 i for i in all_optimizations if i not in self.actions
590 i for i in all_optimizations if i not in self.actions
591 ]
591 ]
592
592
593 def _write_labeled(self, l, label):
593 def _write_labeled(self, l, label):
594 """
594 """
595 Utility function to aid writing of a list under one label
595 Utility function to aid writing of a list under one label
596 """
596 """
597 first = True
597 first = True
598 for r in sorted(l):
598 for r in sorted(l):
599 if not first:
599 if not first:
600 self.ui.write(b', ')
600 self.ui.write(b', ')
601 self.ui.write(r, label=label)
601 self.ui.write(r, label=label)
602 first = False
602 first = False
603
603
604 def print_requirements(self):
604 def print_requirements(self):
605 self.ui.write(_(b'requirements\n'))
605 self.ui.write(_(b'requirements\n'))
606 self.ui.write(_(b' preserved: '))
606 self.ui.write(_(b' preserved: '))
607 self._write_labeled(
607 self._write_labeled(
608 self._preserved_requirements, "upgrade-repo.requirement.preserved"
608 self._preserved_requirements, "upgrade-repo.requirement.preserved"
609 )
609 )
610 self.ui.write((b'\n'))
610 self.ui.write((b'\n'))
611 if self._removed_requirements:
611 if self._removed_requirements:
612 self.ui.write(_(b' removed: '))
612 self.ui.write(_(b' removed: '))
613 self._write_labeled(
613 self._write_labeled(
614 self._removed_requirements, "upgrade-repo.requirement.removed"
614 self._removed_requirements, "upgrade-repo.requirement.removed"
615 )
615 )
616 self.ui.write((b'\n'))
616 self.ui.write((b'\n'))
617 if self._added_requirements:
617 if self._added_requirements:
618 self.ui.write(_(b' added: '))
618 self.ui.write(_(b' added: '))
619 self._write_labeled(
619 self._write_labeled(
620 self._added_requirements, "upgrade-repo.requirement.added"
620 self._added_requirements, "upgrade-repo.requirement.added"
621 )
621 )
622 self.ui.write((b'\n'))
622 self.ui.write((b'\n'))
623 self.ui.write(b'\n')
623 self.ui.write(b'\n')
624
624
625 def print_optimisations(self):
625 def print_optimisations(self):
626 optimisations = [a for a in self.actions if a.type == OPTIMISATION]
626 optimisations = [a for a in self.actions if a.type == OPTIMISATION]
627 optimisations.sort(key=lambda a: a.name)
627 optimisations.sort(key=lambda a: a.name)
628 if optimisations:
628 if optimisations:
629 self.ui.write(_(b'optimisations: '))
629 self.ui.write(_(b'optimisations: '))
630 self._write_labeled(
630 self._write_labeled(
631 [a.name for a in optimisations],
631 [a.name for a in optimisations],
632 "upgrade-repo.optimisation.performed",
632 "upgrade-repo.optimisation.performed",
633 )
633 )
634 self.ui.write(b'\n\n')
634 self.ui.write(b'\n\n')
635
635
636 def print_upgrade_actions(self):
636 def print_upgrade_actions(self):
637 for a in self.actions:
637 for a in self.actions:
638 self.ui.status(b'%s\n %s\n\n' % (a.name, a.upgrademessage))
638 self.ui.status(b'%s\n %s\n\n' % (a.name, a.upgrademessage))
639
639
640 def print_affected_revlogs(self):
640 def print_affected_revlogs(self):
641 if not self.revlogs_to_process:
641 if not self.revlogs_to_process:
642 self.ui.write((b'no revlogs to process\n'))
642 self.ui.write((b'no revlogs to process\n'))
643 else:
643 else:
644 self.ui.write((b'processed revlogs:\n'))
644 self.ui.write((b'processed revlogs:\n'))
645 for r in sorted(self.revlogs_to_process):
645 for r in sorted(self.revlogs_to_process):
646 self.ui.write((b' - %s\n' % r))
646 self.ui.write((b' - %s\n' % r))
647 self.ui.write((b'\n'))
647 self.ui.write((b'\n'))
648
648
649 def print_unused_optimizations(self):
649 def print_unused_optimizations(self):
650 for i in self.unused_optimizations:
650 for i in self.unused_optimizations:
651 self.ui.status(_(b'%s\n %s\n\n') % (i.name, i.description))
651 self.ui.status(_(b'%s\n %s\n\n') % (i.name, i.description))
652
652
653 def has_action(self, name):
653 def has_action(self, name):
654 """ Check whether the upgrade operation will perform this action """
654 """ Check whether the upgrade operation will perform this action """
655 return name in self._actions_names
655 return name in self._actions_names
656
656
657
657
658 ### Code checking if a repository can got through the upgrade process at all. #
658 ### Code checking if a repository can got through the upgrade process at all. #
659
659
660
660
661 def requiredsourcerequirements(repo):
661 def requiredsourcerequirements(repo):
662 """Obtain requirements required to be present to upgrade a repo.
662 """Obtain requirements required to be present to upgrade a repo.
663
663
664 An upgrade will not be allowed if the repository doesn't have the
664 An upgrade will not be allowed if the repository doesn't have the
665 requirements returned by this function.
665 requirements returned by this function.
666 """
666 """
667 return {
667 return {
668 # Introduced in Mercurial 0.9.2.
668 # Introduced in Mercurial 0.9.2.
669 b'revlogv1',
669 b'revlogv1',
670 # Introduced in Mercurial 0.9.2.
670 # Introduced in Mercurial 0.9.2.
671 b'store',
671 b'store',
672 }
672 }
673
673
674
674
675 def blocksourcerequirements(repo):
675 def blocksourcerequirements(repo):
676 """Obtain requirements that will prevent an upgrade from occurring.
676 """Obtain requirements that will prevent an upgrade from occurring.
677
677
678 An upgrade cannot be performed if the source repository contains a
678 An upgrade cannot be performed if the source repository contains a
679 requirements in the returned set.
679 requirements in the returned set.
680 """
680 """
681 return {
681 return {
682 # The upgrade code does not yet support these experimental features.
682 # The upgrade code does not yet support these experimental features.
683 # This is an artificial limitation.
683 # This is an artificial limitation.
684 requirements.TREEMANIFEST_REQUIREMENT,
684 requirements.TREEMANIFEST_REQUIREMENT,
685 # This was a precursor to generaldelta and was never enabled by default.
685 # This was a precursor to generaldelta and was never enabled by default.
686 # It should (hopefully) not exist in the wild.
686 # It should (hopefully) not exist in the wild.
687 b'parentdelta',
687 b'parentdelta',
688 # Upgrade should operate on the actual store, not the shared link.
688 # Upgrade should operate on the actual store, not the shared link.
689 requirements.SHARED_REQUIREMENT,
689 requirements.SHARED_REQUIREMENT,
690 }
690 }
691
691
692
692
693 def check_source_requirements(repo):
693 def check_source_requirements(repo):
694 """Ensure that no existing requirements prevent the repository upgrade"""
694 """Ensure that no existing requirements prevent the repository upgrade"""
695
695
696 required = requiredsourcerequirements(repo)
696 required = requiredsourcerequirements(repo)
697 missingreqs = required - repo.requirements
697 missingreqs = required - repo.requirements
698 if missingreqs:
698 if missingreqs:
699 msg = _(b'cannot upgrade repository; requirement missing: %s')
699 msg = _(b'cannot upgrade repository; requirement missing: %s')
700 missingreqs = b', '.join(sorted(missingreqs))
700 missingreqs = b', '.join(sorted(missingreqs))
701 raise error.Abort(msg % missingreqs)
701 raise error.Abort(msg % missingreqs)
702
702
703 blocking = blocksourcerequirements(repo)
703 blocking = blocksourcerequirements(repo)
704 blockingreqs = blocking & repo.requirements
704 blockingreqs = blocking & repo.requirements
705 if blockingreqs:
705 if blockingreqs:
706 m = _(b'cannot upgrade repository; unsupported source requirement: %s')
706 m = _(b'cannot upgrade repository; unsupported source requirement: %s')
707 blockingreqs = b', '.join(sorted(blockingreqs))
707 blockingreqs = b', '.join(sorted(blockingreqs))
708 raise error.Abort(m % blockingreqs)
708 raise error.Abort(m % blockingreqs)
709
709
710
710
711 ### Verify the validity of the planned requirement changes ####################
711 ### Verify the validity of the planned requirement changes ####################
712
712
713
713
714 def supportremovedrequirements(repo):
714 def supportremovedrequirements(repo):
715 """Obtain requirements that can be removed during an upgrade.
715 """Obtain requirements that can be removed during an upgrade.
716
716
717 If an upgrade were to create a repository that dropped a requirement,
717 If an upgrade were to create a repository that dropped a requirement,
718 the dropped requirement must appear in the returned set for the upgrade
718 the dropped requirement must appear in the returned set for the upgrade
719 to be allowed.
719 to be allowed.
720 """
720 """
721 supported = {
721 supported = {
722 requirements.SPARSEREVLOG_REQUIREMENT,
722 requirements.SPARSEREVLOG_REQUIREMENT,
723 requirements.SIDEDATA_REQUIREMENT,
723 requirements.SIDEDATA_REQUIREMENT,
724 requirements.COPIESSDC_REQUIREMENT,
724 requirements.COPIESSDC_REQUIREMENT,
725 requirements.NODEMAP_REQUIREMENT,
725 requirements.NODEMAP_REQUIREMENT,
726 requirements.SHARESAFE_REQUIREMENT,
726 requirements.SHARESAFE_REQUIREMENT,
727 }
727 }
728 for name in compression.compengines:
728 for name in compression.compengines:
729 engine = compression.compengines[name]
729 engine = compression.compengines[name]
730 if engine.available() and engine.revlogheader():
730 if engine.available() and engine.revlogheader():
731 supported.add(b'exp-compression-%s' % name)
731 supported.add(b'exp-compression-%s' % name)
732 if engine.name() == b'zstd':
732 if engine.name() == b'zstd':
733 supported.add(b'revlog-compression-zstd')
733 supported.add(b'revlog-compression-zstd')
734 return supported
734 return supported
735
735
736
736
737 def supporteddestrequirements(repo):
737 def supporteddestrequirements(repo):
738 """Obtain requirements that upgrade supports in the destination.
738 """Obtain requirements that upgrade supports in the destination.
739
739
740 If the result of the upgrade would create requirements not in this set,
740 If the result of the upgrade would create requirements not in this set,
741 the upgrade is disallowed.
741 the upgrade is disallowed.
742
742
743 Extensions should monkeypatch this to add their custom requirements.
743 Extensions should monkeypatch this to add their custom requirements.
744 """
744 """
745 supported = {
745 supported = {
746 b'dotencode',
746 b'dotencode',
747 b'fncache',
747 b'fncache',
748 b'generaldelta',
748 b'generaldelta',
749 b'revlogv1',
749 b'revlogv1',
750 b'store',
750 b'store',
751 requirements.SPARSEREVLOG_REQUIREMENT,
751 requirements.SPARSEREVLOG_REQUIREMENT,
752 requirements.SIDEDATA_REQUIREMENT,
752 requirements.SIDEDATA_REQUIREMENT,
753 requirements.COPIESSDC_REQUIREMENT,
753 requirements.COPIESSDC_REQUIREMENT,
754 requirements.NODEMAP_REQUIREMENT,
754 requirements.NODEMAP_REQUIREMENT,
755 requirements.SHARESAFE_REQUIREMENT,
755 requirements.SHARESAFE_REQUIREMENT,
756 }
756 }
757 for name in compression.compengines:
757 for name in compression.compengines:
758 engine = compression.compengines[name]
758 engine = compression.compengines[name]
759 if engine.available() and engine.revlogheader():
759 if engine.available() and engine.revlogheader():
760 supported.add(b'exp-compression-%s' % name)
760 supported.add(b'exp-compression-%s' % name)
761 if engine.name() == b'zstd':
761 if engine.name() == b'zstd':
762 supported.add(b'revlog-compression-zstd')
762 supported.add(b'revlog-compression-zstd')
763 return supported
763 return supported
764
764
765
765
766 def allowednewrequirements(repo):
766 def allowednewrequirements(repo):
767 """Obtain requirements that can be added to a repository during upgrade.
767 """Obtain requirements that can be added to a repository during upgrade.
768
768
769 This is used to disallow proposed requirements from being added when
769 This is used to disallow proposed requirements from being added when
770 they weren't present before.
770 they weren't present before.
771
771
772 We use a list of allowed requirement additions instead of a list of known
772 We use a list of allowed requirement additions instead of a list of known
773 bad additions because the whitelist approach is safer and will prevent
773 bad additions because the whitelist approach is safer and will prevent
774 future, unknown requirements from accidentally being added.
774 future, unknown requirements from accidentally being added.
775 """
775 """
776 supported = {
776 supported = {
777 b'dotencode',
777 b'dotencode',
778 b'fncache',
778 b'fncache',
779 b'generaldelta',
779 b'generaldelta',
780 requirements.SPARSEREVLOG_REQUIREMENT,
780 requirements.SPARSEREVLOG_REQUIREMENT,
781 requirements.SIDEDATA_REQUIREMENT,
781 requirements.SIDEDATA_REQUIREMENT,
782 requirements.COPIESSDC_REQUIREMENT,
782 requirements.COPIESSDC_REQUIREMENT,
783 requirements.NODEMAP_REQUIREMENT,
783 requirements.NODEMAP_REQUIREMENT,
784 requirements.SHARESAFE_REQUIREMENT,
784 requirements.SHARESAFE_REQUIREMENT,
785 }
785 }
786 for name in compression.compengines:
786 for name in compression.compengines:
787 engine = compression.compengines[name]
787 engine = compression.compengines[name]
788 if engine.available() and engine.revlogheader():
788 if engine.available() and engine.revlogheader():
789 supported.add(b'exp-compression-%s' % name)
789 supported.add(b'exp-compression-%s' % name)
790 if engine.name() == b'zstd':
790 if engine.name() == b'zstd':
791 supported.add(b'revlog-compression-zstd')
791 supported.add(b'revlog-compression-zstd')
792 return supported
792 return supported
793
793
794
794
795 def check_requirements_changes(repo, new_reqs):
795 def check_requirements_changes(repo, new_reqs):
796 old_reqs = repo.requirements
796 old_reqs = repo.requirements
797
797
798 support_removal = supportremovedrequirements(repo)
798 support_removal = supportremovedrequirements(repo)
799 no_remove_reqs = old_reqs - new_reqs - support_removal
799 no_remove_reqs = old_reqs - new_reqs - support_removal
800 if no_remove_reqs:
800 if no_remove_reqs:
801 msg = _(b'cannot upgrade repository; requirement would be removed: %s')
801 msg = _(b'cannot upgrade repository; requirement would be removed: %s')
802 no_remove_reqs = b', '.join(sorted(no_remove_reqs))
802 no_remove_reqs = b', '.join(sorted(no_remove_reqs))
803 raise error.Abort(msg % no_remove_reqs)
803 raise error.Abort(msg % no_remove_reqs)
804
804
805 support_addition = allowednewrequirements(repo)
805 support_addition = allowednewrequirements(repo)
806 no_add_reqs = new_reqs - old_reqs - support_addition
806 no_add_reqs = new_reqs - old_reqs - support_addition
807 if no_add_reqs:
807 if no_add_reqs:
808 m = _(b'cannot upgrade repository; do not support adding requirement: ')
808 m = _(b'cannot upgrade repository; do not support adding requirement: ')
809 no_add_reqs = b', '.join(sorted(no_add_reqs))
809 no_add_reqs = b', '.join(sorted(no_add_reqs))
810 raise error.Abort(m + no_add_reqs)
810 raise error.Abort(m + no_add_reqs)
811
811
812 supported = supporteddestrequirements(repo)
812 supported = supporteddestrequirements(repo)
813 unsupported_reqs = new_reqs - supported
813 unsupported_reqs = new_reqs - supported
814 if unsupported_reqs:
814 if unsupported_reqs:
815 msg = _(
815 msg = _(
816 b'cannot upgrade repository; do not support destination '
816 b'cannot upgrade repository; do not support destination '
817 b'requirement: %s'
817 b'requirement: %s'
818 )
818 )
819 unsupported_reqs = b', '.join(sorted(unsupported_reqs))
819 unsupported_reqs = b', '.join(sorted(unsupported_reqs))
820 raise error.Abort(msg % unsupported_reqs)
820 raise error.Abort(msg % unsupported_reqs)
@@ -1,1646 +1,1646 b''
1 #require no-reposimplestore
1 #require no-reposimplestore
2
2
3 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
4 > [extensions]
4 > [extensions]
5 > share =
5 > share =
6 > EOF
6 > EOF
7
7
8 store and revlogv1 are required in source
8 store and revlogv1 are required in source
9
9
10 $ hg --config format.usestore=false init no-store
10 $ hg --config format.usestore=false init no-store
11 $ hg -R no-store debugupgraderepo
11 $ hg -R no-store debugupgraderepo
12 abort: cannot upgrade repository; requirement missing: store
12 abort: cannot upgrade repository; requirement missing: store
13 [255]
13 [255]
14
14
15 $ hg init no-revlogv1
15 $ hg init no-revlogv1
16 $ cat > no-revlogv1/.hg/requires << EOF
16 $ cat > no-revlogv1/.hg/requires << EOF
17 > dotencode
17 > dotencode
18 > fncache
18 > fncache
19 > generaldelta
19 > generaldelta
20 > store
20 > store
21 > EOF
21 > EOF
22
22
23 $ hg -R no-revlogv1 debugupgraderepo
23 $ hg -R no-revlogv1 debugupgraderepo
24 abort: cannot upgrade repository; requirement missing: revlogv1
24 abort: cannot upgrade repository; requirement missing: revlogv1
25 [255]
25 [255]
26
26
27 Cannot upgrade shared repositories
27 Cannot upgrade shared repositories
28
28
29 $ hg init share-parent
29 $ hg init share-parent
30 $ hg -q share share-parent share-child
30 $ hg -q share share-parent share-child
31
31
32 $ hg -R share-child debugupgraderepo
32 $ hg -R share-child debugupgraderepo
33 abort: cannot upgrade repository; unsupported source requirement: shared
33 abort: cannot upgrade repository; unsupported source requirement: shared
34 [255]
34 [255]
35
35
36 Do not yet support upgrading treemanifest repos
36 Do not yet support upgrading treemanifest repos
37
37
38 $ hg --config experimental.treemanifest=true init treemanifest
38 $ hg --config experimental.treemanifest=true init treemanifest
39 $ hg -R treemanifest debugupgraderepo
39 $ hg -R treemanifest debugupgraderepo
40 abort: cannot upgrade repository; unsupported source requirement: treemanifest
40 abort: cannot upgrade repository; unsupported source requirement: treemanifest
41 [255]
41 [255]
42
42
43 Cannot add treemanifest requirement during upgrade
43 Cannot add treemanifest requirement during upgrade
44
44
45 $ hg init disallowaddedreq
45 $ hg init disallowaddedreq
46 $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
46 $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
47 abort: cannot upgrade repository; do not support adding requirement: treemanifest
47 abort: cannot upgrade repository; do not support adding requirement: treemanifest
48 [255]
48 [255]
49
49
50 An upgrade of a repository created with recommended settings only suggests optimizations
50 An upgrade of a repository created with recommended settings only suggests optimizations
51
51
52 $ hg init empty
52 $ hg init empty
53 $ cd empty
53 $ cd empty
54 $ hg debugformat
54 $ hg debugformat
55 format-variant repo
55 format-variant repo
56 fncache: yes
56 fncache: yes
57 dotencode: yes
57 dotencode: yes
58 generaldelta: yes
58 generaldelta: yes
59 exp-sharesafe: no
59 exp-sharesafe: no
60 sparserevlog: yes
60 sparserevlog: yes
61 sidedata: no
61 sidedata: no
62 persistent-nodemap: no
62 persistent-nodemap: no
63 copies-sdc: no
63 copies-sdc: no
64 plain-cl-delta: yes
64 plain-cl-delta: yes
65 compression: zlib
65 compression: zlib
66 compression-level: default
66 compression-level: default
67 $ hg debugformat --verbose
67 $ hg debugformat --verbose
68 format-variant repo config default
68 format-variant repo config default
69 fncache: yes yes yes
69 fncache: yes yes yes
70 dotencode: yes yes yes
70 dotencode: yes yes yes
71 generaldelta: yes yes yes
71 generaldelta: yes yes yes
72 exp-sharesafe: no no no
72 exp-sharesafe: no no no
73 sparserevlog: yes yes yes
73 sparserevlog: yes yes yes
74 sidedata: no no no
74 sidedata: no no no
75 persistent-nodemap: no no no
75 persistent-nodemap: no no no
76 copies-sdc: no no no
76 copies-sdc: no no no
77 plain-cl-delta: yes yes yes
77 plain-cl-delta: yes yes yes
78 compression: zlib zlib zlib
78 compression: zlib zlib zlib
79 compression-level: default default default
79 compression-level: default default default
80 $ hg debugformat --verbose --config format.usefncache=no
80 $ hg debugformat --verbose --config format.usefncache=no
81 format-variant repo config default
81 format-variant repo config default
82 fncache: yes no yes
82 fncache: yes no yes
83 dotencode: yes no yes
83 dotencode: yes no yes
84 generaldelta: yes yes yes
84 generaldelta: yes yes yes
85 exp-sharesafe: no no no
85 exp-sharesafe: no no no
86 sparserevlog: yes yes yes
86 sparserevlog: yes yes yes
87 sidedata: no no no
87 sidedata: no no no
88 persistent-nodemap: no no no
88 persistent-nodemap: no no no
89 copies-sdc: no no no
89 copies-sdc: no no no
90 plain-cl-delta: yes yes yes
90 plain-cl-delta: yes yes yes
91 compression: zlib zlib zlib
91 compression: zlib zlib zlib
92 compression-level: default default default
92 compression-level: default default default
93 $ hg debugformat --verbose --config format.usefncache=no --color=debug
93 $ hg debugformat --verbose --config format.usefncache=no --color=debug
94 format-variant repo config default
94 format-variant repo config default
95 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
95 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
96 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
96 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
97 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
97 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
98 [formatvariant.name.uptodate|exp-sharesafe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
98 [formatvariant.name.uptodate|exp-sharesafe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
99 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
99 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
100 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
100 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
101 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
101 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
102 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
102 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
103 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
103 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
104 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
104 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
105 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
105 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
106 $ hg debugformat -Tjson
106 $ hg debugformat -Tjson
107 [
107 [
108 {
108 {
109 "config": true,
109 "config": true,
110 "default": true,
110 "default": true,
111 "name": "fncache",
111 "name": "fncache",
112 "repo": true
112 "repo": true
113 },
113 },
114 {
114 {
115 "config": true,
115 "config": true,
116 "default": true,
116 "default": true,
117 "name": "dotencode",
117 "name": "dotencode",
118 "repo": true
118 "repo": true
119 },
119 },
120 {
120 {
121 "config": true,
121 "config": true,
122 "default": true,
122 "default": true,
123 "name": "generaldelta",
123 "name": "generaldelta",
124 "repo": true
124 "repo": true
125 },
125 },
126 {
126 {
127 "config": false,
127 "config": false,
128 "default": false,
128 "default": false,
129 "name": "exp-sharesafe",
129 "name": "exp-sharesafe",
130 "repo": false
130 "repo": false
131 },
131 },
132 {
132 {
133 "config": true,
133 "config": true,
134 "default": true,
134 "default": true,
135 "name": "sparserevlog",
135 "name": "sparserevlog",
136 "repo": true
136 "repo": true
137 },
137 },
138 {
138 {
139 "config": false,
139 "config": false,
140 "default": false,
140 "default": false,
141 "name": "sidedata",
141 "name": "sidedata",
142 "repo": false
142 "repo": false
143 },
143 },
144 {
144 {
145 "config": false,
145 "config": false,
146 "default": false,
146 "default": false,
147 "name": "persistent-nodemap",
147 "name": "persistent-nodemap",
148 "repo": false
148 "repo": false
149 },
149 },
150 {
150 {
151 "config": false,
151 "config": false,
152 "default": false,
152 "default": false,
153 "name": "copies-sdc",
153 "name": "copies-sdc",
154 "repo": false
154 "repo": false
155 },
155 },
156 {
156 {
157 "config": true,
157 "config": true,
158 "default": true,
158 "default": true,
159 "name": "plain-cl-delta",
159 "name": "plain-cl-delta",
160 "repo": true
160 "repo": true
161 },
161 },
162 {
162 {
163 "config": "zlib",
163 "config": "zlib",
164 "default": "zlib",
164 "default": "zlib",
165 "name": "compression",
165 "name": "compression",
166 "repo": "zlib"
166 "repo": "zlib"
167 },
167 },
168 {
168 {
169 "config": "default",
169 "config": "default",
170 "default": "default",
170 "default": "default",
171 "name": "compression-level",
171 "name": "compression-level",
172 "repo": "default"
172 "repo": "default"
173 }
173 }
174 ]
174 ]
175 $ hg debugupgraderepo
175 $ hg debugupgraderepo
176 (no feature deficiencies found in existing repository)
176 (no format upgrades found in existing repository)
177 performing an upgrade with "--run" will make the following changes:
177 performing an upgrade with "--run" will make the following changes:
178
178
179 requirements
179 requirements
180 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
180 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
181
181
182 processed revlogs:
182 processed revlogs:
183 - all-filelogs
183 - all-filelogs
184 - changelog
184 - changelog
185 - manifest
185 - manifest
186
186
187 additional optimizations are available by specifying "--optimize <name>":
187 additional optimizations are available by specifying "--optimize <name>":
188
188
189 re-delta-parent
189 re-delta-parent
190 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
190 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
191
191
192 re-delta-multibase
192 re-delta-multibase
193 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
193 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
194
194
195 re-delta-all
195 re-delta-all
196 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
196 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
197
197
198 re-delta-fulladd
198 re-delta-fulladd
199 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
199 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
200
200
201
201
202 $ hg debugupgraderepo --quiet
202 $ hg debugupgraderepo --quiet
203 requirements
203 requirements
204 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
204 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
205
205
206 processed revlogs:
206 processed revlogs:
207 - all-filelogs
207 - all-filelogs
208 - changelog
208 - changelog
209 - manifest
209 - manifest
210
210
211
211
212 --optimize can be used to add optimizations
212 --optimize can be used to add optimizations
213
213
214 $ hg debugupgrade --optimize redeltaparent
214 $ hg debugupgrade --optimize redeltaparent
215 (no feature deficiencies found in existing repository)
215 (no format upgrades found in existing repository)
216 performing an upgrade with "--run" will make the following changes:
216 performing an upgrade with "--run" will make the following changes:
217
217
218 requirements
218 requirements
219 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
219 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
220
220
221 optimisations: re-delta-parent
221 optimisations: re-delta-parent
222
222
223 re-delta-parent
223 re-delta-parent
224 deltas within internal storage will choose a new base revision if needed
224 deltas within internal storage will choose a new base revision if needed
225
225
226 processed revlogs:
226 processed revlogs:
227 - all-filelogs
227 - all-filelogs
228 - changelog
228 - changelog
229 - manifest
229 - manifest
230
230
231 additional optimizations are available by specifying "--optimize <name>":
231 additional optimizations are available by specifying "--optimize <name>":
232
232
233 re-delta-multibase
233 re-delta-multibase
234 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
234 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
235
235
236 re-delta-all
236 re-delta-all
237 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
237 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
238
238
239 re-delta-fulladd
239 re-delta-fulladd
240 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
240 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
241
241
242
242
243 modern form of the option
243 modern form of the option
244
244
245 $ hg debugupgrade --optimize re-delta-parent
245 $ hg debugupgrade --optimize re-delta-parent
246 (no feature deficiencies found in existing repository)
246 (no format upgrades found in existing repository)
247 performing an upgrade with "--run" will make the following changes:
247 performing an upgrade with "--run" will make the following changes:
248
248
249 requirements
249 requirements
250 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
250 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
251
251
252 optimisations: re-delta-parent
252 optimisations: re-delta-parent
253
253
254 re-delta-parent
254 re-delta-parent
255 deltas within internal storage will choose a new base revision if needed
255 deltas within internal storage will choose a new base revision if needed
256
256
257 processed revlogs:
257 processed revlogs:
258 - all-filelogs
258 - all-filelogs
259 - changelog
259 - changelog
260 - manifest
260 - manifest
261
261
262 additional optimizations are available by specifying "--optimize <name>":
262 additional optimizations are available by specifying "--optimize <name>":
263
263
264 re-delta-multibase
264 re-delta-multibase
265 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
265 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
266
266
267 re-delta-all
267 re-delta-all
268 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
268 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
269
269
270 re-delta-fulladd
270 re-delta-fulladd
271 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
271 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
272
272
273 $ hg debugupgrade --optimize re-delta-parent --quiet
273 $ hg debugupgrade --optimize re-delta-parent --quiet
274 requirements
274 requirements
275 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
275 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
276
276
277 optimisations: re-delta-parent
277 optimisations: re-delta-parent
278
278
279 processed revlogs:
279 processed revlogs:
280 - all-filelogs
280 - all-filelogs
281 - changelog
281 - changelog
282 - manifest
282 - manifest
283
283
284
284
285 unknown optimization:
285 unknown optimization:
286
286
287 $ hg debugupgrade --optimize foobar
287 $ hg debugupgrade --optimize foobar
288 abort: unknown optimization action requested: foobar
288 abort: unknown optimization action requested: foobar
289 (run without arguments to see valid optimizations)
289 (run without arguments to see valid optimizations)
290 [255]
290 [255]
291
291
292 Various sub-optimal detections work
292 Various sub-optimal detections work
293
293
294 $ cat > .hg/requires << EOF
294 $ cat > .hg/requires << EOF
295 > revlogv1
295 > revlogv1
296 > store
296 > store
297 > EOF
297 > EOF
298
298
299 $ hg debugformat
299 $ hg debugformat
300 format-variant repo
300 format-variant repo
301 fncache: no
301 fncache: no
302 dotencode: no
302 dotencode: no
303 generaldelta: no
303 generaldelta: no
304 exp-sharesafe: no
304 exp-sharesafe: no
305 sparserevlog: no
305 sparserevlog: no
306 sidedata: no
306 sidedata: no
307 persistent-nodemap: no
307 persistent-nodemap: no
308 copies-sdc: no
308 copies-sdc: no
309 plain-cl-delta: yes
309 plain-cl-delta: yes
310 compression: zlib
310 compression: zlib
311 compression-level: default
311 compression-level: default
312 $ hg debugformat --verbose
312 $ hg debugformat --verbose
313 format-variant repo config default
313 format-variant repo config default
314 fncache: no yes yes
314 fncache: no yes yes
315 dotencode: no yes yes
315 dotencode: no yes yes
316 generaldelta: no yes yes
316 generaldelta: no yes yes
317 exp-sharesafe: no no no
317 exp-sharesafe: no no no
318 sparserevlog: no yes yes
318 sparserevlog: no yes yes
319 sidedata: no no no
319 sidedata: no no no
320 persistent-nodemap: no no no
320 persistent-nodemap: no no no
321 copies-sdc: no no no
321 copies-sdc: no no no
322 plain-cl-delta: yes yes yes
322 plain-cl-delta: yes yes yes
323 compression: zlib zlib zlib
323 compression: zlib zlib zlib
324 compression-level: default default default
324 compression-level: default default default
325 $ hg debugformat --verbose --config format.usegeneraldelta=no
325 $ hg debugformat --verbose --config format.usegeneraldelta=no
326 format-variant repo config default
326 format-variant repo config default
327 fncache: no yes yes
327 fncache: no yes yes
328 dotencode: no yes yes
328 dotencode: no yes yes
329 generaldelta: no no yes
329 generaldelta: no no yes
330 exp-sharesafe: no no no
330 exp-sharesafe: no no no
331 sparserevlog: no no yes
331 sparserevlog: no no yes
332 sidedata: no no no
332 sidedata: no no no
333 persistent-nodemap: no no no
333 persistent-nodemap: no no no
334 copies-sdc: no no no
334 copies-sdc: no no no
335 plain-cl-delta: yes yes yes
335 plain-cl-delta: yes yes yes
336 compression: zlib zlib zlib
336 compression: zlib zlib zlib
337 compression-level: default default default
337 compression-level: default default default
338 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
338 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
339 format-variant repo config default
339 format-variant repo config default
340 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
340 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
341 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
341 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
342 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
342 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
343 [formatvariant.name.uptodate|exp-sharesafe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
343 [formatvariant.name.uptodate|exp-sharesafe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
344 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
344 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
345 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
345 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
346 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
346 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
347 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
347 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
348 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
348 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
349 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
349 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
350 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
350 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
351 $ hg debugupgraderepo
351 $ hg debugupgraderepo
352 repository lacks features recommended by current config options:
352 repository lacks features recommended by current config options:
353
353
354 fncache
354 fncache
355 long and reserved filenames may not work correctly; repository performance is sub-optimal
355 long and reserved filenames may not work correctly; repository performance is sub-optimal
356
356
357 dotencode
357 dotencode
358 storage of filenames beginning with a period or space may not work correctly
358 storage of filenames beginning with a period or space may not work correctly
359
359
360 generaldelta
360 generaldelta
361 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
361 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
362
362
363 sparserevlog
363 sparserevlog
364 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
364 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
365
365
366
366
367 performing an upgrade with "--run" will make the following changes:
367 performing an upgrade with "--run" will make the following changes:
368
368
369 requirements
369 requirements
370 preserved: revlogv1, store
370 preserved: revlogv1, store
371 added: dotencode, fncache, generaldelta, sparserevlog
371 added: dotencode, fncache, generaldelta, sparserevlog
372
372
373 fncache
373 fncache
374 repository will be more resilient to storing certain paths and performance of certain operations should be improved
374 repository will be more resilient to storing certain paths and performance of certain operations should be improved
375
375
376 dotencode
376 dotencode
377 repository will be better able to store files beginning with a space or period
377 repository will be better able to store files beginning with a space or period
378
378
379 generaldelta
379 generaldelta
380 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
380 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
381
381
382 sparserevlog
382 sparserevlog
383 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
383 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
384
384
385 processed revlogs:
385 processed revlogs:
386 - all-filelogs
386 - all-filelogs
387 - changelog
387 - changelog
388 - manifest
388 - manifest
389
389
390 additional optimizations are available by specifying "--optimize <name>":
390 additional optimizations are available by specifying "--optimize <name>":
391
391
392 re-delta-parent
392 re-delta-parent
393 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
393 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
394
394
395 re-delta-multibase
395 re-delta-multibase
396 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
396 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
397
397
398 re-delta-all
398 re-delta-all
399 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
399 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
400
400
401 re-delta-fulladd
401 re-delta-fulladd
402 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
402 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
403
403
404 $ hg debugupgraderepo --quiet
404 $ hg debugupgraderepo --quiet
405 requirements
405 requirements
406 preserved: revlogv1, store
406 preserved: revlogv1, store
407 added: dotencode, fncache, generaldelta, sparserevlog
407 added: dotencode, fncache, generaldelta, sparserevlog
408
408
409 processed revlogs:
409 processed revlogs:
410 - all-filelogs
410 - all-filelogs
411 - changelog
411 - changelog
412 - manifest
412 - manifest
413
413
414
414
415 $ hg --config format.dotencode=false debugupgraderepo
415 $ hg --config format.dotencode=false debugupgraderepo
416 repository lacks features recommended by current config options:
416 repository lacks features recommended by current config options:
417
417
418 fncache
418 fncache
419 long and reserved filenames may not work correctly; repository performance is sub-optimal
419 long and reserved filenames may not work correctly; repository performance is sub-optimal
420
420
421 generaldelta
421 generaldelta
422 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
422 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
423
423
424 sparserevlog
424 sparserevlog
425 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
425 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
426
426
427 repository lacks features used by the default config options:
427 repository lacks features used by the default config options:
428
428
429 dotencode
429 dotencode
430 storage of filenames beginning with a period or space may not work correctly
430 storage of filenames beginning with a period or space may not work correctly
431
431
432
432
433 performing an upgrade with "--run" will make the following changes:
433 performing an upgrade with "--run" will make the following changes:
434
434
435 requirements
435 requirements
436 preserved: revlogv1, store
436 preserved: revlogv1, store
437 added: fncache, generaldelta, sparserevlog
437 added: fncache, generaldelta, sparserevlog
438
438
439 fncache
439 fncache
440 repository will be more resilient to storing certain paths and performance of certain operations should be improved
440 repository will be more resilient to storing certain paths and performance of certain operations should be improved
441
441
442 generaldelta
442 generaldelta
443 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
443 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
444
444
445 sparserevlog
445 sparserevlog
446 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
446 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
447
447
448 processed revlogs:
448 processed revlogs:
449 - all-filelogs
449 - all-filelogs
450 - changelog
450 - changelog
451 - manifest
451 - manifest
452
452
453 additional optimizations are available by specifying "--optimize <name>":
453 additional optimizations are available by specifying "--optimize <name>":
454
454
455 re-delta-parent
455 re-delta-parent
456 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
456 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
457
457
458 re-delta-multibase
458 re-delta-multibase
459 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
459 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
460
460
461 re-delta-all
461 re-delta-all
462 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
462 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
463
463
464 re-delta-fulladd
464 re-delta-fulladd
465 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
465 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
466
466
467
467
468 $ cd ..
468 $ cd ..
469
469
470 Upgrading a repository that is already modern essentially no-ops
470 Upgrading a repository that is already modern essentially no-ops
471
471
472 $ hg init modern
472 $ hg init modern
473 $ hg -R modern debugupgraderepo --run
473 $ hg -R modern debugupgraderepo --run
474 upgrade will perform the following actions:
474 upgrade will perform the following actions:
475
475
476 requirements
476 requirements
477 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
477 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
478
478
479 processed revlogs:
479 processed revlogs:
480 - all-filelogs
480 - all-filelogs
481 - changelog
481 - changelog
482 - manifest
482 - manifest
483
483
484 beginning upgrade...
484 beginning upgrade...
485 repository locked and read-only
485 repository locked and read-only
486 creating temporary repository to stage migrated data: $TESTTMP/modern/.hg/upgrade.* (glob)
486 creating temporary repository to stage migrated data: $TESTTMP/modern/.hg/upgrade.* (glob)
487 (it is safe to interrupt this process any time before data migration completes)
487 (it is safe to interrupt this process any time before data migration completes)
488 data fully migrated to temporary repository
488 data fully migrated to temporary repository
489 marking source repository as being upgraded; clients will be unable to read from repository
489 marking source repository as being upgraded; clients will be unable to read from repository
490 starting in-place swap of repository data
490 starting in-place swap of repository data
491 replaced files will be backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
491 replaced files will be backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
492 replacing store...
492 replacing store...
493 store replacement complete; repository was inconsistent for *s (glob)
493 store replacement complete; repository was inconsistent for *s (glob)
494 finalizing requirements file and making repository readable again
494 finalizing requirements file and making repository readable again
495 removing temporary repository $TESTTMP/modern/.hg/upgrade.* (glob)
495 removing temporary repository $TESTTMP/modern/.hg/upgrade.* (glob)
496 copy of old repository backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
496 copy of old repository backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
497 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
497 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
498
498
499 Upgrading a repository to generaldelta works
499 Upgrading a repository to generaldelta works
500
500
501 $ hg --config format.usegeneraldelta=false init upgradegd
501 $ hg --config format.usegeneraldelta=false init upgradegd
502 $ cd upgradegd
502 $ cd upgradegd
503 $ touch f0
503 $ touch f0
504 $ hg -q commit -A -m initial
504 $ hg -q commit -A -m initial
505 $ mkdir FooBarDirectory.d
505 $ mkdir FooBarDirectory.d
506 $ touch FooBarDirectory.d/f1
506 $ touch FooBarDirectory.d/f1
507 $ hg -q commit -A -m 'add f1'
507 $ hg -q commit -A -m 'add f1'
508 $ hg -q up -r 0
508 $ hg -q up -r 0
509 >>> from __future__ import absolute_import, print_function
509 >>> from __future__ import absolute_import, print_function
510 >>> import random
510 >>> import random
511 >>> random.seed(0) # have a reproducible content
511 >>> random.seed(0) # have a reproducible content
512 >>> with open("f2", "wb") as f:
512 >>> with open("f2", "wb") as f:
513 ... for i in range(100000):
513 ... for i in range(100000):
514 ... f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None
514 ... f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None
515 $ hg -q commit -A -m 'add f2'
515 $ hg -q commit -A -m 'add f2'
516
516
517 make sure we have a .d file
517 make sure we have a .d file
518
518
519 $ ls -d .hg/store/data/*
519 $ ls -d .hg/store/data/*
520 .hg/store/data/_foo_bar_directory.d.hg
520 .hg/store/data/_foo_bar_directory.d.hg
521 .hg/store/data/f0.i
521 .hg/store/data/f0.i
522 .hg/store/data/f2.d
522 .hg/store/data/f2.d
523 .hg/store/data/f2.i
523 .hg/store/data/f2.i
524
524
525 $ hg debugupgraderepo --run --config format.sparse-revlog=false
525 $ hg debugupgraderepo --run --config format.sparse-revlog=false
526 upgrade will perform the following actions:
526 upgrade will perform the following actions:
527
527
528 requirements
528 requirements
529 preserved: dotencode, fncache, revlogv1, store
529 preserved: dotencode, fncache, revlogv1, store
530 added: generaldelta
530 added: generaldelta
531
531
532 generaldelta
532 generaldelta
533 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
533 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
534
534
535 processed revlogs:
535 processed revlogs:
536 - all-filelogs
536 - all-filelogs
537 - changelog
537 - changelog
538 - manifest
538 - manifest
539
539
540 beginning upgrade...
540 beginning upgrade...
541 repository locked and read-only
541 repository locked and read-only
542 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
542 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
543 (it is safe to interrupt this process any time before data migration completes)
543 (it is safe to interrupt this process any time before data migration completes)
544 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
544 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
545 migrating 519 KB in store; 1.05 MB tracked data
545 migrating 519 KB in store; 1.05 MB tracked data
546 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
546 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
547 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
547 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
548 migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data)
548 migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data)
549 finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes
549 finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes
550 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
550 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
551 finished migrating 3 changelog revisions; change in size: 0 bytes
551 finished migrating 3 changelog revisions; change in size: 0 bytes
552 finished migrating 9 total revisions; total change in store size: -17 bytes
552 finished migrating 9 total revisions; total change in store size: -17 bytes
553 copying phaseroots
553 copying phaseroots
554 data fully migrated to temporary repository
554 data fully migrated to temporary repository
555 marking source repository as being upgraded; clients will be unable to read from repository
555 marking source repository as being upgraded; clients will be unable to read from repository
556 starting in-place swap of repository data
556 starting in-place swap of repository data
557 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
557 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
558 replacing store...
558 replacing store...
559 store replacement complete; repository was inconsistent for *s (glob)
559 store replacement complete; repository was inconsistent for *s (glob)
560 finalizing requirements file and making repository readable again
560 finalizing requirements file and making repository readable again
561 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
561 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
562 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
562 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
563 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
563 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
564
564
565 Original requirements backed up
565 Original requirements backed up
566
566
567 $ cat .hg/upgradebackup.*/requires
567 $ cat .hg/upgradebackup.*/requires
568 dotencode
568 dotencode
569 fncache
569 fncache
570 revlogv1
570 revlogv1
571 store
571 store
572
572
573 generaldelta added to original requirements files
573 generaldelta added to original requirements files
574
574
575 $ cat .hg/requires
575 $ cat .hg/requires
576 dotencode
576 dotencode
577 fncache
577 fncache
578 generaldelta
578 generaldelta
579 revlogv1
579 revlogv1
580 store
580 store
581
581
582 store directory has files we expect
582 store directory has files we expect
583
583
584 $ ls .hg/store
584 $ ls .hg/store
585 00changelog.i
585 00changelog.i
586 00manifest.i
586 00manifest.i
587 data
587 data
588 fncache
588 fncache
589 phaseroots
589 phaseroots
590 undo
590 undo
591 undo.backupfiles
591 undo.backupfiles
592 undo.phaseroots
592 undo.phaseroots
593
593
594 manifest should be generaldelta
594 manifest should be generaldelta
595
595
596 $ hg debugrevlog -m | grep flags
596 $ hg debugrevlog -m | grep flags
597 flags : inline, generaldelta
597 flags : inline, generaldelta
598
598
599 verify should be happy
599 verify should be happy
600
600
601 $ hg verify
601 $ hg verify
602 checking changesets
602 checking changesets
603 checking manifests
603 checking manifests
604 crosschecking files in changesets and manifests
604 crosschecking files in changesets and manifests
605 checking files
605 checking files
606 checked 3 changesets with 3 changes to 3 files
606 checked 3 changesets with 3 changes to 3 files
607
607
608 old store should be backed up
608 old store should be backed up
609
609
610 $ ls -d .hg/upgradebackup.*/
610 $ ls -d .hg/upgradebackup.*/
611 .hg/upgradebackup.*/ (glob)
611 .hg/upgradebackup.*/ (glob)
612 $ ls .hg/upgradebackup.*/store
612 $ ls .hg/upgradebackup.*/store
613 00changelog.i
613 00changelog.i
614 00manifest.i
614 00manifest.i
615 data
615 data
616 fncache
616 fncache
617 phaseroots
617 phaseroots
618 undo
618 undo
619 undo.backup.fncache
619 undo.backup.fncache
620 undo.backupfiles
620 undo.backupfiles
621 undo.phaseroots
621 undo.phaseroots
622
622
623 unless --no-backup is passed
623 unless --no-backup is passed
624
624
625 $ rm -rf .hg/upgradebackup.*/
625 $ rm -rf .hg/upgradebackup.*/
626 $ hg debugupgraderepo --run --no-backup
626 $ hg debugupgraderepo --run --no-backup
627 upgrade will perform the following actions:
627 upgrade will perform the following actions:
628
628
629 requirements
629 requirements
630 preserved: dotencode, fncache, generaldelta, revlogv1, store
630 preserved: dotencode, fncache, generaldelta, revlogv1, store
631 added: sparserevlog
631 added: sparserevlog
632
632
633 sparserevlog
633 sparserevlog
634 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
634 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
635
635
636 processed revlogs:
636 processed revlogs:
637 - all-filelogs
637 - all-filelogs
638 - changelog
638 - changelog
639 - manifest
639 - manifest
640
640
641 beginning upgrade...
641 beginning upgrade...
642 repository locked and read-only
642 repository locked and read-only
643 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
643 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
644 (it is safe to interrupt this process any time before data migration completes)
644 (it is safe to interrupt this process any time before data migration completes)
645 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
645 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
646 migrating 519 KB in store; 1.05 MB tracked data
646 migrating 519 KB in store; 1.05 MB tracked data
647 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
647 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
648 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
648 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
649 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
649 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
650 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
650 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
651 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
651 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
652 finished migrating 3 changelog revisions; change in size: 0 bytes
652 finished migrating 3 changelog revisions; change in size: 0 bytes
653 finished migrating 9 total revisions; total change in store size: 0 bytes
653 finished migrating 9 total revisions; total change in store size: 0 bytes
654 copying phaseroots
654 copying phaseroots
655 data fully migrated to temporary repository
655 data fully migrated to temporary repository
656 marking source repository as being upgraded; clients will be unable to read from repository
656 marking source repository as being upgraded; clients will be unable to read from repository
657 starting in-place swap of repository data
657 starting in-place swap of repository data
658 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
658 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
659 replacing store...
659 replacing store...
660 store replacement complete; repository was inconsistent for * (glob)
660 store replacement complete; repository was inconsistent for * (glob)
661 finalizing requirements file and making repository readable again
661 finalizing requirements file and making repository readable again
662 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
662 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
663 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
663 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
664 $ ls -1 .hg/ | grep upgradebackup
664 $ ls -1 .hg/ | grep upgradebackup
665 [1]
665 [1]
666
666
667 We can restrict optimization to some revlog:
667 We can restrict optimization to some revlog:
668
668
669 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
669 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
670 upgrade will perform the following actions:
670 upgrade will perform the following actions:
671
671
672 requirements
672 requirements
673 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
673 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
674
674
675 optimisations: re-delta-parent
675 optimisations: re-delta-parent
676
676
677 re-delta-parent
677 re-delta-parent
678 deltas within internal storage will choose a new base revision if needed
678 deltas within internal storage will choose a new base revision if needed
679
679
680 processed revlogs:
680 processed revlogs:
681 - manifest
681 - manifest
682
682
683 beginning upgrade...
683 beginning upgrade...
684 repository locked and read-only
684 repository locked and read-only
685 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
685 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
686 (it is safe to interrupt this process any time before data migration completes)
686 (it is safe to interrupt this process any time before data migration completes)
687 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
687 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
688 migrating 519 KB in store; 1.05 MB tracked data
688 migrating 519 KB in store; 1.05 MB tracked data
689 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
689 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
690 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
690 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
691 blindly copying data/f0.i containing 1 revisions
691 blindly copying data/f0.i containing 1 revisions
692 blindly copying data/f2.i containing 1 revisions
692 blindly copying data/f2.i containing 1 revisions
693 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
693 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
694 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
694 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
695 cloning 3 revisions from 00manifest.i
695 cloning 3 revisions from 00manifest.i
696 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
696 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
697 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
697 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
698 blindly copying 00changelog.i containing 3 revisions
698 blindly copying 00changelog.i containing 3 revisions
699 finished migrating 3 changelog revisions; change in size: 0 bytes
699 finished migrating 3 changelog revisions; change in size: 0 bytes
700 finished migrating 9 total revisions; total change in store size: 0 bytes
700 finished migrating 9 total revisions; total change in store size: 0 bytes
701 copying phaseroots
701 copying phaseroots
702 data fully migrated to temporary repository
702 data fully migrated to temporary repository
703 marking source repository as being upgraded; clients will be unable to read from repository
703 marking source repository as being upgraded; clients will be unable to read from repository
704 starting in-place swap of repository data
704 starting in-place swap of repository data
705 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
705 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
706 replacing store...
706 replacing store...
707 store replacement complete; repository was inconsistent for *s (glob)
707 store replacement complete; repository was inconsistent for *s (glob)
708 finalizing requirements file and making repository readable again
708 finalizing requirements file and making repository readable again
709 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
709 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
710 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
710 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
711
711
712 Check that the repo still works fine
712 Check that the repo still works fine
713
713
714 $ hg log -G --stat
714 $ hg log -G --stat
715 @ changeset: 2:76d4395f5413 (no-py3 !)
715 @ changeset: 2:76d4395f5413 (no-py3 !)
716 @ changeset: 2:fca376863211 (py3 !)
716 @ changeset: 2:fca376863211 (py3 !)
717 | tag: tip
717 | tag: tip
718 | parent: 0:ba592bf28da2
718 | parent: 0:ba592bf28da2
719 | user: test
719 | user: test
720 | date: Thu Jan 01 00:00:00 1970 +0000
720 | date: Thu Jan 01 00:00:00 1970 +0000
721 | summary: add f2
721 | summary: add f2
722 |
722 |
723 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
723 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
724 | 1 files changed, 100000 insertions(+), 0 deletions(-)
724 | 1 files changed, 100000 insertions(+), 0 deletions(-)
725 |
725 |
726 | o changeset: 1:2029ce2354e2
726 | o changeset: 1:2029ce2354e2
727 |/ user: test
727 |/ user: test
728 | date: Thu Jan 01 00:00:00 1970 +0000
728 | date: Thu Jan 01 00:00:00 1970 +0000
729 | summary: add f1
729 | summary: add f1
730 |
730 |
731 |
731 |
732 o changeset: 0:ba592bf28da2
732 o changeset: 0:ba592bf28da2
733 user: test
733 user: test
734 date: Thu Jan 01 00:00:00 1970 +0000
734 date: Thu Jan 01 00:00:00 1970 +0000
735 summary: initial
735 summary: initial
736
736
737
737
738
738
739 $ hg verify
739 $ hg verify
740 checking changesets
740 checking changesets
741 checking manifests
741 checking manifests
742 crosschecking files in changesets and manifests
742 crosschecking files in changesets and manifests
743 checking files
743 checking files
744 checked 3 changesets with 3 changes to 3 files
744 checked 3 changesets with 3 changes to 3 files
745
745
746 Check we can select negatively
746 Check we can select negatively
747
747
748 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
748 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
749 upgrade will perform the following actions:
749 upgrade will perform the following actions:
750
750
751 requirements
751 requirements
752 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
752 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
753
753
754 optimisations: re-delta-parent
754 optimisations: re-delta-parent
755
755
756 re-delta-parent
756 re-delta-parent
757 deltas within internal storage will choose a new base revision if needed
757 deltas within internal storage will choose a new base revision if needed
758
758
759 processed revlogs:
759 processed revlogs:
760 - all-filelogs
760 - all-filelogs
761 - changelog
761 - changelog
762
762
763 beginning upgrade...
763 beginning upgrade...
764 repository locked and read-only
764 repository locked and read-only
765 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
765 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
766 (it is safe to interrupt this process any time before data migration completes)
766 (it is safe to interrupt this process any time before data migration completes)
767 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
767 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
768 migrating 519 KB in store; 1.05 MB tracked data
768 migrating 519 KB in store; 1.05 MB tracked data
769 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
769 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
770 cloning 1 revisions from data/FooBarDirectory.d/f1.i
770 cloning 1 revisions from data/FooBarDirectory.d/f1.i
771 cloning 1 revisions from data/f0.i
771 cloning 1 revisions from data/f0.i
772 cloning 1 revisions from data/f2.i
772 cloning 1 revisions from data/f2.i
773 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
773 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
774 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
774 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
775 blindly copying 00manifest.i containing 3 revisions
775 blindly copying 00manifest.i containing 3 revisions
776 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
776 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
777 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
777 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
778 cloning 3 revisions from 00changelog.i
778 cloning 3 revisions from 00changelog.i
779 finished migrating 3 changelog revisions; change in size: 0 bytes
779 finished migrating 3 changelog revisions; change in size: 0 bytes
780 finished migrating 9 total revisions; total change in store size: 0 bytes
780 finished migrating 9 total revisions; total change in store size: 0 bytes
781 copying phaseroots
781 copying phaseroots
782 data fully migrated to temporary repository
782 data fully migrated to temporary repository
783 marking source repository as being upgraded; clients will be unable to read from repository
783 marking source repository as being upgraded; clients will be unable to read from repository
784 starting in-place swap of repository data
784 starting in-place swap of repository data
785 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
785 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
786 replacing store...
786 replacing store...
787 store replacement complete; repository was inconsistent for *s (glob)
787 store replacement complete; repository was inconsistent for *s (glob)
788 finalizing requirements file and making repository readable again
788 finalizing requirements file and making repository readable again
789 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
789 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
790 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
790 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
791 $ hg verify
791 $ hg verify
792 checking changesets
792 checking changesets
793 checking manifests
793 checking manifests
794 crosschecking files in changesets and manifests
794 crosschecking files in changesets and manifests
795 checking files
795 checking files
796 checked 3 changesets with 3 changes to 3 files
796 checked 3 changesets with 3 changes to 3 files
797
797
798 Check that we can select changelog only
798 Check that we can select changelog only
799
799
800 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
800 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
801 upgrade will perform the following actions:
801 upgrade will perform the following actions:
802
802
803 requirements
803 requirements
804 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
804 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
805
805
806 optimisations: re-delta-parent
806 optimisations: re-delta-parent
807
807
808 re-delta-parent
808 re-delta-parent
809 deltas within internal storage will choose a new base revision if needed
809 deltas within internal storage will choose a new base revision if needed
810
810
811 processed revlogs:
811 processed revlogs:
812 - changelog
812 - changelog
813
813
814 beginning upgrade...
814 beginning upgrade...
815 repository locked and read-only
815 repository locked and read-only
816 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
816 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
817 (it is safe to interrupt this process any time before data migration completes)
817 (it is safe to interrupt this process any time before data migration completes)
818 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
818 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
819 migrating 519 KB in store; 1.05 MB tracked data
819 migrating 519 KB in store; 1.05 MB tracked data
820 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
820 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
821 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
821 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
822 blindly copying data/f0.i containing 1 revisions
822 blindly copying data/f0.i containing 1 revisions
823 blindly copying data/f2.i containing 1 revisions
823 blindly copying data/f2.i containing 1 revisions
824 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
824 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
825 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
825 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
826 blindly copying 00manifest.i containing 3 revisions
826 blindly copying 00manifest.i containing 3 revisions
827 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
827 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
828 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
828 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
829 cloning 3 revisions from 00changelog.i
829 cloning 3 revisions from 00changelog.i
830 finished migrating 3 changelog revisions; change in size: 0 bytes
830 finished migrating 3 changelog revisions; change in size: 0 bytes
831 finished migrating 9 total revisions; total change in store size: 0 bytes
831 finished migrating 9 total revisions; total change in store size: 0 bytes
832 copying phaseroots
832 copying phaseroots
833 data fully migrated to temporary repository
833 data fully migrated to temporary repository
834 marking source repository as being upgraded; clients will be unable to read from repository
834 marking source repository as being upgraded; clients will be unable to read from repository
835 starting in-place swap of repository data
835 starting in-place swap of repository data
836 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
836 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
837 replacing store...
837 replacing store...
838 store replacement complete; repository was inconsistent for *s (glob)
838 store replacement complete; repository was inconsistent for *s (glob)
839 finalizing requirements file and making repository readable again
839 finalizing requirements file and making repository readable again
840 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
840 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
841 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
841 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
842 $ hg verify
842 $ hg verify
843 checking changesets
843 checking changesets
844 checking manifests
844 checking manifests
845 crosschecking files in changesets and manifests
845 crosschecking files in changesets and manifests
846 checking files
846 checking files
847 checked 3 changesets with 3 changes to 3 files
847 checked 3 changesets with 3 changes to 3 files
848
848
849 Check that we can select filelog only
849 Check that we can select filelog only
850
850
851 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
851 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
852 upgrade will perform the following actions:
852 upgrade will perform the following actions:
853
853
854 requirements
854 requirements
855 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
855 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
856
856
857 optimisations: re-delta-parent
857 optimisations: re-delta-parent
858
858
859 re-delta-parent
859 re-delta-parent
860 deltas within internal storage will choose a new base revision if needed
860 deltas within internal storage will choose a new base revision if needed
861
861
862 processed revlogs:
862 processed revlogs:
863 - all-filelogs
863 - all-filelogs
864
864
865 beginning upgrade...
865 beginning upgrade...
866 repository locked and read-only
866 repository locked and read-only
867 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
867 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
868 (it is safe to interrupt this process any time before data migration completes)
868 (it is safe to interrupt this process any time before data migration completes)
869 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
869 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
870 migrating 519 KB in store; 1.05 MB tracked data
870 migrating 519 KB in store; 1.05 MB tracked data
871 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
871 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
872 cloning 1 revisions from data/FooBarDirectory.d/f1.i
872 cloning 1 revisions from data/FooBarDirectory.d/f1.i
873 cloning 1 revisions from data/f0.i
873 cloning 1 revisions from data/f0.i
874 cloning 1 revisions from data/f2.i
874 cloning 1 revisions from data/f2.i
875 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
875 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
876 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
876 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
877 blindly copying 00manifest.i containing 3 revisions
877 blindly copying 00manifest.i containing 3 revisions
878 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
878 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
879 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
879 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
880 blindly copying 00changelog.i containing 3 revisions
880 blindly copying 00changelog.i containing 3 revisions
881 finished migrating 3 changelog revisions; change in size: 0 bytes
881 finished migrating 3 changelog revisions; change in size: 0 bytes
882 finished migrating 9 total revisions; total change in store size: 0 bytes
882 finished migrating 9 total revisions; total change in store size: 0 bytes
883 copying phaseroots
883 copying phaseroots
884 data fully migrated to temporary repository
884 data fully migrated to temporary repository
885 marking source repository as being upgraded; clients will be unable to read from repository
885 marking source repository as being upgraded; clients will be unable to read from repository
886 starting in-place swap of repository data
886 starting in-place swap of repository data
887 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
887 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
888 replacing store...
888 replacing store...
889 store replacement complete; repository was inconsistent for *s (glob)
889 store replacement complete; repository was inconsistent for *s (glob)
890 finalizing requirements file and making repository readable again
890 finalizing requirements file and making repository readable again
891 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
891 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
892 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
892 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
893 $ hg verify
893 $ hg verify
894 checking changesets
894 checking changesets
895 checking manifests
895 checking manifests
896 crosschecking files in changesets and manifests
896 crosschecking files in changesets and manifests
897 checking files
897 checking files
898 checked 3 changesets with 3 changes to 3 files
898 checked 3 changesets with 3 changes to 3 files
899
899
900
900
901 Check you can't skip revlog clone during important format downgrade
901 Check you can't skip revlog clone during important format downgrade
902
902
903 $ echo "[format]" > .hg/hgrc
903 $ echo "[format]" > .hg/hgrc
904 $ echo "sparse-revlog=no" >> .hg/hgrc
904 $ echo "sparse-revlog=no" >> .hg/hgrc
905 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
905 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
906 ignoring revlogs selection flags, format requirements change: sparserevlog
906 ignoring revlogs selection flags, format requirements change: sparserevlog
907 upgrade will perform the following actions:
907 upgrade will perform the following actions:
908
908
909 requirements
909 requirements
910 preserved: dotencode, fncache, generaldelta, revlogv1, store
910 preserved: dotencode, fncache, generaldelta, revlogv1, store
911 removed: sparserevlog
911 removed: sparserevlog
912
912
913 optimisations: re-delta-parent
913 optimisations: re-delta-parent
914
914
915 re-delta-parent
915 re-delta-parent
916 deltas within internal storage will choose a new base revision if needed
916 deltas within internal storage will choose a new base revision if needed
917
917
918 processed revlogs:
918 processed revlogs:
919 - all-filelogs
919 - all-filelogs
920 - changelog
920 - changelog
921 - manifest
921 - manifest
922
922
923 beginning upgrade...
923 beginning upgrade...
924 repository locked and read-only
924 repository locked and read-only
925 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
925 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
926 (it is safe to interrupt this process any time before data migration completes)
926 (it is safe to interrupt this process any time before data migration completes)
927 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
927 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
928 migrating 519 KB in store; 1.05 MB tracked data
928 migrating 519 KB in store; 1.05 MB tracked data
929 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
929 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
930 cloning 1 revisions from data/FooBarDirectory.d/f1.i
930 cloning 1 revisions from data/FooBarDirectory.d/f1.i
931 cloning 1 revisions from data/f0.i
931 cloning 1 revisions from data/f0.i
932 cloning 1 revisions from data/f2.i
932 cloning 1 revisions from data/f2.i
933 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
933 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
934 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
934 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
935 cloning 3 revisions from 00manifest.i
935 cloning 3 revisions from 00manifest.i
936 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
936 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
937 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
937 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
938 cloning 3 revisions from 00changelog.i
938 cloning 3 revisions from 00changelog.i
939 finished migrating 3 changelog revisions; change in size: 0 bytes
939 finished migrating 3 changelog revisions; change in size: 0 bytes
940 finished migrating 9 total revisions; total change in store size: 0 bytes
940 finished migrating 9 total revisions; total change in store size: 0 bytes
941 copying phaseroots
941 copying phaseroots
942 data fully migrated to temporary repository
942 data fully migrated to temporary repository
943 marking source repository as being upgraded; clients will be unable to read from repository
943 marking source repository as being upgraded; clients will be unable to read from repository
944 starting in-place swap of repository data
944 starting in-place swap of repository data
945 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
945 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
946 replacing store...
946 replacing store...
947 store replacement complete; repository was inconsistent for *s (glob)
947 store replacement complete; repository was inconsistent for *s (glob)
948 finalizing requirements file and making repository readable again
948 finalizing requirements file and making repository readable again
949 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
949 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
950 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
950 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
951 $ hg verify
951 $ hg verify
952 checking changesets
952 checking changesets
953 checking manifests
953 checking manifests
954 crosschecking files in changesets and manifests
954 crosschecking files in changesets and manifests
955 checking files
955 checking files
956 checked 3 changesets with 3 changes to 3 files
956 checked 3 changesets with 3 changes to 3 files
957
957
958 Check you can't skip revlog clone during important format upgrade
958 Check you can't skip revlog clone during important format upgrade
959
959
960 $ echo "sparse-revlog=yes" >> .hg/hgrc
960 $ echo "sparse-revlog=yes" >> .hg/hgrc
961 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
961 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
962 ignoring revlogs selection flags, format requirements change: sparserevlog
962 ignoring revlogs selection flags, format requirements change: sparserevlog
963 upgrade will perform the following actions:
963 upgrade will perform the following actions:
964
964
965 requirements
965 requirements
966 preserved: dotencode, fncache, generaldelta, revlogv1, store
966 preserved: dotencode, fncache, generaldelta, revlogv1, store
967 added: sparserevlog
967 added: sparserevlog
968
968
969 optimisations: re-delta-parent
969 optimisations: re-delta-parent
970
970
971 sparserevlog
971 sparserevlog
972 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
972 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
973
973
974 re-delta-parent
974 re-delta-parent
975 deltas within internal storage will choose a new base revision if needed
975 deltas within internal storage will choose a new base revision if needed
976
976
977 processed revlogs:
977 processed revlogs:
978 - all-filelogs
978 - all-filelogs
979 - changelog
979 - changelog
980 - manifest
980 - manifest
981
981
982 beginning upgrade...
982 beginning upgrade...
983 repository locked and read-only
983 repository locked and read-only
984 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
984 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
985 (it is safe to interrupt this process any time before data migration completes)
985 (it is safe to interrupt this process any time before data migration completes)
986 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
986 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
987 migrating 519 KB in store; 1.05 MB tracked data
987 migrating 519 KB in store; 1.05 MB tracked data
988 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
988 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
989 cloning 1 revisions from data/FooBarDirectory.d/f1.i
989 cloning 1 revisions from data/FooBarDirectory.d/f1.i
990 cloning 1 revisions from data/f0.i
990 cloning 1 revisions from data/f0.i
991 cloning 1 revisions from data/f2.i
991 cloning 1 revisions from data/f2.i
992 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
992 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
993 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
993 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
994 cloning 3 revisions from 00manifest.i
994 cloning 3 revisions from 00manifest.i
995 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
995 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
996 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
996 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
997 cloning 3 revisions from 00changelog.i
997 cloning 3 revisions from 00changelog.i
998 finished migrating 3 changelog revisions; change in size: 0 bytes
998 finished migrating 3 changelog revisions; change in size: 0 bytes
999 finished migrating 9 total revisions; total change in store size: 0 bytes
999 finished migrating 9 total revisions; total change in store size: 0 bytes
1000 copying phaseroots
1000 copying phaseroots
1001 data fully migrated to temporary repository
1001 data fully migrated to temporary repository
1002 marking source repository as being upgraded; clients will be unable to read from repository
1002 marking source repository as being upgraded; clients will be unable to read from repository
1003 starting in-place swap of repository data
1003 starting in-place swap of repository data
1004 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
1004 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
1005 replacing store...
1005 replacing store...
1006 store replacement complete; repository was inconsistent for *s (glob)
1006 store replacement complete; repository was inconsistent for *s (glob)
1007 finalizing requirements file and making repository readable again
1007 finalizing requirements file and making repository readable again
1008 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
1008 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
1009 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1009 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1010 $ hg verify
1010 $ hg verify
1011 checking changesets
1011 checking changesets
1012 checking manifests
1012 checking manifests
1013 crosschecking files in changesets and manifests
1013 crosschecking files in changesets and manifests
1014 checking files
1014 checking files
1015 checked 3 changesets with 3 changes to 3 files
1015 checked 3 changesets with 3 changes to 3 files
1016
1016
1017 $ cd ..
1017 $ cd ..
1018
1018
1019 store files with special filenames aren't encoded during copy
1019 store files with special filenames aren't encoded during copy
1020
1020
1021 $ hg init store-filenames
1021 $ hg init store-filenames
1022 $ cd store-filenames
1022 $ cd store-filenames
1023 $ touch foo
1023 $ touch foo
1024 $ hg -q commit -A -m initial
1024 $ hg -q commit -A -m initial
1025 $ touch .hg/store/.XX_special_filename
1025 $ touch .hg/store/.XX_special_filename
1026
1026
1027 $ hg debugupgraderepo --run
1027 $ hg debugupgraderepo --run
1028 upgrade will perform the following actions:
1028 upgrade will perform the following actions:
1029
1029
1030 requirements
1030 requirements
1031 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1031 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1032
1032
1033 processed revlogs:
1033 processed revlogs:
1034 - all-filelogs
1034 - all-filelogs
1035 - changelog
1035 - changelog
1036 - manifest
1036 - manifest
1037
1037
1038 beginning upgrade...
1038 beginning upgrade...
1039 repository locked and read-only
1039 repository locked and read-only
1040 creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1040 creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1041 (it is safe to interrupt this process any time before data migration completes)
1041 (it is safe to interrupt this process any time before data migration completes)
1042 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1042 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1043 migrating 301 bytes in store; 107 bytes tracked data
1043 migrating 301 bytes in store; 107 bytes tracked data
1044 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1044 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1045 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1045 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1046 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1046 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1047 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1047 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1048 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1048 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1049 finished migrating 1 changelog revisions; change in size: 0 bytes
1049 finished migrating 1 changelog revisions; change in size: 0 bytes
1050 finished migrating 3 total revisions; total change in store size: 0 bytes
1050 finished migrating 3 total revisions; total change in store size: 0 bytes
1051 copying .XX_special_filename
1051 copying .XX_special_filename
1052 copying phaseroots
1052 copying phaseroots
1053 data fully migrated to temporary repository
1053 data fully migrated to temporary repository
1054 marking source repository as being upgraded; clients will be unable to read from repository
1054 marking source repository as being upgraded; clients will be unable to read from repository
1055 starting in-place swap of repository data
1055 starting in-place swap of repository data
1056 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1056 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1057 replacing store...
1057 replacing store...
1058 store replacement complete; repository was inconsistent for *s (glob)
1058 store replacement complete; repository was inconsistent for *s (glob)
1059 finalizing requirements file and making repository readable again
1059 finalizing requirements file and making repository readable again
1060 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1060 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1061 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1061 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1062 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1062 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1063 $ hg debugupgraderepo --run --optimize redeltafulladd
1063 $ hg debugupgraderepo --run --optimize redeltafulladd
1064 upgrade will perform the following actions:
1064 upgrade will perform the following actions:
1065
1065
1066 requirements
1066 requirements
1067 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1067 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1068
1068
1069 optimisations: re-delta-fulladd
1069 optimisations: re-delta-fulladd
1070
1070
1071 re-delta-fulladd
1071 re-delta-fulladd
1072 each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it
1072 each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it
1073
1073
1074 processed revlogs:
1074 processed revlogs:
1075 - all-filelogs
1075 - all-filelogs
1076 - changelog
1076 - changelog
1077 - manifest
1077 - manifest
1078
1078
1079 beginning upgrade...
1079 beginning upgrade...
1080 repository locked and read-only
1080 repository locked and read-only
1081 creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1081 creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1082 (it is safe to interrupt this process any time before data migration completes)
1082 (it is safe to interrupt this process any time before data migration completes)
1083 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1083 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1084 migrating 301 bytes in store; 107 bytes tracked data
1084 migrating 301 bytes in store; 107 bytes tracked data
1085 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1085 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1086 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1086 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1087 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1087 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1088 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1088 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1089 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1089 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1090 finished migrating 1 changelog revisions; change in size: 0 bytes
1090 finished migrating 1 changelog revisions; change in size: 0 bytes
1091 finished migrating 3 total revisions; total change in store size: 0 bytes
1091 finished migrating 3 total revisions; total change in store size: 0 bytes
1092 copying .XX_special_filename
1092 copying .XX_special_filename
1093 copying phaseroots
1093 copying phaseroots
1094 data fully migrated to temporary repository
1094 data fully migrated to temporary repository
1095 marking source repository as being upgraded; clients will be unable to read from repository
1095 marking source repository as being upgraded; clients will be unable to read from repository
1096 starting in-place swap of repository data
1096 starting in-place swap of repository data
1097 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1097 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1098 replacing store...
1098 replacing store...
1099 store replacement complete; repository was inconsistent for *s (glob)
1099 store replacement complete; repository was inconsistent for *s (glob)
1100 finalizing requirements file and making repository readable again
1100 finalizing requirements file and making repository readable again
1101 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1101 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1102 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1102 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1103 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1103 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1104
1104
1105 fncache is valid after upgrade
1105 fncache is valid after upgrade
1106
1106
1107 $ hg debugrebuildfncache
1107 $ hg debugrebuildfncache
1108 fncache already up to date
1108 fncache already up to date
1109
1109
1110 $ cd ..
1110 $ cd ..
1111
1111
1112 Check upgrading a large file repository
1112 Check upgrading a large file repository
1113 ---------------------------------------
1113 ---------------------------------------
1114
1114
1115 $ hg init largefilesrepo
1115 $ hg init largefilesrepo
1116 $ cat << EOF >> largefilesrepo/.hg/hgrc
1116 $ cat << EOF >> largefilesrepo/.hg/hgrc
1117 > [extensions]
1117 > [extensions]
1118 > largefiles =
1118 > largefiles =
1119 > EOF
1119 > EOF
1120
1120
1121 $ cd largefilesrepo
1121 $ cd largefilesrepo
1122 $ touch foo
1122 $ touch foo
1123 $ hg add --large foo
1123 $ hg add --large foo
1124 $ hg -q commit -m initial
1124 $ hg -q commit -m initial
1125 $ cat .hg/requires
1125 $ cat .hg/requires
1126 dotencode
1126 dotencode
1127 fncache
1127 fncache
1128 generaldelta
1128 generaldelta
1129 largefiles
1129 largefiles
1130 revlogv1
1130 revlogv1
1131 sparserevlog
1131 sparserevlog
1132 store
1132 store
1133
1133
1134 $ hg debugupgraderepo --run
1134 $ hg debugupgraderepo --run
1135 upgrade will perform the following actions:
1135 upgrade will perform the following actions:
1136
1136
1137 requirements
1137 requirements
1138 preserved: dotencode, fncache, generaldelta, largefiles, revlogv1, sparserevlog, store
1138 preserved: dotencode, fncache, generaldelta, largefiles, revlogv1, sparserevlog, store
1139
1139
1140 processed revlogs:
1140 processed revlogs:
1141 - all-filelogs
1141 - all-filelogs
1142 - changelog
1142 - changelog
1143 - manifest
1143 - manifest
1144
1144
1145 beginning upgrade...
1145 beginning upgrade...
1146 repository locked and read-only
1146 repository locked and read-only
1147 creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1147 creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1148 (it is safe to interrupt this process any time before data migration completes)
1148 (it is safe to interrupt this process any time before data migration completes)
1149 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1149 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1150 migrating 355 bytes in store; 160 bytes tracked data
1150 migrating 355 bytes in store; 160 bytes tracked data
1151 migrating 1 filelogs containing 1 revisions (106 bytes in store; 41 bytes tracked data)
1151 migrating 1 filelogs containing 1 revisions (106 bytes in store; 41 bytes tracked data)
1152 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1152 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1153 migrating 1 manifests containing 1 revisions (116 bytes in store; 51 bytes tracked data)
1153 migrating 1 manifests containing 1 revisions (116 bytes in store; 51 bytes tracked data)
1154 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1154 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1155 migrating changelog containing 1 revisions (133 bytes in store; 68 bytes tracked data)
1155 migrating changelog containing 1 revisions (133 bytes in store; 68 bytes tracked data)
1156 finished migrating 1 changelog revisions; change in size: 0 bytes
1156 finished migrating 1 changelog revisions; change in size: 0 bytes
1157 finished migrating 3 total revisions; total change in store size: 0 bytes
1157 finished migrating 3 total revisions; total change in store size: 0 bytes
1158 copying phaseroots
1158 copying phaseroots
1159 data fully migrated to temporary repository
1159 data fully migrated to temporary repository
1160 marking source repository as being upgraded; clients will be unable to read from repository
1160 marking source repository as being upgraded; clients will be unable to read from repository
1161 starting in-place swap of repository data
1161 starting in-place swap of repository data
1162 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1162 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1163 replacing store...
1163 replacing store...
1164 store replacement complete; repository was inconsistent for *s (glob)
1164 store replacement complete; repository was inconsistent for *s (glob)
1165 finalizing requirements file and making repository readable again
1165 finalizing requirements file and making repository readable again
1166 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1166 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1167 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1167 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1168 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1168 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1169 $ cat .hg/requires
1169 $ cat .hg/requires
1170 dotencode
1170 dotencode
1171 fncache
1171 fncache
1172 generaldelta
1172 generaldelta
1173 largefiles
1173 largefiles
1174 revlogv1
1174 revlogv1
1175 sparserevlog
1175 sparserevlog
1176 store
1176 store
1177
1177
1178 $ cat << EOF >> .hg/hgrc
1178 $ cat << EOF >> .hg/hgrc
1179 > [extensions]
1179 > [extensions]
1180 > lfs =
1180 > lfs =
1181 > [lfs]
1181 > [lfs]
1182 > threshold = 10
1182 > threshold = 10
1183 > EOF
1183 > EOF
1184 $ echo '123456789012345' > lfs.bin
1184 $ echo '123456789012345' > lfs.bin
1185 $ hg ci -Am 'lfs.bin'
1185 $ hg ci -Am 'lfs.bin'
1186 adding lfs.bin
1186 adding lfs.bin
1187 $ grep lfs .hg/requires
1187 $ grep lfs .hg/requires
1188 lfs
1188 lfs
1189 $ find .hg/store/lfs -type f
1189 $ find .hg/store/lfs -type f
1190 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1190 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1191
1191
1192 $ hg debugupgraderepo --run
1192 $ hg debugupgraderepo --run
1193 upgrade will perform the following actions:
1193 upgrade will perform the following actions:
1194
1194
1195 requirements
1195 requirements
1196 preserved: dotencode, fncache, generaldelta, largefiles, lfs, revlogv1, sparserevlog, store
1196 preserved: dotencode, fncache, generaldelta, largefiles, lfs, revlogv1, sparserevlog, store
1197
1197
1198 processed revlogs:
1198 processed revlogs:
1199 - all-filelogs
1199 - all-filelogs
1200 - changelog
1200 - changelog
1201 - manifest
1201 - manifest
1202
1202
1203 beginning upgrade...
1203 beginning upgrade...
1204 repository locked and read-only
1204 repository locked and read-only
1205 creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1205 creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1206 (it is safe to interrupt this process any time before data migration completes)
1206 (it is safe to interrupt this process any time before data migration completes)
1207 migrating 6 total revisions (2 in filelogs, 2 in manifests, 2 in changelog)
1207 migrating 6 total revisions (2 in filelogs, 2 in manifests, 2 in changelog)
1208 migrating 801 bytes in store; 467 bytes tracked data
1208 migrating 801 bytes in store; 467 bytes tracked data
1209 migrating 2 filelogs containing 2 revisions (296 bytes in store; 182 bytes tracked data)
1209 migrating 2 filelogs containing 2 revisions (296 bytes in store; 182 bytes tracked data)
1210 finished migrating 2 filelog revisions across 2 filelogs; change in size: 0 bytes
1210 finished migrating 2 filelog revisions across 2 filelogs; change in size: 0 bytes
1211 migrating 1 manifests containing 2 revisions (241 bytes in store; 151 bytes tracked data)
1211 migrating 1 manifests containing 2 revisions (241 bytes in store; 151 bytes tracked data)
1212 finished migrating 2 manifest revisions across 1 manifests; change in size: 0 bytes
1212 finished migrating 2 manifest revisions across 1 manifests; change in size: 0 bytes
1213 migrating changelog containing 2 revisions (264 bytes in store; 134 bytes tracked data)
1213 migrating changelog containing 2 revisions (264 bytes in store; 134 bytes tracked data)
1214 finished migrating 2 changelog revisions; change in size: 0 bytes
1214 finished migrating 2 changelog revisions; change in size: 0 bytes
1215 finished migrating 6 total revisions; total change in store size: 0 bytes
1215 finished migrating 6 total revisions; total change in store size: 0 bytes
1216 copying phaseroots
1216 copying phaseroots
1217 copying lfs blob d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1217 copying lfs blob d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1218 data fully migrated to temporary repository
1218 data fully migrated to temporary repository
1219 marking source repository as being upgraded; clients will be unable to read from repository
1219 marking source repository as being upgraded; clients will be unable to read from repository
1220 starting in-place swap of repository data
1220 starting in-place swap of repository data
1221 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1221 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1222 replacing store...
1222 replacing store...
1223 store replacement complete; repository was inconsistent for *s (glob)
1223 store replacement complete; repository was inconsistent for *s (glob)
1224 finalizing requirements file and making repository readable again
1224 finalizing requirements file and making repository readable again
1225 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1225 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1226 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1226 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1227 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1227 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1228
1228
1229 $ grep lfs .hg/requires
1229 $ grep lfs .hg/requires
1230 lfs
1230 lfs
1231 $ find .hg/store/lfs -type f
1231 $ find .hg/store/lfs -type f
1232 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1232 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1233 $ hg verify
1233 $ hg verify
1234 checking changesets
1234 checking changesets
1235 checking manifests
1235 checking manifests
1236 crosschecking files in changesets and manifests
1236 crosschecking files in changesets and manifests
1237 checking files
1237 checking files
1238 checked 2 changesets with 2 changes to 2 files
1238 checked 2 changesets with 2 changes to 2 files
1239 $ hg debugdata lfs.bin 0
1239 $ hg debugdata lfs.bin 0
1240 version https://git-lfs.github.com/spec/v1
1240 version https://git-lfs.github.com/spec/v1
1241 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1241 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1242 size 16
1242 size 16
1243 x-is-binary 0
1243 x-is-binary 0
1244
1244
1245 $ cd ..
1245 $ cd ..
1246
1246
1247 repository config is taken in account
1247 repository config is taken in account
1248 -------------------------------------
1248 -------------------------------------
1249
1249
1250 $ cat << EOF >> $HGRCPATH
1250 $ cat << EOF >> $HGRCPATH
1251 > [format]
1251 > [format]
1252 > maxchainlen = 1
1252 > maxchainlen = 1
1253 > EOF
1253 > EOF
1254
1254
1255 $ hg init localconfig
1255 $ hg init localconfig
1256 $ cd localconfig
1256 $ cd localconfig
1257 $ cat << EOF > file
1257 $ cat << EOF > file
1258 > some content
1258 > some content
1259 > with some length
1259 > with some length
1260 > to make sure we get a delta
1260 > to make sure we get a delta
1261 > after changes
1261 > after changes
1262 > very long
1262 > very long
1263 > very long
1263 > very long
1264 > very long
1264 > very long
1265 > very long
1265 > very long
1266 > very long
1266 > very long
1267 > very long
1267 > very long
1268 > very long
1268 > very long
1269 > very long
1269 > very long
1270 > very long
1270 > very long
1271 > very long
1271 > very long
1272 > very long
1272 > very long
1273 > EOF
1273 > EOF
1274 $ hg -q commit -A -m A
1274 $ hg -q commit -A -m A
1275 $ echo "new line" >> file
1275 $ echo "new line" >> file
1276 $ hg -q commit -m B
1276 $ hg -q commit -m B
1277 $ echo "new line" >> file
1277 $ echo "new line" >> file
1278 $ hg -q commit -m C
1278 $ hg -q commit -m C
1279
1279
1280 $ cat << EOF >> .hg/hgrc
1280 $ cat << EOF >> .hg/hgrc
1281 > [format]
1281 > [format]
1282 > maxchainlen = 9001
1282 > maxchainlen = 9001
1283 > EOF
1283 > EOF
1284 $ hg config format
1284 $ hg config format
1285 format.maxchainlen=9001
1285 format.maxchainlen=9001
1286 $ hg debugdeltachain file
1286 $ hg debugdeltachain file
1287 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1287 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1288 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1288 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1289 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1289 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1290 2 1 2 0 other 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1290 2 1 2 0 other 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1291
1291
1292 $ hg debugupgraderepo --run --optimize redeltaall
1292 $ hg debugupgraderepo --run --optimize redeltaall
1293 upgrade will perform the following actions:
1293 upgrade will perform the following actions:
1294
1294
1295 requirements
1295 requirements
1296 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1296 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1297
1297
1298 optimisations: re-delta-all
1298 optimisations: re-delta-all
1299
1299
1300 re-delta-all
1300 re-delta-all
1301 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1301 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1302
1302
1303 processed revlogs:
1303 processed revlogs:
1304 - all-filelogs
1304 - all-filelogs
1305 - changelog
1305 - changelog
1306 - manifest
1306 - manifest
1307
1307
1308 beginning upgrade...
1308 beginning upgrade...
1309 repository locked and read-only
1309 repository locked and read-only
1310 creating temporary repository to stage migrated data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1310 creating temporary repository to stage migrated data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1311 (it is safe to interrupt this process any time before data migration completes)
1311 (it is safe to interrupt this process any time before data migration completes)
1312 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1312 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1313 migrating 1019 bytes in store; 882 bytes tracked data
1313 migrating 1019 bytes in store; 882 bytes tracked data
1314 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
1314 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
1315 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
1315 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
1316 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
1316 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
1317 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1317 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1318 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
1318 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
1319 finished migrating 3 changelog revisions; change in size: 0 bytes
1319 finished migrating 3 changelog revisions; change in size: 0 bytes
1320 finished migrating 9 total revisions; total change in store size: -9 bytes
1320 finished migrating 9 total revisions; total change in store size: -9 bytes
1321 copying phaseroots
1321 copying phaseroots
1322 data fully migrated to temporary repository
1322 data fully migrated to temporary repository
1323 marking source repository as being upgraded; clients will be unable to read from repository
1323 marking source repository as being upgraded; clients will be unable to read from repository
1324 starting in-place swap of repository data
1324 starting in-place swap of repository data
1325 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1325 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1326 replacing store...
1326 replacing store...
1327 store replacement complete; repository was inconsistent for *s (glob)
1327 store replacement complete; repository was inconsistent for *s (glob)
1328 finalizing requirements file and making repository readable again
1328 finalizing requirements file and making repository readable again
1329 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1329 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1330 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1330 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1331 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1331 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1332 $ hg debugdeltachain file
1332 $ hg debugdeltachain file
1333 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1333 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1334 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1334 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1335 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1335 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1336 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1336 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1337 $ cd ..
1337 $ cd ..
1338
1338
1339 $ cat << EOF >> $HGRCPATH
1339 $ cat << EOF >> $HGRCPATH
1340 > [format]
1340 > [format]
1341 > maxchainlen = 9001
1341 > maxchainlen = 9001
1342 > EOF
1342 > EOF
1343
1343
1344 Check upgrading a sparse-revlog repository
1344 Check upgrading a sparse-revlog repository
1345 ---------------------------------------
1345 ---------------------------------------
1346
1346
1347 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1347 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1348 $ cd sparserevlogrepo
1348 $ cd sparserevlogrepo
1349 $ touch foo
1349 $ touch foo
1350 $ hg add foo
1350 $ hg add foo
1351 $ hg -q commit -m "foo"
1351 $ hg -q commit -m "foo"
1352 $ cat .hg/requires
1352 $ cat .hg/requires
1353 dotencode
1353 dotencode
1354 fncache
1354 fncache
1355 generaldelta
1355 generaldelta
1356 revlogv1
1356 revlogv1
1357 store
1357 store
1358
1358
1359 Check that we can add the sparse-revlog format requirement
1359 Check that we can add the sparse-revlog format requirement
1360 $ hg --config format.sparse-revlog=yes debugupgraderepo --run --quiet
1360 $ hg --config format.sparse-revlog=yes debugupgraderepo --run --quiet
1361 upgrade will perform the following actions:
1361 upgrade will perform the following actions:
1362
1362
1363 requirements
1363 requirements
1364 preserved: dotencode, fncache, generaldelta, revlogv1, store
1364 preserved: dotencode, fncache, generaldelta, revlogv1, store
1365 added: sparserevlog
1365 added: sparserevlog
1366
1366
1367 processed revlogs:
1367 processed revlogs:
1368 - all-filelogs
1368 - all-filelogs
1369 - changelog
1369 - changelog
1370 - manifest
1370 - manifest
1371
1371
1372 $ cat .hg/requires
1372 $ cat .hg/requires
1373 dotencode
1373 dotencode
1374 fncache
1374 fncache
1375 generaldelta
1375 generaldelta
1376 revlogv1
1376 revlogv1
1377 sparserevlog
1377 sparserevlog
1378 store
1378 store
1379
1379
1380 Check that we can remove the sparse-revlog format requirement
1380 Check that we can remove the sparse-revlog format requirement
1381 $ hg --config format.sparse-revlog=no debugupgraderepo --run --quiet
1381 $ hg --config format.sparse-revlog=no debugupgraderepo --run --quiet
1382 upgrade will perform the following actions:
1382 upgrade will perform the following actions:
1383
1383
1384 requirements
1384 requirements
1385 preserved: dotencode, fncache, generaldelta, revlogv1, store
1385 preserved: dotencode, fncache, generaldelta, revlogv1, store
1386 removed: sparserevlog
1386 removed: sparserevlog
1387
1387
1388 processed revlogs:
1388 processed revlogs:
1389 - all-filelogs
1389 - all-filelogs
1390 - changelog
1390 - changelog
1391 - manifest
1391 - manifest
1392
1392
1393 $ cat .hg/requires
1393 $ cat .hg/requires
1394 dotencode
1394 dotencode
1395 fncache
1395 fncache
1396 generaldelta
1396 generaldelta
1397 revlogv1
1397 revlogv1
1398 store
1398 store
1399
1399
1400 #if zstd
1400 #if zstd
1401
1401
1402 Check upgrading to a zstd revlog
1402 Check upgrading to a zstd revlog
1403 --------------------------------
1403 --------------------------------
1404
1404
1405 upgrade
1405 upgrade
1406
1406
1407 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup --quiet
1407 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup --quiet
1408 upgrade will perform the following actions:
1408 upgrade will perform the following actions:
1409
1409
1410 requirements
1410 requirements
1411 preserved: dotencode, fncache, generaldelta, revlogv1, store
1411 preserved: dotencode, fncache, generaldelta, revlogv1, store
1412 added: revlog-compression-zstd, sparserevlog
1412 added: revlog-compression-zstd, sparserevlog
1413
1413
1414 processed revlogs:
1414 processed revlogs:
1415 - all-filelogs
1415 - all-filelogs
1416 - changelog
1416 - changelog
1417 - manifest
1417 - manifest
1418
1418
1419 $ hg debugformat -v
1419 $ hg debugformat -v
1420 format-variant repo config default
1420 format-variant repo config default
1421 fncache: yes yes yes
1421 fncache: yes yes yes
1422 dotencode: yes yes yes
1422 dotencode: yes yes yes
1423 generaldelta: yes yes yes
1423 generaldelta: yes yes yes
1424 exp-sharesafe: no no no
1424 exp-sharesafe: no no no
1425 sparserevlog: yes yes yes
1425 sparserevlog: yes yes yes
1426 sidedata: no no no
1426 sidedata: no no no
1427 persistent-nodemap: no no no
1427 persistent-nodemap: no no no
1428 copies-sdc: no no no
1428 copies-sdc: no no no
1429 plain-cl-delta: yes yes yes
1429 plain-cl-delta: yes yes yes
1430 compression: zstd zlib zlib
1430 compression: zstd zlib zlib
1431 compression-level: default default default
1431 compression-level: default default default
1432 $ cat .hg/requires
1432 $ cat .hg/requires
1433 dotencode
1433 dotencode
1434 fncache
1434 fncache
1435 generaldelta
1435 generaldelta
1436 revlog-compression-zstd
1436 revlog-compression-zstd
1437 revlogv1
1437 revlogv1
1438 sparserevlog
1438 sparserevlog
1439 store
1439 store
1440
1440
1441 downgrade
1441 downgrade
1442
1442
1443 $ hg debugupgraderepo --run --no-backup --quiet
1443 $ hg debugupgraderepo --run --no-backup --quiet
1444 upgrade will perform the following actions:
1444 upgrade will perform the following actions:
1445
1445
1446 requirements
1446 requirements
1447 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1447 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1448 removed: revlog-compression-zstd
1448 removed: revlog-compression-zstd
1449
1449
1450 processed revlogs:
1450 processed revlogs:
1451 - all-filelogs
1451 - all-filelogs
1452 - changelog
1452 - changelog
1453 - manifest
1453 - manifest
1454
1454
1455 $ hg debugformat -v
1455 $ hg debugformat -v
1456 format-variant repo config default
1456 format-variant repo config default
1457 fncache: yes yes yes
1457 fncache: yes yes yes
1458 dotencode: yes yes yes
1458 dotencode: yes yes yes
1459 generaldelta: yes yes yes
1459 generaldelta: yes yes yes
1460 exp-sharesafe: no no no
1460 exp-sharesafe: no no no
1461 sparserevlog: yes yes yes
1461 sparserevlog: yes yes yes
1462 sidedata: no no no
1462 sidedata: no no no
1463 persistent-nodemap: no no no
1463 persistent-nodemap: no no no
1464 copies-sdc: no no no
1464 copies-sdc: no no no
1465 plain-cl-delta: yes yes yes
1465 plain-cl-delta: yes yes yes
1466 compression: zlib zlib zlib
1466 compression: zlib zlib zlib
1467 compression-level: default default default
1467 compression-level: default default default
1468 $ cat .hg/requires
1468 $ cat .hg/requires
1469 dotencode
1469 dotencode
1470 fncache
1470 fncache
1471 generaldelta
1471 generaldelta
1472 revlogv1
1472 revlogv1
1473 sparserevlog
1473 sparserevlog
1474 store
1474 store
1475
1475
1476 upgrade from hgrc
1476 upgrade from hgrc
1477
1477
1478 $ cat >> .hg/hgrc << EOF
1478 $ cat >> .hg/hgrc << EOF
1479 > [format]
1479 > [format]
1480 > revlog-compression=zstd
1480 > revlog-compression=zstd
1481 > EOF
1481 > EOF
1482 $ hg debugupgraderepo --run --no-backup --quiet
1482 $ hg debugupgraderepo --run --no-backup --quiet
1483 upgrade will perform the following actions:
1483 upgrade will perform the following actions:
1484
1484
1485 requirements
1485 requirements
1486 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1486 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1487 added: revlog-compression-zstd
1487 added: revlog-compression-zstd
1488
1488
1489 processed revlogs:
1489 processed revlogs:
1490 - all-filelogs
1490 - all-filelogs
1491 - changelog
1491 - changelog
1492 - manifest
1492 - manifest
1493
1493
1494 $ hg debugformat -v
1494 $ hg debugformat -v
1495 format-variant repo config default
1495 format-variant repo config default
1496 fncache: yes yes yes
1496 fncache: yes yes yes
1497 dotencode: yes yes yes
1497 dotencode: yes yes yes
1498 generaldelta: yes yes yes
1498 generaldelta: yes yes yes
1499 exp-sharesafe: no no no
1499 exp-sharesafe: no no no
1500 sparserevlog: yes yes yes
1500 sparserevlog: yes yes yes
1501 sidedata: no no no
1501 sidedata: no no no
1502 persistent-nodemap: no no no
1502 persistent-nodemap: no no no
1503 copies-sdc: no no no
1503 copies-sdc: no no no
1504 plain-cl-delta: yes yes yes
1504 plain-cl-delta: yes yes yes
1505 compression: zstd zstd zlib
1505 compression: zstd zstd zlib
1506 compression-level: default default default
1506 compression-level: default default default
1507 $ cat .hg/requires
1507 $ cat .hg/requires
1508 dotencode
1508 dotencode
1509 fncache
1509 fncache
1510 generaldelta
1510 generaldelta
1511 revlog-compression-zstd
1511 revlog-compression-zstd
1512 revlogv1
1512 revlogv1
1513 sparserevlog
1513 sparserevlog
1514 store
1514 store
1515
1515
1516 #endif
1516 #endif
1517
1517
1518 Check upgrading to a side-data revlog
1518 Check upgrading to a side-data revlog
1519 -------------------------------------
1519 -------------------------------------
1520
1520
1521 upgrade
1521 upgrade
1522
1522
1523 $ hg --config format.exp-use-side-data=yes debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" --quiet
1523 $ hg --config format.exp-use-side-data=yes debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" --quiet
1524 upgrade will perform the following actions:
1524 upgrade will perform the following actions:
1525
1525
1526 requirements
1526 requirements
1527 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-zstd !)
1527 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-zstd !)
1528 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1528 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1529 added: exp-sidedata-flag (zstd !)
1529 added: exp-sidedata-flag (zstd !)
1530 added: exp-sidedata-flag, sparserevlog (no-zstd !)
1530 added: exp-sidedata-flag, sparserevlog (no-zstd !)
1531
1531
1532 processed revlogs:
1532 processed revlogs:
1533 - all-filelogs
1533 - all-filelogs
1534 - changelog
1534 - changelog
1535 - manifest
1535 - manifest
1536
1536
1537 $ hg debugformat -v
1537 $ hg debugformat -v
1538 format-variant repo config default
1538 format-variant repo config default
1539 fncache: yes yes yes
1539 fncache: yes yes yes
1540 dotencode: yes yes yes
1540 dotencode: yes yes yes
1541 generaldelta: yes yes yes
1541 generaldelta: yes yes yes
1542 exp-sharesafe: no no no
1542 exp-sharesafe: no no no
1543 sparserevlog: yes yes yes
1543 sparserevlog: yes yes yes
1544 sidedata: yes no no
1544 sidedata: yes no no
1545 persistent-nodemap: no no no
1545 persistent-nodemap: no no no
1546 copies-sdc: no no no
1546 copies-sdc: no no no
1547 plain-cl-delta: yes yes yes
1547 plain-cl-delta: yes yes yes
1548 compression: zlib zlib zlib (no-zstd !)
1548 compression: zlib zlib zlib (no-zstd !)
1549 compression: zstd zstd zlib (zstd !)
1549 compression: zstd zstd zlib (zstd !)
1550 compression-level: default default default
1550 compression-level: default default default
1551 $ cat .hg/requires
1551 $ cat .hg/requires
1552 dotencode
1552 dotencode
1553 exp-sidedata-flag
1553 exp-sidedata-flag
1554 fncache
1554 fncache
1555 generaldelta
1555 generaldelta
1556 revlog-compression-zstd (zstd !)
1556 revlog-compression-zstd (zstd !)
1557 revlogv1
1557 revlogv1
1558 sparserevlog
1558 sparserevlog
1559 store
1559 store
1560 $ hg debugsidedata -c 0
1560 $ hg debugsidedata -c 0
1561 2 sidedata entries
1561 2 sidedata entries
1562 entry-0001 size 4
1562 entry-0001 size 4
1563 entry-0002 size 32
1563 entry-0002 size 32
1564
1564
1565 downgrade
1565 downgrade
1566
1566
1567 $ hg debugupgraderepo --config format.exp-use-side-data=no --run --no-backup --quiet
1567 $ hg debugupgraderepo --config format.exp-use-side-data=no --run --no-backup --quiet
1568 upgrade will perform the following actions:
1568 upgrade will perform the following actions:
1569
1569
1570 requirements
1570 requirements
1571 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
1571 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
1572 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1572 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1573 removed: exp-sidedata-flag
1573 removed: exp-sidedata-flag
1574
1574
1575 processed revlogs:
1575 processed revlogs:
1576 - all-filelogs
1576 - all-filelogs
1577 - changelog
1577 - changelog
1578 - manifest
1578 - manifest
1579
1579
1580 $ hg debugformat -v
1580 $ hg debugformat -v
1581 format-variant repo config default
1581 format-variant repo config default
1582 fncache: yes yes yes
1582 fncache: yes yes yes
1583 dotencode: yes yes yes
1583 dotencode: yes yes yes
1584 generaldelta: yes yes yes
1584 generaldelta: yes yes yes
1585 exp-sharesafe: no no no
1585 exp-sharesafe: no no no
1586 sparserevlog: yes yes yes
1586 sparserevlog: yes yes yes
1587 sidedata: no no no
1587 sidedata: no no no
1588 persistent-nodemap: no no no
1588 persistent-nodemap: no no no
1589 copies-sdc: no no no
1589 copies-sdc: no no no
1590 plain-cl-delta: yes yes yes
1590 plain-cl-delta: yes yes yes
1591 compression: zlib zlib zlib (no-zstd !)
1591 compression: zlib zlib zlib (no-zstd !)
1592 compression: zstd zstd zlib (zstd !)
1592 compression: zstd zstd zlib (zstd !)
1593 compression-level: default default default
1593 compression-level: default default default
1594 $ cat .hg/requires
1594 $ cat .hg/requires
1595 dotencode
1595 dotencode
1596 fncache
1596 fncache
1597 generaldelta
1597 generaldelta
1598 revlog-compression-zstd (zstd !)
1598 revlog-compression-zstd (zstd !)
1599 revlogv1
1599 revlogv1
1600 sparserevlog
1600 sparserevlog
1601 store
1601 store
1602 $ hg debugsidedata -c 0
1602 $ hg debugsidedata -c 0
1603
1603
1604 upgrade from hgrc
1604 upgrade from hgrc
1605
1605
1606 $ cat >> .hg/hgrc << EOF
1606 $ cat >> .hg/hgrc << EOF
1607 > [format]
1607 > [format]
1608 > exp-use-side-data=yes
1608 > exp-use-side-data=yes
1609 > EOF
1609 > EOF
1610 $ hg debugupgraderepo --run --no-backup --quiet
1610 $ hg debugupgraderepo --run --no-backup --quiet
1611 upgrade will perform the following actions:
1611 upgrade will perform the following actions:
1612
1612
1613 requirements
1613 requirements
1614 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
1614 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
1615 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1615 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1616 added: exp-sidedata-flag
1616 added: exp-sidedata-flag
1617
1617
1618 processed revlogs:
1618 processed revlogs:
1619 - all-filelogs
1619 - all-filelogs
1620 - changelog
1620 - changelog
1621 - manifest
1621 - manifest
1622
1622
1623 $ hg debugformat -v
1623 $ hg debugformat -v
1624 format-variant repo config default
1624 format-variant repo config default
1625 fncache: yes yes yes
1625 fncache: yes yes yes
1626 dotencode: yes yes yes
1626 dotencode: yes yes yes
1627 generaldelta: yes yes yes
1627 generaldelta: yes yes yes
1628 exp-sharesafe: no no no
1628 exp-sharesafe: no no no
1629 sparserevlog: yes yes yes
1629 sparserevlog: yes yes yes
1630 sidedata: yes yes no
1630 sidedata: yes yes no
1631 persistent-nodemap: no no no
1631 persistent-nodemap: no no no
1632 copies-sdc: no no no
1632 copies-sdc: no no no
1633 plain-cl-delta: yes yes yes
1633 plain-cl-delta: yes yes yes
1634 compression: zlib zlib zlib (no-zstd !)
1634 compression: zlib zlib zlib (no-zstd !)
1635 compression: zstd zstd zlib (zstd !)
1635 compression: zstd zstd zlib (zstd !)
1636 compression-level: default default default
1636 compression-level: default default default
1637 $ cat .hg/requires
1637 $ cat .hg/requires
1638 dotencode
1638 dotencode
1639 exp-sidedata-flag
1639 exp-sidedata-flag
1640 fncache
1640 fncache
1641 generaldelta
1641 generaldelta
1642 revlog-compression-zstd (zstd !)
1642 revlog-compression-zstd (zstd !)
1643 revlogv1
1643 revlogv1
1644 sparserevlog
1644 sparserevlog
1645 store
1645 store
1646 $ hg debugsidedata -c 0
1646 $ hg debugsidedata -c 0
General Comments 0
You need to be logged in to leave comments. Login now