##// END OF EJS Templates
sidedatacopies: teach upgrade about the new requirement...
marmoute -
r43408:f9dc98a9 default
parent child Browse files
Show More
@@ -1,1364 +1,1379 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 import stat
10 import stat
11
11
12 from .i18n import _
12 from .i18n import _
13 from .pycompat import getattr
13 from .pycompat import getattr
14 from . import (
14 from . import (
15 changelog,
15 changelog,
16 error,
16 error,
17 filelog,
17 filelog,
18 hg,
18 hg,
19 localrepo,
19 localrepo,
20 manifest,
20 manifest,
21 pycompat,
21 pycompat,
22 revlog,
22 revlog,
23 scmutil,
23 scmutil,
24 util,
24 util,
25 vfs as vfsmod,
25 vfs as vfsmod,
26 )
26 )
27
27
28 from .utils import compression
28 from .utils import compression
29
29
30 # list of requirements that request a clone of all revlog if added/removed
30 # list of requirements that request a clone of all revlog if added/removed
31 RECLONES_REQUIREMENTS = {
31 RECLONES_REQUIREMENTS = {
32 b'generaldelta',
32 b'generaldelta',
33 localrepo.SPARSEREVLOG_REQUIREMENT,
33 localrepo.SPARSEREVLOG_REQUIREMENT,
34 localrepo.SIDEDATA_REQUIREMENT,
34 localrepo.SIDEDATA_REQUIREMENT,
35 }
35 }
36
36
37
37
38 def requiredsourcerequirements(repo):
38 def requiredsourcerequirements(repo):
39 """Obtain requirements required to be present to upgrade a repo.
39 """Obtain requirements required to be present to upgrade a repo.
40
40
41 An upgrade will not be allowed if the repository doesn't have the
41 An upgrade will not be allowed if the repository doesn't have the
42 requirements returned by this function.
42 requirements returned by this function.
43 """
43 """
44 return {
44 return {
45 # Introduced in Mercurial 0.9.2.
45 # Introduced in Mercurial 0.9.2.
46 b'revlogv1',
46 b'revlogv1',
47 # Introduced in Mercurial 0.9.2.
47 # Introduced in Mercurial 0.9.2.
48 b'store',
48 b'store',
49 }
49 }
50
50
51
51
52 def blocksourcerequirements(repo):
52 def blocksourcerequirements(repo):
53 """Obtain requirements that will prevent an upgrade from occurring.
53 """Obtain requirements that will prevent an upgrade from occurring.
54
54
55 An upgrade cannot be performed if the source repository contains a
55 An upgrade cannot be performed if the source repository contains a
56 requirements in the returned set.
56 requirements in the returned set.
57 """
57 """
58 return {
58 return {
59 # The upgrade code does not yet support these experimental features.
59 # The upgrade code does not yet support these experimental features.
60 # This is an artificial limitation.
60 # This is an artificial limitation.
61 b'treemanifest',
61 b'treemanifest',
62 # This was a precursor to generaldelta and was never enabled by default.
62 # This was a precursor to generaldelta and was never enabled by default.
63 # It should (hopefully) not exist in the wild.
63 # It should (hopefully) not exist in the wild.
64 b'parentdelta',
64 b'parentdelta',
65 # Upgrade should operate on the actual store, not the shared link.
65 # Upgrade should operate on the actual store, not the shared link.
66 b'shared',
66 b'shared',
67 }
67 }
68
68
69
69
70 def supportremovedrequirements(repo):
70 def supportremovedrequirements(repo):
71 """Obtain requirements that can be removed during an upgrade.
71 """Obtain requirements that can be removed during an upgrade.
72
72
73 If an upgrade were to create a repository that dropped a requirement,
73 If an upgrade were to create a repository that dropped a requirement,
74 the dropped requirement must appear in the returned set for the upgrade
74 the dropped requirement must appear in the returned set for the upgrade
75 to be allowed.
75 to be allowed.
76 """
76 """
77 supported = {
77 supported = {
78 localrepo.SPARSEREVLOG_REQUIREMENT,
78 localrepo.SPARSEREVLOG_REQUIREMENT,
79 localrepo.SIDEDATA_REQUIREMENT,
79 localrepo.SIDEDATA_REQUIREMENT,
80 }
80 }
81 for name in compression.compengines:
81 for name in compression.compengines:
82 engine = compression.compengines[name]
82 engine = compression.compengines[name]
83 if engine.available() and engine.revlogheader():
83 if engine.available() and engine.revlogheader():
84 supported.add(b'exp-compression-%s' % name)
84 supported.add(b'exp-compression-%s' % name)
85 if engine.name() == b'zstd':
85 if engine.name() == b'zstd':
86 supported.add(b'revlog-compression-zstd')
86 supported.add(b'revlog-compression-zstd')
87 return supported
87 return supported
88
88
89
89
90 def supporteddestrequirements(repo):
90 def supporteddestrequirements(repo):
91 """Obtain requirements that upgrade supports in the destination.
91 """Obtain requirements that upgrade supports in the destination.
92
92
93 If the result of the upgrade would create requirements not in this set,
93 If the result of the upgrade would create requirements not in this set,
94 the upgrade is disallowed.
94 the upgrade is disallowed.
95
95
96 Extensions should monkeypatch this to add their custom requirements.
96 Extensions should monkeypatch this to add their custom requirements.
97 """
97 """
98 supported = {
98 supported = {
99 b'dotencode',
99 b'dotencode',
100 b'fncache',
100 b'fncache',
101 b'generaldelta',
101 b'generaldelta',
102 b'revlogv1',
102 b'revlogv1',
103 b'store',
103 b'store',
104 localrepo.SPARSEREVLOG_REQUIREMENT,
104 localrepo.SPARSEREVLOG_REQUIREMENT,
105 localrepo.SIDEDATA_REQUIREMENT,
105 localrepo.SIDEDATA_REQUIREMENT,
106 }
106 }
107 for name in compression.compengines:
107 for name in compression.compengines:
108 engine = compression.compengines[name]
108 engine = compression.compengines[name]
109 if engine.available() and engine.revlogheader():
109 if engine.available() and engine.revlogheader():
110 supported.add(b'exp-compression-%s' % name)
110 supported.add(b'exp-compression-%s' % name)
111 if engine.name() == b'zstd':
111 if engine.name() == b'zstd':
112 supported.add(b'revlog-compression-zstd')
112 supported.add(b'revlog-compression-zstd')
113 return supported
113 return supported
114
114
115
115
116 def allowednewrequirements(repo):
116 def allowednewrequirements(repo):
117 """Obtain requirements that can be added to a repository during upgrade.
117 """Obtain requirements that can be added to a repository during upgrade.
118
118
119 This is used to disallow proposed requirements from being added when
119 This is used to disallow proposed requirements from being added when
120 they weren't present before.
120 they weren't present before.
121
121
122 We use a list of allowed requirement additions instead of a list of known
122 We use a list of allowed requirement additions instead of a list of known
123 bad additions because the whitelist approach is safer and will prevent
123 bad additions because the whitelist approach is safer and will prevent
124 future, unknown requirements from accidentally being added.
124 future, unknown requirements from accidentally being added.
125 """
125 """
126 supported = {
126 supported = {
127 b'dotencode',
127 b'dotencode',
128 b'fncache',
128 b'fncache',
129 b'generaldelta',
129 b'generaldelta',
130 localrepo.SPARSEREVLOG_REQUIREMENT,
130 localrepo.SPARSEREVLOG_REQUIREMENT,
131 localrepo.SIDEDATA_REQUIREMENT,
131 localrepo.SIDEDATA_REQUIREMENT,
132 }
132 }
133 for name in compression.compengines:
133 for name in compression.compengines:
134 engine = compression.compengines[name]
134 engine = compression.compengines[name]
135 if engine.available() and engine.revlogheader():
135 if engine.available() and engine.revlogheader():
136 supported.add(b'exp-compression-%s' % name)
136 supported.add(b'exp-compression-%s' % name)
137 if engine.name() == b'zstd':
137 if engine.name() == b'zstd':
138 supported.add(b'revlog-compression-zstd')
138 supported.add(b'revlog-compression-zstd')
139 return supported
139 return supported
140
140
141
141
142 def preservedrequirements(repo):
142 def preservedrequirements(repo):
143 return set()
143 return set()
144
144
145
145
146 deficiency = b'deficiency'
146 deficiency = b'deficiency'
147 optimisation = b'optimization'
147 optimisation = b'optimization'
148
148
149
149
150 class improvement(object):
150 class improvement(object):
151 """Represents an improvement that can be made as part of an upgrade.
151 """Represents an improvement that can be made as part of an upgrade.
152
152
153 The following attributes are defined on each instance:
153 The following attributes are defined on each instance:
154
154
155 name
155 name
156 Machine-readable string uniquely identifying this improvement. It
156 Machine-readable string uniquely identifying this improvement. It
157 will be mapped to an action later in the upgrade process.
157 will be mapped to an action later in the upgrade process.
158
158
159 type
159 type
160 Either ``deficiency`` or ``optimisation``. A deficiency is an obvious
160 Either ``deficiency`` or ``optimisation``. A deficiency is an obvious
161 problem. An optimization is an action (sometimes optional) that
161 problem. An optimization is an action (sometimes optional) that
162 can be taken to further improve the state of the repository.
162 can be taken to further improve the state of the repository.
163
163
164 description
164 description
165 Message intended for humans explaining the improvement in more detail,
165 Message intended for humans explaining the improvement in more detail,
166 including the implications of it. For ``deficiency`` types, should be
166 including the implications of it. For ``deficiency`` types, should be
167 worded in the present tense. For ``optimisation`` types, should be
167 worded in the present tense. For ``optimisation`` types, should be
168 worded in the future tense.
168 worded in the future tense.
169
169
170 upgrademessage
170 upgrademessage
171 Message intended for humans explaining what an upgrade addressing this
171 Message intended for humans explaining what an upgrade addressing this
172 issue will do. Should be worded in the future tense.
172 issue will do. Should be worded in the future tense.
173 """
173 """
174
174
175 def __init__(self, name, type, description, upgrademessage):
175 def __init__(self, name, type, description, upgrademessage):
176 self.name = name
176 self.name = name
177 self.type = type
177 self.type = type
178 self.description = description
178 self.description = description
179 self.upgrademessage = upgrademessage
179 self.upgrademessage = upgrademessage
180
180
181 def __eq__(self, other):
181 def __eq__(self, other):
182 if not isinstance(other, improvement):
182 if not isinstance(other, improvement):
183 # This is what python tell use to do
183 # This is what python tell use to do
184 return NotImplemented
184 return NotImplemented
185 return self.name == other.name
185 return self.name == other.name
186
186
187 def __ne__(self, other):
187 def __ne__(self, other):
188 return not (self == other)
188 return not (self == other)
189
189
190 def __hash__(self):
190 def __hash__(self):
191 return hash(self.name)
191 return hash(self.name)
192
192
193
193
194 allformatvariant = []
194 allformatvariant = []
195
195
196
196
197 def registerformatvariant(cls):
197 def registerformatvariant(cls):
198 allformatvariant.append(cls)
198 allformatvariant.append(cls)
199 return cls
199 return cls
200
200
201
201
202 class formatvariant(improvement):
202 class formatvariant(improvement):
203 """an improvement subclass dedicated to repository format"""
203 """an improvement subclass dedicated to repository format"""
204
204
205 type = deficiency
205 type = deficiency
206 ### The following attributes should be defined for each class:
206 ### The following attributes should be defined for each class:
207
207
208 # machine-readable string uniquely identifying this improvement. it will be
208 # machine-readable string uniquely identifying this improvement. it will be
209 # mapped to an action later in the upgrade process.
209 # mapped to an action later in the upgrade process.
210 name = None
210 name = None
211
211
212 # message intended for humans explaining the improvement in more detail,
212 # message intended for humans explaining the improvement in more detail,
213 # including the implications of it ``deficiency`` types, should be worded
213 # including the implications of it ``deficiency`` types, should be worded
214 # in the present tense.
214 # in the present tense.
215 description = None
215 description = None
216
216
217 # message intended for humans explaining what an upgrade addressing this
217 # message intended for humans explaining what an upgrade addressing this
218 # issue will do. should be worded in the future tense.
218 # issue will do. should be worded in the future tense.
219 upgrademessage = None
219 upgrademessage = None
220
220
221 # value of current Mercurial default for new repository
221 # value of current Mercurial default for new repository
222 default = None
222 default = None
223
223
224 def __init__(self):
224 def __init__(self):
225 raise NotImplementedError()
225 raise NotImplementedError()
226
226
227 @staticmethod
227 @staticmethod
228 def fromrepo(repo):
228 def fromrepo(repo):
229 """current value of the variant in the repository"""
229 """current value of the variant in the repository"""
230 raise NotImplementedError()
230 raise NotImplementedError()
231
231
232 @staticmethod
232 @staticmethod
233 def fromconfig(repo):
233 def fromconfig(repo):
234 """current value of the variant in the configuration"""
234 """current value of the variant in the configuration"""
235 raise NotImplementedError()
235 raise NotImplementedError()
236
236
237
237
238 class requirementformatvariant(formatvariant):
238 class requirementformatvariant(formatvariant):
239 """formatvariant based on a 'requirement' name.
239 """formatvariant based on a 'requirement' name.
240
240
241 Many format variant are controlled by a 'requirement'. We define a small
241 Many format variant are controlled by a 'requirement'. We define a small
242 subclass to factor the code.
242 subclass to factor the code.
243 """
243 """
244
244
245 # the requirement that control this format variant
245 # the requirement that control this format variant
246 _requirement = None
246 _requirement = None
247
247
248 @staticmethod
248 @staticmethod
249 def _newreporequirements(ui):
249 def _newreporequirements(ui):
250 return localrepo.newreporequirements(
250 return localrepo.newreporequirements(
251 ui, localrepo.defaultcreateopts(ui)
251 ui, localrepo.defaultcreateopts(ui)
252 )
252 )
253
253
254 @classmethod
254 @classmethod
255 def fromrepo(cls, repo):
255 def fromrepo(cls, repo):
256 assert cls._requirement is not None
256 assert cls._requirement is not None
257 return cls._requirement in repo.requirements
257 return cls._requirement in repo.requirements
258
258
259 @classmethod
259 @classmethod
260 def fromconfig(cls, repo):
260 def fromconfig(cls, repo):
261 assert cls._requirement is not None
261 assert cls._requirement is not None
262 return cls._requirement in cls._newreporequirements(repo.ui)
262 return cls._requirement in cls._newreporequirements(repo.ui)
263
263
264
264
265 @registerformatvariant
265 @registerformatvariant
266 class fncache(requirementformatvariant):
266 class fncache(requirementformatvariant):
267 name = b'fncache'
267 name = b'fncache'
268
268
269 _requirement = b'fncache'
269 _requirement = b'fncache'
270
270
271 default = True
271 default = True
272
272
273 description = _(
273 description = _(
274 b'long and reserved filenames may not work correctly; '
274 b'long and reserved filenames may not work correctly; '
275 b'repository performance is sub-optimal'
275 b'repository performance is sub-optimal'
276 )
276 )
277
277
278 upgrademessage = _(
278 upgrademessage = _(
279 b'repository will be more resilient to storing '
279 b'repository will be more resilient to storing '
280 b'certain paths and performance of certain '
280 b'certain paths and performance of certain '
281 b'operations should be improved'
281 b'operations should be improved'
282 )
282 )
283
283
284
284
285 @registerformatvariant
285 @registerformatvariant
286 class dotencode(requirementformatvariant):
286 class dotencode(requirementformatvariant):
287 name = b'dotencode'
287 name = b'dotencode'
288
288
289 _requirement = b'dotencode'
289 _requirement = b'dotencode'
290
290
291 default = True
291 default = True
292
292
293 description = _(
293 description = _(
294 b'storage of filenames beginning with a period or '
294 b'storage of filenames beginning with a period or '
295 b'space may not work correctly'
295 b'space may not work correctly'
296 )
296 )
297
297
298 upgrademessage = _(
298 upgrademessage = _(
299 b'repository will be better able to store files '
299 b'repository will be better able to store files '
300 b'beginning with a space or period'
300 b'beginning with a space or period'
301 )
301 )
302
302
303
303
304 @registerformatvariant
304 @registerformatvariant
305 class generaldelta(requirementformatvariant):
305 class generaldelta(requirementformatvariant):
306 name = b'generaldelta'
306 name = b'generaldelta'
307
307
308 _requirement = b'generaldelta'
308 _requirement = b'generaldelta'
309
309
310 default = True
310 default = True
311
311
312 description = _(
312 description = _(
313 b'deltas within internal storage are unable to '
313 b'deltas within internal storage are unable to '
314 b'choose optimal revisions; repository is larger and '
314 b'choose optimal revisions; repository is larger and '
315 b'slower than it could be; interaction with other '
315 b'slower than it could be; interaction with other '
316 b'repositories may require extra network and CPU '
316 b'repositories may require extra network and CPU '
317 b'resources, making "hg push" and "hg pull" slower'
317 b'resources, making "hg push" and "hg pull" slower'
318 )
318 )
319
319
320 upgrademessage = _(
320 upgrademessage = _(
321 b'repository storage will be able to create '
321 b'repository storage will be able to create '
322 b'optimal deltas; new repository data will be '
322 b'optimal deltas; new repository data will be '
323 b'smaller and read times should decrease; '
323 b'smaller and read times should decrease; '
324 b'interacting with other repositories using this '
324 b'interacting with other repositories using this '
325 b'storage model should require less network and '
325 b'storage model should require less network and '
326 b'CPU resources, making "hg push" and "hg pull" '
326 b'CPU resources, making "hg push" and "hg pull" '
327 b'faster'
327 b'faster'
328 )
328 )
329
329
330
330
331 @registerformatvariant
331 @registerformatvariant
332 class sparserevlog(requirementformatvariant):
332 class sparserevlog(requirementformatvariant):
333 name = b'sparserevlog'
333 name = b'sparserevlog'
334
334
335 _requirement = localrepo.SPARSEREVLOG_REQUIREMENT
335 _requirement = localrepo.SPARSEREVLOG_REQUIREMENT
336
336
337 default = True
337 default = True
338
338
339 description = _(
339 description = _(
340 b'in order to limit disk reading and memory usage on older '
340 b'in order to limit disk reading and memory usage on older '
341 b'version, the span of a delta chain from its root to its '
341 b'version, the span of a delta chain from its root to its '
342 b'end is limited, whatever the relevant data in this span. '
342 b'end is limited, whatever the relevant data in this span. '
343 b'This can severly limit Mercurial ability to build good '
343 b'This can severly limit Mercurial ability to build good '
344 b'chain of delta resulting is much more storage space being '
344 b'chain of delta resulting is much more storage space being '
345 b'taken and limit reusability of on disk delta during '
345 b'taken and limit reusability of on disk delta during '
346 b'exchange.'
346 b'exchange.'
347 )
347 )
348
348
349 upgrademessage = _(
349 upgrademessage = _(
350 b'Revlog supports delta chain with more unused data '
350 b'Revlog supports delta chain with more unused data '
351 b'between payload. These gaps will be skipped at read '
351 b'between payload. These gaps will be skipped at read '
352 b'time. This allows for better delta chains, making a '
352 b'time. This allows for better delta chains, making a '
353 b'better compression and faster exchange with server.'
353 b'better compression and faster exchange with server.'
354 )
354 )
355
355
356
356
357 @registerformatvariant
357 @registerformatvariant
358 class sidedata(requirementformatvariant):
358 class sidedata(requirementformatvariant):
359 name = b'sidedata'
359 name = b'sidedata'
360
360
361 _requirement = localrepo.SIDEDATA_REQUIREMENT
361 _requirement = localrepo.SIDEDATA_REQUIREMENT
362
362
363 default = False
363 default = False
364
364
365 description = _(
365 description = _(
366 b'Allows storage of extra data alongside a revision, '
366 b'Allows storage of extra data alongside a revision, '
367 b'unlocking various caching options.'
367 b'unlocking various caching options.'
368 )
368 )
369
369
370 upgrademessage = _(b'Allows storage of extra data alongside a revision.')
370 upgrademessage = _(b'Allows storage of extra data alongside a revision.')
371
371
372
372
373 @registerformatvariant
373 @registerformatvariant
374 class copiessdc(requirementformatvariant):
375 name = b'copies-sdc'
376
377 _requirement = localrepo.COPIESSDC_REQUIREMENT
378
379 default = False
380
381 description = _(b'Stores copies information alongside changesets.')
382
383 upgrademessage = _(
384 b'Allows to use more efficient algorithm to deal with ' b'copy tracing.'
385 )
386
387
388 @registerformatvariant
374 class removecldeltachain(formatvariant):
389 class removecldeltachain(formatvariant):
375 name = b'plain-cl-delta'
390 name = b'plain-cl-delta'
376
391
377 default = True
392 default = True
378
393
379 description = _(
394 description = _(
380 b'changelog storage is using deltas instead of '
395 b'changelog storage is using deltas instead of '
381 b'raw entries; changelog reading and any '
396 b'raw entries; changelog reading and any '
382 b'operation relying on changelog data are slower '
397 b'operation relying on changelog data are slower '
383 b'than they could be'
398 b'than they could be'
384 )
399 )
385
400
386 upgrademessage = _(
401 upgrademessage = _(
387 b'changelog storage will be reformated to '
402 b'changelog storage will be reformated to '
388 b'store raw entries; changelog reading will be '
403 b'store raw entries; changelog reading will be '
389 b'faster; changelog size may be reduced'
404 b'faster; changelog size may be reduced'
390 )
405 )
391
406
392 @staticmethod
407 @staticmethod
393 def fromrepo(repo):
408 def fromrepo(repo):
394 # Mercurial 4.0 changed changelogs to not use delta chains. Search for
409 # Mercurial 4.0 changed changelogs to not use delta chains. Search for
395 # changelogs with deltas.
410 # changelogs with deltas.
396 cl = repo.changelog
411 cl = repo.changelog
397 chainbase = cl.chainbase
412 chainbase = cl.chainbase
398 return all(rev == chainbase(rev) for rev in cl)
413 return all(rev == chainbase(rev) for rev in cl)
399
414
400 @staticmethod
415 @staticmethod
401 def fromconfig(repo):
416 def fromconfig(repo):
402 return True
417 return True
403
418
404
419
405 @registerformatvariant
420 @registerformatvariant
406 class compressionengine(formatvariant):
421 class compressionengine(formatvariant):
407 name = b'compression'
422 name = b'compression'
408 default = b'zlib'
423 default = b'zlib'
409
424
410 description = _(
425 description = _(
411 b'Compresion algorithm used to compress data. '
426 b'Compresion algorithm used to compress data. '
412 b'Some engine are faster than other'
427 b'Some engine are faster than other'
413 )
428 )
414
429
415 upgrademessage = _(
430 upgrademessage = _(
416 b'revlog content will be recompressed with the new algorithm.'
431 b'revlog content will be recompressed with the new algorithm.'
417 )
432 )
418
433
419 @classmethod
434 @classmethod
420 def fromrepo(cls, repo):
435 def fromrepo(cls, repo):
421 # we allow multiple compression engine requirement to co-exist because
436 # we allow multiple compression engine requirement to co-exist because
422 # strickly speaking, revlog seems to support mixed compression style.
437 # strickly speaking, revlog seems to support mixed compression style.
423 #
438 #
424 # The compression used for new entries will be "the last one"
439 # The compression used for new entries will be "the last one"
425 compression = b'zlib'
440 compression = b'zlib'
426 for req in repo.requirements:
441 for req in repo.requirements:
427 prefix = req.startswith
442 prefix = req.startswith
428 if prefix(b'revlog-compression-') or prefix(b'exp-compression-'):
443 if prefix(b'revlog-compression-') or prefix(b'exp-compression-'):
429 compression = req.split(b'-', 2)[2]
444 compression = req.split(b'-', 2)[2]
430 return compression
445 return compression
431
446
432 @classmethod
447 @classmethod
433 def fromconfig(cls, repo):
448 def fromconfig(cls, repo):
434 return repo.ui.config(b'format', b'revlog-compression')
449 return repo.ui.config(b'format', b'revlog-compression')
435
450
436
451
437 @registerformatvariant
452 @registerformatvariant
438 class compressionlevel(formatvariant):
453 class compressionlevel(formatvariant):
439 name = b'compression-level'
454 name = b'compression-level'
440 default = b'default'
455 default = b'default'
441
456
442 description = _(b'compression level')
457 description = _(b'compression level')
443
458
444 upgrademessage = _(b'revlog content will be recompressed')
459 upgrademessage = _(b'revlog content will be recompressed')
445
460
446 @classmethod
461 @classmethod
447 def fromrepo(cls, repo):
462 def fromrepo(cls, repo):
448 comp = compressionengine.fromrepo(repo)
463 comp = compressionengine.fromrepo(repo)
449 level = None
464 level = None
450 if comp == b'zlib':
465 if comp == b'zlib':
451 level = repo.ui.configint(b'storage', b'revlog.zlib.level')
466 level = repo.ui.configint(b'storage', b'revlog.zlib.level')
452 elif comp == b'zstd':
467 elif comp == b'zstd':
453 level = repo.ui.configint(b'storage', b'revlog.zstd.level')
468 level = repo.ui.configint(b'storage', b'revlog.zstd.level')
454 if level is None:
469 if level is None:
455 return b'default'
470 return b'default'
456 return bytes(level)
471 return bytes(level)
457
472
458 @classmethod
473 @classmethod
459 def fromconfig(cls, repo):
474 def fromconfig(cls, repo):
460 comp = compressionengine.fromconfig(repo)
475 comp = compressionengine.fromconfig(repo)
461 level = None
476 level = None
462 if comp == b'zlib':
477 if comp == b'zlib':
463 level = repo.ui.configint(b'storage', b'revlog.zlib.level')
478 level = repo.ui.configint(b'storage', b'revlog.zlib.level')
464 elif comp == b'zstd':
479 elif comp == b'zstd':
465 level = repo.ui.configint(b'storage', b'revlog.zstd.level')
480 level = repo.ui.configint(b'storage', b'revlog.zstd.level')
466 if level is None:
481 if level is None:
467 return b'default'
482 return b'default'
468 return bytes(level)
483 return bytes(level)
469
484
470
485
471 def finddeficiencies(repo):
486 def finddeficiencies(repo):
472 """returns a list of deficiencies that the repo suffer from"""
487 """returns a list of deficiencies that the repo suffer from"""
473 deficiencies = []
488 deficiencies = []
474
489
475 # We could detect lack of revlogv1 and store here, but they were added
490 # We could detect lack of revlogv1 and store here, but they were added
476 # in 0.9.2 and we don't support upgrading repos without these
491 # in 0.9.2 and we don't support upgrading repos without these
477 # requirements, so let's not bother.
492 # requirements, so let's not bother.
478
493
479 for fv in allformatvariant:
494 for fv in allformatvariant:
480 if not fv.fromrepo(repo):
495 if not fv.fromrepo(repo):
481 deficiencies.append(fv)
496 deficiencies.append(fv)
482
497
483 return deficiencies
498 return deficiencies
484
499
485
500
486 # search without '-' to support older form on newer client.
501 # search without '-' to support older form on newer client.
487 #
502 #
488 # We don't enforce backward compatibility for debug command so this
503 # We don't enforce backward compatibility for debug command so this
489 # might eventually be dropped. However, having to use two different
504 # might eventually be dropped. However, having to use two different
490 # forms in script when comparing result is anoying enough to add
505 # forms in script when comparing result is anoying enough to add
491 # backward compatibility for a while.
506 # backward compatibility for a while.
492 legacy_opts_map = {
507 legacy_opts_map = {
493 b'redeltaparent': b're-delta-parent',
508 b'redeltaparent': b're-delta-parent',
494 b'redeltamultibase': b're-delta-multibase',
509 b'redeltamultibase': b're-delta-multibase',
495 b'redeltaall': b're-delta-all',
510 b'redeltaall': b're-delta-all',
496 b'redeltafulladd': b're-delta-fulladd',
511 b'redeltafulladd': b're-delta-fulladd',
497 }
512 }
498
513
499
514
500 def findoptimizations(repo):
515 def findoptimizations(repo):
501 """Determine optimisation that could be used during upgrade"""
516 """Determine optimisation that could be used during upgrade"""
502 # These are unconditionally added. There is logic later that figures out
517 # These are unconditionally added. There is logic later that figures out
503 # which ones to apply.
518 # which ones to apply.
504 optimizations = []
519 optimizations = []
505
520
506 optimizations.append(
521 optimizations.append(
507 improvement(
522 improvement(
508 name=b're-delta-parent',
523 name=b're-delta-parent',
509 type=optimisation,
524 type=optimisation,
510 description=_(
525 description=_(
511 b'deltas within internal storage will be recalculated to '
526 b'deltas within internal storage will be recalculated to '
512 b'choose an optimal base revision where this was not '
527 b'choose an optimal base revision where this was not '
513 b'already done; the size of the repository may shrink and '
528 b'already done; the size of the repository may shrink and '
514 b'various operations may become faster; the first time '
529 b'various operations may become faster; the first time '
515 b'this optimization is performed could slow down upgrade '
530 b'this optimization is performed could slow down upgrade '
516 b'execution considerably; subsequent invocations should '
531 b'execution considerably; subsequent invocations should '
517 b'not run noticeably slower'
532 b'not run noticeably slower'
518 ),
533 ),
519 upgrademessage=_(
534 upgrademessage=_(
520 b'deltas within internal storage will choose a new '
535 b'deltas within internal storage will choose a new '
521 b'base revision if needed'
536 b'base revision if needed'
522 ),
537 ),
523 )
538 )
524 )
539 )
525
540
526 optimizations.append(
541 optimizations.append(
527 improvement(
542 improvement(
528 name=b're-delta-multibase',
543 name=b're-delta-multibase',
529 type=optimisation,
544 type=optimisation,
530 description=_(
545 description=_(
531 b'deltas within internal storage will be recalculated '
546 b'deltas within internal storage will be recalculated '
532 b'against multiple base revision and the smallest '
547 b'against multiple base revision and the smallest '
533 b'difference will be used; the size of the repository may '
548 b'difference will be used; the size of the repository may '
534 b'shrink significantly when there are many merges; this '
549 b'shrink significantly when there are many merges; this '
535 b'optimization will slow down execution in proportion to '
550 b'optimization will slow down execution in proportion to '
536 b'the number of merges in the repository and the amount '
551 b'the number of merges in the repository and the amount '
537 b'of files in the repository; this slow down should not '
552 b'of files in the repository; this slow down should not '
538 b'be significant unless there are tens of thousands of '
553 b'be significant unless there are tens of thousands of '
539 b'files and thousands of merges'
554 b'files and thousands of merges'
540 ),
555 ),
541 upgrademessage=_(
556 upgrademessage=_(
542 b'deltas within internal storage will choose an '
557 b'deltas within internal storage will choose an '
543 b'optimal delta by computing deltas against multiple '
558 b'optimal delta by computing deltas against multiple '
544 b'parents; may slow down execution time '
559 b'parents; may slow down execution time '
545 b'significantly'
560 b'significantly'
546 ),
561 ),
547 )
562 )
548 )
563 )
549
564
550 optimizations.append(
565 optimizations.append(
551 improvement(
566 improvement(
552 name=b're-delta-all',
567 name=b're-delta-all',
553 type=optimisation,
568 type=optimisation,
554 description=_(
569 description=_(
555 b'deltas within internal storage will always be '
570 b'deltas within internal storage will always be '
556 b'recalculated without reusing prior deltas; this will '
571 b'recalculated without reusing prior deltas; this will '
557 b'likely make execution run several times slower; this '
572 b'likely make execution run several times slower; this '
558 b'optimization is typically not needed'
573 b'optimization is typically not needed'
559 ),
574 ),
560 upgrademessage=_(
575 upgrademessage=_(
561 b'deltas within internal storage will be fully '
576 b'deltas within internal storage will be fully '
562 b'recomputed; this will likely drastically slow down '
577 b'recomputed; this will likely drastically slow down '
563 b'execution time'
578 b'execution time'
564 ),
579 ),
565 )
580 )
566 )
581 )
567
582
568 optimizations.append(
583 optimizations.append(
569 improvement(
584 improvement(
570 name=b're-delta-fulladd',
585 name=b're-delta-fulladd',
571 type=optimisation,
586 type=optimisation,
572 description=_(
587 description=_(
573 b'every revision will be re-added as if it was new '
588 b'every revision will be re-added as if it was new '
574 b'content. It will go through the full storage '
589 b'content. It will go through the full storage '
575 b'mechanism giving extensions a chance to process it '
590 b'mechanism giving extensions a chance to process it '
576 b'(eg. lfs). This is similar to "re-delta-all" but even '
591 b'(eg. lfs). This is similar to "re-delta-all" but even '
577 b'slower since more logic is involved.'
592 b'slower since more logic is involved.'
578 ),
593 ),
579 upgrademessage=_(
594 upgrademessage=_(
580 b'each revision will be added as new content to the '
595 b'each revision will be added as new content to the '
581 b'internal storage; this will likely drastically slow '
596 b'internal storage; this will likely drastically slow '
582 b'down execution time, but some extensions might need '
597 b'down execution time, but some extensions might need '
583 b'it'
598 b'it'
584 ),
599 ),
585 )
600 )
586 )
601 )
587
602
588 return optimizations
603 return optimizations
589
604
590
605
591 def determineactions(repo, deficiencies, sourcereqs, destreqs):
606 def determineactions(repo, deficiencies, sourcereqs, destreqs):
592 """Determine upgrade actions that will be performed.
607 """Determine upgrade actions that will be performed.
593
608
594 Given a list of improvements as returned by ``finddeficiencies`` and
609 Given a list of improvements as returned by ``finddeficiencies`` and
595 ``findoptimizations``, determine the list of upgrade actions that
610 ``findoptimizations``, determine the list of upgrade actions that
596 will be performed.
611 will be performed.
597
612
598 The role of this function is to filter improvements if needed, apply
613 The role of this function is to filter improvements if needed, apply
599 recommended optimizations from the improvements list that make sense,
614 recommended optimizations from the improvements list that make sense,
600 etc.
615 etc.
601
616
602 Returns a list of action names.
617 Returns a list of action names.
603 """
618 """
604 newactions = []
619 newactions = []
605
620
606 knownreqs = supporteddestrequirements(repo)
621 knownreqs = supporteddestrequirements(repo)
607
622
608 for d in deficiencies:
623 for d in deficiencies:
609 name = d.name
624 name = d.name
610
625
611 # If the action is a requirement that doesn't show up in the
626 # If the action is a requirement that doesn't show up in the
612 # destination requirements, prune the action.
627 # destination requirements, prune the action.
613 if name in knownreqs and name not in destreqs:
628 if name in knownreqs and name not in destreqs:
614 continue
629 continue
615
630
616 newactions.append(d)
631 newactions.append(d)
617
632
618 # FUTURE consider adding some optimizations here for certain transitions.
633 # FUTURE consider adding some optimizations here for certain transitions.
619 # e.g. adding generaldelta could schedule parent redeltas.
634 # e.g. adding generaldelta could schedule parent redeltas.
620
635
621 return newactions
636 return newactions
622
637
623
638
624 def _revlogfrompath(repo, path):
639 def _revlogfrompath(repo, path):
625 """Obtain a revlog from a repo path.
640 """Obtain a revlog from a repo path.
626
641
627 An instance of the appropriate class is returned.
642 An instance of the appropriate class is returned.
628 """
643 """
629 if path == b'00changelog.i':
644 if path == b'00changelog.i':
630 return changelog.changelog(repo.svfs)
645 return changelog.changelog(repo.svfs)
631 elif path.endswith(b'00manifest.i'):
646 elif path.endswith(b'00manifest.i'):
632 mandir = path[: -len(b'00manifest.i')]
647 mandir = path[: -len(b'00manifest.i')]
633 return manifest.manifestrevlog(repo.svfs, tree=mandir)
648 return manifest.manifestrevlog(repo.svfs, tree=mandir)
634 else:
649 else:
635 # reverse of "/".join(("data", path + ".i"))
650 # reverse of "/".join(("data", path + ".i"))
636 return filelog.filelog(repo.svfs, path[5:-2])
651 return filelog.filelog(repo.svfs, path[5:-2])
637
652
638
653
639 def _copyrevlog(tr, destrepo, oldrl, unencodedname):
654 def _copyrevlog(tr, destrepo, oldrl, unencodedname):
640 """copy all relevant files for `oldrl` into `destrepo` store
655 """copy all relevant files for `oldrl` into `destrepo` store
641
656
642 Files are copied "as is" without any transformation. The copy is performed
657 Files are copied "as is" without any transformation. The copy is performed
643 without extra checks. Callers are responsible for making sure the copied
658 without extra checks. Callers are responsible for making sure the copied
644 content is compatible with format of the destination repository.
659 content is compatible with format of the destination repository.
645 """
660 """
646 oldrl = getattr(oldrl, '_revlog', oldrl)
661 oldrl = getattr(oldrl, '_revlog', oldrl)
647 newrl = _revlogfrompath(destrepo, unencodedname)
662 newrl = _revlogfrompath(destrepo, unencodedname)
648 newrl = getattr(newrl, '_revlog', newrl)
663 newrl = getattr(newrl, '_revlog', newrl)
649
664
650 oldvfs = oldrl.opener
665 oldvfs = oldrl.opener
651 newvfs = newrl.opener
666 newvfs = newrl.opener
652 oldindex = oldvfs.join(oldrl.indexfile)
667 oldindex = oldvfs.join(oldrl.indexfile)
653 newindex = newvfs.join(newrl.indexfile)
668 newindex = newvfs.join(newrl.indexfile)
654 olddata = oldvfs.join(oldrl.datafile)
669 olddata = oldvfs.join(oldrl.datafile)
655 newdata = newvfs.join(newrl.datafile)
670 newdata = newvfs.join(newrl.datafile)
656
671
657 with newvfs(newrl.indexfile, b'w'):
672 with newvfs(newrl.indexfile, b'w'):
658 pass # create all the directories
673 pass # create all the directories
659
674
660 util.copyfile(oldindex, newindex)
675 util.copyfile(oldindex, newindex)
661 copydata = oldrl.opener.exists(oldrl.datafile)
676 copydata = oldrl.opener.exists(oldrl.datafile)
662 if copydata:
677 if copydata:
663 util.copyfile(olddata, newdata)
678 util.copyfile(olddata, newdata)
664
679
665 if not (
680 if not (
666 unencodedname.endswith(b'00changelog.i')
681 unencodedname.endswith(b'00changelog.i')
667 or unencodedname.endswith(b'00manifest.i')
682 or unencodedname.endswith(b'00manifest.i')
668 ):
683 ):
669 destrepo.svfs.fncache.add(unencodedname)
684 destrepo.svfs.fncache.add(unencodedname)
670 if copydata:
685 if copydata:
671 destrepo.svfs.fncache.add(unencodedname[:-2] + b'.d')
686 destrepo.svfs.fncache.add(unencodedname[:-2] + b'.d')
672
687
673
688
674 UPGRADE_CHANGELOG = object()
689 UPGRADE_CHANGELOG = object()
675 UPGRADE_MANIFEST = object()
690 UPGRADE_MANIFEST = object()
676 UPGRADE_FILELOG = object()
691 UPGRADE_FILELOG = object()
677
692
678 UPGRADE_ALL_REVLOGS = frozenset(
693 UPGRADE_ALL_REVLOGS = frozenset(
679 [UPGRADE_CHANGELOG, UPGRADE_MANIFEST, UPGRADE_FILELOG]
694 [UPGRADE_CHANGELOG, UPGRADE_MANIFEST, UPGRADE_FILELOG]
680 )
695 )
681
696
682
697
683 def getsidedatacompanion(srcrepo, dstrepo):
698 def getsidedatacompanion(srcrepo, dstrepo):
684 sidedatacompanion = None
699 sidedatacompanion = None
685 removedreqs = srcrepo.requirements - dstrepo.requirements
700 removedreqs = srcrepo.requirements - dstrepo.requirements
686 if localrepo.SIDEDATA_REQUIREMENT in removedreqs:
701 if localrepo.SIDEDATA_REQUIREMENT in removedreqs:
687
702
688 def sidedatacompanion(rl, rev):
703 def sidedatacompanion(rl, rev):
689 rl = getattr(rl, '_revlog', rl)
704 rl = getattr(rl, '_revlog', rl)
690 if rl.flags(rev) & revlog.REVIDX_SIDEDATA:
705 if rl.flags(rev) & revlog.REVIDX_SIDEDATA:
691 return True, (), {}
706 return True, (), {}
692 return False, (), {}
707 return False, (), {}
693
708
694 return sidedatacompanion
709 return sidedatacompanion
695
710
696
711
697 def matchrevlog(revlogfilter, entry):
712 def matchrevlog(revlogfilter, entry):
698 """check is a revlog is selected for cloning
713 """check is a revlog is selected for cloning
699
714
700 The store entry is checked against the passed filter"""
715 The store entry is checked against the passed filter"""
701 if entry.endswith(b'00changelog.i'):
716 if entry.endswith(b'00changelog.i'):
702 return UPGRADE_CHANGELOG in revlogfilter
717 return UPGRADE_CHANGELOG in revlogfilter
703 elif entry.endswith(b'00manifest.i'):
718 elif entry.endswith(b'00manifest.i'):
704 return UPGRADE_MANIFEST in revlogfilter
719 return UPGRADE_MANIFEST in revlogfilter
705 return UPGRADE_FILELOG in revlogfilter
720 return UPGRADE_FILELOG in revlogfilter
706
721
707
722
708 def _clonerevlogs(
723 def _clonerevlogs(
709 ui,
724 ui,
710 srcrepo,
725 srcrepo,
711 dstrepo,
726 dstrepo,
712 tr,
727 tr,
713 deltareuse,
728 deltareuse,
714 forcedeltabothparents,
729 forcedeltabothparents,
715 revlogs=UPGRADE_ALL_REVLOGS,
730 revlogs=UPGRADE_ALL_REVLOGS,
716 ):
731 ):
717 """Copy revlogs between 2 repos."""
732 """Copy revlogs between 2 repos."""
718 revcount = 0
733 revcount = 0
719 srcsize = 0
734 srcsize = 0
720 srcrawsize = 0
735 srcrawsize = 0
721 dstsize = 0
736 dstsize = 0
722 fcount = 0
737 fcount = 0
723 frevcount = 0
738 frevcount = 0
724 fsrcsize = 0
739 fsrcsize = 0
725 frawsize = 0
740 frawsize = 0
726 fdstsize = 0
741 fdstsize = 0
727 mcount = 0
742 mcount = 0
728 mrevcount = 0
743 mrevcount = 0
729 msrcsize = 0
744 msrcsize = 0
730 mrawsize = 0
745 mrawsize = 0
731 mdstsize = 0
746 mdstsize = 0
732 crevcount = 0
747 crevcount = 0
733 csrcsize = 0
748 csrcsize = 0
734 crawsize = 0
749 crawsize = 0
735 cdstsize = 0
750 cdstsize = 0
736
751
737 alldatafiles = list(srcrepo.store.walk())
752 alldatafiles = list(srcrepo.store.walk())
738
753
739 # Perform a pass to collect metadata. This validates we can open all
754 # Perform a pass to collect metadata. This validates we can open all
740 # source files and allows a unified progress bar to be displayed.
755 # source files and allows a unified progress bar to be displayed.
741 for unencoded, encoded, size in alldatafiles:
756 for unencoded, encoded, size in alldatafiles:
742 if unencoded.endswith(b'.d'):
757 if unencoded.endswith(b'.d'):
743 continue
758 continue
744
759
745 rl = _revlogfrompath(srcrepo, unencoded)
760 rl = _revlogfrompath(srcrepo, unencoded)
746
761
747 info = rl.storageinfo(
762 info = rl.storageinfo(
748 exclusivefiles=True,
763 exclusivefiles=True,
749 revisionscount=True,
764 revisionscount=True,
750 trackedsize=True,
765 trackedsize=True,
751 storedsize=True,
766 storedsize=True,
752 )
767 )
753
768
754 revcount += info[b'revisionscount'] or 0
769 revcount += info[b'revisionscount'] or 0
755 datasize = info[b'storedsize'] or 0
770 datasize = info[b'storedsize'] or 0
756 rawsize = info[b'trackedsize'] or 0
771 rawsize = info[b'trackedsize'] or 0
757
772
758 srcsize += datasize
773 srcsize += datasize
759 srcrawsize += rawsize
774 srcrawsize += rawsize
760
775
761 # This is for the separate progress bars.
776 # This is for the separate progress bars.
762 if isinstance(rl, changelog.changelog):
777 if isinstance(rl, changelog.changelog):
763 crevcount += len(rl)
778 crevcount += len(rl)
764 csrcsize += datasize
779 csrcsize += datasize
765 crawsize += rawsize
780 crawsize += rawsize
766 elif isinstance(rl, manifest.manifestrevlog):
781 elif isinstance(rl, manifest.manifestrevlog):
767 mcount += 1
782 mcount += 1
768 mrevcount += len(rl)
783 mrevcount += len(rl)
769 msrcsize += datasize
784 msrcsize += datasize
770 mrawsize += rawsize
785 mrawsize += rawsize
771 elif isinstance(rl, filelog.filelog):
786 elif isinstance(rl, filelog.filelog):
772 fcount += 1
787 fcount += 1
773 frevcount += len(rl)
788 frevcount += len(rl)
774 fsrcsize += datasize
789 fsrcsize += datasize
775 frawsize += rawsize
790 frawsize += rawsize
776 else:
791 else:
777 error.ProgrammingError(b'unknown revlog type')
792 error.ProgrammingError(b'unknown revlog type')
778
793
779 if not revcount:
794 if not revcount:
780 return
795 return
781
796
782 ui.write(
797 ui.write(
783 _(
798 _(
784 b'migrating %d total revisions (%d in filelogs, %d in manifests, '
799 b'migrating %d total revisions (%d in filelogs, %d in manifests, '
785 b'%d in changelog)\n'
800 b'%d in changelog)\n'
786 )
801 )
787 % (revcount, frevcount, mrevcount, crevcount)
802 % (revcount, frevcount, mrevcount, crevcount)
788 )
803 )
789 ui.write(
804 ui.write(
790 _(b'migrating %s in store; %s tracked data\n')
805 _(b'migrating %s in store; %s tracked data\n')
791 % ((util.bytecount(srcsize), util.bytecount(srcrawsize)))
806 % ((util.bytecount(srcsize), util.bytecount(srcrawsize)))
792 )
807 )
793
808
794 # Used to keep track of progress.
809 # Used to keep track of progress.
795 progress = None
810 progress = None
796
811
797 def oncopiedrevision(rl, rev, node):
812 def oncopiedrevision(rl, rev, node):
798 progress.increment()
813 progress.increment()
799
814
800 sidedatacompanion = getsidedatacompanion(srcrepo, dstrepo)
815 sidedatacompanion = getsidedatacompanion(srcrepo, dstrepo)
801
816
802 # Do the actual copying.
817 # Do the actual copying.
803 # FUTURE this operation can be farmed off to worker processes.
818 # FUTURE this operation can be farmed off to worker processes.
804 seen = set()
819 seen = set()
805 for unencoded, encoded, size in alldatafiles:
820 for unencoded, encoded, size in alldatafiles:
806 if unencoded.endswith(b'.d'):
821 if unencoded.endswith(b'.d'):
807 continue
822 continue
808
823
809 oldrl = _revlogfrompath(srcrepo, unencoded)
824 oldrl = _revlogfrompath(srcrepo, unencoded)
810
825
811 if isinstance(oldrl, changelog.changelog) and b'c' not in seen:
826 if isinstance(oldrl, changelog.changelog) and b'c' not in seen:
812 ui.write(
827 ui.write(
813 _(
828 _(
814 b'finished migrating %d manifest revisions across %d '
829 b'finished migrating %d manifest revisions across %d '
815 b'manifests; change in size: %s\n'
830 b'manifests; change in size: %s\n'
816 )
831 )
817 % (mrevcount, mcount, util.bytecount(mdstsize - msrcsize))
832 % (mrevcount, mcount, util.bytecount(mdstsize - msrcsize))
818 )
833 )
819
834
820 ui.write(
835 ui.write(
821 _(
836 _(
822 b'migrating changelog containing %d revisions '
837 b'migrating changelog containing %d revisions '
823 b'(%s in store; %s tracked data)\n'
838 b'(%s in store; %s tracked data)\n'
824 )
839 )
825 % (
840 % (
826 crevcount,
841 crevcount,
827 util.bytecount(csrcsize),
842 util.bytecount(csrcsize),
828 util.bytecount(crawsize),
843 util.bytecount(crawsize),
829 )
844 )
830 )
845 )
831 seen.add(b'c')
846 seen.add(b'c')
832 progress = srcrepo.ui.makeprogress(
847 progress = srcrepo.ui.makeprogress(
833 _(b'changelog revisions'), total=crevcount
848 _(b'changelog revisions'), total=crevcount
834 )
849 )
835 elif isinstance(oldrl, manifest.manifestrevlog) and b'm' not in seen:
850 elif isinstance(oldrl, manifest.manifestrevlog) and b'm' not in seen:
836 ui.write(
851 ui.write(
837 _(
852 _(
838 b'finished migrating %d filelog revisions across %d '
853 b'finished migrating %d filelog revisions across %d '
839 b'filelogs; change in size: %s\n'
854 b'filelogs; change in size: %s\n'
840 )
855 )
841 % (frevcount, fcount, util.bytecount(fdstsize - fsrcsize))
856 % (frevcount, fcount, util.bytecount(fdstsize - fsrcsize))
842 )
857 )
843
858
844 ui.write(
859 ui.write(
845 _(
860 _(
846 b'migrating %d manifests containing %d revisions '
861 b'migrating %d manifests containing %d revisions '
847 b'(%s in store; %s tracked data)\n'
862 b'(%s in store; %s tracked data)\n'
848 )
863 )
849 % (
864 % (
850 mcount,
865 mcount,
851 mrevcount,
866 mrevcount,
852 util.bytecount(msrcsize),
867 util.bytecount(msrcsize),
853 util.bytecount(mrawsize),
868 util.bytecount(mrawsize),
854 )
869 )
855 )
870 )
856 seen.add(b'm')
871 seen.add(b'm')
857 if progress:
872 if progress:
858 progress.complete()
873 progress.complete()
859 progress = srcrepo.ui.makeprogress(
874 progress = srcrepo.ui.makeprogress(
860 _(b'manifest revisions'), total=mrevcount
875 _(b'manifest revisions'), total=mrevcount
861 )
876 )
862 elif b'f' not in seen:
877 elif b'f' not in seen:
863 ui.write(
878 ui.write(
864 _(
879 _(
865 b'migrating %d filelogs containing %d revisions '
880 b'migrating %d filelogs containing %d revisions '
866 b'(%s in store; %s tracked data)\n'
881 b'(%s in store; %s tracked data)\n'
867 )
882 )
868 % (
883 % (
869 fcount,
884 fcount,
870 frevcount,
885 frevcount,
871 util.bytecount(fsrcsize),
886 util.bytecount(fsrcsize),
872 util.bytecount(frawsize),
887 util.bytecount(frawsize),
873 )
888 )
874 )
889 )
875 seen.add(b'f')
890 seen.add(b'f')
876 if progress:
891 if progress:
877 progress.complete()
892 progress.complete()
878 progress = srcrepo.ui.makeprogress(
893 progress = srcrepo.ui.makeprogress(
879 _(b'file revisions'), total=frevcount
894 _(b'file revisions'), total=frevcount
880 )
895 )
881
896
882 if matchrevlog(revlogs, unencoded):
897 if matchrevlog(revlogs, unencoded):
883 ui.note(
898 ui.note(
884 _(b'cloning %d revisions from %s\n') % (len(oldrl), unencoded)
899 _(b'cloning %d revisions from %s\n') % (len(oldrl), unencoded)
885 )
900 )
886 newrl = _revlogfrompath(dstrepo, unencoded)
901 newrl = _revlogfrompath(dstrepo, unencoded)
887 oldrl.clone(
902 oldrl.clone(
888 tr,
903 tr,
889 newrl,
904 newrl,
890 addrevisioncb=oncopiedrevision,
905 addrevisioncb=oncopiedrevision,
891 deltareuse=deltareuse,
906 deltareuse=deltareuse,
892 forcedeltabothparents=forcedeltabothparents,
907 forcedeltabothparents=forcedeltabothparents,
893 sidedatacompanion=sidedatacompanion,
908 sidedatacompanion=sidedatacompanion,
894 )
909 )
895 else:
910 else:
896 msg = _(b'blindly copying %s containing %i revisions\n')
911 msg = _(b'blindly copying %s containing %i revisions\n')
897 ui.note(msg % (unencoded, len(oldrl)))
912 ui.note(msg % (unencoded, len(oldrl)))
898 _copyrevlog(tr, dstrepo, oldrl, unencoded)
913 _copyrevlog(tr, dstrepo, oldrl, unencoded)
899
914
900 newrl = _revlogfrompath(dstrepo, unencoded)
915 newrl = _revlogfrompath(dstrepo, unencoded)
901
916
902 info = newrl.storageinfo(storedsize=True)
917 info = newrl.storageinfo(storedsize=True)
903 datasize = info[b'storedsize'] or 0
918 datasize = info[b'storedsize'] or 0
904
919
905 dstsize += datasize
920 dstsize += datasize
906
921
907 if isinstance(newrl, changelog.changelog):
922 if isinstance(newrl, changelog.changelog):
908 cdstsize += datasize
923 cdstsize += datasize
909 elif isinstance(newrl, manifest.manifestrevlog):
924 elif isinstance(newrl, manifest.manifestrevlog):
910 mdstsize += datasize
925 mdstsize += datasize
911 else:
926 else:
912 fdstsize += datasize
927 fdstsize += datasize
913
928
914 progress.complete()
929 progress.complete()
915
930
916 ui.write(
931 ui.write(
917 _(
932 _(
918 b'finished migrating %d changelog revisions; change in size: '
933 b'finished migrating %d changelog revisions; change in size: '
919 b'%s\n'
934 b'%s\n'
920 )
935 )
921 % (crevcount, util.bytecount(cdstsize - csrcsize))
936 % (crevcount, util.bytecount(cdstsize - csrcsize))
922 )
937 )
923
938
924 ui.write(
939 ui.write(
925 _(
940 _(
926 b'finished migrating %d total revisions; total change in store '
941 b'finished migrating %d total revisions; total change in store '
927 b'size: %s\n'
942 b'size: %s\n'
928 )
943 )
929 % (revcount, util.bytecount(dstsize - srcsize))
944 % (revcount, util.bytecount(dstsize - srcsize))
930 )
945 )
931
946
932
947
933 def _filterstorefile(srcrepo, dstrepo, requirements, path, mode, st):
948 def _filterstorefile(srcrepo, dstrepo, requirements, path, mode, st):
934 """Determine whether to copy a store file during upgrade.
949 """Determine whether to copy a store file during upgrade.
935
950
936 This function is called when migrating store files from ``srcrepo`` to
951 This function is called when migrating store files from ``srcrepo`` to
937 ``dstrepo`` as part of upgrading a repository.
952 ``dstrepo`` as part of upgrading a repository.
938
953
939 Args:
954 Args:
940 srcrepo: repo we are copying from
955 srcrepo: repo we are copying from
941 dstrepo: repo we are copying to
956 dstrepo: repo we are copying to
942 requirements: set of requirements for ``dstrepo``
957 requirements: set of requirements for ``dstrepo``
943 path: store file being examined
958 path: store file being examined
944 mode: the ``ST_MODE`` file type of ``path``
959 mode: the ``ST_MODE`` file type of ``path``
945 st: ``stat`` data structure for ``path``
960 st: ``stat`` data structure for ``path``
946
961
947 Function should return ``True`` if the file is to be copied.
962 Function should return ``True`` if the file is to be copied.
948 """
963 """
949 # Skip revlogs.
964 # Skip revlogs.
950 if path.endswith((b'.i', b'.d')):
965 if path.endswith((b'.i', b'.d')):
951 return False
966 return False
952 # Skip transaction related files.
967 # Skip transaction related files.
953 if path.startswith(b'undo'):
968 if path.startswith(b'undo'):
954 return False
969 return False
955 # Only copy regular files.
970 # Only copy regular files.
956 if mode != stat.S_IFREG:
971 if mode != stat.S_IFREG:
957 return False
972 return False
958 # Skip other skipped files.
973 # Skip other skipped files.
959 if path in (b'lock', b'fncache'):
974 if path in (b'lock', b'fncache'):
960 return False
975 return False
961
976
962 return True
977 return True
963
978
964
979
965 def _finishdatamigration(ui, srcrepo, dstrepo, requirements):
980 def _finishdatamigration(ui, srcrepo, dstrepo, requirements):
966 """Hook point for extensions to perform additional actions during upgrade.
981 """Hook point for extensions to perform additional actions during upgrade.
967
982
968 This function is called after revlogs and store files have been copied but
983 This function is called after revlogs and store files have been copied but
969 before the new store is swapped into the original location.
984 before the new store is swapped into the original location.
970 """
985 """
971
986
972
987
973 def _upgraderepo(
988 def _upgraderepo(
974 ui, srcrepo, dstrepo, requirements, actions, revlogs=UPGRADE_ALL_REVLOGS
989 ui, srcrepo, dstrepo, requirements, actions, revlogs=UPGRADE_ALL_REVLOGS
975 ):
990 ):
976 """Do the low-level work of upgrading a repository.
991 """Do the low-level work of upgrading a repository.
977
992
978 The upgrade is effectively performed as a copy between a source
993 The upgrade is effectively performed as a copy between a source
979 repository and a temporary destination repository.
994 repository and a temporary destination repository.
980
995
981 The source repository is unmodified for as long as possible so the
996 The source repository is unmodified for as long as possible so the
982 upgrade can abort at any time without causing loss of service for
997 upgrade can abort at any time without causing loss of service for
983 readers and without corrupting the source repository.
998 readers and without corrupting the source repository.
984 """
999 """
985 assert srcrepo.currentwlock()
1000 assert srcrepo.currentwlock()
986 assert dstrepo.currentwlock()
1001 assert dstrepo.currentwlock()
987
1002
988 ui.write(
1003 ui.write(
989 _(
1004 _(
990 b'(it is safe to interrupt this process any time before '
1005 b'(it is safe to interrupt this process any time before '
991 b'data migration completes)\n'
1006 b'data migration completes)\n'
992 )
1007 )
993 )
1008 )
994
1009
995 if b're-delta-all' in actions:
1010 if b're-delta-all' in actions:
996 deltareuse = revlog.revlog.DELTAREUSENEVER
1011 deltareuse = revlog.revlog.DELTAREUSENEVER
997 elif b're-delta-parent' in actions:
1012 elif b're-delta-parent' in actions:
998 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
1013 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
999 elif b're-delta-multibase' in actions:
1014 elif b're-delta-multibase' in actions:
1000 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
1015 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
1001 elif b're-delta-fulladd' in actions:
1016 elif b're-delta-fulladd' in actions:
1002 deltareuse = revlog.revlog.DELTAREUSEFULLADD
1017 deltareuse = revlog.revlog.DELTAREUSEFULLADD
1003 else:
1018 else:
1004 deltareuse = revlog.revlog.DELTAREUSEALWAYS
1019 deltareuse = revlog.revlog.DELTAREUSEALWAYS
1005
1020
1006 with dstrepo.transaction(b'upgrade') as tr:
1021 with dstrepo.transaction(b'upgrade') as tr:
1007 _clonerevlogs(
1022 _clonerevlogs(
1008 ui,
1023 ui,
1009 srcrepo,
1024 srcrepo,
1010 dstrepo,
1025 dstrepo,
1011 tr,
1026 tr,
1012 deltareuse,
1027 deltareuse,
1013 b're-delta-multibase' in actions,
1028 b're-delta-multibase' in actions,
1014 revlogs=revlogs,
1029 revlogs=revlogs,
1015 )
1030 )
1016
1031
1017 # Now copy other files in the store directory.
1032 # Now copy other files in the store directory.
1018 # The sorted() makes execution deterministic.
1033 # The sorted() makes execution deterministic.
1019 for p, kind, st in sorted(srcrepo.store.vfs.readdir(b'', stat=True)):
1034 for p, kind, st in sorted(srcrepo.store.vfs.readdir(b'', stat=True)):
1020 if not _filterstorefile(srcrepo, dstrepo, requirements, p, kind, st):
1035 if not _filterstorefile(srcrepo, dstrepo, requirements, p, kind, st):
1021 continue
1036 continue
1022
1037
1023 srcrepo.ui.write(_(b'copying %s\n') % p)
1038 srcrepo.ui.write(_(b'copying %s\n') % p)
1024 src = srcrepo.store.rawvfs.join(p)
1039 src = srcrepo.store.rawvfs.join(p)
1025 dst = dstrepo.store.rawvfs.join(p)
1040 dst = dstrepo.store.rawvfs.join(p)
1026 util.copyfile(src, dst, copystat=True)
1041 util.copyfile(src, dst, copystat=True)
1027
1042
1028 _finishdatamigration(ui, srcrepo, dstrepo, requirements)
1043 _finishdatamigration(ui, srcrepo, dstrepo, requirements)
1029
1044
1030 ui.write(_(b'data fully migrated to temporary repository\n'))
1045 ui.write(_(b'data fully migrated to temporary repository\n'))
1031
1046
1032 backuppath = pycompat.mkdtemp(prefix=b'upgradebackup.', dir=srcrepo.path)
1047 backuppath = pycompat.mkdtemp(prefix=b'upgradebackup.', dir=srcrepo.path)
1033 backupvfs = vfsmod.vfs(backuppath)
1048 backupvfs = vfsmod.vfs(backuppath)
1034
1049
1035 # Make a backup of requires file first, as it is the first to be modified.
1050 # Make a backup of requires file first, as it is the first to be modified.
1036 util.copyfile(srcrepo.vfs.join(b'requires'), backupvfs.join(b'requires'))
1051 util.copyfile(srcrepo.vfs.join(b'requires'), backupvfs.join(b'requires'))
1037
1052
1038 # We install an arbitrary requirement that clients must not support
1053 # We install an arbitrary requirement that clients must not support
1039 # as a mechanism to lock out new clients during the data swap. This is
1054 # as a mechanism to lock out new clients during the data swap. This is
1040 # better than allowing a client to continue while the repository is in
1055 # better than allowing a client to continue while the repository is in
1041 # an inconsistent state.
1056 # an inconsistent state.
1042 ui.write(
1057 ui.write(
1043 _(
1058 _(
1044 b'marking source repository as being upgraded; clients will be '
1059 b'marking source repository as being upgraded; clients will be '
1045 b'unable to read from repository\n'
1060 b'unable to read from repository\n'
1046 )
1061 )
1047 )
1062 )
1048 scmutil.writerequires(
1063 scmutil.writerequires(
1049 srcrepo.vfs, srcrepo.requirements | {b'upgradeinprogress'}
1064 srcrepo.vfs, srcrepo.requirements | {b'upgradeinprogress'}
1050 )
1065 )
1051
1066
1052 ui.write(_(b'starting in-place swap of repository data\n'))
1067 ui.write(_(b'starting in-place swap of repository data\n'))
1053 ui.write(_(b'replaced files will be backed up at %s\n') % backuppath)
1068 ui.write(_(b'replaced files will be backed up at %s\n') % backuppath)
1054
1069
1055 # Now swap in the new store directory. Doing it as a rename should make
1070 # Now swap in the new store directory. Doing it as a rename should make
1056 # the operation nearly instantaneous and atomic (at least in well-behaved
1071 # the operation nearly instantaneous and atomic (at least in well-behaved
1057 # environments).
1072 # environments).
1058 ui.write(_(b'replacing store...\n'))
1073 ui.write(_(b'replacing store...\n'))
1059 tstart = util.timer()
1074 tstart = util.timer()
1060 util.rename(srcrepo.spath, backupvfs.join(b'store'))
1075 util.rename(srcrepo.spath, backupvfs.join(b'store'))
1061 util.rename(dstrepo.spath, srcrepo.spath)
1076 util.rename(dstrepo.spath, srcrepo.spath)
1062 elapsed = util.timer() - tstart
1077 elapsed = util.timer() - tstart
1063 ui.write(
1078 ui.write(
1064 _(
1079 _(
1065 b'store replacement complete; repository was inconsistent for '
1080 b'store replacement complete; repository was inconsistent for '
1066 b'%0.1fs\n'
1081 b'%0.1fs\n'
1067 )
1082 )
1068 % elapsed
1083 % elapsed
1069 )
1084 )
1070
1085
1071 # We first write the requirements file. Any new requirements will lock
1086 # We first write the requirements file. Any new requirements will lock
1072 # out legacy clients.
1087 # out legacy clients.
1073 ui.write(
1088 ui.write(
1074 _(
1089 _(
1075 b'finalizing requirements file and making repository readable '
1090 b'finalizing requirements file and making repository readable '
1076 b'again\n'
1091 b'again\n'
1077 )
1092 )
1078 )
1093 )
1079 scmutil.writerequires(srcrepo.vfs, requirements)
1094 scmutil.writerequires(srcrepo.vfs, requirements)
1080
1095
1081 # The lock file from the old store won't be removed because nothing has a
1096 # The lock file from the old store won't be removed because nothing has a
1082 # reference to its new location. So clean it up manually. Alternatively, we
1097 # reference to its new location. So clean it up manually. Alternatively, we
1083 # could update srcrepo.svfs and other variables to point to the new
1098 # could update srcrepo.svfs and other variables to point to the new
1084 # location. This is simpler.
1099 # location. This is simpler.
1085 backupvfs.unlink(b'store/lock')
1100 backupvfs.unlink(b'store/lock')
1086
1101
1087 return backuppath
1102 return backuppath
1088
1103
1089
1104
1090 def upgraderepo(
1105 def upgraderepo(
1091 ui,
1106 ui,
1092 repo,
1107 repo,
1093 run=False,
1108 run=False,
1094 optimize=None,
1109 optimize=None,
1095 backup=True,
1110 backup=True,
1096 manifest=None,
1111 manifest=None,
1097 changelog=None,
1112 changelog=None,
1098 ):
1113 ):
1099 """Upgrade a repository in place."""
1114 """Upgrade a repository in place."""
1100 if optimize is None:
1115 if optimize is None:
1101 optimize = []
1116 optimize = []
1102 optimize = set(legacy_opts_map.get(o, o) for o in optimize)
1117 optimize = set(legacy_opts_map.get(o, o) for o in optimize)
1103 repo = repo.unfiltered()
1118 repo = repo.unfiltered()
1104
1119
1105 revlogs = set(UPGRADE_ALL_REVLOGS)
1120 revlogs = set(UPGRADE_ALL_REVLOGS)
1106 specentries = ((b'c', changelog), (b'm', manifest))
1121 specentries = ((b'c', changelog), (b'm', manifest))
1107 specified = [(y, x) for (y, x) in specentries if x is not None]
1122 specified = [(y, x) for (y, x) in specentries if x is not None]
1108 if specified:
1123 if specified:
1109 # we have some limitation on revlogs to be recloned
1124 # we have some limitation on revlogs to be recloned
1110 if any(x for y, x in specified):
1125 if any(x for y, x in specified):
1111 revlogs = set()
1126 revlogs = set()
1112 for r, enabled in specified:
1127 for r, enabled in specified:
1113 if enabled:
1128 if enabled:
1114 if r == b'c':
1129 if r == b'c':
1115 revlogs.add(UPGRADE_CHANGELOG)
1130 revlogs.add(UPGRADE_CHANGELOG)
1116 elif r == b'm':
1131 elif r == b'm':
1117 revlogs.add(UPGRADE_MANIFEST)
1132 revlogs.add(UPGRADE_MANIFEST)
1118 else:
1133 else:
1119 # none are enabled
1134 # none are enabled
1120 for r, __ in specified:
1135 for r, __ in specified:
1121 if r == b'c':
1136 if r == b'c':
1122 revlogs.discard(UPGRADE_CHANGELOG)
1137 revlogs.discard(UPGRADE_CHANGELOG)
1123 elif r == b'm':
1138 elif r == b'm':
1124 revlogs.discard(UPGRADE_MANIFEST)
1139 revlogs.discard(UPGRADE_MANIFEST)
1125
1140
1126 # Ensure the repository can be upgraded.
1141 # Ensure the repository can be upgraded.
1127 missingreqs = requiredsourcerequirements(repo) - repo.requirements
1142 missingreqs = requiredsourcerequirements(repo) - repo.requirements
1128 if missingreqs:
1143 if missingreqs:
1129 raise error.Abort(
1144 raise error.Abort(
1130 _(b'cannot upgrade repository; requirement missing: %s')
1145 _(b'cannot upgrade repository; requirement missing: %s')
1131 % _(b', ').join(sorted(missingreqs))
1146 % _(b', ').join(sorted(missingreqs))
1132 )
1147 )
1133
1148
1134 blockedreqs = blocksourcerequirements(repo) & repo.requirements
1149 blockedreqs = blocksourcerequirements(repo) & repo.requirements
1135 if blockedreqs:
1150 if blockedreqs:
1136 raise error.Abort(
1151 raise error.Abort(
1137 _(
1152 _(
1138 b'cannot upgrade repository; unsupported source '
1153 b'cannot upgrade repository; unsupported source '
1139 b'requirement: %s'
1154 b'requirement: %s'
1140 )
1155 )
1141 % _(b', ').join(sorted(blockedreqs))
1156 % _(b', ').join(sorted(blockedreqs))
1142 )
1157 )
1143
1158
1144 # FUTURE there is potentially a need to control the wanted requirements via
1159 # FUTURE there is potentially a need to control the wanted requirements via
1145 # command arguments or via an extension hook point.
1160 # command arguments or via an extension hook point.
1146 newreqs = localrepo.newreporequirements(
1161 newreqs = localrepo.newreporequirements(
1147 repo.ui, localrepo.defaultcreateopts(repo.ui)
1162 repo.ui, localrepo.defaultcreateopts(repo.ui)
1148 )
1163 )
1149 newreqs.update(preservedrequirements(repo))
1164 newreqs.update(preservedrequirements(repo))
1150
1165
1151 noremovereqs = (
1166 noremovereqs = (
1152 repo.requirements - newreqs - supportremovedrequirements(repo)
1167 repo.requirements - newreqs - supportremovedrequirements(repo)
1153 )
1168 )
1154 if noremovereqs:
1169 if noremovereqs:
1155 raise error.Abort(
1170 raise error.Abort(
1156 _(
1171 _(
1157 b'cannot upgrade repository; requirement would be '
1172 b'cannot upgrade repository; requirement would be '
1158 b'removed: %s'
1173 b'removed: %s'
1159 )
1174 )
1160 % _(b', ').join(sorted(noremovereqs))
1175 % _(b', ').join(sorted(noremovereqs))
1161 )
1176 )
1162
1177
1163 noaddreqs = newreqs - repo.requirements - allowednewrequirements(repo)
1178 noaddreqs = newreqs - repo.requirements - allowednewrequirements(repo)
1164 if noaddreqs:
1179 if noaddreqs:
1165 raise error.Abort(
1180 raise error.Abort(
1166 _(
1181 _(
1167 b'cannot upgrade repository; do not support adding '
1182 b'cannot upgrade repository; do not support adding '
1168 b'requirement: %s'
1183 b'requirement: %s'
1169 )
1184 )
1170 % _(b', ').join(sorted(noaddreqs))
1185 % _(b', ').join(sorted(noaddreqs))
1171 )
1186 )
1172
1187
1173 unsupportedreqs = newreqs - supporteddestrequirements(repo)
1188 unsupportedreqs = newreqs - supporteddestrequirements(repo)
1174 if unsupportedreqs:
1189 if unsupportedreqs:
1175 raise error.Abort(
1190 raise error.Abort(
1176 _(
1191 _(
1177 b'cannot upgrade repository; do not support '
1192 b'cannot upgrade repository; do not support '
1178 b'destination requirement: %s'
1193 b'destination requirement: %s'
1179 )
1194 )
1180 % _(b', ').join(sorted(unsupportedreqs))
1195 % _(b', ').join(sorted(unsupportedreqs))
1181 )
1196 )
1182
1197
1183 # Find and validate all improvements that can be made.
1198 # Find and validate all improvements that can be made.
1184 alloptimizations = findoptimizations(repo)
1199 alloptimizations = findoptimizations(repo)
1185
1200
1186 # Apply and Validate arguments.
1201 # Apply and Validate arguments.
1187 optimizations = []
1202 optimizations = []
1188 for o in alloptimizations:
1203 for o in alloptimizations:
1189 if o.name in optimize:
1204 if o.name in optimize:
1190 optimizations.append(o)
1205 optimizations.append(o)
1191 optimize.discard(o.name)
1206 optimize.discard(o.name)
1192
1207
1193 if optimize: # anything left is unknown
1208 if optimize: # anything left is unknown
1194 raise error.Abort(
1209 raise error.Abort(
1195 _(b'unknown optimization action requested: %s')
1210 _(b'unknown optimization action requested: %s')
1196 % b', '.join(sorted(optimize)),
1211 % b', '.join(sorted(optimize)),
1197 hint=_(b'run without arguments to see valid optimizations'),
1212 hint=_(b'run without arguments to see valid optimizations'),
1198 )
1213 )
1199
1214
1200 deficiencies = finddeficiencies(repo)
1215 deficiencies = finddeficiencies(repo)
1201 actions = determineactions(repo, deficiencies, repo.requirements, newreqs)
1216 actions = determineactions(repo, deficiencies, repo.requirements, newreqs)
1202 actions.extend(
1217 actions.extend(
1203 o
1218 o
1204 for o in sorted(optimizations)
1219 for o in sorted(optimizations)
1205 # determineactions could have added optimisation
1220 # determineactions could have added optimisation
1206 if o not in actions
1221 if o not in actions
1207 )
1222 )
1208
1223
1209 removedreqs = repo.requirements - newreqs
1224 removedreqs = repo.requirements - newreqs
1210 addedreqs = newreqs - repo.requirements
1225 addedreqs = newreqs - repo.requirements
1211
1226
1212 if revlogs != UPGRADE_ALL_REVLOGS:
1227 if revlogs != UPGRADE_ALL_REVLOGS:
1213 incompatible = RECLONES_REQUIREMENTS & (removedreqs | addedreqs)
1228 incompatible = RECLONES_REQUIREMENTS & (removedreqs | addedreqs)
1214 if incompatible:
1229 if incompatible:
1215 msg = _(
1230 msg = _(
1216 b'ignoring revlogs selection flags, format requirements '
1231 b'ignoring revlogs selection flags, format requirements '
1217 b'change: %s\n'
1232 b'change: %s\n'
1218 )
1233 )
1219 ui.warn(msg % b', '.join(sorted(incompatible)))
1234 ui.warn(msg % b', '.join(sorted(incompatible)))
1220 revlogs = UPGRADE_ALL_REVLOGS
1235 revlogs = UPGRADE_ALL_REVLOGS
1221
1236
1222 def printrequirements():
1237 def printrequirements():
1223 ui.write(_(b'requirements\n'))
1238 ui.write(_(b'requirements\n'))
1224 ui.write(
1239 ui.write(
1225 _(b' preserved: %s\n')
1240 _(b' preserved: %s\n')
1226 % _(b', ').join(sorted(newreqs & repo.requirements))
1241 % _(b', ').join(sorted(newreqs & repo.requirements))
1227 )
1242 )
1228
1243
1229 if repo.requirements - newreqs:
1244 if repo.requirements - newreqs:
1230 ui.write(
1245 ui.write(
1231 _(b' removed: %s\n')
1246 _(b' removed: %s\n')
1232 % _(b', ').join(sorted(repo.requirements - newreqs))
1247 % _(b', ').join(sorted(repo.requirements - newreqs))
1233 )
1248 )
1234
1249
1235 if newreqs - repo.requirements:
1250 if newreqs - repo.requirements:
1236 ui.write(
1251 ui.write(
1237 _(b' added: %s\n')
1252 _(b' added: %s\n')
1238 % _(b', ').join(sorted(newreqs - repo.requirements))
1253 % _(b', ').join(sorted(newreqs - repo.requirements))
1239 )
1254 )
1240
1255
1241 ui.write(b'\n')
1256 ui.write(b'\n')
1242
1257
1243 def printupgradeactions():
1258 def printupgradeactions():
1244 for a in actions:
1259 for a in actions:
1245 ui.write(b'%s\n %s\n\n' % (a.name, a.upgrademessage))
1260 ui.write(b'%s\n %s\n\n' % (a.name, a.upgrademessage))
1246
1261
1247 if not run:
1262 if not run:
1248 fromconfig = []
1263 fromconfig = []
1249 onlydefault = []
1264 onlydefault = []
1250
1265
1251 for d in deficiencies:
1266 for d in deficiencies:
1252 if d.fromconfig(repo):
1267 if d.fromconfig(repo):
1253 fromconfig.append(d)
1268 fromconfig.append(d)
1254 elif d.default:
1269 elif d.default:
1255 onlydefault.append(d)
1270 onlydefault.append(d)
1256
1271
1257 if fromconfig or onlydefault:
1272 if fromconfig or onlydefault:
1258
1273
1259 if fromconfig:
1274 if fromconfig:
1260 ui.write(
1275 ui.write(
1261 _(
1276 _(
1262 b'repository lacks features recommended by '
1277 b'repository lacks features recommended by '
1263 b'current config options:\n\n'
1278 b'current config options:\n\n'
1264 )
1279 )
1265 )
1280 )
1266 for i in fromconfig:
1281 for i in fromconfig:
1267 ui.write(b'%s\n %s\n\n' % (i.name, i.description))
1282 ui.write(b'%s\n %s\n\n' % (i.name, i.description))
1268
1283
1269 if onlydefault:
1284 if onlydefault:
1270 ui.write(
1285 ui.write(
1271 _(
1286 _(
1272 b'repository lacks features used by the default '
1287 b'repository lacks features used by the default '
1273 b'config options:\n\n'
1288 b'config options:\n\n'
1274 )
1289 )
1275 )
1290 )
1276 for i in onlydefault:
1291 for i in onlydefault:
1277 ui.write(b'%s\n %s\n\n' % (i.name, i.description))
1292 ui.write(b'%s\n %s\n\n' % (i.name, i.description))
1278
1293
1279 ui.write(b'\n')
1294 ui.write(b'\n')
1280 else:
1295 else:
1281 ui.write(
1296 ui.write(
1282 _(
1297 _(
1283 b'(no feature deficiencies found in existing '
1298 b'(no feature deficiencies found in existing '
1284 b'repository)\n'
1299 b'repository)\n'
1285 )
1300 )
1286 )
1301 )
1287
1302
1288 ui.write(
1303 ui.write(
1289 _(
1304 _(
1290 b'performing an upgrade with "--run" will make the following '
1305 b'performing an upgrade with "--run" will make the following '
1291 b'changes:\n\n'
1306 b'changes:\n\n'
1292 )
1307 )
1293 )
1308 )
1294
1309
1295 printrequirements()
1310 printrequirements()
1296 printupgradeactions()
1311 printupgradeactions()
1297
1312
1298 unusedoptimize = [i for i in alloptimizations if i not in actions]
1313 unusedoptimize = [i for i in alloptimizations if i not in actions]
1299
1314
1300 if unusedoptimize:
1315 if unusedoptimize:
1301 ui.write(
1316 ui.write(
1302 _(
1317 _(
1303 b'additional optimizations are available by specifying '
1318 b'additional optimizations are available by specifying '
1304 b'"--optimize <name>":\n\n'
1319 b'"--optimize <name>":\n\n'
1305 )
1320 )
1306 )
1321 )
1307 for i in unusedoptimize:
1322 for i in unusedoptimize:
1308 ui.write(_(b'%s\n %s\n\n') % (i.name, i.description))
1323 ui.write(_(b'%s\n %s\n\n') % (i.name, i.description))
1309 return
1324 return
1310
1325
1311 # Else we're in the run=true case.
1326 # Else we're in the run=true case.
1312 ui.write(_(b'upgrade will perform the following actions:\n\n'))
1327 ui.write(_(b'upgrade will perform the following actions:\n\n'))
1313 printrequirements()
1328 printrequirements()
1314 printupgradeactions()
1329 printupgradeactions()
1315
1330
1316 upgradeactions = [a.name for a in actions]
1331 upgradeactions = [a.name for a in actions]
1317
1332
1318 ui.write(_(b'beginning upgrade...\n'))
1333 ui.write(_(b'beginning upgrade...\n'))
1319 with repo.wlock(), repo.lock():
1334 with repo.wlock(), repo.lock():
1320 ui.write(_(b'repository locked and read-only\n'))
1335 ui.write(_(b'repository locked and read-only\n'))
1321 # Our strategy for upgrading the repository is to create a new,
1336 # Our strategy for upgrading the repository is to create a new,
1322 # temporary repository, write data to it, then do a swap of the
1337 # temporary repository, write data to it, then do a swap of the
1323 # data. There are less heavyweight ways to do this, but it is easier
1338 # data. There are less heavyweight ways to do this, but it is easier
1324 # to create a new repo object than to instantiate all the components
1339 # to create a new repo object than to instantiate all the components
1325 # (like the store) separately.
1340 # (like the store) separately.
1326 tmppath = pycompat.mkdtemp(prefix=b'upgrade.', dir=repo.path)
1341 tmppath = pycompat.mkdtemp(prefix=b'upgrade.', dir=repo.path)
1327 backuppath = None
1342 backuppath = None
1328 try:
1343 try:
1329 ui.write(
1344 ui.write(
1330 _(
1345 _(
1331 b'creating temporary repository to stage migrated '
1346 b'creating temporary repository to stage migrated '
1332 b'data: %s\n'
1347 b'data: %s\n'
1333 )
1348 )
1334 % tmppath
1349 % tmppath
1335 )
1350 )
1336
1351
1337 # clone ui without using ui.copy because repo.ui is protected
1352 # clone ui without using ui.copy because repo.ui is protected
1338 repoui = repo.ui.__class__(repo.ui)
1353 repoui = repo.ui.__class__(repo.ui)
1339 dstrepo = hg.repository(repoui, path=tmppath, create=True)
1354 dstrepo = hg.repository(repoui, path=tmppath, create=True)
1340
1355
1341 with dstrepo.wlock(), dstrepo.lock():
1356 with dstrepo.wlock(), dstrepo.lock():
1342 backuppath = _upgraderepo(
1357 backuppath = _upgraderepo(
1343 ui, repo, dstrepo, newreqs, upgradeactions, revlogs=revlogs
1358 ui, repo, dstrepo, newreqs, upgradeactions, revlogs=revlogs
1344 )
1359 )
1345 if not (backup or backuppath is None):
1360 if not (backup or backuppath is None):
1346 ui.write(_(b'removing old repository content%s\n') % backuppath)
1361 ui.write(_(b'removing old repository content%s\n') % backuppath)
1347 repo.vfs.rmtree(backuppath, forcibly=True)
1362 repo.vfs.rmtree(backuppath, forcibly=True)
1348 backuppath = None
1363 backuppath = None
1349
1364
1350 finally:
1365 finally:
1351 ui.write(_(b'removing temporary repository %s\n') % tmppath)
1366 ui.write(_(b'removing temporary repository %s\n') % tmppath)
1352 repo.vfs.rmtree(tmppath, forcibly=True)
1367 repo.vfs.rmtree(tmppath, forcibly=True)
1353
1368
1354 if backuppath:
1369 if backuppath:
1355 ui.warn(
1370 ui.warn(
1356 _(b'copy of old repository backed up at %s\n') % backuppath
1371 _(b'copy of old repository backed up at %s\n') % backuppath
1357 )
1372 )
1358 ui.warn(
1373 ui.warn(
1359 _(
1374 _(
1360 b'the old repository will not be deleted; remove '
1375 b'the old repository will not be deleted; remove '
1361 b'it to free up disk space once the upgraded '
1376 b'it to free up disk space once the upgraded '
1362 b'repository is verified\n'
1377 b'repository is verified\n'
1363 )
1378 )
1364 )
1379 )
@@ -1,717 +1,720 b''
1 #testcases lfsremote-on lfsremote-off
1 #testcases lfsremote-on lfsremote-off
2 #require serve no-reposimplestore no-chg
2 #require serve no-reposimplestore no-chg
3
3
4 This test splits `hg serve` with and without using the extension into separate
4 This test splits `hg serve` with and without using the extension into separate
5 tests cases. The tests are broken down as follows, where "LFS"/"No-LFS"
5 tests cases. The tests are broken down as follows, where "LFS"/"No-LFS"
6 indicates whether or not there are commits that use an LFS file, and "D"/"E"
6 indicates whether or not there are commits that use an LFS file, and "D"/"E"
7 indicates whether or not the extension is loaded. The "X" cases are not tested
7 indicates whether or not the extension is loaded. The "X" cases are not tested
8 individually, because the lfs requirement causes the process to bail early if
8 individually, because the lfs requirement causes the process to bail early if
9 the extension is disabled.
9 the extension is disabled.
10
10
11 . Server
11 . Server
12 .
12 .
13 . No-LFS LFS
13 . No-LFS LFS
14 . +----------------------------+
14 . +----------------------------+
15 . | || D | E | D | E |
15 . | || D | E | D | E |
16 . |---++=======================|
16 . |---++=======================|
17 . C | D || N/A | #1 | X | #4 |
17 . C | D || N/A | #1 | X | #4 |
18 . l No +---++-----------------------|
18 . l No +---++-----------------------|
19 . i LFS | E || #2 | #2 | X | #5 |
19 . i LFS | E || #2 | #2 | X | #5 |
20 . e +---++-----------------------|
20 . e +---++-----------------------|
21 . n | D || X | X | X | X |
21 . n | D || X | X | X | X |
22 . t LFS |---++-----------------------|
22 . t LFS |---++-----------------------|
23 . | E || #3 | #3 | X | #6 |
23 . | E || #3 | #3 | X | #6 |
24 . |---++-----------------------+
24 . |---++-----------------------+
25
25
26 make command server magic visible
26 make command server magic visible
27
27
28 #if windows
28 #if windows
29 $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH"
29 $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH"
30 #else
30 #else
31 $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH"
31 $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH"
32 #endif
32 #endif
33 $ export PYTHONPATH
33 $ export PYTHONPATH
34
34
35 $ hg init server
35 $ hg init server
36 $ SERVER_REQUIRES="$TESTTMP/server/.hg/requires"
36 $ SERVER_REQUIRES="$TESTTMP/server/.hg/requires"
37
37
38 $ cat > $TESTTMP/debugprocessors.py <<EOF
38 $ cat > $TESTTMP/debugprocessors.py <<EOF
39 > from mercurial import (
39 > from mercurial import (
40 > cmdutil,
40 > cmdutil,
41 > commands,
41 > commands,
42 > pycompat,
42 > pycompat,
43 > registrar,
43 > registrar,
44 > )
44 > )
45 > cmdtable = {}
45 > cmdtable = {}
46 > command = registrar.command(cmdtable)
46 > command = registrar.command(cmdtable)
47 > @command(b'debugprocessors', [], b'FILE')
47 > @command(b'debugprocessors', [], b'FILE')
48 > def debugprocessors(ui, repo, file_=None, **opts):
48 > def debugprocessors(ui, repo, file_=None, **opts):
49 > opts = pycompat.byteskwargs(opts)
49 > opts = pycompat.byteskwargs(opts)
50 > opts[b'changelog'] = False
50 > opts[b'changelog'] = False
51 > opts[b'manifest'] = False
51 > opts[b'manifest'] = False
52 > opts[b'dir'] = False
52 > opts[b'dir'] = False
53 > rl = cmdutil.openrevlog(repo, b'debugprocessors', file_, opts)
53 > rl = cmdutil.openrevlog(repo, b'debugprocessors', file_, opts)
54 > for flag, proc in rl._flagprocessors.items():
54 > for flag, proc in rl._flagprocessors.items():
55 > ui.status(b"registered processor '%#x'\n" % (flag))
55 > ui.status(b"registered processor '%#x'\n" % (flag))
56 > EOF
56 > EOF
57
57
58 Skip the experimental.changegroup3=True config. Failure to agree on this comes
58 Skip the experimental.changegroup3=True config. Failure to agree on this comes
59 first, and causes an "abort: no common changegroup version" if the extension is
59 first, and causes an "abort: no common changegroup version" if the extension is
60 only loaded on one side. If that *is* enabled, the subsequent failure is "abort:
60 only loaded on one side. If that *is* enabled, the subsequent failure is "abort:
61 missing processor for flag '0x2000'!" if the extension is only loaded on one side
61 missing processor for flag '0x2000'!" if the extension is only loaded on one side
62 (possibly also masked by the Internal Server Error message).
62 (possibly also masked by the Internal Server Error message).
63 $ cat >> $HGRCPATH <<EOF
63 $ cat >> $HGRCPATH <<EOF
64 > [extensions]
64 > [extensions]
65 > debugprocessors = $TESTTMP/debugprocessors.py
65 > debugprocessors = $TESTTMP/debugprocessors.py
66 > [experimental]
66 > [experimental]
67 > lfs.disableusercache = True
67 > lfs.disableusercache = True
68 > [lfs]
68 > [lfs]
69 > threshold=10
69 > threshold=10
70 > [web]
70 > [web]
71 > allow_push=*
71 > allow_push=*
72 > push_ssl=False
72 > push_ssl=False
73 > EOF
73 > EOF
74
74
75 $ cp $HGRCPATH $HGRCPATH.orig
75 $ cp $HGRCPATH $HGRCPATH.orig
76
76
77 #if lfsremote-on
77 #if lfsremote-on
78 $ hg --config extensions.lfs= -R server \
78 $ hg --config extensions.lfs= -R server \
79 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log
79 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log
80 #else
80 #else
81 $ hg --config extensions.lfs=! -R server \
81 $ hg --config extensions.lfs=! -R server \
82 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log
82 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log
83 #endif
83 #endif
84
84
85 $ cat hg.pid >> $DAEMON_PIDS
85 $ cat hg.pid >> $DAEMON_PIDS
86 $ hg clone -q http://localhost:$HGPORT client
86 $ hg clone -q http://localhost:$HGPORT client
87 $ grep 'lfs' client/.hg/requires $SERVER_REQUIRES
87 $ grep 'lfs' client/.hg/requires $SERVER_REQUIRES
88 [1]
88 [1]
89
89
90 This trivial repo will force commandserver to load the extension, but not call
90 This trivial repo will force commandserver to load the extension, but not call
91 reposetup() on another repo actually being operated on. This gives coverage
91 reposetup() on another repo actually being operated on. This gives coverage
92 that wrapper functions are not assuming reposetup() was called.
92 that wrapper functions are not assuming reposetup() was called.
93
93
94 $ hg init $TESTTMP/cmdservelfs
94 $ hg init $TESTTMP/cmdservelfs
95 $ cat >> $TESTTMP/cmdservelfs/.hg/hgrc << EOF
95 $ cat >> $TESTTMP/cmdservelfs/.hg/hgrc << EOF
96 > [extensions]
96 > [extensions]
97 > lfs =
97 > lfs =
98 > EOF
98 > EOF
99
99
100 --------------------------------------------------------------------------------
100 --------------------------------------------------------------------------------
101 Case #1: client with non-lfs content and the extension disabled; server with
101 Case #1: client with non-lfs content and the extension disabled; server with
102 non-lfs content, and the extension enabled.
102 non-lfs content, and the extension enabled.
103
103
104 $ cd client
104 $ cd client
105 $ echo 'non-lfs' > nonlfs.txt
105 $ echo 'non-lfs' > nonlfs.txt
106 >>> from __future__ import absolute_import
106 >>> from __future__ import absolute_import
107 >>> from hgclient import check, readchannel, runcommand
107 >>> from hgclient import check, readchannel, runcommand
108 >>> @check
108 >>> @check
109 ... def diff(server):
109 ... def diff(server):
110 ... readchannel(server)
110 ... readchannel(server)
111 ... # run an arbitrary command in the repo with the extension loaded
111 ... # run an arbitrary command in the repo with the extension loaded
112 ... runcommand(server, [b'id', b'-R', b'../cmdservelfs'])
112 ... runcommand(server, [b'id', b'-R', b'../cmdservelfs'])
113 ... # now run a command in a repo without the extension to ensure that
113 ... # now run a command in a repo without the extension to ensure that
114 ... # files are added safely..
114 ... # files are added safely..
115 ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs'])
115 ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs'])
116 ... # .. and that scmutil.prefetchfiles() safely no-ops..
116 ... # .. and that scmutil.prefetchfiles() safely no-ops..
117 ... runcommand(server, [b'diff', b'-r', b'.~1'])
117 ... runcommand(server, [b'diff', b'-r', b'.~1'])
118 ... # .. and that debugupgraderepo safely no-ops.
118 ... # .. and that debugupgraderepo safely no-ops.
119 ... runcommand(server, [b'debugupgraderepo', b'-q', b'--run'])
119 ... runcommand(server, [b'debugupgraderepo', b'-q', b'--run'])
120 *** runcommand id -R ../cmdservelfs
120 *** runcommand id -R ../cmdservelfs
121 000000000000 tip
121 000000000000 tip
122 *** runcommand ci -Aqm non-lfs
122 *** runcommand ci -Aqm non-lfs
123 *** runcommand diff -r .~1
123 *** runcommand diff -r .~1
124 diff -r 000000000000 nonlfs.txt
124 diff -r 000000000000 nonlfs.txt
125 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
125 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
126 +++ b/nonlfs.txt Thu Jan 01 00:00:00 1970 +0000
126 +++ b/nonlfs.txt Thu Jan 01 00:00:00 1970 +0000
127 @@ -0,0 +1,1 @@
127 @@ -0,0 +1,1 @@
128 +non-lfs
128 +non-lfs
129 *** runcommand debugupgraderepo -q --run
129 *** runcommand debugupgraderepo -q --run
130 upgrade will perform the following actions:
130 upgrade will perform the following actions:
131
131
132 requirements
132 requirements
133 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
133 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
134
134
135 sidedata
135 sidedata
136 Allows storage of extra data alongside a revision.
136 Allows storage of extra data alongside a revision.
137
137
138 copies-sdc
139 Allows to use more efficient algorithm to deal with copy tracing.
140
138 beginning upgrade...
141 beginning upgrade...
139 repository locked and read-only
142 repository locked and read-only
140 creating temporary repository to stage migrated data: * (glob)
143 creating temporary repository to stage migrated data: * (glob)
141 (it is safe to interrupt this process any time before data migration completes)
144 (it is safe to interrupt this process any time before data migration completes)
142 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
145 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
143 migrating 324 bytes in store; 129 bytes tracked data
146 migrating 324 bytes in store; 129 bytes tracked data
144 migrating 1 filelogs containing 1 revisions (73 bytes in store; 8 bytes tracked data)
147 migrating 1 filelogs containing 1 revisions (73 bytes in store; 8 bytes tracked data)
145 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
148 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
146 migrating 1 manifests containing 1 revisions (117 bytes in store; 52 bytes tracked data)
149 migrating 1 manifests containing 1 revisions (117 bytes in store; 52 bytes tracked data)
147 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
150 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
148 migrating changelog containing 1 revisions (134 bytes in store; 69 bytes tracked data)
151 migrating changelog containing 1 revisions (134 bytes in store; 69 bytes tracked data)
149 finished migrating 1 changelog revisions; change in size: 0 bytes
152 finished migrating 1 changelog revisions; change in size: 0 bytes
150 finished migrating 3 total revisions; total change in store size: 0 bytes
153 finished migrating 3 total revisions; total change in store size: 0 bytes
151 copying phaseroots
154 copying phaseroots
152 data fully migrated to temporary repository
155 data fully migrated to temporary repository
153 marking source repository as being upgraded; clients will be unable to read from repository
156 marking source repository as being upgraded; clients will be unable to read from repository
154 starting in-place swap of repository data
157 starting in-place swap of repository data
155 replaced files will be backed up at * (glob)
158 replaced files will be backed up at * (glob)
156 replacing store...
159 replacing store...
157 store replacement complete; repository was inconsistent for *s (glob)
160 store replacement complete; repository was inconsistent for *s (glob)
158 finalizing requirements file and making repository readable again
161 finalizing requirements file and making repository readable again
159 removing temporary repository * (glob)
162 removing temporary repository * (glob)
160 copy of old repository backed up at * (glob)
163 copy of old repository backed up at * (glob)
161 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
164 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
162
165
163 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
166 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
164 [1]
167 [1]
165
168
166 #if lfsremote-on
169 #if lfsremote-on
167
170
168 $ hg push -q
171 $ hg push -q
169 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
172 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
170 [1]
173 [1]
171
174
172 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client1_clone
175 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client1_clone
173 $ grep 'lfs' $TESTTMP/client1_clone/.hg/requires $SERVER_REQUIRES
176 $ grep 'lfs' $TESTTMP/client1_clone/.hg/requires $SERVER_REQUIRES
174 [1]
177 [1]
175
178
176 $ hg init $TESTTMP/client1_pull
179 $ hg init $TESTTMP/client1_pull
177 $ hg -R $TESTTMP/client1_pull pull -q http://localhost:$HGPORT
180 $ hg -R $TESTTMP/client1_pull pull -q http://localhost:$HGPORT
178 $ grep 'lfs' $TESTTMP/client1_pull/.hg/requires $SERVER_REQUIRES
181 $ grep 'lfs' $TESTTMP/client1_pull/.hg/requires $SERVER_REQUIRES
179 [1]
182 [1]
180
183
181 $ hg identify http://localhost:$HGPORT
184 $ hg identify http://localhost:$HGPORT
182 d437e1d24fbd
185 d437e1d24fbd
183
186
184 #endif
187 #endif
185
188
186 --------------------------------------------------------------------------------
189 --------------------------------------------------------------------------------
187 Case #2: client with non-lfs content and the extension enabled; server with
190 Case #2: client with non-lfs content and the extension enabled; server with
188 non-lfs content, and the extension state controlled by #testcases.
191 non-lfs content, and the extension state controlled by #testcases.
189
192
190 $ cat >> $HGRCPATH <<EOF
193 $ cat >> $HGRCPATH <<EOF
191 > [extensions]
194 > [extensions]
192 > lfs =
195 > lfs =
193 > EOF
196 > EOF
194 $ echo 'non-lfs' > nonlfs2.txt
197 $ echo 'non-lfs' > nonlfs2.txt
195 $ hg ci -Aqm 'non-lfs file with lfs client'
198 $ hg ci -Aqm 'non-lfs file with lfs client'
196
199
197 Since no lfs content has been added yet, the push is allowed, even when the
200 Since no lfs content has been added yet, the push is allowed, even when the
198 extension is not enabled remotely.
201 extension is not enabled remotely.
199
202
200 $ hg push -q
203 $ hg push -q
201 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
204 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
202 [1]
205 [1]
203
206
204 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client2_clone
207 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client2_clone
205 $ grep 'lfs' $TESTTMP/client2_clone/.hg/requires $SERVER_REQUIRES
208 $ grep 'lfs' $TESTTMP/client2_clone/.hg/requires $SERVER_REQUIRES
206 [1]
209 [1]
207
210
208 $ hg init $TESTTMP/client2_pull
211 $ hg init $TESTTMP/client2_pull
209 $ hg -R $TESTTMP/client2_pull pull -q http://localhost:$HGPORT
212 $ hg -R $TESTTMP/client2_pull pull -q http://localhost:$HGPORT
210 $ grep 'lfs' $TESTTMP/client2_pull/.hg/requires $SERVER_REQUIRES
213 $ grep 'lfs' $TESTTMP/client2_pull/.hg/requires $SERVER_REQUIRES
211 [1]
214 [1]
212
215
213 $ hg identify http://localhost:$HGPORT
216 $ hg identify http://localhost:$HGPORT
214 1477875038c6
217 1477875038c6
215
218
216 --------------------------------------------------------------------------------
219 --------------------------------------------------------------------------------
217 Case #3: client with lfs content and the extension enabled; server with
220 Case #3: client with lfs content and the extension enabled; server with
218 non-lfs content, and the extension state controlled by #testcases. The server
221 non-lfs content, and the extension state controlled by #testcases. The server
219 should have an 'lfs' requirement after it picks up its first commit with a blob.
222 should have an 'lfs' requirement after it picks up its first commit with a blob.
220
223
221 $ echo 'this is a big lfs file' > lfs.bin
224 $ echo 'this is a big lfs file' > lfs.bin
222 $ hg ci -Aqm 'lfs'
225 $ hg ci -Aqm 'lfs'
223 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
226 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
224 .hg/requires:lfs
227 .hg/requires:lfs
225
228
226 #if lfsremote-off
229 #if lfsremote-off
227 $ hg push -q
230 $ hg push -q
228 abort: required features are not supported in the destination: lfs
231 abort: required features are not supported in the destination: lfs
229 (enable the lfs extension on the server)
232 (enable the lfs extension on the server)
230 [255]
233 [255]
231 #else
234 #else
232 $ hg push -q
235 $ hg push -q
233 #endif
236 #endif
234 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
237 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
235 .hg/requires:lfs
238 .hg/requires:lfs
236 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
239 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
237
240
238 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client3_clone
241 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client3_clone
239 $ grep 'lfs' $TESTTMP/client3_clone/.hg/requires $SERVER_REQUIRES || true
242 $ grep 'lfs' $TESTTMP/client3_clone/.hg/requires $SERVER_REQUIRES || true
240 $TESTTMP/client3_clone/.hg/requires:lfs (lfsremote-on !)
243 $TESTTMP/client3_clone/.hg/requires:lfs (lfsremote-on !)
241 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
244 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
242
245
243 $ hg init $TESTTMP/client3_pull
246 $ hg init $TESTTMP/client3_pull
244 $ hg -R $TESTTMP/client3_pull pull -q http://localhost:$HGPORT
247 $ hg -R $TESTTMP/client3_pull pull -q http://localhost:$HGPORT
245 $ grep 'lfs' $TESTTMP/client3_pull/.hg/requires $SERVER_REQUIRES || true
248 $ grep 'lfs' $TESTTMP/client3_pull/.hg/requires $SERVER_REQUIRES || true
246 $TESTTMP/client3_pull/.hg/requires:lfs (lfsremote-on !)
249 $TESTTMP/client3_pull/.hg/requires:lfs (lfsremote-on !)
247 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
250 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
248
251
249 Test that the commit/changegroup requirement check hook can be run multiple
252 Test that the commit/changegroup requirement check hook can be run multiple
250 times.
253 times.
251
254
252 $ hg clone -qr 0 http://localhost:$HGPORT $TESTTMP/cmdserve_client3
255 $ hg clone -qr 0 http://localhost:$HGPORT $TESTTMP/cmdserve_client3
253
256
254 $ cd ../cmdserve_client3
257 $ cd ../cmdserve_client3
255
258
256 >>> from __future__ import absolute_import
259 >>> from __future__ import absolute_import
257 >>> from hgclient import check, readchannel, runcommand
260 >>> from hgclient import check, readchannel, runcommand
258 >>> @check
261 >>> @check
259 ... def addrequirement(server):
262 ... def addrequirement(server):
260 ... readchannel(server)
263 ... readchannel(server)
261 ... # change the repo in a way that adds the lfs requirement
264 ... # change the repo in a way that adds the lfs requirement
262 ... runcommand(server, [b'pull', b'-qu'])
265 ... runcommand(server, [b'pull', b'-qu'])
263 ... # Now cause the requirement adding hook to fire again, without going
266 ... # Now cause the requirement adding hook to fire again, without going
264 ... # through reposetup() again.
267 ... # through reposetup() again.
265 ... with open('file.txt', 'wb') as fp:
268 ... with open('file.txt', 'wb') as fp:
266 ... fp.write(b'data')
269 ... fp.write(b'data')
267 ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs'])
270 ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs'])
268 *** runcommand pull -qu
271 *** runcommand pull -qu
269 *** runcommand ci -Aqm non-lfs
272 *** runcommand ci -Aqm non-lfs
270
273
271 $ cd ../client
274 $ cd ../client
272
275
273 The difference here is the push failed above when the extension isn't
276 The difference here is the push failed above when the extension isn't
274 enabled on the server.
277 enabled on the server.
275 $ hg identify http://localhost:$HGPORT
278 $ hg identify http://localhost:$HGPORT
276 8374dc4052cb (lfsremote-on !)
279 8374dc4052cb (lfsremote-on !)
277 1477875038c6 (lfsremote-off !)
280 1477875038c6 (lfsremote-off !)
278
281
279 Don't bother testing the lfsremote-off cases- the server won't be able
282 Don't bother testing the lfsremote-off cases- the server won't be able
280 to launch if there's lfs content and the extension is disabled.
283 to launch if there's lfs content and the extension is disabled.
281
284
282 #if lfsremote-on
285 #if lfsremote-on
283
286
284 --------------------------------------------------------------------------------
287 --------------------------------------------------------------------------------
285 Case #4: client with non-lfs content and the extension disabled; server with
288 Case #4: client with non-lfs content and the extension disabled; server with
286 lfs content, and the extension enabled.
289 lfs content, and the extension enabled.
287
290
288 $ cat >> $HGRCPATH <<EOF
291 $ cat >> $HGRCPATH <<EOF
289 > [extensions]
292 > [extensions]
290 > lfs = !
293 > lfs = !
291 > EOF
294 > EOF
292
295
293 $ hg init $TESTTMP/client4
296 $ hg init $TESTTMP/client4
294 $ cd $TESTTMP/client4
297 $ cd $TESTTMP/client4
295 $ cat >> .hg/hgrc <<EOF
298 $ cat >> .hg/hgrc <<EOF
296 > [paths]
299 > [paths]
297 > default = http://localhost:$HGPORT
300 > default = http://localhost:$HGPORT
298 > EOF
301 > EOF
299 $ echo 'non-lfs' > nonlfs2.txt
302 $ echo 'non-lfs' > nonlfs2.txt
300 $ hg ci -Aqm 'non-lfs'
303 $ hg ci -Aqm 'non-lfs'
301 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
304 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
302 $TESTTMP/server/.hg/requires:lfs
305 $TESTTMP/server/.hg/requires:lfs
303
306
304 $ hg push -q --force
307 $ hg push -q --force
305 warning: repository is unrelated
308 warning: repository is unrelated
306 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
309 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
307 $TESTTMP/server/.hg/requires:lfs
310 $TESTTMP/server/.hg/requires:lfs
308
311
309 $ hg clone http://localhost:$HGPORT $TESTTMP/client4_clone
312 $ hg clone http://localhost:$HGPORT $TESTTMP/client4_clone
310 (remote is using large file support (lfs), but it is explicitly disabled in the local configuration)
313 (remote is using large file support (lfs), but it is explicitly disabled in the local configuration)
311 abort: repository requires features unknown to this Mercurial: lfs!
314 abort: repository requires features unknown to this Mercurial: lfs!
312 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
315 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
313 [255]
316 [255]
314 $ grep 'lfs' $TESTTMP/client4_clone/.hg/requires $SERVER_REQUIRES
317 $ grep 'lfs' $TESTTMP/client4_clone/.hg/requires $SERVER_REQUIRES
315 grep: $TESTTMP/client4_clone/.hg/requires: $ENOENT$
318 grep: $TESTTMP/client4_clone/.hg/requires: $ENOENT$
316 $TESTTMP/server/.hg/requires:lfs
319 $TESTTMP/server/.hg/requires:lfs
317 [2]
320 [2]
318
321
319 TODO: fail more gracefully.
322 TODO: fail more gracefully.
320
323
321 $ hg init $TESTTMP/client4_pull
324 $ hg init $TESTTMP/client4_pull
322 $ hg -R $TESTTMP/client4_pull pull http://localhost:$HGPORT
325 $ hg -R $TESTTMP/client4_pull pull http://localhost:$HGPORT
323 pulling from http://localhost:$HGPORT/
326 pulling from http://localhost:$HGPORT/
324 requesting all changes
327 requesting all changes
325 remote: abort: no common changegroup version
328 remote: abort: no common changegroup version
326 abort: pull failed on remote
329 abort: pull failed on remote
327 [255]
330 [255]
328 $ grep 'lfs' $TESTTMP/client4_pull/.hg/requires $SERVER_REQUIRES
331 $ grep 'lfs' $TESTTMP/client4_pull/.hg/requires $SERVER_REQUIRES
329 $TESTTMP/server/.hg/requires:lfs
332 $TESTTMP/server/.hg/requires:lfs
330
333
331 $ hg identify http://localhost:$HGPORT
334 $ hg identify http://localhost:$HGPORT
332 03b080fa9d93
335 03b080fa9d93
333
336
334 --------------------------------------------------------------------------------
337 --------------------------------------------------------------------------------
335 Case #5: client with non-lfs content and the extension enabled; server with
338 Case #5: client with non-lfs content and the extension enabled; server with
336 lfs content, and the extension enabled.
339 lfs content, and the extension enabled.
337
340
338 $ cat >> $HGRCPATH <<EOF
341 $ cat >> $HGRCPATH <<EOF
339 > [extensions]
342 > [extensions]
340 > lfs =
343 > lfs =
341 > EOF
344 > EOF
342 $ echo 'non-lfs' > nonlfs3.txt
345 $ echo 'non-lfs' > nonlfs3.txt
343 $ hg ci -Aqm 'non-lfs file with lfs client'
346 $ hg ci -Aqm 'non-lfs file with lfs client'
344
347
345 $ hg push -q
348 $ hg push -q
346 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
349 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
347 $TESTTMP/server/.hg/requires:lfs
350 $TESTTMP/server/.hg/requires:lfs
348
351
349 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client5_clone
352 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client5_clone
350 $ grep 'lfs' $TESTTMP/client5_clone/.hg/requires $SERVER_REQUIRES
353 $ grep 'lfs' $TESTTMP/client5_clone/.hg/requires $SERVER_REQUIRES
351 $TESTTMP/client5_clone/.hg/requires:lfs
354 $TESTTMP/client5_clone/.hg/requires:lfs
352 $TESTTMP/server/.hg/requires:lfs
355 $TESTTMP/server/.hg/requires:lfs
353
356
354 $ hg init $TESTTMP/client5_pull
357 $ hg init $TESTTMP/client5_pull
355 $ hg -R $TESTTMP/client5_pull pull -q http://localhost:$HGPORT
358 $ hg -R $TESTTMP/client5_pull pull -q http://localhost:$HGPORT
356 $ grep 'lfs' $TESTTMP/client5_pull/.hg/requires $SERVER_REQUIRES
359 $ grep 'lfs' $TESTTMP/client5_pull/.hg/requires $SERVER_REQUIRES
357 $TESTTMP/client5_pull/.hg/requires:lfs
360 $TESTTMP/client5_pull/.hg/requires:lfs
358 $TESTTMP/server/.hg/requires:lfs
361 $TESTTMP/server/.hg/requires:lfs
359
362
360 $ hg identify http://localhost:$HGPORT
363 $ hg identify http://localhost:$HGPORT
361 c729025cc5e3
364 c729025cc5e3
362
365
363 $ mv $HGRCPATH $HGRCPATH.tmp
366 $ mv $HGRCPATH $HGRCPATH.tmp
364 $ cp $HGRCPATH.orig $HGRCPATH
367 $ cp $HGRCPATH.orig $HGRCPATH
365
368
366 >>> from __future__ import absolute_import
369 >>> from __future__ import absolute_import
367 >>> from hgclient import bprint, check, readchannel, runcommand, stdout
370 >>> from hgclient import bprint, check, readchannel, runcommand, stdout
368 >>> @check
371 >>> @check
369 ... def checkflags(server):
372 ... def checkflags(server):
370 ... readchannel(server)
373 ... readchannel(server)
371 ... bprint(b'')
374 ... bprint(b'')
372 ... bprint(b'# LFS required- both lfs and non-lfs revlogs have 0x2000 flag')
375 ... bprint(b'# LFS required- both lfs and non-lfs revlogs have 0x2000 flag')
373 ... stdout.flush()
376 ... stdout.flush()
374 ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
377 ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
375 ... b'../server'])
378 ... b'../server'])
376 ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
379 ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
377 ... b'../server'])
380 ... b'../server'])
378 ... runcommand(server, [b'config', b'extensions', b'--cwd',
381 ... runcommand(server, [b'config', b'extensions', b'--cwd',
379 ... b'../server'])
382 ... b'../server'])
380 ...
383 ...
381 ... bprint(b"\n# LFS not enabled- revlogs don't have 0x2000 flag")
384 ... bprint(b"\n# LFS not enabled- revlogs don't have 0x2000 flag")
382 ... stdout.flush()
385 ... stdout.flush()
383 ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
386 ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
384 ... runcommand(server, [b'config', b'extensions'])
387 ... runcommand(server, [b'config', b'extensions'])
385
388
386 # LFS required- both lfs and non-lfs revlogs have 0x2000 flag
389 # LFS required- both lfs and non-lfs revlogs have 0x2000 flag
387 *** runcommand debugprocessors lfs.bin -R ../server
390 *** runcommand debugprocessors lfs.bin -R ../server
388 registered processor '0x8000'
391 registered processor '0x8000'
389 registered processor '0x2000'
392 registered processor '0x2000'
390 *** runcommand debugprocessors nonlfs2.txt -R ../server
393 *** runcommand debugprocessors nonlfs2.txt -R ../server
391 registered processor '0x8000'
394 registered processor '0x8000'
392 registered processor '0x2000'
395 registered processor '0x2000'
393 *** runcommand config extensions --cwd ../server
396 *** runcommand config extensions --cwd ../server
394 extensions.debugprocessors=$TESTTMP/debugprocessors.py
397 extensions.debugprocessors=$TESTTMP/debugprocessors.py
395 extensions.lfs=
398 extensions.lfs=
396
399
397 # LFS not enabled- revlogs don't have 0x2000 flag
400 # LFS not enabled- revlogs don't have 0x2000 flag
398 *** runcommand debugprocessors nonlfs3.txt
401 *** runcommand debugprocessors nonlfs3.txt
399 registered processor '0x8000'
402 registered processor '0x8000'
400 *** runcommand config extensions
403 *** runcommand config extensions
401 extensions.debugprocessors=$TESTTMP/debugprocessors.py
404 extensions.debugprocessors=$TESTTMP/debugprocessors.py
402
405
403 $ rm $HGRCPATH
406 $ rm $HGRCPATH
404 $ mv $HGRCPATH.tmp $HGRCPATH
407 $ mv $HGRCPATH.tmp $HGRCPATH
405
408
406 $ hg clone $TESTTMP/client $TESTTMP/nonlfs -qr 0 --config extensions.lfs=
409 $ hg clone $TESTTMP/client $TESTTMP/nonlfs -qr 0 --config extensions.lfs=
407 $ cat >> $TESTTMP/nonlfs/.hg/hgrc <<EOF
410 $ cat >> $TESTTMP/nonlfs/.hg/hgrc <<EOF
408 > [extensions]
411 > [extensions]
409 > lfs = !
412 > lfs = !
410 > EOF
413 > EOF
411
414
412 >>> from __future__ import absolute_import, print_function
415 >>> from __future__ import absolute_import, print_function
413 >>> from hgclient import bprint, check, readchannel, runcommand, stdout
416 >>> from hgclient import bprint, check, readchannel, runcommand, stdout
414 >>> @check
417 >>> @check
415 ... def checkflags2(server):
418 ... def checkflags2(server):
416 ... readchannel(server)
419 ... readchannel(server)
417 ... bprint(b'')
420 ... bprint(b'')
418 ... bprint(b'# LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag')
421 ... bprint(b'# LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag')
419 ... stdout.flush()
422 ... stdout.flush()
420 ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
423 ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
421 ... b'../server'])
424 ... b'../server'])
422 ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
425 ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
423 ... b'../server'])
426 ... b'../server'])
424 ... runcommand(server, [b'config', b'extensions', b'--cwd',
427 ... runcommand(server, [b'config', b'extensions', b'--cwd',
425 ... b'../server'])
428 ... b'../server'])
426 ...
429 ...
427 ... bprint(b'\n# LFS enabled without requirement- revlogs have 0x2000 flag')
430 ... bprint(b'\n# LFS enabled without requirement- revlogs have 0x2000 flag')
428 ... stdout.flush()
431 ... stdout.flush()
429 ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
432 ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
430 ... runcommand(server, [b'config', b'extensions'])
433 ... runcommand(server, [b'config', b'extensions'])
431 ...
434 ...
432 ... bprint(b"\n# LFS disabled locally- revlogs don't have 0x2000 flag")
435 ... bprint(b"\n# LFS disabled locally- revlogs don't have 0x2000 flag")
433 ... stdout.flush()
436 ... stdout.flush()
434 ... runcommand(server, [b'debugprocessors', b'nonlfs.txt', b'-R',
437 ... runcommand(server, [b'debugprocessors', b'nonlfs.txt', b'-R',
435 ... b'../nonlfs'])
438 ... b'../nonlfs'])
436 ... runcommand(server, [b'config', b'extensions', b'--cwd',
439 ... runcommand(server, [b'config', b'extensions', b'--cwd',
437 ... b'../nonlfs'])
440 ... b'../nonlfs'])
438
441
439 # LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag
442 # LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag
440 *** runcommand debugprocessors lfs.bin -R ../server
443 *** runcommand debugprocessors lfs.bin -R ../server
441 registered processor '0x8000'
444 registered processor '0x8000'
442 registered processor '0x2000'
445 registered processor '0x2000'
443 *** runcommand debugprocessors nonlfs2.txt -R ../server
446 *** runcommand debugprocessors nonlfs2.txt -R ../server
444 registered processor '0x8000'
447 registered processor '0x8000'
445 registered processor '0x2000'
448 registered processor '0x2000'
446 *** runcommand config extensions --cwd ../server
449 *** runcommand config extensions --cwd ../server
447 extensions.debugprocessors=$TESTTMP/debugprocessors.py
450 extensions.debugprocessors=$TESTTMP/debugprocessors.py
448 extensions.lfs=
451 extensions.lfs=
449
452
450 # LFS enabled without requirement- revlogs have 0x2000 flag
453 # LFS enabled without requirement- revlogs have 0x2000 flag
451 *** runcommand debugprocessors nonlfs3.txt
454 *** runcommand debugprocessors nonlfs3.txt
452 registered processor '0x8000'
455 registered processor '0x8000'
453 registered processor '0x2000'
456 registered processor '0x2000'
454 *** runcommand config extensions
457 *** runcommand config extensions
455 extensions.debugprocessors=$TESTTMP/debugprocessors.py
458 extensions.debugprocessors=$TESTTMP/debugprocessors.py
456 extensions.lfs=
459 extensions.lfs=
457
460
458 # LFS disabled locally- revlogs don't have 0x2000 flag
461 # LFS disabled locally- revlogs don't have 0x2000 flag
459 *** runcommand debugprocessors nonlfs.txt -R ../nonlfs
462 *** runcommand debugprocessors nonlfs.txt -R ../nonlfs
460 registered processor '0x8000'
463 registered processor '0x8000'
461 *** runcommand config extensions --cwd ../nonlfs
464 *** runcommand config extensions --cwd ../nonlfs
462 extensions.debugprocessors=$TESTTMP/debugprocessors.py
465 extensions.debugprocessors=$TESTTMP/debugprocessors.py
463 extensions.lfs=!
466 extensions.lfs=!
464
467
465 --------------------------------------------------------------------------------
468 --------------------------------------------------------------------------------
466 Case #6: client with lfs content and the extension enabled; server with
469 Case #6: client with lfs content and the extension enabled; server with
467 lfs content, and the extension enabled.
470 lfs content, and the extension enabled.
468
471
469 $ echo 'this is another lfs file' > lfs2.txt
472 $ echo 'this is another lfs file' > lfs2.txt
470 $ hg ci -Aqm 'lfs file with lfs client'
473 $ hg ci -Aqm 'lfs file with lfs client'
471
474
472 $ hg --config paths.default= push -v http://localhost:$HGPORT
475 $ hg --config paths.default= push -v http://localhost:$HGPORT
473 pushing to http://localhost:$HGPORT/
476 pushing to http://localhost:$HGPORT/
474 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
477 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
475 searching for changes
478 searching for changes
476 remote has heads on branch 'default' that are not known locally: 8374dc4052cb
479 remote has heads on branch 'default' that are not known locally: 8374dc4052cb
477 lfs: uploading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
480 lfs: uploading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
478 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
481 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
479 lfs: uploaded 1 files (25 bytes)
482 lfs: uploaded 1 files (25 bytes)
480 1 changesets found
483 1 changesets found
481 uncompressed size of bundle content:
484 uncompressed size of bundle content:
482 206 (changelog)
485 206 (changelog)
483 172 (manifests)
486 172 (manifests)
484 275 lfs2.txt
487 275 lfs2.txt
485 remote: adding changesets
488 remote: adding changesets
486 remote: adding manifests
489 remote: adding manifests
487 remote: adding file changes
490 remote: adding file changes
488 remote: added 1 changesets with 1 changes to 1 files
491 remote: added 1 changesets with 1 changes to 1 files
489 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
492 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
490 .hg/requires:lfs
493 .hg/requires:lfs
491 $TESTTMP/server/.hg/requires:lfs
494 $TESTTMP/server/.hg/requires:lfs
492
495
493 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client6_clone
496 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client6_clone
494 $ grep 'lfs' $TESTTMP/client6_clone/.hg/requires $SERVER_REQUIRES
497 $ grep 'lfs' $TESTTMP/client6_clone/.hg/requires $SERVER_REQUIRES
495 $TESTTMP/client6_clone/.hg/requires:lfs
498 $TESTTMP/client6_clone/.hg/requires:lfs
496 $TESTTMP/server/.hg/requires:lfs
499 $TESTTMP/server/.hg/requires:lfs
497
500
498 $ hg init $TESTTMP/client6_pull
501 $ hg init $TESTTMP/client6_pull
499 $ hg -R $TESTTMP/client6_pull pull -u -v http://localhost:$HGPORT
502 $ hg -R $TESTTMP/client6_pull pull -u -v http://localhost:$HGPORT
500 pulling from http://localhost:$HGPORT/
503 pulling from http://localhost:$HGPORT/
501 requesting all changes
504 requesting all changes
502 adding changesets
505 adding changesets
503 adding manifests
506 adding manifests
504 adding file changes
507 adding file changes
505 calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs
508 calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs
506 added 6 changesets with 5 changes to 5 files (+1 heads)
509 added 6 changesets with 5 changes to 5 files (+1 heads)
507 new changesets d437e1d24fbd:d3b84d50eacb
510 new changesets d437e1d24fbd:d3b84d50eacb
508 resolving manifests
511 resolving manifests
509 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
512 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
510 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
513 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
511 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
514 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
512 lfs: downloaded 1 files (25 bytes)
515 lfs: downloaded 1 files (25 bytes)
513 getting lfs2.txt
516 getting lfs2.txt
514 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
517 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
515 getting nonlfs2.txt
518 getting nonlfs2.txt
516 getting nonlfs3.txt
519 getting nonlfs3.txt
517 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
520 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
518 updated to "d3b84d50eacb: lfs file with lfs client"
521 updated to "d3b84d50eacb: lfs file with lfs client"
519 1 other heads for branch "default"
522 1 other heads for branch "default"
520 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
523 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
521 $ grep 'lfs' $TESTTMP/client6_pull/.hg/requires $SERVER_REQUIRES
524 $ grep 'lfs' $TESTTMP/client6_pull/.hg/requires $SERVER_REQUIRES
522 $TESTTMP/client6_pull/.hg/requires:lfs
525 $TESTTMP/client6_pull/.hg/requires:lfs
523 $TESTTMP/server/.hg/requires:lfs
526 $TESTTMP/server/.hg/requires:lfs
524
527
525 $ hg identify http://localhost:$HGPORT
528 $ hg identify http://localhost:$HGPORT
526 d3b84d50eacb
529 d3b84d50eacb
527
530
528 --------------------------------------------------------------------------------
531 --------------------------------------------------------------------------------
529 Misc: process dies early if a requirement exists and the extension is disabled
532 Misc: process dies early if a requirement exists and the extension is disabled
530
533
531 $ hg --config extensions.lfs=! summary
534 $ hg --config extensions.lfs=! summary
532 abort: repository requires features unknown to this Mercurial: lfs!
535 abort: repository requires features unknown to this Mercurial: lfs!
533 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
536 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
534 [255]
537 [255]
535
538
536 $ echo 'this is an lfs file' > $TESTTMP/client6_clone/lfspair1.bin
539 $ echo 'this is an lfs file' > $TESTTMP/client6_clone/lfspair1.bin
537 $ echo 'this is an lfs file too' > $TESTTMP/client6_clone/lfspair2.bin
540 $ echo 'this is an lfs file too' > $TESTTMP/client6_clone/lfspair2.bin
538 $ hg -R $TESTTMP/client6_clone ci -Aqm 'add lfs pair'
541 $ hg -R $TESTTMP/client6_clone ci -Aqm 'add lfs pair'
539 $ hg -R $TESTTMP/client6_clone push -q
542 $ hg -R $TESTTMP/client6_clone push -q
540
543
541 $ hg clone -qU http://localhost:$HGPORT $TESTTMP/bulkfetch
544 $ hg clone -qU http://localhost:$HGPORT $TESTTMP/bulkfetch
542
545
543 Cat doesn't prefetch unless data is needed (e.g. '-T {rawdata}' doesn't need it)
546 Cat doesn't prefetch unless data is needed (e.g. '-T {rawdata}' doesn't need it)
544
547
545 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T '{rawdata}\n{path}\n'
548 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T '{rawdata}\n{path}\n'
546 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
549 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
547 version https://git-lfs.github.com/spec/v1
550 version https://git-lfs.github.com/spec/v1
548 oid sha256:cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
551 oid sha256:cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
549 size 20
552 size 20
550 x-is-binary 0
553 x-is-binary 0
551
554
552 lfspair1.bin
555 lfspair1.bin
553
556
554 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T json
557 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T json
555 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
558 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
556 [lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
559 [lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
557 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
560 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
558 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
561 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
559 lfs: downloaded 1 files (20 bytes)
562 lfs: downloaded 1 files (20 bytes)
560 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
563 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
561
564
562 {
565 {
563 "data": "this is an lfs file\n",
566 "data": "this is an lfs file\n",
564 "path": "lfspair1.bin",
567 "path": "lfspair1.bin",
565 "rawdata": "version https://git-lfs.github.com/spec/v1\noid sha256:cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782\nsize 20\nx-is-binary 0\n"
568 "rawdata": "version https://git-lfs.github.com/spec/v1\noid sha256:cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782\nsize 20\nx-is-binary 0\n"
566 }
569 }
567 ]
570 ]
568
571
569 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
572 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
570
573
571 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T '{data}\n'
574 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T '{data}\n'
572 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
575 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
573 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
576 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
574 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
577 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
575 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
578 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
576 lfs: downloaded 1 files (20 bytes)
579 lfs: downloaded 1 files (20 bytes)
577 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
580 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
578 this is an lfs file
581 this is an lfs file
579
582
580 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair2.bin
583 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair2.bin
581 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
584 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
582 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
585 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
583 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
586 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
584 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
587 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
585 lfs: downloaded 1 files (24 bytes)
588 lfs: downloaded 1 files (24 bytes)
586 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
589 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
587 this is an lfs file too
590 this is an lfs file too
588
591
589 Export will prefetch all needed files across all needed revisions
592 Export will prefetch all needed files across all needed revisions
590
593
591 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
594 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
592 $ hg -R $TESTTMP/bulkfetch -v export -r 0:tip -o all.export
595 $ hg -R $TESTTMP/bulkfetch -v export -r 0:tip -o all.export
593 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
596 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
594 exporting patches:
597 exporting patches:
595 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
598 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
596 lfs: need to transfer 4 objects (92 bytes)
599 lfs: need to transfer 4 objects (92 bytes)
597 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
600 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
598 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
601 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
599 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
602 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
600 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
603 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
601 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
604 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
602 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
605 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
603 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
606 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
604 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
607 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
605 lfs: downloaded 4 files (92 bytes)
608 lfs: downloaded 4 files (92 bytes)
606 all.export
609 all.export
607 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
610 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
608 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
611 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
609 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
612 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
610 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
613 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
611
614
612 Export with selected files is used with `extdiff --patch`
615 Export with selected files is used with `extdiff --patch`
613
616
614 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
617 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
615 $ hg --config extensions.extdiff= \
618 $ hg --config extensions.extdiff= \
616 > -R $TESTTMP/bulkfetch -v extdiff -r 2:tip --patch $TESTTMP/bulkfetch/lfs.bin
619 > -R $TESTTMP/bulkfetch -v extdiff -r 2:tip --patch $TESTTMP/bulkfetch/lfs.bin
617 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
620 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
618 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
621 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
619 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
622 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
620 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
623 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
621 lfs: downloaded 1 files (23 bytes)
624 lfs: downloaded 1 files (23 bytes)
622 */hg-8374dc4052cb.patch (glob)
625 */hg-8374dc4052cb.patch (glob)
623 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
626 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
624 */hg-9640b57e77b1.patch (glob)
627 */hg-9640b57e77b1.patch (glob)
625 --- */hg-8374dc4052cb.patch * (glob)
628 --- */hg-8374dc4052cb.patch * (glob)
626 +++ */hg-9640b57e77b1.patch * (glob)
629 +++ */hg-9640b57e77b1.patch * (glob)
627 @@ -2,12 +2,7 @@
630 @@ -2,12 +2,7 @@
628 # User test
631 # User test
629 # Date 0 0
632 # Date 0 0
630 # Thu Jan 01 00:00:00 1970 +0000
633 # Thu Jan 01 00:00:00 1970 +0000
631 -# Node ID 8374dc4052cbd388e79d9dc4ddb29784097aa354
634 -# Node ID 8374dc4052cbd388e79d9dc4ddb29784097aa354
632 -# Parent 1477875038c60152e391238920a16381c627b487
635 -# Parent 1477875038c60152e391238920a16381c627b487
633 -lfs
636 -lfs
634 +# Node ID 9640b57e77b14c3a0144fb4478b6cc13e13ea0d1
637 +# Node ID 9640b57e77b14c3a0144fb4478b6cc13e13ea0d1
635 +# Parent d3b84d50eacbd56638e11abce6b8616aaba54420
638 +# Parent d3b84d50eacbd56638e11abce6b8616aaba54420
636 +add lfs pair
639 +add lfs pair
637
640
638 -diff -r 1477875038c6 -r 8374dc4052cb lfs.bin
641 -diff -r 1477875038c6 -r 8374dc4052cb lfs.bin
639 ---- /dev/null Thu Jan 01 00:00:00 1970 +0000
642 ---- /dev/null Thu Jan 01 00:00:00 1970 +0000
640 -+++ b/lfs.bin Thu Jan 01 00:00:00 1970 +0000
643 -+++ b/lfs.bin Thu Jan 01 00:00:00 1970 +0000
641 -@@ -0,0 +1,1 @@
644 -@@ -0,0 +1,1 @@
642 -+this is a big lfs file
645 -+this is a big lfs file
643 cleaning up temp directory
646 cleaning up temp directory
644 [1]
647 [1]
645
648
646 Diff will prefetch files
649 Diff will prefetch files
647
650
648 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
651 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
649 $ hg -R $TESTTMP/bulkfetch -v diff -r 2:tip
652 $ hg -R $TESTTMP/bulkfetch -v diff -r 2:tip
650 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
653 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
651 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
654 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
652 lfs: need to transfer 4 objects (92 bytes)
655 lfs: need to transfer 4 objects (92 bytes)
653 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
656 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
654 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
657 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
655 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
658 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
656 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
659 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
657 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
660 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
658 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
661 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
659 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
662 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
660 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
663 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
661 lfs: downloaded 4 files (92 bytes)
664 lfs: downloaded 4 files (92 bytes)
662 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
665 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
663 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
666 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
664 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
667 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
665 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
668 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
666 diff -r 8374dc4052cb -r 9640b57e77b1 lfs.bin
669 diff -r 8374dc4052cb -r 9640b57e77b1 lfs.bin
667 --- a/lfs.bin Thu Jan 01 00:00:00 1970 +0000
670 --- a/lfs.bin Thu Jan 01 00:00:00 1970 +0000
668 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
671 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
669 @@ -1,1 +0,0 @@
672 @@ -1,1 +0,0 @@
670 -this is a big lfs file
673 -this is a big lfs file
671 diff -r 8374dc4052cb -r 9640b57e77b1 lfs2.txt
674 diff -r 8374dc4052cb -r 9640b57e77b1 lfs2.txt
672 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
675 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
673 +++ b/lfs2.txt Thu Jan 01 00:00:00 1970 +0000
676 +++ b/lfs2.txt Thu Jan 01 00:00:00 1970 +0000
674 @@ -0,0 +1,1 @@
677 @@ -0,0 +1,1 @@
675 +this is another lfs file
678 +this is another lfs file
676 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair1.bin
679 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair1.bin
677 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
680 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
678 +++ b/lfspair1.bin Thu Jan 01 00:00:00 1970 +0000
681 +++ b/lfspair1.bin Thu Jan 01 00:00:00 1970 +0000
679 @@ -0,0 +1,1 @@
682 @@ -0,0 +1,1 @@
680 +this is an lfs file
683 +this is an lfs file
681 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair2.bin
684 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair2.bin
682 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
685 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
683 +++ b/lfspair2.bin Thu Jan 01 00:00:00 1970 +0000
686 +++ b/lfspair2.bin Thu Jan 01 00:00:00 1970 +0000
684 @@ -0,0 +1,1 @@
687 @@ -0,0 +1,1 @@
685 +this is an lfs file too
688 +this is an lfs file too
686 diff -r 8374dc4052cb -r 9640b57e77b1 nonlfs.txt
689 diff -r 8374dc4052cb -r 9640b57e77b1 nonlfs.txt
687 --- a/nonlfs.txt Thu Jan 01 00:00:00 1970 +0000
690 --- a/nonlfs.txt Thu Jan 01 00:00:00 1970 +0000
688 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
691 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
689 @@ -1,1 +0,0 @@
692 @@ -1,1 +0,0 @@
690 -non-lfs
693 -non-lfs
691 diff -r 8374dc4052cb -r 9640b57e77b1 nonlfs3.txt
694 diff -r 8374dc4052cb -r 9640b57e77b1 nonlfs3.txt
692 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
695 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
693 +++ b/nonlfs3.txt Thu Jan 01 00:00:00 1970 +0000
696 +++ b/nonlfs3.txt Thu Jan 01 00:00:00 1970 +0000
694 @@ -0,0 +1,1 @@
697 @@ -0,0 +1,1 @@
695 +non-lfs
698 +non-lfs
696
699
697 Only the files required by diff are prefetched
700 Only the files required by diff are prefetched
698
701
699 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
702 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
700 $ hg -R $TESTTMP/bulkfetch -v diff -r 2:tip $TESTTMP/bulkfetch/lfspair2.bin
703 $ hg -R $TESTTMP/bulkfetch -v diff -r 2:tip $TESTTMP/bulkfetch/lfspair2.bin
701 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
704 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
702 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
705 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
703 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
706 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
704 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
707 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
705 lfs: downloaded 1 files (24 bytes)
708 lfs: downloaded 1 files (24 bytes)
706 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
709 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
707 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair2.bin
710 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair2.bin
708 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
711 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
709 +++ b/lfspair2.bin Thu Jan 01 00:00:00 1970 +0000
712 +++ b/lfspair2.bin Thu Jan 01 00:00:00 1970 +0000
710 @@ -0,0 +1,1 @@
713 @@ -0,0 +1,1 @@
711 +this is an lfs file too
714 +this is an lfs file too
712
715
713 #endif
716 #endif
714
717
715 $ "$PYTHON" $TESTDIR/killdaemons.py $DAEMON_PIDS
718 $ "$PYTHON" $TESTDIR/killdaemons.py $DAEMON_PIDS
716
719
717 $ cat $TESTTMP/errors.log
720 $ cat $TESTTMP/errors.log
@@ -1,98 +1,102 b''
1 ==========================================================
1 ==========================================================
2 Test file dedicated to checking side-data related behavior
2 Test file dedicated to checking side-data related behavior
3 ==========================================================
3 ==========================================================
4
4
5 Check data can be written/read from sidedata
5 Check data can be written/read from sidedata
6 ============================================
6 ============================================
7
7
8 $ cat << EOF >> $HGRCPATH
8 $ cat << EOF >> $HGRCPATH
9 > [extensions]
9 > [extensions]
10 > testsidedata=$TESTDIR/testlib/ext-sidedata.py
10 > testsidedata=$TESTDIR/testlib/ext-sidedata.py
11 > EOF
11 > EOF
12
12
13 $ hg init test-sidedata --config format.use-side-data=yes
13 $ hg init test-sidedata --config format.use-side-data=yes
14 $ cd test-sidedata
14 $ cd test-sidedata
15 $ echo aaa > a
15 $ echo aaa > a
16 $ hg add a
16 $ hg add a
17 $ hg commit -m a --traceback
17 $ hg commit -m a --traceback
18 $ echo aaa > b
18 $ echo aaa > b
19 $ hg add b
19 $ hg add b
20 $ hg commit -m b
20 $ hg commit -m b
21 $ echo xxx >> a
21 $ echo xxx >> a
22 $ hg commit -m aa
22 $ hg commit -m aa
23
23
24 $ hg debugsidedata -c 0
24 $ hg debugsidedata -c 0
25 2 sidedata entries
25 2 sidedata entries
26 entry-0001 size 4
26 entry-0001 size 4
27 entry-0002 size 32
27 entry-0002 size 32
28 $ hg debugsidedata -c 1 -v
28 $ hg debugsidedata -c 1 -v
29 2 sidedata entries
29 2 sidedata entries
30 entry-0001 size 4
30 entry-0001 size 4
31 '\x00\x00\x006'
31 '\x00\x00\x006'
32 entry-0002 size 32
32 entry-0002 size 32
33 '\x98\t\xf9\xc4v\xf0\xc5P\x90\xf7wRf\xe8\xe27e\xfc\xc1\x93\xa4\x96\xd0\x1d\x97\xaaG\x1d\xd7t\xfa\xde'
33 '\x98\t\xf9\xc4v\xf0\xc5P\x90\xf7wRf\xe8\xe27e\xfc\xc1\x93\xa4\x96\xd0\x1d\x97\xaaG\x1d\xd7t\xfa\xde'
34 $ hg debugsidedata -m 2
34 $ hg debugsidedata -m 2
35 2 sidedata entries
35 2 sidedata entries
36 entry-0001 size 4
36 entry-0001 size 4
37 entry-0002 size 32
37 entry-0002 size 32
38 $ hg debugsidedata a 1
38 $ hg debugsidedata a 1
39 2 sidedata entries
39 2 sidedata entries
40 entry-0001 size 4
40 entry-0001 size 4
41 entry-0002 size 32
41 entry-0002 size 32
42
42
43 Check upgrade behavior
43 Check upgrade behavior
44 ======================
44 ======================
45
45
46 Right now, sidedata has not upgrade support
46 Right now, sidedata has not upgrade support
47
47
48 Check that we can upgrade to sidedata
48 Check that we can upgrade to sidedata
49 -------------------------------------
49 -------------------------------------
50
50
51 $ hg init up-no-side-data --config format.use-side-data=no
51 $ hg init up-no-side-data --config format.use-side-data=no
52 $ hg debugformat -v -R up-no-side-data
52 $ hg debugformat -v -R up-no-side-data
53 format-variant repo config default
53 format-variant repo config default
54 fncache: yes yes yes
54 fncache: yes yes yes
55 dotencode: yes yes yes
55 dotencode: yes yes yes
56 generaldelta: yes yes yes
56 generaldelta: yes yes yes
57 sparserevlog: yes yes yes
57 sparserevlog: yes yes yes
58 sidedata: no no no
58 sidedata: no no no
59 copies-sdc: no no no
59 plain-cl-delta: yes yes yes
60 plain-cl-delta: yes yes yes
60 compression: zlib zlib zlib
61 compression: zlib zlib zlib
61 compression-level: default default default
62 compression-level: default default default
62 $ hg debugformat -v -R up-no-side-data --config format.use-side-data=yes
63 $ hg debugformat -v -R up-no-side-data --config format.use-side-data=yes
63 format-variant repo config default
64 format-variant repo config default
64 fncache: yes yes yes
65 fncache: yes yes yes
65 dotencode: yes yes yes
66 dotencode: yes yes yes
66 generaldelta: yes yes yes
67 generaldelta: yes yes yes
67 sparserevlog: yes yes yes
68 sparserevlog: yes yes yes
68 sidedata: no yes no
69 sidedata: no yes no
70 copies-sdc: no no no
69 plain-cl-delta: yes yes yes
71 plain-cl-delta: yes yes yes
70 compression: zlib zlib zlib
72 compression: zlib zlib zlib
71 compression-level: default default default
73 compression-level: default default default
72 $ hg debugupgraderepo -R up-no-side-data --config format.use-side-data=yes > /dev/null
74 $ hg debugupgraderepo -R up-no-side-data --config format.use-side-data=yes > /dev/null
73
75
74 Check that we can downgrade from sidedata
76 Check that we can downgrade from sidedata
75 -----------------------------------------
77 -----------------------------------------
76
78
77 $ hg init up-side-data --config format.use-side-data=yes
79 $ hg init up-side-data --config format.use-side-data=yes
78 $ hg debugformat -v -R up-side-data
80 $ hg debugformat -v -R up-side-data
79 format-variant repo config default
81 format-variant repo config default
80 fncache: yes yes yes
82 fncache: yes yes yes
81 dotencode: yes yes yes
83 dotencode: yes yes yes
82 generaldelta: yes yes yes
84 generaldelta: yes yes yes
83 sparserevlog: yes yes yes
85 sparserevlog: yes yes yes
84 sidedata: yes no no
86 sidedata: yes no no
87 copies-sdc: no no no
85 plain-cl-delta: yes yes yes
88 plain-cl-delta: yes yes yes
86 compression: zlib zlib zlib
89 compression: zlib zlib zlib
87 compression-level: default default default
90 compression-level: default default default
88 $ hg debugformat -v -R up-side-data --config format.use-side-data=no
91 $ hg debugformat -v -R up-side-data --config format.use-side-data=no
89 format-variant repo config default
92 format-variant repo config default
90 fncache: yes yes yes
93 fncache: yes yes yes
91 dotencode: yes yes yes
94 dotencode: yes yes yes
92 generaldelta: yes yes yes
95 generaldelta: yes yes yes
93 sparserevlog: yes yes yes
96 sparserevlog: yes yes yes
94 sidedata: yes no no
97 sidedata: yes no no
98 copies-sdc: no no no
95 plain-cl-delta: yes yes yes
99 plain-cl-delta: yes yes yes
96 compression: zlib zlib zlib
100 compression: zlib zlib zlib
97 compression-level: default default default
101 compression-level: default default default
98 $ hg debugupgraderepo -R up-side-data --config format.use-side-data=no > /dev/null
102 $ hg debugupgraderepo -R up-side-data --config format.use-side-data=no > /dev/null
@@ -1,1413 +1,1490 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 sparserevlog: yes
59 sparserevlog: yes
60 sidedata: no
60 sidedata: no
61 copies-sdc: no
61 plain-cl-delta: yes
62 plain-cl-delta: yes
62 compression: zlib
63 compression: zlib
63 compression-level: default
64 compression-level: default
64 $ hg debugformat --verbose
65 $ hg debugformat --verbose
65 format-variant repo config default
66 format-variant repo config default
66 fncache: yes yes yes
67 fncache: yes yes yes
67 dotencode: yes yes yes
68 dotencode: yes yes yes
68 generaldelta: yes yes yes
69 generaldelta: yes yes yes
69 sparserevlog: yes yes yes
70 sparserevlog: yes yes yes
70 sidedata: no no no
71 sidedata: no no no
72 copies-sdc: no no no
71 plain-cl-delta: yes yes yes
73 plain-cl-delta: yes yes yes
72 compression: zlib zlib zlib
74 compression: zlib zlib zlib
73 compression-level: default default default
75 compression-level: default default default
74 $ hg debugformat --verbose --config format.usefncache=no
76 $ hg debugformat --verbose --config format.usefncache=no
75 format-variant repo config default
77 format-variant repo config default
76 fncache: yes no yes
78 fncache: yes no yes
77 dotencode: yes no yes
79 dotencode: yes no yes
78 generaldelta: yes yes yes
80 generaldelta: yes yes yes
79 sparserevlog: yes yes yes
81 sparserevlog: yes yes yes
80 sidedata: no no no
82 sidedata: no no no
83 copies-sdc: no no no
81 plain-cl-delta: yes yes yes
84 plain-cl-delta: yes yes yes
82 compression: zlib zlib zlib
85 compression: zlib zlib zlib
83 compression-level: default default default
86 compression-level: default default default
84 $ hg debugformat --verbose --config format.usefncache=no --color=debug
87 $ hg debugformat --verbose --config format.usefncache=no --color=debug
85 format-variant repo config default
88 format-variant repo config default
86 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
89 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
87 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
90 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
88 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
91 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
89 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
92 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
90 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
93 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
94 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
91 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
95 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
92 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
96 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
93 [formatvariant.name.uptodate|compression-level:][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
97 [formatvariant.name.uptodate|compression-level:][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
94 $ hg debugformat -Tjson
98 $ hg debugformat -Tjson
95 [
99 [
96 {
100 {
97 "config": true,
101 "config": true,
98 "default": true,
102 "default": true,
99 "name": "fncache",
103 "name": "fncache",
100 "repo": true
104 "repo": true
101 },
105 },
102 {
106 {
103 "config": true,
107 "config": true,
104 "default": true,
108 "default": true,
105 "name": "dotencode",
109 "name": "dotencode",
106 "repo": true
110 "repo": true
107 },
111 },
108 {
112 {
109 "config": true,
113 "config": true,
110 "default": true,
114 "default": true,
111 "name": "generaldelta",
115 "name": "generaldelta",
112 "repo": true
116 "repo": true
113 },
117 },
114 {
118 {
115 "config": true,
119 "config": true,
116 "default": true,
120 "default": true,
117 "name": "sparserevlog",
121 "name": "sparserevlog",
118 "repo": true
122 "repo": true
119 },
123 },
120 {
124 {
121 "config": false,
125 "config": false,
122 "default": false,
126 "default": false,
123 "name": "sidedata",
127 "name": "sidedata",
124 "repo": false
128 "repo": false
125 },
129 },
126 {
130 {
131 "config": false,
132 "default": false,
133 "name": "copies-sdc",
134 "repo": false
135 },
136 {
127 "config": true,
137 "config": true,
128 "default": true,
138 "default": true,
129 "name": "plain-cl-delta",
139 "name": "plain-cl-delta",
130 "repo": true
140 "repo": true
131 },
141 },
132 {
142 {
133 "config": "zlib",
143 "config": "zlib",
134 "default": "zlib",
144 "default": "zlib",
135 "name": "compression",
145 "name": "compression",
136 "repo": "zlib"
146 "repo": "zlib"
137 },
147 },
138 {
148 {
139 "config": "default",
149 "config": "default",
140 "default": "default",
150 "default": "default",
141 "name": "compression-level",
151 "name": "compression-level",
142 "repo": "default"
152 "repo": "default"
143 }
153 }
144 ]
154 ]
145 $ hg debugupgraderepo
155 $ hg debugupgraderepo
146 (no feature deficiencies found in existing repository)
156 (no feature deficiencies found in existing repository)
147 performing an upgrade with "--run" will make the following changes:
157 performing an upgrade with "--run" will make the following changes:
148
158
149 requirements
159 requirements
150 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
160 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
151
161
152 sidedata
162 sidedata
153 Allows storage of extra data alongside a revision.
163 Allows storage of extra data alongside a revision.
154
164
165 copies-sdc
166 Allows to use more efficient algorithm to deal with copy tracing.
167
155 additional optimizations are available by specifying "--optimize <name>":
168 additional optimizations are available by specifying "--optimize <name>":
156
169
157 re-delta-parent
170 re-delta-parent
158 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
171 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
159
172
160 re-delta-multibase
173 re-delta-multibase
161 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
174 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
162
175
163 re-delta-all
176 re-delta-all
164 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
177 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
165
178
166 re-delta-fulladd
179 re-delta-fulladd
167 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.
180 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.
168
181
169
182
170 --optimize can be used to add optimizations
183 --optimize can be used to add optimizations
171
184
172 $ hg debugupgrade --optimize redeltaparent
185 $ hg debugupgrade --optimize redeltaparent
173 (no feature deficiencies found in existing repository)
186 (no feature deficiencies found in existing repository)
174 performing an upgrade with "--run" will make the following changes:
187 performing an upgrade with "--run" will make the following changes:
175
188
176 requirements
189 requirements
177 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
190 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
178
191
179 sidedata
192 sidedata
180 Allows storage of extra data alongside a revision.
193 Allows storage of extra data alongside a revision.
181
194
195 copies-sdc
196 Allows to use more efficient algorithm to deal with copy tracing.
197
182 re-delta-parent
198 re-delta-parent
183 deltas within internal storage will choose a new base revision if needed
199 deltas within internal storage will choose a new base revision if needed
184
200
185 additional optimizations are available by specifying "--optimize <name>":
201 additional optimizations are available by specifying "--optimize <name>":
186
202
187 re-delta-multibase
203 re-delta-multibase
188 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
204 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
189
205
190 re-delta-all
206 re-delta-all
191 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
207 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
192
208
193 re-delta-fulladd
209 re-delta-fulladd
194 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.
210 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.
195
211
196
212
197 modern form of the option
213 modern form of the option
198
214
199 $ hg debugupgrade --optimize re-delta-parent
215 $ hg debugupgrade --optimize re-delta-parent
200 (no feature deficiencies found in existing repository)
216 (no feature deficiencies found in existing repository)
201 performing an upgrade with "--run" will make the following changes:
217 performing an upgrade with "--run" will make the following changes:
202
218
203 requirements
219 requirements
204 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
220 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
205
221
206 sidedata
222 sidedata
207 Allows storage of extra data alongside a revision.
223 Allows storage of extra data alongside a revision.
208
224
225 copies-sdc
226 Allows to use more efficient algorithm to deal with copy tracing.
227
209 re-delta-parent
228 re-delta-parent
210 deltas within internal storage will choose a new base revision if needed
229 deltas within internal storage will choose a new base revision if needed
211
230
212 additional optimizations are available by specifying "--optimize <name>":
231 additional optimizations are available by specifying "--optimize <name>":
213
232
214 re-delta-multibase
233 re-delta-multibase
215 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
216
235
217 re-delta-all
236 re-delta-all
218 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
219
238
220 re-delta-fulladd
239 re-delta-fulladd
221 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.
222
241
223
242
224 unknown optimization:
243 unknown optimization:
225
244
226 $ hg debugupgrade --optimize foobar
245 $ hg debugupgrade --optimize foobar
227 abort: unknown optimization action requested: foobar
246 abort: unknown optimization action requested: foobar
228 (run without arguments to see valid optimizations)
247 (run without arguments to see valid optimizations)
229 [255]
248 [255]
230
249
231 Various sub-optimal detections work
250 Various sub-optimal detections work
232
251
233 $ cat > .hg/requires << EOF
252 $ cat > .hg/requires << EOF
234 > revlogv1
253 > revlogv1
235 > store
254 > store
236 > EOF
255 > EOF
237
256
238 $ hg debugformat
257 $ hg debugformat
239 format-variant repo
258 format-variant repo
240 fncache: no
259 fncache: no
241 dotencode: no
260 dotencode: no
242 generaldelta: no
261 generaldelta: no
243 sparserevlog: no
262 sparserevlog: no
244 sidedata: no
263 sidedata: no
264 copies-sdc: no
245 plain-cl-delta: yes
265 plain-cl-delta: yes
246 compression: zlib
266 compression: zlib
247 compression-level: default
267 compression-level: default
248 $ hg debugformat --verbose
268 $ hg debugformat --verbose
249 format-variant repo config default
269 format-variant repo config default
250 fncache: no yes yes
270 fncache: no yes yes
251 dotencode: no yes yes
271 dotencode: no yes yes
252 generaldelta: no yes yes
272 generaldelta: no yes yes
253 sparserevlog: no yes yes
273 sparserevlog: no yes yes
254 sidedata: no no no
274 sidedata: no no no
275 copies-sdc: no no no
255 plain-cl-delta: yes yes yes
276 plain-cl-delta: yes yes yes
256 compression: zlib zlib zlib
277 compression: zlib zlib zlib
257 compression-level: default default default
278 compression-level: default default default
258 $ hg debugformat --verbose --config format.usegeneraldelta=no
279 $ hg debugformat --verbose --config format.usegeneraldelta=no
259 format-variant repo config default
280 format-variant repo config default
260 fncache: no yes yes
281 fncache: no yes yes
261 dotencode: no yes yes
282 dotencode: no yes yes
262 generaldelta: no no yes
283 generaldelta: no no yes
263 sparserevlog: no no yes
284 sparserevlog: no no yes
264 sidedata: no no no
285 sidedata: no no no
286 copies-sdc: no no no
265 plain-cl-delta: yes yes yes
287 plain-cl-delta: yes yes yes
266 compression: zlib zlib zlib
288 compression: zlib zlib zlib
267 compression-level: default default default
289 compression-level: default default default
268 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
290 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
269 format-variant repo config default
291 format-variant repo config default
270 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
292 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
271 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
293 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
272 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
294 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
273 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
295 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
274 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
296 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
297 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
275 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
298 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
276 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
299 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
277 [formatvariant.name.uptodate|compression-level:][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
300 [formatvariant.name.uptodate|compression-level:][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
278 $ hg debugupgraderepo
301 $ hg debugupgraderepo
279 repository lacks features recommended by current config options:
302 repository lacks features recommended by current config options:
280
303
281 fncache
304 fncache
282 long and reserved filenames may not work correctly; repository performance is sub-optimal
305 long and reserved filenames may not work correctly; repository performance is sub-optimal
283
306
284 dotencode
307 dotencode
285 storage of filenames beginning with a period or space may not work correctly
308 storage of filenames beginning with a period or space may not work correctly
286
309
287 generaldelta
310 generaldelta
288 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
311 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
289
312
290 sparserevlog
313 sparserevlog
291 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.
314 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.
292
315
293
316
294 performing an upgrade with "--run" will make the following changes:
317 performing an upgrade with "--run" will make the following changes:
295
318
296 requirements
319 requirements
297 preserved: revlogv1, store
320 preserved: revlogv1, store
298 added: dotencode, fncache, generaldelta, sparserevlog
321 added: dotencode, fncache, generaldelta, sparserevlog
299
322
300 fncache
323 fncache
301 repository will be more resilient to storing certain paths and performance of certain operations should be improved
324 repository will be more resilient to storing certain paths and performance of certain operations should be improved
302
325
303 dotencode
326 dotencode
304 repository will be better able to store files beginning with a space or period
327 repository will be better able to store files beginning with a space or period
305
328
306 generaldelta
329 generaldelta
307 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
330 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
308
331
309 sparserevlog
332 sparserevlog
310 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.
333 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.
311
334
312 sidedata
335 sidedata
313 Allows storage of extra data alongside a revision.
336 Allows storage of extra data alongside a revision.
314
337
338 copies-sdc
339 Allows to use more efficient algorithm to deal with copy tracing.
340
315 additional optimizations are available by specifying "--optimize <name>":
341 additional optimizations are available by specifying "--optimize <name>":
316
342
317 re-delta-parent
343 re-delta-parent
318 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
344 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
319
345
320 re-delta-multibase
346 re-delta-multibase
321 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
347 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
322
348
323 re-delta-all
349 re-delta-all
324 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
350 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
325
351
326 re-delta-fulladd
352 re-delta-fulladd
327 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.
353 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.
328
354
329
355
330 $ hg --config format.dotencode=false debugupgraderepo
356 $ hg --config format.dotencode=false debugupgraderepo
331 repository lacks features recommended by current config options:
357 repository lacks features recommended by current config options:
332
358
333 fncache
359 fncache
334 long and reserved filenames may not work correctly; repository performance is sub-optimal
360 long and reserved filenames may not work correctly; repository performance is sub-optimal
335
361
336 generaldelta
362 generaldelta
337 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
363 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
338
364
339 sparserevlog
365 sparserevlog
340 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.
366 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.
341
367
342 repository lacks features used by the default config options:
368 repository lacks features used by the default config options:
343
369
344 dotencode
370 dotencode
345 storage of filenames beginning with a period or space may not work correctly
371 storage of filenames beginning with a period or space may not work correctly
346
372
347
373
348 performing an upgrade with "--run" will make the following changes:
374 performing an upgrade with "--run" will make the following changes:
349
375
350 requirements
376 requirements
351 preserved: revlogv1, store
377 preserved: revlogv1, store
352 added: fncache, generaldelta, sparserevlog
378 added: fncache, generaldelta, sparserevlog
353
379
354 fncache
380 fncache
355 repository will be more resilient to storing certain paths and performance of certain operations should be improved
381 repository will be more resilient to storing certain paths and performance of certain operations should be improved
356
382
357 generaldelta
383 generaldelta
358 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
384 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
359
385
360 sparserevlog
386 sparserevlog
361 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.
387 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.
362
388
363 sidedata
389 sidedata
364 Allows storage of extra data alongside a revision.
390 Allows storage of extra data alongside a revision.
365
391
392 copies-sdc
393 Allows to use more efficient algorithm to deal with copy tracing.
394
366 additional optimizations are available by specifying "--optimize <name>":
395 additional optimizations are available by specifying "--optimize <name>":
367
396
368 re-delta-parent
397 re-delta-parent
369 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
398 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
370
399
371 re-delta-multibase
400 re-delta-multibase
372 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
401 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
373
402
374 re-delta-all
403 re-delta-all
375 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
404 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
376
405
377 re-delta-fulladd
406 re-delta-fulladd
378 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.
407 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.
379
408
380
409
381 $ cd ..
410 $ cd ..
382
411
383 Upgrading a repository that is already modern essentially no-ops
412 Upgrading a repository that is already modern essentially no-ops
384
413
385 $ hg init modern
414 $ hg init modern
386 $ hg -R modern debugupgraderepo --run
415 $ hg -R modern debugupgraderepo --run
387 upgrade will perform the following actions:
416 upgrade will perform the following actions:
388
417
389 requirements
418 requirements
390 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
419 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
391
420
392 sidedata
421 sidedata
393 Allows storage of extra data alongside a revision.
422 Allows storage of extra data alongside a revision.
394
423
424 copies-sdc
425 Allows to use more efficient algorithm to deal with copy tracing.
426
395 beginning upgrade...
427 beginning upgrade...
396 repository locked and read-only
428 repository locked and read-only
397 creating temporary repository to stage migrated data: $TESTTMP/modern/.hg/upgrade.* (glob)
429 creating temporary repository to stage migrated data: $TESTTMP/modern/.hg/upgrade.* (glob)
398 (it is safe to interrupt this process any time before data migration completes)
430 (it is safe to interrupt this process any time before data migration completes)
399 data fully migrated to temporary repository
431 data fully migrated to temporary repository
400 marking source repository as being upgraded; clients will be unable to read from repository
432 marking source repository as being upgraded; clients will be unable to read from repository
401 starting in-place swap of repository data
433 starting in-place swap of repository data
402 replaced files will be backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
434 replaced files will be backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
403 replacing store...
435 replacing store...
404 store replacement complete; repository was inconsistent for *s (glob)
436 store replacement complete; repository was inconsistent for *s (glob)
405 finalizing requirements file and making repository readable again
437 finalizing requirements file and making repository readable again
406 removing temporary repository $TESTTMP/modern/.hg/upgrade.* (glob)
438 removing temporary repository $TESTTMP/modern/.hg/upgrade.* (glob)
407 copy of old repository backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
439 copy of old repository backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
408 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
440 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
409
441
410 Upgrading a repository to generaldelta works
442 Upgrading a repository to generaldelta works
411
443
412 $ hg --config format.usegeneraldelta=false init upgradegd
444 $ hg --config format.usegeneraldelta=false init upgradegd
413 $ cd upgradegd
445 $ cd upgradegd
414 $ touch f0
446 $ touch f0
415 $ hg -q commit -A -m initial
447 $ hg -q commit -A -m initial
416 $ mkdir FooBarDirectory.d
448 $ mkdir FooBarDirectory.d
417 $ touch FooBarDirectory.d/f1
449 $ touch FooBarDirectory.d/f1
418 $ hg -q commit -A -m 'add f1'
450 $ hg -q commit -A -m 'add f1'
419 $ hg -q up -r 0
451 $ hg -q up -r 0
420 >>> from __future__ import absolute_import, print_function
452 >>> from __future__ import absolute_import, print_function
421 >>> import random
453 >>> import random
422 >>> random.seed(0) # have a reproducible content
454 >>> random.seed(0) # have a reproducible content
423 >>> with open("f2", "w") as f:
455 >>> with open("f2", "w") as f:
424 ... for i in range(100000):
456 ... for i in range(100000):
425 ... f.write("%d\n" % random.randint(1000000000, 9999999999)) and None
457 ... f.write("%d\n" % random.randint(1000000000, 9999999999)) and None
426 $ hg -q commit -A -m 'add f2'
458 $ hg -q commit -A -m 'add f2'
427
459
428 make sure we have a .d file
460 make sure we have a .d file
429
461
430 $ ls -d .hg/store/data/*
462 $ ls -d .hg/store/data/*
431 .hg/store/data/_foo_bar_directory.d.hg
463 .hg/store/data/_foo_bar_directory.d.hg
432 .hg/store/data/f0.i
464 .hg/store/data/f0.i
433 .hg/store/data/f2.d
465 .hg/store/data/f2.d
434 .hg/store/data/f2.i
466 .hg/store/data/f2.i
435
467
436 $ hg debugupgraderepo --run --config format.sparse-revlog=false
468 $ hg debugupgraderepo --run --config format.sparse-revlog=false
437 upgrade will perform the following actions:
469 upgrade will perform the following actions:
438
470
439 requirements
471 requirements
440 preserved: dotencode, fncache, revlogv1, store
472 preserved: dotencode, fncache, revlogv1, store
441 added: generaldelta
473 added: generaldelta
442
474
443 generaldelta
475 generaldelta
444 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
476 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
445
477
446 sidedata
478 sidedata
447 Allows storage of extra data alongside a revision.
479 Allows storage of extra data alongside a revision.
448
480
481 copies-sdc
482 Allows to use more efficient algorithm to deal with copy tracing.
483
449 beginning upgrade...
484 beginning upgrade...
450 repository locked and read-only
485 repository locked and read-only
451 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
486 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
452 (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)
453 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
488 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
454 migrating 519 KB in store; 1.05 MB tracked data
489 migrating 519 KB in store; 1.05 MB tracked data
455 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
490 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
456 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
491 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
457 migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data)
492 migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data)
458 finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes
493 finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes
459 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
494 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
460 finished migrating 3 changelog revisions; change in size: 0 bytes
495 finished migrating 3 changelog revisions; change in size: 0 bytes
461 finished migrating 9 total revisions; total change in store size: -17 bytes
496 finished migrating 9 total revisions; total change in store size: -17 bytes
462 copying phaseroots
497 copying phaseroots
463 data fully migrated to temporary repository
498 data fully migrated to temporary repository
464 marking source repository as being upgraded; clients will be unable to read from repository
499 marking source repository as being upgraded; clients will be unable to read from repository
465 starting in-place swap of repository data
500 starting in-place swap of repository data
466 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
501 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
467 replacing store...
502 replacing store...
468 store replacement complete; repository was inconsistent for *s (glob)
503 store replacement complete; repository was inconsistent for *s (glob)
469 finalizing requirements file and making repository readable again
504 finalizing requirements file and making repository readable again
470 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
505 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
471 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
506 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
472 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
507 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
473
508
474 Original requirements backed up
509 Original requirements backed up
475
510
476 $ cat .hg/upgradebackup.*/requires
511 $ cat .hg/upgradebackup.*/requires
477 dotencode
512 dotencode
478 fncache
513 fncache
479 revlogv1
514 revlogv1
480 store
515 store
481
516
482 generaldelta added to original requirements files
517 generaldelta added to original requirements files
483
518
484 $ cat .hg/requires
519 $ cat .hg/requires
485 dotencode
520 dotencode
486 fncache
521 fncache
487 generaldelta
522 generaldelta
488 revlogv1
523 revlogv1
489 store
524 store
490
525
491 store directory has files we expect
526 store directory has files we expect
492
527
493 $ ls .hg/store
528 $ ls .hg/store
494 00changelog.i
529 00changelog.i
495 00manifest.i
530 00manifest.i
496 data
531 data
497 fncache
532 fncache
498 phaseroots
533 phaseroots
499 undo
534 undo
500 undo.backupfiles
535 undo.backupfiles
501 undo.phaseroots
536 undo.phaseroots
502
537
503 manifest should be generaldelta
538 manifest should be generaldelta
504
539
505 $ hg debugrevlog -m | grep flags
540 $ hg debugrevlog -m | grep flags
506 flags : inline, generaldelta
541 flags : inline, generaldelta
507
542
508 verify should be happy
543 verify should be happy
509
544
510 $ hg verify
545 $ hg verify
511 checking changesets
546 checking changesets
512 checking manifests
547 checking manifests
513 crosschecking files in changesets and manifests
548 crosschecking files in changesets and manifests
514 checking files
549 checking files
515 checked 3 changesets with 3 changes to 3 files
550 checked 3 changesets with 3 changes to 3 files
516
551
517 old store should be backed up
552 old store should be backed up
518
553
519 $ ls -d .hg/upgradebackup.*/
554 $ ls -d .hg/upgradebackup.*/
520 .hg/upgradebackup.*/ (glob)
555 .hg/upgradebackup.*/ (glob)
521 $ ls .hg/upgradebackup.*/store
556 $ ls .hg/upgradebackup.*/store
522 00changelog.i
557 00changelog.i
523 00manifest.i
558 00manifest.i
524 data
559 data
525 fncache
560 fncache
526 phaseroots
561 phaseroots
527 undo
562 undo
528 undo.backup.fncache
563 undo.backup.fncache
529 undo.backupfiles
564 undo.backupfiles
530 undo.phaseroots
565 undo.phaseroots
531
566
532 unless --no-backup is passed
567 unless --no-backup is passed
533
568
534 $ rm -rf .hg/upgradebackup.*/
569 $ rm -rf .hg/upgradebackup.*/
535 $ hg debugupgraderepo --run --no-backup
570 $ hg debugupgraderepo --run --no-backup
536 upgrade will perform the following actions:
571 upgrade will perform the following actions:
537
572
538 requirements
573 requirements
539 preserved: dotencode, fncache, generaldelta, revlogv1, store
574 preserved: dotencode, fncache, generaldelta, revlogv1, store
540 added: sparserevlog
575 added: sparserevlog
541
576
542 sparserevlog
577 sparserevlog
543 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.
578 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.
544
579
545 sidedata
580 sidedata
546 Allows storage of extra data alongside a revision.
581 Allows storage of extra data alongside a revision.
547
582
583 copies-sdc
584 Allows to use more efficient algorithm to deal with copy tracing.
585
548 beginning upgrade...
586 beginning upgrade...
549 repository locked and read-only
587 repository locked and read-only
550 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
588 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
551 (it is safe to interrupt this process any time before data migration completes)
589 (it is safe to interrupt this process any time before data migration completes)
552 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
590 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
553 migrating 519 KB in store; 1.05 MB tracked data
591 migrating 519 KB in store; 1.05 MB tracked data
554 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
592 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
555 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
593 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
556 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
594 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
557 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
595 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
558 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
596 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
559 finished migrating 3 changelog revisions; change in size: 0 bytes
597 finished migrating 3 changelog revisions; change in size: 0 bytes
560 finished migrating 9 total revisions; total change in store size: 0 bytes
598 finished migrating 9 total revisions; total change in store size: 0 bytes
561 copying phaseroots
599 copying phaseroots
562 data fully migrated to temporary repository
600 data fully migrated to temporary repository
563 marking source repository as being upgraded; clients will be unable to read from repository
601 marking source repository as being upgraded; clients will be unable to read from repository
564 starting in-place swap of repository data
602 starting in-place swap of repository data
565 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
603 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
566 replacing store...
604 replacing store...
567 store replacement complete; repository was inconsistent for * (glob)
605 store replacement complete; repository was inconsistent for * (glob)
568 finalizing requirements file and making repository readable again
606 finalizing requirements file and making repository readable again
569 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
607 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
570 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
608 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
571 $ ls -1 .hg/ | grep upgradebackup
609 $ ls -1 .hg/ | grep upgradebackup
572 [1]
610 [1]
573
611
574 We can restrict optimization to some revlog:
612 We can restrict optimization to some revlog:
575
613
576 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
614 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
577 upgrade will perform the following actions:
615 upgrade will perform the following actions:
578
616
579 requirements
617 requirements
580 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
618 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
581
619
582 sidedata
620 sidedata
583 Allows storage of extra data alongside a revision.
621 Allows storage of extra data alongside a revision.
584
622
623 copies-sdc
624 Allows to use more efficient algorithm to deal with copy tracing.
625
585 re-delta-parent
626 re-delta-parent
586 deltas within internal storage will choose a new base revision if needed
627 deltas within internal storage will choose a new base revision if needed
587
628
588 beginning upgrade...
629 beginning upgrade...
589 repository locked and read-only
630 repository locked and read-only
590 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
631 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
591 (it is safe to interrupt this process any time before data migration completes)
632 (it is safe to interrupt this process any time before data migration completes)
592 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
633 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
593 migrating 519 KB in store; 1.05 MB tracked data
634 migrating 519 KB in store; 1.05 MB tracked data
594 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
635 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
595 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
636 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
596 blindly copying data/f0.i containing 1 revisions
637 blindly copying data/f0.i containing 1 revisions
597 blindly copying data/f2.i containing 1 revisions
638 blindly copying data/f2.i containing 1 revisions
598 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
639 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
599 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
640 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
600 cloning 3 revisions from 00manifest.i
641 cloning 3 revisions from 00manifest.i
601 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
642 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
602 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
643 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
603 blindly copying 00changelog.i containing 3 revisions
644 blindly copying 00changelog.i containing 3 revisions
604 finished migrating 3 changelog revisions; change in size: 0 bytes
645 finished migrating 3 changelog revisions; change in size: 0 bytes
605 finished migrating 9 total revisions; total change in store size: 0 bytes
646 finished migrating 9 total revisions; total change in store size: 0 bytes
606 copying phaseroots
647 copying phaseroots
607 data fully migrated to temporary repository
648 data fully migrated to temporary repository
608 marking source repository as being upgraded; clients will be unable to read from repository
649 marking source repository as being upgraded; clients will be unable to read from repository
609 starting in-place swap of repository data
650 starting in-place swap of repository data
610 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
651 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
611 replacing store...
652 replacing store...
612 store replacement complete; repository was inconsistent for *s (glob)
653 store replacement complete; repository was inconsistent for *s (glob)
613 finalizing requirements file and making repository readable again
654 finalizing requirements file and making repository readable again
614 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
655 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
615 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
656 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
616
657
617 Check that the repo still works fine
658 Check that the repo still works fine
618
659
619 $ hg log -G --stat
660 $ hg log -G --stat
620 @ changeset: 2:76d4395f5413 (no-py3 !)
661 @ changeset: 2:76d4395f5413 (no-py3 !)
621 @ changeset: 2:fca376863211 (py3 !)
662 @ changeset: 2:fca376863211 (py3 !)
622 | tag: tip
663 | tag: tip
623 | parent: 0:ba592bf28da2
664 | parent: 0:ba592bf28da2
624 | user: test
665 | user: test
625 | date: Thu Jan 01 00:00:00 1970 +0000
666 | date: Thu Jan 01 00:00:00 1970 +0000
626 | summary: add f2
667 | summary: add f2
627 |
668 |
628 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
669 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
629 | 1 files changed, 100000 insertions(+), 0 deletions(-)
670 | 1 files changed, 100000 insertions(+), 0 deletions(-)
630 |
671 |
631 | o changeset: 1:2029ce2354e2
672 | o changeset: 1:2029ce2354e2
632 |/ user: test
673 |/ user: test
633 | date: Thu Jan 01 00:00:00 1970 +0000
674 | date: Thu Jan 01 00:00:00 1970 +0000
634 | summary: add f1
675 | summary: add f1
635 |
676 |
636 |
677 |
637 o changeset: 0:ba592bf28da2
678 o changeset: 0:ba592bf28da2
638 user: test
679 user: test
639 date: Thu Jan 01 00:00:00 1970 +0000
680 date: Thu Jan 01 00:00:00 1970 +0000
640 summary: initial
681 summary: initial
641
682
642
683
643
684
644 $ hg verify
685 $ hg verify
645 checking changesets
686 checking changesets
646 checking manifests
687 checking manifests
647 crosschecking files in changesets and manifests
688 crosschecking files in changesets and manifests
648 checking files
689 checking files
649 checked 3 changesets with 3 changes to 3 files
690 checked 3 changesets with 3 changes to 3 files
650
691
651 Check we can select negatively
692 Check we can select negatively
652
693
653 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
694 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
654 upgrade will perform the following actions:
695 upgrade will perform the following actions:
655
696
656 requirements
697 requirements
657 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
698 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
658
699
659 sidedata
700 sidedata
660 Allows storage of extra data alongside a revision.
701 Allows storage of extra data alongside a revision.
661
702
703 copies-sdc
704 Allows to use more efficient algorithm to deal with copy tracing.
705
662 re-delta-parent
706 re-delta-parent
663 deltas within internal storage will choose a new base revision if needed
707 deltas within internal storage will choose a new base revision if needed
664
708
665 beginning upgrade...
709 beginning upgrade...
666 repository locked and read-only
710 repository locked and read-only
667 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
711 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
668 (it is safe to interrupt this process any time before data migration completes)
712 (it is safe to interrupt this process any time before data migration completes)
669 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
713 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
670 migrating 519 KB in store; 1.05 MB tracked data
714 migrating 519 KB in store; 1.05 MB tracked data
671 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
715 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
672 cloning 1 revisions from data/FooBarDirectory.d/f1.i
716 cloning 1 revisions from data/FooBarDirectory.d/f1.i
673 cloning 1 revisions from data/f0.i
717 cloning 1 revisions from data/f0.i
674 cloning 1 revisions from data/f2.i
718 cloning 1 revisions from data/f2.i
675 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
719 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
676 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
720 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
677 blindly copying 00manifest.i containing 3 revisions
721 blindly copying 00manifest.i containing 3 revisions
678 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
722 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
679 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
723 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
680 cloning 3 revisions from 00changelog.i
724 cloning 3 revisions from 00changelog.i
681 finished migrating 3 changelog revisions; change in size: 0 bytes
725 finished migrating 3 changelog revisions; change in size: 0 bytes
682 finished migrating 9 total revisions; total change in store size: 0 bytes
726 finished migrating 9 total revisions; total change in store size: 0 bytes
683 copying phaseroots
727 copying phaseroots
684 data fully migrated to temporary repository
728 data fully migrated to temporary repository
685 marking source repository as being upgraded; clients will be unable to read from repository
729 marking source repository as being upgraded; clients will be unable to read from repository
686 starting in-place swap of repository data
730 starting in-place swap of repository data
687 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
731 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
688 replacing store...
732 replacing store...
689 store replacement complete; repository was inconsistent for *s (glob)
733 store replacement complete; repository was inconsistent for *s (glob)
690 finalizing requirements file and making repository readable again
734 finalizing requirements file and making repository readable again
691 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
735 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
692 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
736 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
693 $ hg verify
737 $ hg verify
694 checking changesets
738 checking changesets
695 checking manifests
739 checking manifests
696 crosschecking files in changesets and manifests
740 crosschecking files in changesets and manifests
697 checking files
741 checking files
698 checked 3 changesets with 3 changes to 3 files
742 checked 3 changesets with 3 changes to 3 files
699
743
700 Check that we can select changelog only
744 Check that we can select changelog only
701
745
702 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
746 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
703 upgrade will perform the following actions:
747 upgrade will perform the following actions:
704
748
705 requirements
749 requirements
706 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
750 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
707
751
708 sidedata
752 sidedata
709 Allows storage of extra data alongside a revision.
753 Allows storage of extra data alongside a revision.
710
754
755 copies-sdc
756 Allows to use more efficient algorithm to deal with copy tracing.
757
711 re-delta-parent
758 re-delta-parent
712 deltas within internal storage will choose a new base revision if needed
759 deltas within internal storage will choose a new base revision if needed
713
760
714 beginning upgrade...
761 beginning upgrade...
715 repository locked and read-only
762 repository locked and read-only
716 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
763 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
717 (it is safe to interrupt this process any time before data migration completes)
764 (it is safe to interrupt this process any time before data migration completes)
718 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
765 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
719 migrating 519 KB in store; 1.05 MB tracked data
766 migrating 519 KB in store; 1.05 MB tracked data
720 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
767 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
721 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
768 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
722 blindly copying data/f0.i containing 1 revisions
769 blindly copying data/f0.i containing 1 revisions
723 blindly copying data/f2.i containing 1 revisions
770 blindly copying data/f2.i containing 1 revisions
724 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
771 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
725 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
772 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
726 blindly copying 00manifest.i containing 3 revisions
773 blindly copying 00manifest.i containing 3 revisions
727 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
774 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
728 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
775 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
729 cloning 3 revisions from 00changelog.i
776 cloning 3 revisions from 00changelog.i
730 finished migrating 3 changelog revisions; change in size: 0 bytes
777 finished migrating 3 changelog revisions; change in size: 0 bytes
731 finished migrating 9 total revisions; total change in store size: 0 bytes
778 finished migrating 9 total revisions; total change in store size: 0 bytes
732 copying phaseroots
779 copying phaseroots
733 data fully migrated to temporary repository
780 data fully migrated to temporary repository
734 marking source repository as being upgraded; clients will be unable to read from repository
781 marking source repository as being upgraded; clients will be unable to read from repository
735 starting in-place swap of repository data
782 starting in-place swap of repository data
736 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
783 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
737 replacing store...
784 replacing store...
738 store replacement complete; repository was inconsistent for *s (glob)
785 store replacement complete; repository was inconsistent for *s (glob)
739 finalizing requirements file and making repository readable again
786 finalizing requirements file and making repository readable again
740 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
787 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
741 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
788 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
742 $ hg verify
789 $ hg verify
743 checking changesets
790 checking changesets
744 checking manifests
791 checking manifests
745 crosschecking files in changesets and manifests
792 crosschecking files in changesets and manifests
746 checking files
793 checking files
747 checked 3 changesets with 3 changes to 3 files
794 checked 3 changesets with 3 changes to 3 files
748
795
749 Check that we can select filelog only
796 Check that we can select filelog only
750
797
751 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
798 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
752 upgrade will perform the following actions:
799 upgrade will perform the following actions:
753
800
754 requirements
801 requirements
755 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
802 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
756
803
757 sidedata
804 sidedata
758 Allows storage of extra data alongside a revision.
805 Allows storage of extra data alongside a revision.
759
806
807 copies-sdc
808 Allows to use more efficient algorithm to deal with copy tracing.
809
760 re-delta-parent
810 re-delta-parent
761 deltas within internal storage will choose a new base revision if needed
811 deltas within internal storage will choose a new base revision if needed
762
812
763 beginning upgrade...
813 beginning upgrade...
764 repository locked and read-only
814 repository locked and read-only
765 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
815 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)
816 (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)
817 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
768 migrating 519 KB in store; 1.05 MB tracked data
818 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)
819 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
820 cloning 1 revisions from data/FooBarDirectory.d/f1.i
771 cloning 1 revisions from data/f0.i
821 cloning 1 revisions from data/f0.i
772 cloning 1 revisions from data/f2.i
822 cloning 1 revisions from data/f2.i
773 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
823 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)
824 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
775 blindly copying 00manifest.i containing 3 revisions
825 blindly copying 00manifest.i containing 3 revisions
776 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
826 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)
827 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
778 blindly copying 00changelog.i containing 3 revisions
828 blindly copying 00changelog.i containing 3 revisions
779 finished migrating 3 changelog revisions; change in size: 0 bytes
829 finished migrating 3 changelog revisions; change in size: 0 bytes
780 finished migrating 9 total revisions; total change in store size: 0 bytes
830 finished migrating 9 total revisions; total change in store size: 0 bytes
781 copying phaseroots
831 copying phaseroots
782 data fully migrated to temporary repository
832 data fully migrated to temporary repository
783 marking source repository as being upgraded; clients will be unable to read from repository
833 marking source repository as being upgraded; clients will be unable to read from repository
784 starting in-place swap of repository data
834 starting in-place swap of repository data
785 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
835 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
786 replacing store...
836 replacing store...
787 store replacement complete; repository was inconsistent for *s (glob)
837 store replacement complete; repository was inconsistent for *s (glob)
788 finalizing requirements file and making repository readable again
838 finalizing requirements file and making repository readable again
789 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
839 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
790 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
840 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
791 $ hg verify
841 $ hg verify
792 checking changesets
842 checking changesets
793 checking manifests
843 checking manifests
794 crosschecking files in changesets and manifests
844 crosschecking files in changesets and manifests
795 checking files
845 checking files
796 checked 3 changesets with 3 changes to 3 files
846 checked 3 changesets with 3 changes to 3 files
797
847
798
848
799 Check you can't skip revlog clone during important format downgrade
849 Check you can't skip revlog clone during important format downgrade
800
850
801 $ echo "[format]" > .hg/hgrc
851 $ echo "[format]" > .hg/hgrc
802 $ echo "sparse-revlog=no" >> .hg/hgrc
852 $ echo "sparse-revlog=no" >> .hg/hgrc
803 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
853 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
804 ignoring revlogs selection flags, format requirements change: sparserevlog
854 ignoring revlogs selection flags, format requirements change: sparserevlog
805 upgrade will perform the following actions:
855 upgrade will perform the following actions:
806
856
807 requirements
857 requirements
808 preserved: dotencode, fncache, generaldelta, revlogv1, store
858 preserved: dotencode, fncache, generaldelta, revlogv1, store
809 removed: sparserevlog
859 removed: sparserevlog
810
860
811 sidedata
861 sidedata
812 Allows storage of extra data alongside a revision.
862 Allows storage of extra data alongside a revision.
813
863
864 copies-sdc
865 Allows to use more efficient algorithm to deal with copy tracing.
866
814 re-delta-parent
867 re-delta-parent
815 deltas within internal storage will choose a new base revision if needed
868 deltas within internal storage will choose a new base revision if needed
816
869
817 beginning upgrade...
870 beginning upgrade...
818 repository locked and read-only
871 repository locked and read-only
819 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
872 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
820 (it is safe to interrupt this process any time before data migration completes)
873 (it is safe to interrupt this process any time before data migration completes)
821 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
874 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
822 migrating 519 KB in store; 1.05 MB tracked data
875 migrating 519 KB in store; 1.05 MB tracked data
823 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
876 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
824 cloning 1 revisions from data/FooBarDirectory.d/f1.i
877 cloning 1 revisions from data/FooBarDirectory.d/f1.i
825 cloning 1 revisions from data/f0.i
878 cloning 1 revisions from data/f0.i
826 cloning 1 revisions from data/f2.i
879 cloning 1 revisions from data/f2.i
827 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
880 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
828 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
881 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
829 cloning 3 revisions from 00manifest.i
882 cloning 3 revisions from 00manifest.i
830 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
883 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
831 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
884 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
832 cloning 3 revisions from 00changelog.i
885 cloning 3 revisions from 00changelog.i
833 finished migrating 3 changelog revisions; change in size: 0 bytes
886 finished migrating 3 changelog revisions; change in size: 0 bytes
834 finished migrating 9 total revisions; total change in store size: 0 bytes
887 finished migrating 9 total revisions; total change in store size: 0 bytes
835 copying phaseroots
888 copying phaseroots
836 data fully migrated to temporary repository
889 data fully migrated to temporary repository
837 marking source repository as being upgraded; clients will be unable to read from repository
890 marking source repository as being upgraded; clients will be unable to read from repository
838 starting in-place swap of repository data
891 starting in-place swap of repository data
839 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
892 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
840 replacing store...
893 replacing store...
841 store replacement complete; repository was inconsistent for *s (glob)
894 store replacement complete; repository was inconsistent for *s (glob)
842 finalizing requirements file and making repository readable again
895 finalizing requirements file and making repository readable again
843 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
896 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
844 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
897 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
845 $ hg verify
898 $ hg verify
846 checking changesets
899 checking changesets
847 checking manifests
900 checking manifests
848 crosschecking files in changesets and manifests
901 crosschecking files in changesets and manifests
849 checking files
902 checking files
850 checked 3 changesets with 3 changes to 3 files
903 checked 3 changesets with 3 changes to 3 files
851
904
852 Check you can't skip revlog clone during important format upgrade
905 Check you can't skip revlog clone during important format upgrade
853
906
854 $ echo "sparse-revlog=yes" >> .hg/hgrc
907 $ echo "sparse-revlog=yes" >> .hg/hgrc
855 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
908 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
856 ignoring revlogs selection flags, format requirements change: sparserevlog
909 ignoring revlogs selection flags, format requirements change: sparserevlog
857 upgrade will perform the following actions:
910 upgrade will perform the following actions:
858
911
859 requirements
912 requirements
860 preserved: dotencode, fncache, generaldelta, revlogv1, store
913 preserved: dotencode, fncache, generaldelta, revlogv1, store
861 added: sparserevlog
914 added: sparserevlog
862
915
863 sparserevlog
916 sparserevlog
864 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.
917 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.
865
918
866 sidedata
919 sidedata
867 Allows storage of extra data alongside a revision.
920 Allows storage of extra data alongside a revision.
868
921
922 copies-sdc
923 Allows to use more efficient algorithm to deal with copy tracing.
924
869 re-delta-parent
925 re-delta-parent
870 deltas within internal storage will choose a new base revision if needed
926 deltas within internal storage will choose a new base revision if needed
871
927
872 beginning upgrade...
928 beginning upgrade...
873 repository locked and read-only
929 repository locked and read-only
874 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
930 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
875 (it is safe to interrupt this process any time before data migration completes)
931 (it is safe to interrupt this process any time before data migration completes)
876 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
932 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
877 migrating 519 KB in store; 1.05 MB tracked data
933 migrating 519 KB in store; 1.05 MB tracked data
878 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
934 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
879 cloning 1 revisions from data/FooBarDirectory.d/f1.i
935 cloning 1 revisions from data/FooBarDirectory.d/f1.i
880 cloning 1 revisions from data/f0.i
936 cloning 1 revisions from data/f0.i
881 cloning 1 revisions from data/f2.i
937 cloning 1 revisions from data/f2.i
882 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
938 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
883 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
939 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
884 cloning 3 revisions from 00manifest.i
940 cloning 3 revisions from 00manifest.i
885 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
941 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
886 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
942 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
887 cloning 3 revisions from 00changelog.i
943 cloning 3 revisions from 00changelog.i
888 finished migrating 3 changelog revisions; change in size: 0 bytes
944 finished migrating 3 changelog revisions; change in size: 0 bytes
889 finished migrating 9 total revisions; total change in store size: 0 bytes
945 finished migrating 9 total revisions; total change in store size: 0 bytes
890 copying phaseroots
946 copying phaseroots
891 data fully migrated to temporary repository
947 data fully migrated to temporary repository
892 marking source repository as being upgraded; clients will be unable to read from repository
948 marking source repository as being upgraded; clients will be unable to read from repository
893 starting in-place swap of repository data
949 starting in-place swap of repository data
894 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
950 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
895 replacing store...
951 replacing store...
896 store replacement complete; repository was inconsistent for *s (glob)
952 store replacement complete; repository was inconsistent for *s (glob)
897 finalizing requirements file and making repository readable again
953 finalizing requirements file and making repository readable again
898 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
954 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
899 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
955 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
900 $ hg verify
956 $ hg verify
901 checking changesets
957 checking changesets
902 checking manifests
958 checking manifests
903 crosschecking files in changesets and manifests
959 crosschecking files in changesets and manifests
904 checking files
960 checking files
905 checked 3 changesets with 3 changes to 3 files
961 checked 3 changesets with 3 changes to 3 files
906
962
907 $ cd ..
963 $ cd ..
908
964
909 store files with special filenames aren't encoded during copy
965 store files with special filenames aren't encoded during copy
910
966
911 $ hg init store-filenames
967 $ hg init store-filenames
912 $ cd store-filenames
968 $ cd store-filenames
913 $ touch foo
969 $ touch foo
914 $ hg -q commit -A -m initial
970 $ hg -q commit -A -m initial
915 $ touch .hg/store/.XX_special_filename
971 $ touch .hg/store/.XX_special_filename
916
972
917 $ hg debugupgraderepo --run
973 $ hg debugupgraderepo --run
918 upgrade will perform the following actions:
974 upgrade will perform the following actions:
919
975
920 requirements
976 requirements
921 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
977 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
922
978
923 sidedata
979 sidedata
924 Allows storage of extra data alongside a revision.
980 Allows storage of extra data alongside a revision.
925
981
982 copies-sdc
983 Allows to use more efficient algorithm to deal with copy tracing.
984
926 beginning upgrade...
985 beginning upgrade...
927 repository locked and read-only
986 repository locked and read-only
928 creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
987 creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
929 (it is safe to interrupt this process any time before data migration completes)
988 (it is safe to interrupt this process any time before data migration completes)
930 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
989 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
931 migrating 301 bytes in store; 107 bytes tracked data
990 migrating 301 bytes in store; 107 bytes tracked data
932 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
991 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
933 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
992 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
934 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
993 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
935 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
994 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
936 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
995 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
937 finished migrating 1 changelog revisions; change in size: 0 bytes
996 finished migrating 1 changelog revisions; change in size: 0 bytes
938 finished migrating 3 total revisions; total change in store size: 0 bytes
997 finished migrating 3 total revisions; total change in store size: 0 bytes
939 copying .XX_special_filename
998 copying .XX_special_filename
940 copying phaseroots
999 copying phaseroots
941 data fully migrated to temporary repository
1000 data fully migrated to temporary repository
942 marking source repository as being upgraded; clients will be unable to read from repository
1001 marking source repository as being upgraded; clients will be unable to read from repository
943 starting in-place swap of repository data
1002 starting in-place swap of repository data
944 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1003 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
945 replacing store...
1004 replacing store...
946 store replacement complete; repository was inconsistent for *s (glob)
1005 store replacement complete; repository was inconsistent for *s (glob)
947 finalizing requirements file and making repository readable again
1006 finalizing requirements file and making repository readable again
948 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1007 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
949 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1008 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
950 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1009 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
951 $ hg debugupgraderepo --run --optimize redeltafulladd
1010 $ hg debugupgraderepo --run --optimize redeltafulladd
952 upgrade will perform the following actions:
1011 upgrade will perform the following actions:
953
1012
954 requirements
1013 requirements
955 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1014 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
956
1015
957 sidedata
1016 sidedata
958 Allows storage of extra data alongside a revision.
1017 Allows storage of extra data alongside a revision.
959
1018
1019 copies-sdc
1020 Allows to use more efficient algorithm to deal with copy tracing.
1021
960 re-delta-fulladd
1022 re-delta-fulladd
961 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
1023 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
962
1024
963 beginning upgrade...
1025 beginning upgrade...
964 repository locked and read-only
1026 repository locked and read-only
965 creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1027 creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
966 (it is safe to interrupt this process any time before data migration completes)
1028 (it is safe to interrupt this process any time before data migration completes)
967 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1029 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
968 migrating 301 bytes in store; 107 bytes tracked data
1030 migrating 301 bytes in store; 107 bytes tracked data
969 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1031 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
970 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1032 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
971 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1033 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
972 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1034 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
973 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1035 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
974 finished migrating 1 changelog revisions; change in size: 0 bytes
1036 finished migrating 1 changelog revisions; change in size: 0 bytes
975 finished migrating 3 total revisions; total change in store size: 0 bytes
1037 finished migrating 3 total revisions; total change in store size: 0 bytes
976 copying .XX_special_filename
1038 copying .XX_special_filename
977 copying phaseroots
1039 copying phaseroots
978 data fully migrated to temporary repository
1040 data fully migrated to temporary repository
979 marking source repository as being upgraded; clients will be unable to read from repository
1041 marking source repository as being upgraded; clients will be unable to read from repository
980 starting in-place swap of repository data
1042 starting in-place swap of repository data
981 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1043 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
982 replacing store...
1044 replacing store...
983 store replacement complete; repository was inconsistent for *s (glob)
1045 store replacement complete; repository was inconsistent for *s (glob)
984 finalizing requirements file and making repository readable again
1046 finalizing requirements file and making repository readable again
985 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1047 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
986 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1048 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
987 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1049 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
988
1050
989 fncache is valid after upgrade
1051 fncache is valid after upgrade
990
1052
991 $ hg debugrebuildfncache
1053 $ hg debugrebuildfncache
992 fncache already up to date
1054 fncache already up to date
993
1055
994 $ cd ..
1056 $ cd ..
995
1057
996 Check upgrading a large file repository
1058 Check upgrading a large file repository
997 ---------------------------------------
1059 ---------------------------------------
998
1060
999 $ hg init largefilesrepo
1061 $ hg init largefilesrepo
1000 $ cat << EOF >> largefilesrepo/.hg/hgrc
1062 $ cat << EOF >> largefilesrepo/.hg/hgrc
1001 > [extensions]
1063 > [extensions]
1002 > largefiles =
1064 > largefiles =
1003 > EOF
1065 > EOF
1004
1066
1005 $ cd largefilesrepo
1067 $ cd largefilesrepo
1006 $ touch foo
1068 $ touch foo
1007 $ hg add --large foo
1069 $ hg add --large foo
1008 $ hg -q commit -m initial
1070 $ hg -q commit -m initial
1009 $ cat .hg/requires
1071 $ cat .hg/requires
1010 dotencode
1072 dotencode
1011 fncache
1073 fncache
1012 generaldelta
1074 generaldelta
1013 largefiles
1075 largefiles
1014 revlogv1
1076 revlogv1
1015 sparserevlog
1077 sparserevlog
1016 store
1078 store
1017
1079
1018 $ hg debugupgraderepo --run
1080 $ hg debugupgraderepo --run
1019 upgrade will perform the following actions:
1081 upgrade will perform the following actions:
1020
1082
1021 requirements
1083 requirements
1022 preserved: dotencode, fncache, generaldelta, largefiles, revlogv1, sparserevlog, store
1084 preserved: dotencode, fncache, generaldelta, largefiles, revlogv1, sparserevlog, store
1023
1085
1024 sidedata
1086 sidedata
1025 Allows storage of extra data alongside a revision.
1087 Allows storage of extra data alongside a revision.
1026
1088
1089 copies-sdc
1090 Allows to use more efficient algorithm to deal with copy tracing.
1091
1027 beginning upgrade...
1092 beginning upgrade...
1028 repository locked and read-only
1093 repository locked and read-only
1029 creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1094 creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1030 (it is safe to interrupt this process any time before data migration completes)
1095 (it is safe to interrupt this process any time before data migration completes)
1031 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1096 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1032 migrating 355 bytes in store; 160 bytes tracked data
1097 migrating 355 bytes in store; 160 bytes tracked data
1033 migrating 1 filelogs containing 1 revisions (106 bytes in store; 41 bytes tracked data)
1098 migrating 1 filelogs containing 1 revisions (106 bytes in store; 41 bytes tracked data)
1034 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1099 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1035 migrating 1 manifests containing 1 revisions (116 bytes in store; 51 bytes tracked data)
1100 migrating 1 manifests containing 1 revisions (116 bytes in store; 51 bytes tracked data)
1036 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1101 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1037 migrating changelog containing 1 revisions (133 bytes in store; 68 bytes tracked data)
1102 migrating changelog containing 1 revisions (133 bytes in store; 68 bytes tracked data)
1038 finished migrating 1 changelog revisions; change in size: 0 bytes
1103 finished migrating 1 changelog revisions; change in size: 0 bytes
1039 finished migrating 3 total revisions; total change in store size: 0 bytes
1104 finished migrating 3 total revisions; total change in store size: 0 bytes
1040 copying phaseroots
1105 copying phaseroots
1041 data fully migrated to temporary repository
1106 data fully migrated to temporary repository
1042 marking source repository as being upgraded; clients will be unable to read from repository
1107 marking source repository as being upgraded; clients will be unable to read from repository
1043 starting in-place swap of repository data
1108 starting in-place swap of repository data
1044 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1109 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1045 replacing store...
1110 replacing store...
1046 store replacement complete; repository was inconsistent for *s (glob)
1111 store replacement complete; repository was inconsistent for *s (glob)
1047 finalizing requirements file and making repository readable again
1112 finalizing requirements file and making repository readable again
1048 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1113 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1049 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1114 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1050 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1115 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1051 $ cat .hg/requires
1116 $ cat .hg/requires
1052 dotencode
1117 dotencode
1053 fncache
1118 fncache
1054 generaldelta
1119 generaldelta
1055 largefiles
1120 largefiles
1056 revlogv1
1121 revlogv1
1057 sparserevlog
1122 sparserevlog
1058 store
1123 store
1059
1124
1060 $ cat << EOF >> .hg/hgrc
1125 $ cat << EOF >> .hg/hgrc
1061 > [extensions]
1126 > [extensions]
1062 > lfs =
1127 > lfs =
1063 > [lfs]
1128 > [lfs]
1064 > threshold = 10
1129 > threshold = 10
1065 > EOF
1130 > EOF
1066 $ echo '123456789012345' > lfs.bin
1131 $ echo '123456789012345' > lfs.bin
1067 $ hg ci -Am 'lfs.bin'
1132 $ hg ci -Am 'lfs.bin'
1068 adding lfs.bin
1133 adding lfs.bin
1069 $ grep lfs .hg/requires
1134 $ grep lfs .hg/requires
1070 lfs
1135 lfs
1071 $ find .hg/store/lfs -type f
1136 $ find .hg/store/lfs -type f
1072 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1137 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1073
1138
1074 $ hg debugupgraderepo --run
1139 $ hg debugupgraderepo --run
1075 upgrade will perform the following actions:
1140 upgrade will perform the following actions:
1076
1141
1077 requirements
1142 requirements
1078 preserved: dotencode, fncache, generaldelta, largefiles, lfs, revlogv1, sparserevlog, store
1143 preserved: dotencode, fncache, generaldelta, largefiles, lfs, revlogv1, sparserevlog, store
1079
1144
1080 sidedata
1145 sidedata
1081 Allows storage of extra data alongside a revision.
1146 Allows storage of extra data alongside a revision.
1082
1147
1148 copies-sdc
1149 Allows to use more efficient algorithm to deal with copy tracing.
1150
1083 beginning upgrade...
1151 beginning upgrade...
1084 repository locked and read-only
1152 repository locked and read-only
1085 creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1153 creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1086 (it is safe to interrupt this process any time before data migration completes)
1154 (it is safe to interrupt this process any time before data migration completes)
1087 migrating 6 total revisions (2 in filelogs, 2 in manifests, 2 in changelog)
1155 migrating 6 total revisions (2 in filelogs, 2 in manifests, 2 in changelog)
1088 migrating 801 bytes in store; 467 bytes tracked data
1156 migrating 801 bytes in store; 467 bytes tracked data
1089 migrating 2 filelogs containing 2 revisions (296 bytes in store; 182 bytes tracked data)
1157 migrating 2 filelogs containing 2 revisions (296 bytes in store; 182 bytes tracked data)
1090 finished migrating 2 filelog revisions across 2 filelogs; change in size: 0 bytes
1158 finished migrating 2 filelog revisions across 2 filelogs; change in size: 0 bytes
1091 migrating 1 manifests containing 2 revisions (241 bytes in store; 151 bytes tracked data)
1159 migrating 1 manifests containing 2 revisions (241 bytes in store; 151 bytes tracked data)
1092 finished migrating 2 manifest revisions across 1 manifests; change in size: 0 bytes
1160 finished migrating 2 manifest revisions across 1 manifests; change in size: 0 bytes
1093 migrating changelog containing 2 revisions (264 bytes in store; 134 bytes tracked data)
1161 migrating changelog containing 2 revisions (264 bytes in store; 134 bytes tracked data)
1094 finished migrating 2 changelog revisions; change in size: 0 bytes
1162 finished migrating 2 changelog revisions; change in size: 0 bytes
1095 finished migrating 6 total revisions; total change in store size: 0 bytes
1163 finished migrating 6 total revisions; total change in store size: 0 bytes
1096 copying phaseroots
1164 copying phaseroots
1097 copying lfs blob d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1165 copying lfs blob d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1098 data fully migrated to temporary repository
1166 data fully migrated to temporary repository
1099 marking source repository as being upgraded; clients will be unable to read from repository
1167 marking source repository as being upgraded; clients will be unable to read from repository
1100 starting in-place swap of repository data
1168 starting in-place swap of repository data
1101 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1169 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1102 replacing store...
1170 replacing store...
1103 store replacement complete; repository was inconsistent for *s (glob)
1171 store replacement complete; repository was inconsistent for *s (glob)
1104 finalizing requirements file and making repository readable again
1172 finalizing requirements file and making repository readable again
1105 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1173 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1106 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1174 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1107 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1175 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1108
1176
1109 $ grep lfs .hg/requires
1177 $ grep lfs .hg/requires
1110 lfs
1178 lfs
1111 $ find .hg/store/lfs -type f
1179 $ find .hg/store/lfs -type f
1112 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1180 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1113 $ hg verify
1181 $ hg verify
1114 checking changesets
1182 checking changesets
1115 checking manifests
1183 checking manifests
1116 crosschecking files in changesets and manifests
1184 crosschecking files in changesets and manifests
1117 checking files
1185 checking files
1118 checked 2 changesets with 2 changes to 2 files
1186 checked 2 changesets with 2 changes to 2 files
1119 $ hg debugdata lfs.bin 0
1187 $ hg debugdata lfs.bin 0
1120 version https://git-lfs.github.com/spec/v1
1188 version https://git-lfs.github.com/spec/v1
1121 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1189 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1122 size 16
1190 size 16
1123 x-is-binary 0
1191 x-is-binary 0
1124
1192
1125 $ cd ..
1193 $ cd ..
1126
1194
1127 repository config is taken in account
1195 repository config is taken in account
1128 -------------------------------------
1196 -------------------------------------
1129
1197
1130 $ cat << EOF >> $HGRCPATH
1198 $ cat << EOF >> $HGRCPATH
1131 > [format]
1199 > [format]
1132 > maxchainlen = 1
1200 > maxchainlen = 1
1133 > EOF
1201 > EOF
1134
1202
1135 $ hg init localconfig
1203 $ hg init localconfig
1136 $ cd localconfig
1204 $ cd localconfig
1137 $ cat << EOF > file
1205 $ cat << EOF > file
1138 > some content
1206 > some content
1139 > with some length
1207 > with some length
1140 > to make sure we get a delta
1208 > to make sure we get a delta
1141 > after changes
1209 > after changes
1142 > very long
1210 > very long
1143 > very long
1211 > very long
1144 > very long
1212 > very long
1145 > very long
1213 > very long
1146 > very long
1214 > very long
1147 > very long
1215 > very long
1148 > very long
1216 > very long
1149 > very long
1217 > very long
1150 > very long
1218 > very long
1151 > very long
1219 > very long
1152 > very long
1220 > very long
1153 > EOF
1221 > EOF
1154 $ hg -q commit -A -m A
1222 $ hg -q commit -A -m A
1155 $ echo "new line" >> file
1223 $ echo "new line" >> file
1156 $ hg -q commit -m B
1224 $ hg -q commit -m B
1157 $ echo "new line" >> file
1225 $ echo "new line" >> file
1158 $ hg -q commit -m C
1226 $ hg -q commit -m C
1159
1227
1160 $ cat << EOF >> .hg/hgrc
1228 $ cat << EOF >> .hg/hgrc
1161 > [format]
1229 > [format]
1162 > maxchainlen = 9001
1230 > maxchainlen = 9001
1163 > EOF
1231 > EOF
1164 $ hg config format
1232 $ hg config format
1165 format.maxchainlen=9001
1233 format.maxchainlen=9001
1166 $ hg debugdeltachain file
1234 $ hg debugdeltachain file
1167 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1235 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1168 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1236 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1169 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1237 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1170 2 1 2 0 other 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1238 2 1 2 0 other 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1171
1239
1172 $ hg debugupgraderepo --run --optimize redeltaall
1240 $ hg debugupgraderepo --run --optimize redeltaall
1173 upgrade will perform the following actions:
1241 upgrade will perform the following actions:
1174
1242
1175 requirements
1243 requirements
1176 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1244 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1177
1245
1178 sidedata
1246 sidedata
1179 Allows storage of extra data alongside a revision.
1247 Allows storage of extra data alongside a revision.
1180
1248
1249 copies-sdc
1250 Allows to use more efficient algorithm to deal with copy tracing.
1251
1181 re-delta-all
1252 re-delta-all
1182 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1253 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1183
1254
1184 beginning upgrade...
1255 beginning upgrade...
1185 repository locked and read-only
1256 repository locked and read-only
1186 creating temporary repository to stage migrated data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1257 creating temporary repository to stage migrated data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1187 (it is safe to interrupt this process any time before data migration completes)
1258 (it is safe to interrupt this process any time before data migration completes)
1188 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1259 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1189 migrating 1019 bytes in store; 882 bytes tracked data
1260 migrating 1019 bytes in store; 882 bytes tracked data
1190 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
1261 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
1191 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
1262 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
1192 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
1263 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
1193 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1264 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1194 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
1265 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
1195 finished migrating 3 changelog revisions; change in size: 0 bytes
1266 finished migrating 3 changelog revisions; change in size: 0 bytes
1196 finished migrating 9 total revisions; total change in store size: -9 bytes
1267 finished migrating 9 total revisions; total change in store size: -9 bytes
1197 copying phaseroots
1268 copying phaseroots
1198 data fully migrated to temporary repository
1269 data fully migrated to temporary repository
1199 marking source repository as being upgraded; clients will be unable to read from repository
1270 marking source repository as being upgraded; clients will be unable to read from repository
1200 starting in-place swap of repository data
1271 starting in-place swap of repository data
1201 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1272 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1202 replacing store...
1273 replacing store...
1203 store replacement complete; repository was inconsistent for *s (glob)
1274 store replacement complete; repository was inconsistent for *s (glob)
1204 finalizing requirements file and making repository readable again
1275 finalizing requirements file and making repository readable again
1205 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1276 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1206 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1277 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1207 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1278 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1208 $ hg debugdeltachain file
1279 $ hg debugdeltachain file
1209 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1280 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1210 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1281 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1211 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1282 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1212 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1283 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1213 $ cd ..
1284 $ cd ..
1214
1285
1215 $ cat << EOF >> $HGRCPATH
1286 $ cat << EOF >> $HGRCPATH
1216 > [format]
1287 > [format]
1217 > maxchainlen = 9001
1288 > maxchainlen = 9001
1218 > EOF
1289 > EOF
1219
1290
1220 Check upgrading a sparse-revlog repository
1291 Check upgrading a sparse-revlog repository
1221 ---------------------------------------
1292 ---------------------------------------
1222
1293
1223 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1294 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1224 $ cd sparserevlogrepo
1295 $ cd sparserevlogrepo
1225 $ touch foo
1296 $ touch foo
1226 $ hg add foo
1297 $ hg add foo
1227 $ hg -q commit -m "foo"
1298 $ hg -q commit -m "foo"
1228 $ cat .hg/requires
1299 $ cat .hg/requires
1229 dotencode
1300 dotencode
1230 fncache
1301 fncache
1231 generaldelta
1302 generaldelta
1232 revlogv1
1303 revlogv1
1233 store
1304 store
1234
1305
1235 Check that we can add the sparse-revlog format requirement
1306 Check that we can add the sparse-revlog format requirement
1236 $ hg --config format.sparse-revlog=yes debugupgraderepo --run >/dev/null
1307 $ hg --config format.sparse-revlog=yes debugupgraderepo --run >/dev/null
1237 copy of old repository backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1308 copy of old repository backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1238 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1309 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1239 $ cat .hg/requires
1310 $ cat .hg/requires
1240 dotencode
1311 dotencode
1241 fncache
1312 fncache
1242 generaldelta
1313 generaldelta
1243 revlogv1
1314 revlogv1
1244 sparserevlog
1315 sparserevlog
1245 store
1316 store
1246
1317
1247 Check that we can remove the sparse-revlog format requirement
1318 Check that we can remove the sparse-revlog format requirement
1248 $ hg --config format.sparse-revlog=no debugupgraderepo --run >/dev/null
1319 $ hg --config format.sparse-revlog=no debugupgraderepo --run >/dev/null
1249 copy of old repository backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1320 copy of old repository backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1250 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1321 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1251 $ cat .hg/requires
1322 $ cat .hg/requires
1252 dotencode
1323 dotencode
1253 fncache
1324 fncache
1254 generaldelta
1325 generaldelta
1255 revlogv1
1326 revlogv1
1256 store
1327 store
1257
1328
1258 #if zstd
1329 #if zstd
1259
1330
1260 Check upgrading to a zstd revlog
1331 Check upgrading to a zstd revlog
1261 --------------------------------
1332 --------------------------------
1262
1333
1263 upgrade
1334 upgrade
1264
1335
1265 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup >/dev/null
1336 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup >/dev/null
1266 $ hg debugformat -v
1337 $ hg debugformat -v
1267 format-variant repo config default
1338 format-variant repo config default
1268 fncache: yes yes yes
1339 fncache: yes yes yes
1269 dotencode: yes yes yes
1340 dotencode: yes yes yes
1270 generaldelta: yes yes yes
1341 generaldelta: yes yes yes
1271 sparserevlog: yes yes yes
1342 sparserevlog: yes yes yes
1272 sidedata: no no no
1343 sidedata: no no no
1344 copies-sdc: no no no
1273 plain-cl-delta: yes yes yes
1345 plain-cl-delta: yes yes yes
1274 compression: zstd zlib zlib
1346 compression: zstd zlib zlib
1275 compression-level: default default default
1347 compression-level: default default default
1276 $ cat .hg/requires
1348 $ cat .hg/requires
1277 dotencode
1349 dotencode
1278 fncache
1350 fncache
1279 generaldelta
1351 generaldelta
1280 revlog-compression-zstd
1352 revlog-compression-zstd
1281 revlogv1
1353 revlogv1
1282 sparserevlog
1354 sparserevlog
1283 store
1355 store
1284
1356
1285 downgrade
1357 downgrade
1286
1358
1287 $ hg debugupgraderepo --run --no-backup > /dev/null
1359 $ hg debugupgraderepo --run --no-backup > /dev/null
1288 $ hg debugformat -v
1360 $ hg debugformat -v
1289 format-variant repo config default
1361 format-variant repo config default
1290 fncache: yes yes yes
1362 fncache: yes yes yes
1291 dotencode: yes yes yes
1363 dotencode: yes yes yes
1292 generaldelta: yes yes yes
1364 generaldelta: yes yes yes
1293 sparserevlog: yes yes yes
1365 sparserevlog: yes yes yes
1294 sidedata: no no no
1366 sidedata: no no no
1367 copies-sdc: no no no
1295 plain-cl-delta: yes yes yes
1368 plain-cl-delta: yes yes yes
1296 compression: zlib zlib zlib
1369 compression: zlib zlib zlib
1297 compression-level: default default default
1370 compression-level: default default default
1298 $ cat .hg/requires
1371 $ cat .hg/requires
1299 dotencode
1372 dotencode
1300 fncache
1373 fncache
1301 generaldelta
1374 generaldelta
1302 revlogv1
1375 revlogv1
1303 sparserevlog
1376 sparserevlog
1304 store
1377 store
1305
1378
1306 upgrade from hgrc
1379 upgrade from hgrc
1307
1380
1308 $ cat >> .hg/hgrc << EOF
1381 $ cat >> .hg/hgrc << EOF
1309 > [format]
1382 > [format]
1310 > revlog-compression=zstd
1383 > revlog-compression=zstd
1311 > EOF
1384 > EOF
1312 $ hg debugupgraderepo --run --no-backup > /dev/null
1385 $ hg debugupgraderepo --run --no-backup > /dev/null
1313 $ hg debugformat -v
1386 $ hg debugformat -v
1314 format-variant repo config default
1387 format-variant repo config default
1315 fncache: yes yes yes
1388 fncache: yes yes yes
1316 dotencode: yes yes yes
1389 dotencode: yes yes yes
1317 generaldelta: yes yes yes
1390 generaldelta: yes yes yes
1318 sparserevlog: yes yes yes
1391 sparserevlog: yes yes yes
1319 sidedata: no no no
1392 sidedata: no no no
1393 copies-sdc: no no no
1320 plain-cl-delta: yes yes yes
1394 plain-cl-delta: yes yes yes
1321 compression: zstd zstd zlib
1395 compression: zstd zstd zlib
1322 compression-level: default default default
1396 compression-level: default default default
1323 $ cat .hg/requires
1397 $ cat .hg/requires
1324 dotencode
1398 dotencode
1325 fncache
1399 fncache
1326 generaldelta
1400 generaldelta
1327 revlog-compression-zstd
1401 revlog-compression-zstd
1328 revlogv1
1402 revlogv1
1329 sparserevlog
1403 sparserevlog
1330 store
1404 store
1331
1405
1332 #endif
1406 #endif
1333
1407
1334 Check upgrading to a side-data revlog
1408 Check upgrading to a side-data revlog
1335 -------------------------------------
1409 -------------------------------------
1336
1410
1337 upgrade
1411 upgrade
1338
1412
1339 $ hg --config format.use-side-data=yes debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" >/dev/null
1413 $ hg --config format.use-side-data=yes debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" >/dev/null
1340 $ hg debugformat -v
1414 $ hg debugformat -v
1341 format-variant repo config default
1415 format-variant repo config default
1342 fncache: yes yes yes
1416 fncache: yes yes yes
1343 dotencode: yes yes yes
1417 dotencode: yes yes yes
1344 generaldelta: yes yes yes
1418 generaldelta: yes yes yes
1345 sparserevlog: yes yes yes
1419 sparserevlog: yes yes yes
1346 sidedata: yes no no
1420 sidedata: yes no no
1421 copies-sdc: no no no
1347 plain-cl-delta: yes yes yes
1422 plain-cl-delta: yes yes yes
1348 compression: zstd zstd zlib
1423 compression: zstd zstd zlib
1349 compression-level: default default default
1424 compression-level: default default default
1350 $ cat .hg/requires
1425 $ cat .hg/requires
1351 dotencode
1426 dotencode
1352 exp-sidedata-flag
1427 exp-sidedata-flag
1353 fncache
1428 fncache
1354 generaldelta
1429 generaldelta
1355 revlog-compression-zstd
1430 revlog-compression-zstd
1356 revlogv1
1431 revlogv1
1357 sparserevlog
1432 sparserevlog
1358 store
1433 store
1359 $ hg debugsidedata -c 0
1434 $ hg debugsidedata -c 0
1360 2 sidedata entries
1435 2 sidedata entries
1361 entry-0001 size 4
1436 entry-0001 size 4
1362 entry-0002 size 32
1437 entry-0002 size 32
1363
1438
1364 downgrade
1439 downgrade
1365
1440
1366 $ hg debugupgraderepo --config format.use-side-data=no --run --no-backup > /dev/null
1441 $ hg debugupgraderepo --config format.use-side-data=no --run --no-backup > /dev/null
1367 $ hg debugformat -v
1442 $ hg debugformat -v
1368 format-variant repo config default
1443 format-variant repo config default
1369 fncache: yes yes yes
1444 fncache: yes yes yes
1370 dotencode: yes yes yes
1445 dotencode: yes yes yes
1371 generaldelta: yes yes yes
1446 generaldelta: yes yes yes
1372 sparserevlog: yes yes yes
1447 sparserevlog: yes yes yes
1373 sidedata: no no no
1448 sidedata: no no no
1449 copies-sdc: no no no
1374 plain-cl-delta: yes yes yes
1450 plain-cl-delta: yes yes yes
1375 compression: zstd zstd zlib
1451 compression: zstd zstd zlib
1376 compression-level: default default default
1452 compression-level: default default default
1377 $ cat .hg/requires
1453 $ cat .hg/requires
1378 dotencode
1454 dotencode
1379 fncache
1455 fncache
1380 generaldelta
1456 generaldelta
1381 revlog-compression-zstd
1457 revlog-compression-zstd
1382 revlogv1
1458 revlogv1
1383 sparserevlog
1459 sparserevlog
1384 store
1460 store
1385 $ hg debugsidedata -c 0
1461 $ hg debugsidedata -c 0
1386
1462
1387 upgrade from hgrc
1463 upgrade from hgrc
1388
1464
1389 $ cat >> .hg/hgrc << EOF
1465 $ cat >> .hg/hgrc << EOF
1390 > [format]
1466 > [format]
1391 > use-side-data=yes
1467 > use-side-data=yes
1392 > EOF
1468 > EOF
1393 $ hg debugupgraderepo --run --no-backup > /dev/null
1469 $ hg debugupgraderepo --run --no-backup > /dev/null
1394 $ hg debugformat -v
1470 $ hg debugformat -v
1395 format-variant repo config default
1471 format-variant repo config default
1396 fncache: yes yes yes
1472 fncache: yes yes yes
1397 dotencode: yes yes yes
1473 dotencode: yes yes yes
1398 generaldelta: yes yes yes
1474 generaldelta: yes yes yes
1399 sparserevlog: yes yes yes
1475 sparserevlog: yes yes yes
1400 sidedata: yes yes no
1476 sidedata: yes yes no
1477 copies-sdc: no no no
1401 plain-cl-delta: yes yes yes
1478 plain-cl-delta: yes yes yes
1402 compression: zstd zstd zlib
1479 compression: zstd zstd zlib
1403 compression-level: default default default
1480 compression-level: default default default
1404 $ cat .hg/requires
1481 $ cat .hg/requires
1405 dotencode
1482 dotencode
1406 exp-sidedata-flag
1483 exp-sidedata-flag
1407 fncache
1484 fncache
1408 generaldelta
1485 generaldelta
1409 revlog-compression-zstd
1486 revlog-compression-zstd
1410 revlogv1
1487 revlogv1
1411 sparserevlog
1488 sparserevlog
1412 store
1489 store
1413 $ hg debugsidedata -c 0
1490 $ hg debugsidedata -c 0
General Comments 0
You need to be logged in to leave comments. Login now