##// END OF EJS Templates
upgrade: display the list of processed revlog before proceeding...
marmoute -
r46649:6c960b70 default
parent child Browse files
Show More
@@ -1,1481 +1,1492 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 metadata,
21 metadata,
22 pycompat,
22 pycompat,
23 requirements,
23 requirements,
24 revlog,
24 revlog,
25 scmutil,
25 scmutil,
26 util,
26 util,
27 vfs as vfsmod,
27 vfs as vfsmod,
28 )
28 )
29
29
30 from .utils import compression
30 from .utils import compression
31
31
32 # list of requirements that request a clone of all revlog if added/removed
32 # list of requirements that request a clone of all revlog if added/removed
33 RECLONES_REQUIREMENTS = {
33 RECLONES_REQUIREMENTS = {
34 b'generaldelta',
34 b'generaldelta',
35 requirements.SPARSEREVLOG_REQUIREMENT,
35 requirements.SPARSEREVLOG_REQUIREMENT,
36 }
36 }
37
37
38
38
39 def requiredsourcerequirements(repo):
39 def requiredsourcerequirements(repo):
40 """Obtain requirements required to be present to upgrade a repo.
40 """Obtain requirements required to be present to upgrade a repo.
41
41
42 An upgrade will not be allowed if the repository doesn't have the
42 An upgrade will not be allowed if the repository doesn't have the
43 requirements returned by this function.
43 requirements returned by this function.
44 """
44 """
45 return {
45 return {
46 # Introduced in Mercurial 0.9.2.
46 # Introduced in Mercurial 0.9.2.
47 b'revlogv1',
47 b'revlogv1',
48 # Introduced in Mercurial 0.9.2.
48 # Introduced in Mercurial 0.9.2.
49 b'store',
49 b'store',
50 }
50 }
51
51
52
52
53 def blocksourcerequirements(repo):
53 def blocksourcerequirements(repo):
54 """Obtain requirements that will prevent an upgrade from occurring.
54 """Obtain requirements that will prevent an upgrade from occurring.
55
55
56 An upgrade cannot be performed if the source repository contains a
56 An upgrade cannot be performed if the source repository contains a
57 requirements in the returned set.
57 requirements in the returned set.
58 """
58 """
59 return {
59 return {
60 # The upgrade code does not yet support these experimental features.
60 # The upgrade code does not yet support these experimental features.
61 # This is an artificial limitation.
61 # This is an artificial limitation.
62 requirements.TREEMANIFEST_REQUIREMENT,
62 requirements.TREEMANIFEST_REQUIREMENT,
63 # This was a precursor to generaldelta and was never enabled by default.
63 # This was a precursor to generaldelta and was never enabled by default.
64 # It should (hopefully) not exist in the wild.
64 # It should (hopefully) not exist in the wild.
65 b'parentdelta',
65 b'parentdelta',
66 # Upgrade should operate on the actual store, not the shared link.
66 # Upgrade should operate on the actual store, not the shared link.
67 requirements.SHARED_REQUIREMENT,
67 requirements.SHARED_REQUIREMENT,
68 }
68 }
69
69
70
70
71 def supportremovedrequirements(repo):
71 def supportremovedrequirements(repo):
72 """Obtain requirements that can be removed during an upgrade.
72 """Obtain requirements that can be removed during an upgrade.
73
73
74 If an upgrade were to create a repository that dropped a requirement,
74 If an upgrade were to create a repository that dropped a requirement,
75 the dropped requirement must appear in the returned set for the upgrade
75 the dropped requirement must appear in the returned set for the upgrade
76 to be allowed.
76 to be allowed.
77 """
77 """
78 supported = {
78 supported = {
79 requirements.SPARSEREVLOG_REQUIREMENT,
79 requirements.SPARSEREVLOG_REQUIREMENT,
80 requirements.SIDEDATA_REQUIREMENT,
80 requirements.SIDEDATA_REQUIREMENT,
81 requirements.COPIESSDC_REQUIREMENT,
81 requirements.COPIESSDC_REQUIREMENT,
82 requirements.NODEMAP_REQUIREMENT,
82 requirements.NODEMAP_REQUIREMENT,
83 requirements.SHARESAFE_REQUIREMENT,
83 requirements.SHARESAFE_REQUIREMENT,
84 }
84 }
85 for name in compression.compengines:
85 for name in compression.compengines:
86 engine = compression.compengines[name]
86 engine = compression.compengines[name]
87 if engine.available() and engine.revlogheader():
87 if engine.available() and engine.revlogheader():
88 supported.add(b'exp-compression-%s' % name)
88 supported.add(b'exp-compression-%s' % name)
89 if engine.name() == b'zstd':
89 if engine.name() == b'zstd':
90 supported.add(b'revlog-compression-zstd')
90 supported.add(b'revlog-compression-zstd')
91 return supported
91 return supported
92
92
93
93
94 def supporteddestrequirements(repo):
94 def supporteddestrequirements(repo):
95 """Obtain requirements that upgrade supports in the destination.
95 """Obtain requirements that upgrade supports in the destination.
96
96
97 If the result of the upgrade would create requirements not in this set,
97 If the result of the upgrade would create requirements not in this set,
98 the upgrade is disallowed.
98 the upgrade is disallowed.
99
99
100 Extensions should monkeypatch this to add their custom requirements.
100 Extensions should monkeypatch this to add their custom requirements.
101 """
101 """
102 supported = {
102 supported = {
103 b'dotencode',
103 b'dotencode',
104 b'fncache',
104 b'fncache',
105 b'generaldelta',
105 b'generaldelta',
106 b'revlogv1',
106 b'revlogv1',
107 b'store',
107 b'store',
108 requirements.SPARSEREVLOG_REQUIREMENT,
108 requirements.SPARSEREVLOG_REQUIREMENT,
109 requirements.SIDEDATA_REQUIREMENT,
109 requirements.SIDEDATA_REQUIREMENT,
110 requirements.COPIESSDC_REQUIREMENT,
110 requirements.COPIESSDC_REQUIREMENT,
111 requirements.NODEMAP_REQUIREMENT,
111 requirements.NODEMAP_REQUIREMENT,
112 requirements.SHARESAFE_REQUIREMENT,
112 requirements.SHARESAFE_REQUIREMENT,
113 }
113 }
114 for name in compression.compengines:
114 for name in compression.compengines:
115 engine = compression.compengines[name]
115 engine = compression.compengines[name]
116 if engine.available() and engine.revlogheader():
116 if engine.available() and engine.revlogheader():
117 supported.add(b'exp-compression-%s' % name)
117 supported.add(b'exp-compression-%s' % name)
118 if engine.name() == b'zstd':
118 if engine.name() == b'zstd':
119 supported.add(b'revlog-compression-zstd')
119 supported.add(b'revlog-compression-zstd')
120 return supported
120 return supported
121
121
122
122
123 def allowednewrequirements(repo):
123 def allowednewrequirements(repo):
124 """Obtain requirements that can be added to a repository during upgrade.
124 """Obtain requirements that can be added to a repository during upgrade.
125
125
126 This is used to disallow proposed requirements from being added when
126 This is used to disallow proposed requirements from being added when
127 they weren't present before.
127 they weren't present before.
128
128
129 We use a list of allowed requirement additions instead of a list of known
129 We use a list of allowed requirement additions instead of a list of known
130 bad additions because the whitelist approach is safer and will prevent
130 bad additions because the whitelist approach is safer and will prevent
131 future, unknown requirements from accidentally being added.
131 future, unknown requirements from accidentally being added.
132 """
132 """
133 supported = {
133 supported = {
134 b'dotencode',
134 b'dotencode',
135 b'fncache',
135 b'fncache',
136 b'generaldelta',
136 b'generaldelta',
137 requirements.SPARSEREVLOG_REQUIREMENT,
137 requirements.SPARSEREVLOG_REQUIREMENT,
138 requirements.SIDEDATA_REQUIREMENT,
138 requirements.SIDEDATA_REQUIREMENT,
139 requirements.COPIESSDC_REQUIREMENT,
139 requirements.COPIESSDC_REQUIREMENT,
140 requirements.NODEMAP_REQUIREMENT,
140 requirements.NODEMAP_REQUIREMENT,
141 requirements.SHARESAFE_REQUIREMENT,
141 requirements.SHARESAFE_REQUIREMENT,
142 }
142 }
143 for name in compression.compengines:
143 for name in compression.compengines:
144 engine = compression.compengines[name]
144 engine = compression.compengines[name]
145 if engine.available() and engine.revlogheader():
145 if engine.available() and engine.revlogheader():
146 supported.add(b'exp-compression-%s' % name)
146 supported.add(b'exp-compression-%s' % name)
147 if engine.name() == b'zstd':
147 if engine.name() == b'zstd':
148 supported.add(b'revlog-compression-zstd')
148 supported.add(b'revlog-compression-zstd')
149 return supported
149 return supported
150
150
151
151
152 def preservedrequirements(repo):
152 def preservedrequirements(repo):
153 return set()
153 return set()
154
154
155
155
156 DEFICIENCY = b'deficiency'
156 DEFICIENCY = b'deficiency'
157 OPTIMISATION = b'optimization'
157 OPTIMISATION = b'optimization'
158
158
159
159
160 class improvement(object):
160 class improvement(object):
161 """Represents an improvement that can be made as part of an upgrade.
161 """Represents an improvement that can be made as part of an upgrade.
162
162
163 The following attributes are defined on each instance:
163 The following attributes are defined on each instance:
164
164
165 name
165 name
166 Machine-readable string uniquely identifying this improvement. It
166 Machine-readable string uniquely identifying this improvement. It
167 will be mapped to an action later in the upgrade process.
167 will be mapped to an action later in the upgrade process.
168
168
169 type
169 type
170 Either ``DEFICIENCY`` or ``OPTIMISATION``. A deficiency is an obvious
170 Either ``DEFICIENCY`` or ``OPTIMISATION``. A deficiency is an obvious
171 problem. An optimization is an action (sometimes optional) that
171 problem. An optimization is an action (sometimes optional) that
172 can be taken to further improve the state of the repository.
172 can be taken to further improve the state of the repository.
173
173
174 description
174 description
175 Message intended for humans explaining the improvement in more detail,
175 Message intended for humans explaining the improvement in more detail,
176 including the implications of it. For ``DEFICIENCY`` types, should be
176 including the implications of it. For ``DEFICIENCY`` types, should be
177 worded in the present tense. For ``OPTIMISATION`` types, should be
177 worded in the present tense. For ``OPTIMISATION`` types, should be
178 worded in the future tense.
178 worded in the future tense.
179
179
180 upgrademessage
180 upgrademessage
181 Message intended for humans explaining what an upgrade addressing this
181 Message intended for humans explaining what an upgrade addressing this
182 issue will do. Should be worded in the future tense.
182 issue will do. Should be worded in the future tense.
183 """
183 """
184
184
185 def __init__(self, name, type, description, upgrademessage):
185 def __init__(self, name, type, description, upgrademessage):
186 self.name = name
186 self.name = name
187 self.type = type
187 self.type = type
188 self.description = description
188 self.description = description
189 self.upgrademessage = upgrademessage
189 self.upgrademessage = upgrademessage
190
190
191 def __eq__(self, other):
191 def __eq__(self, other):
192 if not isinstance(other, improvement):
192 if not isinstance(other, improvement):
193 # This is what python tell use to do
193 # This is what python tell use to do
194 return NotImplemented
194 return NotImplemented
195 return self.name == other.name
195 return self.name == other.name
196
196
197 def __ne__(self, other):
197 def __ne__(self, other):
198 return not (self == other)
198 return not (self == other)
199
199
200 def __hash__(self):
200 def __hash__(self):
201 return hash(self.name)
201 return hash(self.name)
202
202
203
203
204 allformatvariant = []
204 allformatvariant = []
205
205
206
206
207 def registerformatvariant(cls):
207 def registerformatvariant(cls):
208 allformatvariant.append(cls)
208 allformatvariant.append(cls)
209 return cls
209 return cls
210
210
211
211
212 class formatvariant(improvement):
212 class formatvariant(improvement):
213 """an improvement subclass dedicated to repository format"""
213 """an improvement subclass dedicated to repository format"""
214
214
215 type = DEFICIENCY
215 type = DEFICIENCY
216 ### The following attributes should be defined for each class:
216 ### The following attributes should be defined for each class:
217
217
218 # machine-readable string uniquely identifying this improvement. it will be
218 # machine-readable string uniquely identifying this improvement. it will be
219 # mapped to an action later in the upgrade process.
219 # mapped to an action later in the upgrade process.
220 name = None
220 name = None
221
221
222 # message intended for humans explaining the improvement in more detail,
222 # message intended for humans explaining the improvement in more detail,
223 # including the implications of it ``DEFICIENCY`` types, should be worded
223 # including the implications of it ``DEFICIENCY`` types, should be worded
224 # in the present tense.
224 # in the present tense.
225 description = None
225 description = None
226
226
227 # message intended for humans explaining what an upgrade addressing this
227 # message intended for humans explaining what an upgrade addressing this
228 # issue will do. should be worded in the future tense.
228 # issue will do. should be worded in the future tense.
229 upgrademessage = None
229 upgrademessage = None
230
230
231 # value of current Mercurial default for new repository
231 # value of current Mercurial default for new repository
232 default = None
232 default = None
233
233
234 def __init__(self):
234 def __init__(self):
235 raise NotImplementedError()
235 raise NotImplementedError()
236
236
237 @staticmethod
237 @staticmethod
238 def fromrepo(repo):
238 def fromrepo(repo):
239 """current value of the variant in the repository"""
239 """current value of the variant in the repository"""
240 raise NotImplementedError()
240 raise NotImplementedError()
241
241
242 @staticmethod
242 @staticmethod
243 def fromconfig(repo):
243 def fromconfig(repo):
244 """current value of the variant in the configuration"""
244 """current value of the variant in the configuration"""
245 raise NotImplementedError()
245 raise NotImplementedError()
246
246
247
247
248 class requirementformatvariant(formatvariant):
248 class requirementformatvariant(formatvariant):
249 """formatvariant based on a 'requirement' name.
249 """formatvariant based on a 'requirement' name.
250
250
251 Many format variant are controlled by a 'requirement'. We define a small
251 Many format variant are controlled by a 'requirement'. We define a small
252 subclass to factor the code.
252 subclass to factor the code.
253 """
253 """
254
254
255 # the requirement that control this format variant
255 # the requirement that control this format variant
256 _requirement = None
256 _requirement = None
257
257
258 @staticmethod
258 @staticmethod
259 def _newreporequirements(ui):
259 def _newreporequirements(ui):
260 return localrepo.newreporequirements(
260 return localrepo.newreporequirements(
261 ui, localrepo.defaultcreateopts(ui)
261 ui, localrepo.defaultcreateopts(ui)
262 )
262 )
263
263
264 @classmethod
264 @classmethod
265 def fromrepo(cls, repo):
265 def fromrepo(cls, repo):
266 assert cls._requirement is not None
266 assert cls._requirement is not None
267 return cls._requirement in repo.requirements
267 return cls._requirement in repo.requirements
268
268
269 @classmethod
269 @classmethod
270 def fromconfig(cls, repo):
270 def fromconfig(cls, repo):
271 assert cls._requirement is not None
271 assert cls._requirement is not None
272 return cls._requirement in cls._newreporequirements(repo.ui)
272 return cls._requirement in cls._newreporequirements(repo.ui)
273
273
274
274
275 @registerformatvariant
275 @registerformatvariant
276 class fncache(requirementformatvariant):
276 class fncache(requirementformatvariant):
277 name = b'fncache'
277 name = b'fncache'
278
278
279 _requirement = b'fncache'
279 _requirement = b'fncache'
280
280
281 default = True
281 default = True
282
282
283 description = _(
283 description = _(
284 b'long and reserved filenames may not work correctly; '
284 b'long and reserved filenames may not work correctly; '
285 b'repository performance is sub-optimal'
285 b'repository performance is sub-optimal'
286 )
286 )
287
287
288 upgrademessage = _(
288 upgrademessage = _(
289 b'repository will be more resilient to storing '
289 b'repository will be more resilient to storing '
290 b'certain paths and performance of certain '
290 b'certain paths and performance of certain '
291 b'operations should be improved'
291 b'operations should be improved'
292 )
292 )
293
293
294
294
295 @registerformatvariant
295 @registerformatvariant
296 class dotencode(requirementformatvariant):
296 class dotencode(requirementformatvariant):
297 name = b'dotencode'
297 name = b'dotencode'
298
298
299 _requirement = b'dotencode'
299 _requirement = b'dotencode'
300
300
301 default = True
301 default = True
302
302
303 description = _(
303 description = _(
304 b'storage of filenames beginning with a period or '
304 b'storage of filenames beginning with a period or '
305 b'space may not work correctly'
305 b'space may not work correctly'
306 )
306 )
307
307
308 upgrademessage = _(
308 upgrademessage = _(
309 b'repository will be better able to store files '
309 b'repository will be better able to store files '
310 b'beginning with a space or period'
310 b'beginning with a space or period'
311 )
311 )
312
312
313
313
314 @registerformatvariant
314 @registerformatvariant
315 class generaldelta(requirementformatvariant):
315 class generaldelta(requirementformatvariant):
316 name = b'generaldelta'
316 name = b'generaldelta'
317
317
318 _requirement = b'generaldelta'
318 _requirement = b'generaldelta'
319
319
320 default = True
320 default = True
321
321
322 description = _(
322 description = _(
323 b'deltas within internal storage are unable to '
323 b'deltas within internal storage are unable to '
324 b'choose optimal revisions; repository is larger and '
324 b'choose optimal revisions; repository is larger and '
325 b'slower than it could be; interaction with other '
325 b'slower than it could be; interaction with other '
326 b'repositories may require extra network and CPU '
326 b'repositories may require extra network and CPU '
327 b'resources, making "hg push" and "hg pull" slower'
327 b'resources, making "hg push" and "hg pull" slower'
328 )
328 )
329
329
330 upgrademessage = _(
330 upgrademessage = _(
331 b'repository storage will be able to create '
331 b'repository storage will be able to create '
332 b'optimal deltas; new repository data will be '
332 b'optimal deltas; new repository data will be '
333 b'smaller and read times should decrease; '
333 b'smaller and read times should decrease; '
334 b'interacting with other repositories using this '
334 b'interacting with other repositories using this '
335 b'storage model should require less network and '
335 b'storage model should require less network and '
336 b'CPU resources, making "hg push" and "hg pull" '
336 b'CPU resources, making "hg push" and "hg pull" '
337 b'faster'
337 b'faster'
338 )
338 )
339
339
340
340
341 @registerformatvariant
341 @registerformatvariant
342 class sharedsafe(requirementformatvariant):
342 class sharedsafe(requirementformatvariant):
343 name = b'exp-sharesafe'
343 name = b'exp-sharesafe'
344 _requirement = requirements.SHARESAFE_REQUIREMENT
344 _requirement = requirements.SHARESAFE_REQUIREMENT
345
345
346 default = False
346 default = False
347
347
348 description = _(
348 description = _(
349 b'old shared repositories do not share source repository '
349 b'old shared repositories do not share source repository '
350 b'requirements and config. This leads to various problems '
350 b'requirements and config. This leads to various problems '
351 b'when the source repository format is upgraded or some new '
351 b'when the source repository format is upgraded or some new '
352 b'extensions are enabled.'
352 b'extensions are enabled.'
353 )
353 )
354
354
355 upgrademessage = _(
355 upgrademessage = _(
356 b'Upgrades a repository to share-safe format so that future '
356 b'Upgrades a repository to share-safe format so that future '
357 b'shares of this repository share its requirements and configs.'
357 b'shares of this repository share its requirements and configs.'
358 )
358 )
359
359
360
360
361 @registerformatvariant
361 @registerformatvariant
362 class sparserevlog(requirementformatvariant):
362 class sparserevlog(requirementformatvariant):
363 name = b'sparserevlog'
363 name = b'sparserevlog'
364
364
365 _requirement = requirements.SPARSEREVLOG_REQUIREMENT
365 _requirement = requirements.SPARSEREVLOG_REQUIREMENT
366
366
367 default = True
367 default = True
368
368
369 description = _(
369 description = _(
370 b'in order to limit disk reading and memory usage on older '
370 b'in order to limit disk reading and memory usage on older '
371 b'version, the span of a delta chain from its root to its '
371 b'version, the span of a delta chain from its root to its '
372 b'end is limited, whatever the relevant data in this span. '
372 b'end is limited, whatever the relevant data in this span. '
373 b'This can severly limit Mercurial ability to build good '
373 b'This can severly limit Mercurial ability to build good '
374 b'chain of delta resulting is much more storage space being '
374 b'chain of delta resulting is much more storage space being '
375 b'taken and limit reusability of on disk delta during '
375 b'taken and limit reusability of on disk delta during '
376 b'exchange.'
376 b'exchange.'
377 )
377 )
378
378
379 upgrademessage = _(
379 upgrademessage = _(
380 b'Revlog supports delta chain with more unused data '
380 b'Revlog supports delta chain with more unused data '
381 b'between payload. These gaps will be skipped at read '
381 b'between payload. These gaps will be skipped at read '
382 b'time. This allows for better delta chains, making a '
382 b'time. This allows for better delta chains, making a '
383 b'better compression and faster exchange with server.'
383 b'better compression and faster exchange with server.'
384 )
384 )
385
385
386
386
387 @registerformatvariant
387 @registerformatvariant
388 class sidedata(requirementformatvariant):
388 class sidedata(requirementformatvariant):
389 name = b'sidedata'
389 name = b'sidedata'
390
390
391 _requirement = requirements.SIDEDATA_REQUIREMENT
391 _requirement = requirements.SIDEDATA_REQUIREMENT
392
392
393 default = False
393 default = False
394
394
395 description = _(
395 description = _(
396 b'Allows storage of extra data alongside a revision, '
396 b'Allows storage of extra data alongside a revision, '
397 b'unlocking various caching options.'
397 b'unlocking various caching options.'
398 )
398 )
399
399
400 upgrademessage = _(b'Allows storage of extra data alongside a revision.')
400 upgrademessage = _(b'Allows storage of extra data alongside a revision.')
401
401
402
402
403 @registerformatvariant
403 @registerformatvariant
404 class persistentnodemap(requirementformatvariant):
404 class persistentnodemap(requirementformatvariant):
405 name = b'persistent-nodemap'
405 name = b'persistent-nodemap'
406
406
407 _requirement = requirements.NODEMAP_REQUIREMENT
407 _requirement = requirements.NODEMAP_REQUIREMENT
408
408
409 default = False
409 default = False
410
410
411 description = _(
411 description = _(
412 b'persist the node -> rev mapping on disk to speedup lookup'
412 b'persist the node -> rev mapping on disk to speedup lookup'
413 )
413 )
414
414
415 upgrademessage = _(b'Speedup revision lookup by node id.')
415 upgrademessage = _(b'Speedup revision lookup by node id.')
416
416
417
417
418 @registerformatvariant
418 @registerformatvariant
419 class copiessdc(requirementformatvariant):
419 class copiessdc(requirementformatvariant):
420 name = b'copies-sdc'
420 name = b'copies-sdc'
421
421
422 _requirement = requirements.COPIESSDC_REQUIREMENT
422 _requirement = requirements.COPIESSDC_REQUIREMENT
423
423
424 default = False
424 default = False
425
425
426 description = _(b'Stores copies information alongside changesets.')
426 description = _(b'Stores copies information alongside changesets.')
427
427
428 upgrademessage = _(
428 upgrademessage = _(
429 b'Allows to use more efficient algorithm to deal with ' b'copy tracing.'
429 b'Allows to use more efficient algorithm to deal with ' b'copy tracing.'
430 )
430 )
431
431
432
432
433 @registerformatvariant
433 @registerformatvariant
434 class removecldeltachain(formatvariant):
434 class removecldeltachain(formatvariant):
435 name = b'plain-cl-delta'
435 name = b'plain-cl-delta'
436
436
437 default = True
437 default = True
438
438
439 description = _(
439 description = _(
440 b'changelog storage is using deltas instead of '
440 b'changelog storage is using deltas instead of '
441 b'raw entries; changelog reading and any '
441 b'raw entries; changelog reading and any '
442 b'operation relying on changelog data are slower '
442 b'operation relying on changelog data are slower '
443 b'than they could be'
443 b'than they could be'
444 )
444 )
445
445
446 upgrademessage = _(
446 upgrademessage = _(
447 b'changelog storage will be reformated to '
447 b'changelog storage will be reformated to '
448 b'store raw entries; changelog reading will be '
448 b'store raw entries; changelog reading will be '
449 b'faster; changelog size may be reduced'
449 b'faster; changelog size may be reduced'
450 )
450 )
451
451
452 @staticmethod
452 @staticmethod
453 def fromrepo(repo):
453 def fromrepo(repo):
454 # Mercurial 4.0 changed changelogs to not use delta chains. Search for
454 # Mercurial 4.0 changed changelogs to not use delta chains. Search for
455 # changelogs with deltas.
455 # changelogs with deltas.
456 cl = repo.changelog
456 cl = repo.changelog
457 chainbase = cl.chainbase
457 chainbase = cl.chainbase
458 return all(rev == chainbase(rev) for rev in cl)
458 return all(rev == chainbase(rev) for rev in cl)
459
459
460 @staticmethod
460 @staticmethod
461 def fromconfig(repo):
461 def fromconfig(repo):
462 return True
462 return True
463
463
464
464
465 @registerformatvariant
465 @registerformatvariant
466 class compressionengine(formatvariant):
466 class compressionengine(formatvariant):
467 name = b'compression'
467 name = b'compression'
468 default = b'zlib'
468 default = b'zlib'
469
469
470 description = _(
470 description = _(
471 b'Compresion algorithm used to compress data. '
471 b'Compresion algorithm used to compress data. '
472 b'Some engine are faster than other'
472 b'Some engine are faster than other'
473 )
473 )
474
474
475 upgrademessage = _(
475 upgrademessage = _(
476 b'revlog content will be recompressed with the new algorithm.'
476 b'revlog content will be recompressed with the new algorithm.'
477 )
477 )
478
478
479 @classmethod
479 @classmethod
480 def fromrepo(cls, repo):
480 def fromrepo(cls, repo):
481 # we allow multiple compression engine requirement to co-exist because
481 # we allow multiple compression engine requirement to co-exist because
482 # strickly speaking, revlog seems to support mixed compression style.
482 # strickly speaking, revlog seems to support mixed compression style.
483 #
483 #
484 # The compression used for new entries will be "the last one"
484 # The compression used for new entries will be "the last one"
485 compression = b'zlib'
485 compression = b'zlib'
486 for req in repo.requirements:
486 for req in repo.requirements:
487 prefix = req.startswith
487 prefix = req.startswith
488 if prefix(b'revlog-compression-') or prefix(b'exp-compression-'):
488 if prefix(b'revlog-compression-') or prefix(b'exp-compression-'):
489 compression = req.split(b'-', 2)[2]
489 compression = req.split(b'-', 2)[2]
490 return compression
490 return compression
491
491
492 @classmethod
492 @classmethod
493 def fromconfig(cls, repo):
493 def fromconfig(cls, repo):
494 compengines = repo.ui.configlist(b'format', b'revlog-compression')
494 compengines = repo.ui.configlist(b'format', b'revlog-compression')
495 # return the first valid value as the selection code would do
495 # return the first valid value as the selection code would do
496 for comp in compengines:
496 for comp in compengines:
497 if comp in util.compengines:
497 if comp in util.compengines:
498 return comp
498 return comp
499
499
500 # no valide compression found lets display it all for clarity
500 # no valide compression found lets display it all for clarity
501 return b','.join(compengines)
501 return b','.join(compengines)
502
502
503
503
504 @registerformatvariant
504 @registerformatvariant
505 class compressionlevel(formatvariant):
505 class compressionlevel(formatvariant):
506 name = b'compression-level'
506 name = b'compression-level'
507 default = b'default'
507 default = b'default'
508
508
509 description = _(b'compression level')
509 description = _(b'compression level')
510
510
511 upgrademessage = _(b'revlog content will be recompressed')
511 upgrademessage = _(b'revlog content will be recompressed')
512
512
513 @classmethod
513 @classmethod
514 def fromrepo(cls, repo):
514 def fromrepo(cls, repo):
515 comp = compressionengine.fromrepo(repo)
515 comp = compressionengine.fromrepo(repo)
516 level = None
516 level = None
517 if comp == b'zlib':
517 if comp == b'zlib':
518 level = repo.ui.configint(b'storage', b'revlog.zlib.level')
518 level = repo.ui.configint(b'storage', b'revlog.zlib.level')
519 elif comp == b'zstd':
519 elif comp == b'zstd':
520 level = repo.ui.configint(b'storage', b'revlog.zstd.level')
520 level = repo.ui.configint(b'storage', b'revlog.zstd.level')
521 if level is None:
521 if level is None:
522 return b'default'
522 return b'default'
523 return bytes(level)
523 return bytes(level)
524
524
525 @classmethod
525 @classmethod
526 def fromconfig(cls, repo):
526 def fromconfig(cls, repo):
527 comp = compressionengine.fromconfig(repo)
527 comp = compressionengine.fromconfig(repo)
528 level = None
528 level = None
529 if comp == b'zlib':
529 if comp == b'zlib':
530 level = repo.ui.configint(b'storage', b'revlog.zlib.level')
530 level = repo.ui.configint(b'storage', b'revlog.zlib.level')
531 elif comp == b'zstd':
531 elif comp == b'zstd':
532 level = repo.ui.configint(b'storage', b'revlog.zstd.level')
532 level = repo.ui.configint(b'storage', b'revlog.zstd.level')
533 if level is None:
533 if level is None:
534 return b'default'
534 return b'default'
535 return bytes(level)
535 return bytes(level)
536
536
537
537
538 def finddeficiencies(repo):
538 def finddeficiencies(repo):
539 """returns a list of deficiencies that the repo suffer from"""
539 """returns a list of deficiencies that the repo suffer from"""
540 deficiencies = []
540 deficiencies = []
541
541
542 # We could detect lack of revlogv1 and store here, but they were added
542 # We could detect lack of revlogv1 and store here, but they were added
543 # in 0.9.2 and we don't support upgrading repos without these
543 # in 0.9.2 and we don't support upgrading repos without these
544 # requirements, so let's not bother.
544 # requirements, so let's not bother.
545
545
546 for fv in allformatvariant:
546 for fv in allformatvariant:
547 if not fv.fromrepo(repo):
547 if not fv.fromrepo(repo):
548 deficiencies.append(fv)
548 deficiencies.append(fv)
549
549
550 return deficiencies
550 return deficiencies
551
551
552
552
553 # search without '-' to support older form on newer client.
553 # search without '-' to support older form on newer client.
554 #
554 #
555 # We don't enforce backward compatibility for debug command so this
555 # We don't enforce backward compatibility for debug command so this
556 # might eventually be dropped. However, having to use two different
556 # might eventually be dropped. However, having to use two different
557 # forms in script when comparing result is anoying enough to add
557 # forms in script when comparing result is anoying enough to add
558 # backward compatibility for a while.
558 # backward compatibility for a while.
559 legacy_opts_map = {
559 legacy_opts_map = {
560 b'redeltaparent': b're-delta-parent',
560 b'redeltaparent': b're-delta-parent',
561 b'redeltamultibase': b're-delta-multibase',
561 b'redeltamultibase': b're-delta-multibase',
562 b'redeltaall': b're-delta-all',
562 b'redeltaall': b're-delta-all',
563 b'redeltafulladd': b're-delta-fulladd',
563 b'redeltafulladd': b're-delta-fulladd',
564 }
564 }
565
565
566 ALL_OPTIMISATIONS = []
566 ALL_OPTIMISATIONS = []
567
567
568
568
569 def register_optimization(obj):
569 def register_optimization(obj):
570 ALL_OPTIMISATIONS.append(obj)
570 ALL_OPTIMISATIONS.append(obj)
571 return obj
571 return obj
572
572
573
573
574 register_optimization(
574 register_optimization(
575 improvement(
575 improvement(
576 name=b're-delta-parent',
576 name=b're-delta-parent',
577 type=OPTIMISATION,
577 type=OPTIMISATION,
578 description=_(
578 description=_(
579 b'deltas within internal storage will be recalculated to '
579 b'deltas within internal storage will be recalculated to '
580 b'choose an optimal base revision where this was not '
580 b'choose an optimal base revision where this was not '
581 b'already done; the size of the repository may shrink and '
581 b'already done; the size of the repository may shrink and '
582 b'various operations may become faster; the first time '
582 b'various operations may become faster; the first time '
583 b'this optimization is performed could slow down upgrade '
583 b'this optimization is performed could slow down upgrade '
584 b'execution considerably; subsequent invocations should '
584 b'execution considerably; subsequent invocations should '
585 b'not run noticeably slower'
585 b'not run noticeably slower'
586 ),
586 ),
587 upgrademessage=_(
587 upgrademessage=_(
588 b'deltas within internal storage will choose a new '
588 b'deltas within internal storage will choose a new '
589 b'base revision if needed'
589 b'base revision if needed'
590 ),
590 ),
591 )
591 )
592 )
592 )
593
593
594 register_optimization(
594 register_optimization(
595 improvement(
595 improvement(
596 name=b're-delta-multibase',
596 name=b're-delta-multibase',
597 type=OPTIMISATION,
597 type=OPTIMISATION,
598 description=_(
598 description=_(
599 b'deltas within internal storage will be recalculated '
599 b'deltas within internal storage will be recalculated '
600 b'against multiple base revision and the smallest '
600 b'against multiple base revision and the smallest '
601 b'difference will be used; the size of the repository may '
601 b'difference will be used; the size of the repository may '
602 b'shrink significantly when there are many merges; this '
602 b'shrink significantly when there are many merges; this '
603 b'optimization will slow down execution in proportion to '
603 b'optimization will slow down execution in proportion to '
604 b'the number of merges in the repository and the amount '
604 b'the number of merges in the repository and the amount '
605 b'of files in the repository; this slow down should not '
605 b'of files in the repository; this slow down should not '
606 b'be significant unless there are tens of thousands of '
606 b'be significant unless there are tens of thousands of '
607 b'files and thousands of merges'
607 b'files and thousands of merges'
608 ),
608 ),
609 upgrademessage=_(
609 upgrademessage=_(
610 b'deltas within internal storage will choose an '
610 b'deltas within internal storage will choose an '
611 b'optimal delta by computing deltas against multiple '
611 b'optimal delta by computing deltas against multiple '
612 b'parents; may slow down execution time '
612 b'parents; may slow down execution time '
613 b'significantly'
613 b'significantly'
614 ),
614 ),
615 )
615 )
616 )
616 )
617
617
618 register_optimization(
618 register_optimization(
619 improvement(
619 improvement(
620 name=b're-delta-all',
620 name=b're-delta-all',
621 type=OPTIMISATION,
621 type=OPTIMISATION,
622 description=_(
622 description=_(
623 b'deltas within internal storage will always be '
623 b'deltas within internal storage will always be '
624 b'recalculated without reusing prior deltas; this will '
624 b'recalculated without reusing prior deltas; this will '
625 b'likely make execution run several times slower; this '
625 b'likely make execution run several times slower; this '
626 b'optimization is typically not needed'
626 b'optimization is typically not needed'
627 ),
627 ),
628 upgrademessage=_(
628 upgrademessage=_(
629 b'deltas within internal storage will be fully '
629 b'deltas within internal storage will be fully '
630 b'recomputed; this will likely drastically slow down '
630 b'recomputed; this will likely drastically slow down '
631 b'execution time'
631 b'execution time'
632 ),
632 ),
633 )
633 )
634 )
634 )
635
635
636 register_optimization(
636 register_optimization(
637 improvement(
637 improvement(
638 name=b're-delta-fulladd',
638 name=b're-delta-fulladd',
639 type=OPTIMISATION,
639 type=OPTIMISATION,
640 description=_(
640 description=_(
641 b'every revision will be re-added as if it was new '
641 b'every revision will be re-added as if it was new '
642 b'content. It will go through the full storage '
642 b'content. It will go through the full storage '
643 b'mechanism giving extensions a chance to process it '
643 b'mechanism giving extensions a chance to process it '
644 b'(eg. lfs). This is similar to "re-delta-all" but even '
644 b'(eg. lfs). This is similar to "re-delta-all" but even '
645 b'slower since more logic is involved.'
645 b'slower since more logic is involved.'
646 ),
646 ),
647 upgrademessage=_(
647 upgrademessage=_(
648 b'each revision will be added as new content to the '
648 b'each revision will be added as new content to the '
649 b'internal storage; this will likely drastically slow '
649 b'internal storage; this will likely drastically slow '
650 b'down execution time, but some extensions might need '
650 b'down execution time, but some extensions might need '
651 b'it'
651 b'it'
652 ),
652 ),
653 )
653 )
654 )
654 )
655
655
656
656
657 def findoptimizations(repo):
657 def findoptimizations(repo):
658 """Determine optimisation that could be used during upgrade"""
658 """Determine optimisation that could be used during upgrade"""
659 # These are unconditionally added. There is logic later that figures out
659 # These are unconditionally added. There is logic later that figures out
660 # which ones to apply.
660 # which ones to apply.
661 return list(ALL_OPTIMISATIONS)
661 return list(ALL_OPTIMISATIONS)
662
662
663
663
664 def determineactions(repo, deficiencies, sourcereqs, destreqs):
664 def determineactions(repo, deficiencies, sourcereqs, destreqs):
665 """Determine upgrade actions that will be performed.
665 """Determine upgrade actions that will be performed.
666
666
667 Given a list of improvements as returned by ``finddeficiencies`` and
667 Given a list of improvements as returned by ``finddeficiencies`` and
668 ``findoptimizations``, determine the list of upgrade actions that
668 ``findoptimizations``, determine the list of upgrade actions that
669 will be performed.
669 will be performed.
670
670
671 The role of this function is to filter improvements if needed, apply
671 The role of this function is to filter improvements if needed, apply
672 recommended optimizations from the improvements list that make sense,
672 recommended optimizations from the improvements list that make sense,
673 etc.
673 etc.
674
674
675 Returns a list of action names.
675 Returns a list of action names.
676 """
676 """
677 newactions = []
677 newactions = []
678
678
679 for d in deficiencies:
679 for d in deficiencies:
680 name = d._requirement
680 name = d._requirement
681
681
682 # If the action is a requirement that doesn't show up in the
682 # If the action is a requirement that doesn't show up in the
683 # destination requirements, prune the action.
683 # destination requirements, prune the action.
684 if name is not None and name not in destreqs:
684 if name is not None and name not in destreqs:
685 continue
685 continue
686
686
687 newactions.append(d)
687 newactions.append(d)
688
688
689 # FUTURE consider adding some optimizations here for certain transitions.
689 # FUTURE consider adding some optimizations here for certain transitions.
690 # e.g. adding generaldelta could schedule parent redeltas.
690 # e.g. adding generaldelta could schedule parent redeltas.
691
691
692 return newactions
692 return newactions
693
693
694
694
695 def _revlogfrompath(repo, path):
695 def _revlogfrompath(repo, path):
696 """Obtain a revlog from a repo path.
696 """Obtain a revlog from a repo path.
697
697
698 An instance of the appropriate class is returned.
698 An instance of the appropriate class is returned.
699 """
699 """
700 if path == b'00changelog.i':
700 if path == b'00changelog.i':
701 return changelog.changelog(repo.svfs)
701 return changelog.changelog(repo.svfs)
702 elif path.endswith(b'00manifest.i'):
702 elif path.endswith(b'00manifest.i'):
703 mandir = path[: -len(b'00manifest.i')]
703 mandir = path[: -len(b'00manifest.i')]
704 return manifest.manifestrevlog(repo.svfs, tree=mandir)
704 return manifest.manifestrevlog(repo.svfs, tree=mandir)
705 else:
705 else:
706 # reverse of "/".join(("data", path + ".i"))
706 # reverse of "/".join(("data", path + ".i"))
707 return filelog.filelog(repo.svfs, path[5:-2])
707 return filelog.filelog(repo.svfs, path[5:-2])
708
708
709
709
710 def _copyrevlog(tr, destrepo, oldrl, unencodedname):
710 def _copyrevlog(tr, destrepo, oldrl, unencodedname):
711 """copy all relevant files for `oldrl` into `destrepo` store
711 """copy all relevant files for `oldrl` into `destrepo` store
712
712
713 Files are copied "as is" without any transformation. The copy is performed
713 Files are copied "as is" without any transformation. The copy is performed
714 without extra checks. Callers are responsible for making sure the copied
714 without extra checks. Callers are responsible for making sure the copied
715 content is compatible with format of the destination repository.
715 content is compatible with format of the destination repository.
716 """
716 """
717 oldrl = getattr(oldrl, '_revlog', oldrl)
717 oldrl = getattr(oldrl, '_revlog', oldrl)
718 newrl = _revlogfrompath(destrepo, unencodedname)
718 newrl = _revlogfrompath(destrepo, unencodedname)
719 newrl = getattr(newrl, '_revlog', newrl)
719 newrl = getattr(newrl, '_revlog', newrl)
720
720
721 oldvfs = oldrl.opener
721 oldvfs = oldrl.opener
722 newvfs = newrl.opener
722 newvfs = newrl.opener
723 oldindex = oldvfs.join(oldrl.indexfile)
723 oldindex = oldvfs.join(oldrl.indexfile)
724 newindex = newvfs.join(newrl.indexfile)
724 newindex = newvfs.join(newrl.indexfile)
725 olddata = oldvfs.join(oldrl.datafile)
725 olddata = oldvfs.join(oldrl.datafile)
726 newdata = newvfs.join(newrl.datafile)
726 newdata = newvfs.join(newrl.datafile)
727
727
728 with newvfs(newrl.indexfile, b'w'):
728 with newvfs(newrl.indexfile, b'w'):
729 pass # create all the directories
729 pass # create all the directories
730
730
731 util.copyfile(oldindex, newindex)
731 util.copyfile(oldindex, newindex)
732 copydata = oldrl.opener.exists(oldrl.datafile)
732 copydata = oldrl.opener.exists(oldrl.datafile)
733 if copydata:
733 if copydata:
734 util.copyfile(olddata, newdata)
734 util.copyfile(olddata, newdata)
735
735
736 if not (
736 if not (
737 unencodedname.endswith(b'00changelog.i')
737 unencodedname.endswith(b'00changelog.i')
738 or unencodedname.endswith(b'00manifest.i')
738 or unencodedname.endswith(b'00manifest.i')
739 ):
739 ):
740 destrepo.svfs.fncache.add(unencodedname)
740 destrepo.svfs.fncache.add(unencodedname)
741 if copydata:
741 if copydata:
742 destrepo.svfs.fncache.add(unencodedname[:-2] + b'.d')
742 destrepo.svfs.fncache.add(unencodedname[:-2] + b'.d')
743
743
744
744
745 UPGRADE_CHANGELOG = object()
745 UPGRADE_CHANGELOG = b"changelog"
746 UPGRADE_MANIFEST = object()
746 UPGRADE_MANIFEST = b"manifest"
747 UPGRADE_FILELOGS = object()
747 UPGRADE_FILELOGS = b"all-filelogs"
748
748
749 UPGRADE_ALL_REVLOGS = frozenset(
749 UPGRADE_ALL_REVLOGS = frozenset(
750 [UPGRADE_CHANGELOG, UPGRADE_MANIFEST, UPGRADE_FILELOGS]
750 [UPGRADE_CHANGELOG, UPGRADE_MANIFEST, UPGRADE_FILELOGS]
751 )
751 )
752
752
753
753
754 def getsidedatacompanion(srcrepo, dstrepo):
754 def getsidedatacompanion(srcrepo, dstrepo):
755 sidedatacompanion = None
755 sidedatacompanion = None
756 removedreqs = srcrepo.requirements - dstrepo.requirements
756 removedreqs = srcrepo.requirements - dstrepo.requirements
757 addedreqs = dstrepo.requirements - srcrepo.requirements
757 addedreqs = dstrepo.requirements - srcrepo.requirements
758 if requirements.SIDEDATA_REQUIREMENT in removedreqs:
758 if requirements.SIDEDATA_REQUIREMENT in removedreqs:
759
759
760 def sidedatacompanion(rl, rev):
760 def sidedatacompanion(rl, rev):
761 rl = getattr(rl, '_revlog', rl)
761 rl = getattr(rl, '_revlog', rl)
762 if rl.flags(rev) & revlog.REVIDX_SIDEDATA:
762 if rl.flags(rev) & revlog.REVIDX_SIDEDATA:
763 return True, (), {}, 0, 0
763 return True, (), {}, 0, 0
764 return False, (), {}, 0, 0
764 return False, (), {}, 0, 0
765
765
766 elif requirements.COPIESSDC_REQUIREMENT in addedreqs:
766 elif requirements.COPIESSDC_REQUIREMENT in addedreqs:
767 sidedatacompanion = metadata.getsidedataadder(srcrepo, dstrepo)
767 sidedatacompanion = metadata.getsidedataadder(srcrepo, dstrepo)
768 elif requirements.COPIESSDC_REQUIREMENT in removedreqs:
768 elif requirements.COPIESSDC_REQUIREMENT in removedreqs:
769 sidedatacompanion = metadata.getsidedataremover(srcrepo, dstrepo)
769 sidedatacompanion = metadata.getsidedataremover(srcrepo, dstrepo)
770 return sidedatacompanion
770 return sidedatacompanion
771
771
772
772
773 def matchrevlog(revlogfilter, entry):
773 def matchrevlog(revlogfilter, entry):
774 """check if a revlog is selected for cloning.
774 """check if a revlog is selected for cloning.
775
775
776 In other words, are there any updates which need to be done on revlog
776 In other words, are there any updates which need to be done on revlog
777 or it can be blindly copied.
777 or it can be blindly copied.
778
778
779 The store entry is checked against the passed filter"""
779 The store entry is checked against the passed filter"""
780 if entry.endswith(b'00changelog.i'):
780 if entry.endswith(b'00changelog.i'):
781 return UPGRADE_CHANGELOG in revlogfilter
781 return UPGRADE_CHANGELOG in revlogfilter
782 elif entry.endswith(b'00manifest.i'):
782 elif entry.endswith(b'00manifest.i'):
783 return UPGRADE_MANIFEST in revlogfilter
783 return UPGRADE_MANIFEST in revlogfilter
784 return UPGRADE_FILELOGS in revlogfilter
784 return UPGRADE_FILELOGS in revlogfilter
785
785
786
786
787 def _clonerevlogs(
787 def _clonerevlogs(
788 ui,
788 ui,
789 srcrepo,
789 srcrepo,
790 dstrepo,
790 dstrepo,
791 tr,
791 tr,
792 deltareuse,
792 deltareuse,
793 forcedeltabothparents,
793 forcedeltabothparents,
794 revlogs=UPGRADE_ALL_REVLOGS,
794 revlogs=UPGRADE_ALL_REVLOGS,
795 ):
795 ):
796 """Copy revlogs between 2 repos."""
796 """Copy revlogs between 2 repos."""
797 revcount = 0
797 revcount = 0
798 srcsize = 0
798 srcsize = 0
799 srcrawsize = 0
799 srcrawsize = 0
800 dstsize = 0
800 dstsize = 0
801 fcount = 0
801 fcount = 0
802 frevcount = 0
802 frevcount = 0
803 fsrcsize = 0
803 fsrcsize = 0
804 frawsize = 0
804 frawsize = 0
805 fdstsize = 0
805 fdstsize = 0
806 mcount = 0
806 mcount = 0
807 mrevcount = 0
807 mrevcount = 0
808 msrcsize = 0
808 msrcsize = 0
809 mrawsize = 0
809 mrawsize = 0
810 mdstsize = 0
810 mdstsize = 0
811 crevcount = 0
811 crevcount = 0
812 csrcsize = 0
812 csrcsize = 0
813 crawsize = 0
813 crawsize = 0
814 cdstsize = 0
814 cdstsize = 0
815
815
816 alldatafiles = list(srcrepo.store.walk())
816 alldatafiles = list(srcrepo.store.walk())
817
817
818 # Perform a pass to collect metadata. This validates we can open all
818 # Perform a pass to collect metadata. This validates we can open all
819 # source files and allows a unified progress bar to be displayed.
819 # source files and allows a unified progress bar to be displayed.
820 for unencoded, encoded, size in alldatafiles:
820 for unencoded, encoded, size in alldatafiles:
821 if unencoded.endswith(b'.d'):
821 if unencoded.endswith(b'.d'):
822 continue
822 continue
823
823
824 rl = _revlogfrompath(srcrepo, unencoded)
824 rl = _revlogfrompath(srcrepo, unencoded)
825
825
826 info = rl.storageinfo(
826 info = rl.storageinfo(
827 exclusivefiles=True,
827 exclusivefiles=True,
828 revisionscount=True,
828 revisionscount=True,
829 trackedsize=True,
829 trackedsize=True,
830 storedsize=True,
830 storedsize=True,
831 )
831 )
832
832
833 revcount += info[b'revisionscount'] or 0
833 revcount += info[b'revisionscount'] or 0
834 datasize = info[b'storedsize'] or 0
834 datasize = info[b'storedsize'] or 0
835 rawsize = info[b'trackedsize'] or 0
835 rawsize = info[b'trackedsize'] or 0
836
836
837 srcsize += datasize
837 srcsize += datasize
838 srcrawsize += rawsize
838 srcrawsize += rawsize
839
839
840 # This is for the separate progress bars.
840 # This is for the separate progress bars.
841 if isinstance(rl, changelog.changelog):
841 if isinstance(rl, changelog.changelog):
842 crevcount += len(rl)
842 crevcount += len(rl)
843 csrcsize += datasize
843 csrcsize += datasize
844 crawsize += rawsize
844 crawsize += rawsize
845 elif isinstance(rl, manifest.manifestrevlog):
845 elif isinstance(rl, manifest.manifestrevlog):
846 mcount += 1
846 mcount += 1
847 mrevcount += len(rl)
847 mrevcount += len(rl)
848 msrcsize += datasize
848 msrcsize += datasize
849 mrawsize += rawsize
849 mrawsize += rawsize
850 elif isinstance(rl, filelog.filelog):
850 elif isinstance(rl, filelog.filelog):
851 fcount += 1
851 fcount += 1
852 frevcount += len(rl)
852 frevcount += len(rl)
853 fsrcsize += datasize
853 fsrcsize += datasize
854 frawsize += rawsize
854 frawsize += rawsize
855 else:
855 else:
856 error.ProgrammingError(b'unknown revlog type')
856 error.ProgrammingError(b'unknown revlog type')
857
857
858 if not revcount:
858 if not revcount:
859 return
859 return
860
860
861 ui.status(
861 ui.status(
862 _(
862 _(
863 b'migrating %d total revisions (%d in filelogs, %d in manifests, '
863 b'migrating %d total revisions (%d in filelogs, %d in manifests, '
864 b'%d in changelog)\n'
864 b'%d in changelog)\n'
865 )
865 )
866 % (revcount, frevcount, mrevcount, crevcount)
866 % (revcount, frevcount, mrevcount, crevcount)
867 )
867 )
868 ui.status(
868 ui.status(
869 _(b'migrating %s in store; %s tracked data\n')
869 _(b'migrating %s in store; %s tracked data\n')
870 % ((util.bytecount(srcsize), util.bytecount(srcrawsize)))
870 % ((util.bytecount(srcsize), util.bytecount(srcrawsize)))
871 )
871 )
872
872
873 # Used to keep track of progress.
873 # Used to keep track of progress.
874 progress = None
874 progress = None
875
875
876 def oncopiedrevision(rl, rev, node):
876 def oncopiedrevision(rl, rev, node):
877 progress.increment()
877 progress.increment()
878
878
879 sidedatacompanion = getsidedatacompanion(srcrepo, dstrepo)
879 sidedatacompanion = getsidedatacompanion(srcrepo, dstrepo)
880
880
881 # Do the actual copying.
881 # Do the actual copying.
882 # FUTURE this operation can be farmed off to worker processes.
882 # FUTURE this operation can be farmed off to worker processes.
883 seen = set()
883 seen = set()
884 for unencoded, encoded, size in alldatafiles:
884 for unencoded, encoded, size in alldatafiles:
885 if unencoded.endswith(b'.d'):
885 if unencoded.endswith(b'.d'):
886 continue
886 continue
887
887
888 oldrl = _revlogfrompath(srcrepo, unencoded)
888 oldrl = _revlogfrompath(srcrepo, unencoded)
889
889
890 if isinstance(oldrl, changelog.changelog) and b'c' not in seen:
890 if isinstance(oldrl, changelog.changelog) and b'c' not in seen:
891 ui.status(
891 ui.status(
892 _(
892 _(
893 b'finished migrating %d manifest revisions across %d '
893 b'finished migrating %d manifest revisions across %d '
894 b'manifests; change in size: %s\n'
894 b'manifests; change in size: %s\n'
895 )
895 )
896 % (mrevcount, mcount, util.bytecount(mdstsize - msrcsize))
896 % (mrevcount, mcount, util.bytecount(mdstsize - msrcsize))
897 )
897 )
898
898
899 ui.status(
899 ui.status(
900 _(
900 _(
901 b'migrating changelog containing %d revisions '
901 b'migrating changelog containing %d revisions '
902 b'(%s in store; %s tracked data)\n'
902 b'(%s in store; %s tracked data)\n'
903 )
903 )
904 % (
904 % (
905 crevcount,
905 crevcount,
906 util.bytecount(csrcsize),
906 util.bytecount(csrcsize),
907 util.bytecount(crawsize),
907 util.bytecount(crawsize),
908 )
908 )
909 )
909 )
910 seen.add(b'c')
910 seen.add(b'c')
911 progress = srcrepo.ui.makeprogress(
911 progress = srcrepo.ui.makeprogress(
912 _(b'changelog revisions'), total=crevcount
912 _(b'changelog revisions'), total=crevcount
913 )
913 )
914 elif isinstance(oldrl, manifest.manifestrevlog) and b'm' not in seen:
914 elif isinstance(oldrl, manifest.manifestrevlog) and b'm' not in seen:
915 ui.status(
915 ui.status(
916 _(
916 _(
917 b'finished migrating %d filelog revisions across %d '
917 b'finished migrating %d filelog revisions across %d '
918 b'filelogs; change in size: %s\n'
918 b'filelogs; change in size: %s\n'
919 )
919 )
920 % (frevcount, fcount, util.bytecount(fdstsize - fsrcsize))
920 % (frevcount, fcount, util.bytecount(fdstsize - fsrcsize))
921 )
921 )
922
922
923 ui.status(
923 ui.status(
924 _(
924 _(
925 b'migrating %d manifests containing %d revisions '
925 b'migrating %d manifests containing %d revisions '
926 b'(%s in store; %s tracked data)\n'
926 b'(%s in store; %s tracked data)\n'
927 )
927 )
928 % (
928 % (
929 mcount,
929 mcount,
930 mrevcount,
930 mrevcount,
931 util.bytecount(msrcsize),
931 util.bytecount(msrcsize),
932 util.bytecount(mrawsize),
932 util.bytecount(mrawsize),
933 )
933 )
934 )
934 )
935 seen.add(b'm')
935 seen.add(b'm')
936 if progress:
936 if progress:
937 progress.complete()
937 progress.complete()
938 progress = srcrepo.ui.makeprogress(
938 progress = srcrepo.ui.makeprogress(
939 _(b'manifest revisions'), total=mrevcount
939 _(b'manifest revisions'), total=mrevcount
940 )
940 )
941 elif b'f' not in seen:
941 elif b'f' not in seen:
942 ui.status(
942 ui.status(
943 _(
943 _(
944 b'migrating %d filelogs containing %d revisions '
944 b'migrating %d filelogs containing %d revisions '
945 b'(%s in store; %s tracked data)\n'
945 b'(%s in store; %s tracked data)\n'
946 )
946 )
947 % (
947 % (
948 fcount,
948 fcount,
949 frevcount,
949 frevcount,
950 util.bytecount(fsrcsize),
950 util.bytecount(fsrcsize),
951 util.bytecount(frawsize),
951 util.bytecount(frawsize),
952 )
952 )
953 )
953 )
954 seen.add(b'f')
954 seen.add(b'f')
955 if progress:
955 if progress:
956 progress.complete()
956 progress.complete()
957 progress = srcrepo.ui.makeprogress(
957 progress = srcrepo.ui.makeprogress(
958 _(b'file revisions'), total=frevcount
958 _(b'file revisions'), total=frevcount
959 )
959 )
960
960
961 if matchrevlog(revlogs, unencoded):
961 if matchrevlog(revlogs, unencoded):
962 ui.note(
962 ui.note(
963 _(b'cloning %d revisions from %s\n') % (len(oldrl), unencoded)
963 _(b'cloning %d revisions from %s\n') % (len(oldrl), unencoded)
964 )
964 )
965 newrl = _revlogfrompath(dstrepo, unencoded)
965 newrl = _revlogfrompath(dstrepo, unencoded)
966 oldrl.clone(
966 oldrl.clone(
967 tr,
967 tr,
968 newrl,
968 newrl,
969 addrevisioncb=oncopiedrevision,
969 addrevisioncb=oncopiedrevision,
970 deltareuse=deltareuse,
970 deltareuse=deltareuse,
971 forcedeltabothparents=forcedeltabothparents,
971 forcedeltabothparents=forcedeltabothparents,
972 sidedatacompanion=sidedatacompanion,
972 sidedatacompanion=sidedatacompanion,
973 )
973 )
974 else:
974 else:
975 msg = _(b'blindly copying %s containing %i revisions\n')
975 msg = _(b'blindly copying %s containing %i revisions\n')
976 ui.note(msg % (unencoded, len(oldrl)))
976 ui.note(msg % (unencoded, len(oldrl)))
977 _copyrevlog(tr, dstrepo, oldrl, unencoded)
977 _copyrevlog(tr, dstrepo, oldrl, unencoded)
978
978
979 newrl = _revlogfrompath(dstrepo, unencoded)
979 newrl = _revlogfrompath(dstrepo, unencoded)
980
980
981 info = newrl.storageinfo(storedsize=True)
981 info = newrl.storageinfo(storedsize=True)
982 datasize = info[b'storedsize'] or 0
982 datasize = info[b'storedsize'] or 0
983
983
984 dstsize += datasize
984 dstsize += datasize
985
985
986 if isinstance(newrl, changelog.changelog):
986 if isinstance(newrl, changelog.changelog):
987 cdstsize += datasize
987 cdstsize += datasize
988 elif isinstance(newrl, manifest.manifestrevlog):
988 elif isinstance(newrl, manifest.manifestrevlog):
989 mdstsize += datasize
989 mdstsize += datasize
990 else:
990 else:
991 fdstsize += datasize
991 fdstsize += datasize
992
992
993 progress.complete()
993 progress.complete()
994
994
995 ui.status(
995 ui.status(
996 _(
996 _(
997 b'finished migrating %d changelog revisions; change in size: '
997 b'finished migrating %d changelog revisions; change in size: '
998 b'%s\n'
998 b'%s\n'
999 )
999 )
1000 % (crevcount, util.bytecount(cdstsize - csrcsize))
1000 % (crevcount, util.bytecount(cdstsize - csrcsize))
1001 )
1001 )
1002
1002
1003 ui.status(
1003 ui.status(
1004 _(
1004 _(
1005 b'finished migrating %d total revisions; total change in store '
1005 b'finished migrating %d total revisions; total change in store '
1006 b'size: %s\n'
1006 b'size: %s\n'
1007 )
1007 )
1008 % (revcount, util.bytecount(dstsize - srcsize))
1008 % (revcount, util.bytecount(dstsize - srcsize))
1009 )
1009 )
1010
1010
1011
1011
1012 def _filterstorefile(srcrepo, dstrepo, requirements, path, mode, st):
1012 def _filterstorefile(srcrepo, dstrepo, requirements, path, mode, st):
1013 """Determine whether to copy a store file during upgrade.
1013 """Determine whether to copy a store file during upgrade.
1014
1014
1015 This function is called when migrating store files from ``srcrepo`` to
1015 This function is called when migrating store files from ``srcrepo`` to
1016 ``dstrepo`` as part of upgrading a repository.
1016 ``dstrepo`` as part of upgrading a repository.
1017
1017
1018 Args:
1018 Args:
1019 srcrepo: repo we are copying from
1019 srcrepo: repo we are copying from
1020 dstrepo: repo we are copying to
1020 dstrepo: repo we are copying to
1021 requirements: set of requirements for ``dstrepo``
1021 requirements: set of requirements for ``dstrepo``
1022 path: store file being examined
1022 path: store file being examined
1023 mode: the ``ST_MODE`` file type of ``path``
1023 mode: the ``ST_MODE`` file type of ``path``
1024 st: ``stat`` data structure for ``path``
1024 st: ``stat`` data structure for ``path``
1025
1025
1026 Function should return ``True`` if the file is to be copied.
1026 Function should return ``True`` if the file is to be copied.
1027 """
1027 """
1028 # Skip revlogs.
1028 # Skip revlogs.
1029 if path.endswith((b'.i', b'.d', b'.n', b'.nd')):
1029 if path.endswith((b'.i', b'.d', b'.n', b'.nd')):
1030 return False
1030 return False
1031 # Skip transaction related files.
1031 # Skip transaction related files.
1032 if path.startswith(b'undo'):
1032 if path.startswith(b'undo'):
1033 return False
1033 return False
1034 # Only copy regular files.
1034 # Only copy regular files.
1035 if mode != stat.S_IFREG:
1035 if mode != stat.S_IFREG:
1036 return False
1036 return False
1037 # Skip other skipped files.
1037 # Skip other skipped files.
1038 if path in (b'lock', b'fncache'):
1038 if path in (b'lock', b'fncache'):
1039 return False
1039 return False
1040
1040
1041 return True
1041 return True
1042
1042
1043
1043
1044 def _finishdatamigration(ui, srcrepo, dstrepo, requirements):
1044 def _finishdatamigration(ui, srcrepo, dstrepo, requirements):
1045 """Hook point for extensions to perform additional actions during upgrade.
1045 """Hook point for extensions to perform additional actions during upgrade.
1046
1046
1047 This function is called after revlogs and store files have been copied but
1047 This function is called after revlogs and store files have been copied but
1048 before the new store is swapped into the original location.
1048 before the new store is swapped into the original location.
1049 """
1049 """
1050
1050
1051
1051
1052 def _upgraderepo(
1052 def _upgraderepo(
1053 ui, srcrepo, dstrepo, requirements, actions, revlogs=UPGRADE_ALL_REVLOGS
1053 ui, srcrepo, dstrepo, requirements, actions, revlogs=UPGRADE_ALL_REVLOGS
1054 ):
1054 ):
1055 """Do the low-level work of upgrading a repository.
1055 """Do the low-level work of upgrading a repository.
1056
1056
1057 The upgrade is effectively performed as a copy between a source
1057 The upgrade is effectively performed as a copy between a source
1058 repository and a temporary destination repository.
1058 repository and a temporary destination repository.
1059
1059
1060 The source repository is unmodified for as long as possible so the
1060 The source repository is unmodified for as long as possible so the
1061 upgrade can abort at any time without causing loss of service for
1061 upgrade can abort at any time without causing loss of service for
1062 readers and without corrupting the source repository.
1062 readers and without corrupting the source repository.
1063 """
1063 """
1064 assert srcrepo.currentwlock()
1064 assert srcrepo.currentwlock()
1065 assert dstrepo.currentwlock()
1065 assert dstrepo.currentwlock()
1066
1066
1067 ui.status(
1067 ui.status(
1068 _(
1068 _(
1069 b'(it is safe to interrupt this process any time before '
1069 b'(it is safe to interrupt this process any time before '
1070 b'data migration completes)\n'
1070 b'data migration completes)\n'
1071 )
1071 )
1072 )
1072 )
1073
1073
1074 if b're-delta-all' in actions:
1074 if b're-delta-all' in actions:
1075 deltareuse = revlog.revlog.DELTAREUSENEVER
1075 deltareuse = revlog.revlog.DELTAREUSENEVER
1076 elif b're-delta-parent' in actions:
1076 elif b're-delta-parent' in actions:
1077 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
1077 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
1078 elif b're-delta-multibase' in actions:
1078 elif b're-delta-multibase' in actions:
1079 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
1079 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
1080 elif b're-delta-fulladd' in actions:
1080 elif b're-delta-fulladd' in actions:
1081 deltareuse = revlog.revlog.DELTAREUSEFULLADD
1081 deltareuse = revlog.revlog.DELTAREUSEFULLADD
1082 else:
1082 else:
1083 deltareuse = revlog.revlog.DELTAREUSEALWAYS
1083 deltareuse = revlog.revlog.DELTAREUSEALWAYS
1084
1084
1085 with dstrepo.transaction(b'upgrade') as tr:
1085 with dstrepo.transaction(b'upgrade') as tr:
1086 _clonerevlogs(
1086 _clonerevlogs(
1087 ui,
1087 ui,
1088 srcrepo,
1088 srcrepo,
1089 dstrepo,
1089 dstrepo,
1090 tr,
1090 tr,
1091 deltareuse,
1091 deltareuse,
1092 b're-delta-multibase' in actions,
1092 b're-delta-multibase' in actions,
1093 revlogs=revlogs,
1093 revlogs=revlogs,
1094 )
1094 )
1095
1095
1096 # Now copy other files in the store directory.
1096 # Now copy other files in the store directory.
1097 # The sorted() makes execution deterministic.
1097 # The sorted() makes execution deterministic.
1098 for p, kind, st in sorted(srcrepo.store.vfs.readdir(b'', stat=True)):
1098 for p, kind, st in sorted(srcrepo.store.vfs.readdir(b'', stat=True)):
1099 if not _filterstorefile(srcrepo, dstrepo, requirements, p, kind, st):
1099 if not _filterstorefile(srcrepo, dstrepo, requirements, p, kind, st):
1100 continue
1100 continue
1101
1101
1102 srcrepo.ui.status(_(b'copying %s\n') % p)
1102 srcrepo.ui.status(_(b'copying %s\n') % p)
1103 src = srcrepo.store.rawvfs.join(p)
1103 src = srcrepo.store.rawvfs.join(p)
1104 dst = dstrepo.store.rawvfs.join(p)
1104 dst = dstrepo.store.rawvfs.join(p)
1105 util.copyfile(src, dst, copystat=True)
1105 util.copyfile(src, dst, copystat=True)
1106
1106
1107 _finishdatamigration(ui, srcrepo, dstrepo, requirements)
1107 _finishdatamigration(ui, srcrepo, dstrepo, requirements)
1108
1108
1109 ui.status(_(b'data fully migrated to temporary repository\n'))
1109 ui.status(_(b'data fully migrated to temporary repository\n'))
1110
1110
1111 backuppath = pycompat.mkdtemp(prefix=b'upgradebackup.', dir=srcrepo.path)
1111 backuppath = pycompat.mkdtemp(prefix=b'upgradebackup.', dir=srcrepo.path)
1112 backupvfs = vfsmod.vfs(backuppath)
1112 backupvfs = vfsmod.vfs(backuppath)
1113
1113
1114 # Make a backup of requires file first, as it is the first to be modified.
1114 # Make a backup of requires file first, as it is the first to be modified.
1115 util.copyfile(srcrepo.vfs.join(b'requires'), backupvfs.join(b'requires'))
1115 util.copyfile(srcrepo.vfs.join(b'requires'), backupvfs.join(b'requires'))
1116
1116
1117 # We install an arbitrary requirement that clients must not support
1117 # We install an arbitrary requirement that clients must not support
1118 # as a mechanism to lock out new clients during the data swap. This is
1118 # as a mechanism to lock out new clients during the data swap. This is
1119 # better than allowing a client to continue while the repository is in
1119 # better than allowing a client to continue while the repository is in
1120 # an inconsistent state.
1120 # an inconsistent state.
1121 ui.status(
1121 ui.status(
1122 _(
1122 _(
1123 b'marking source repository as being upgraded; clients will be '
1123 b'marking source repository as being upgraded; clients will be '
1124 b'unable to read from repository\n'
1124 b'unable to read from repository\n'
1125 )
1125 )
1126 )
1126 )
1127 scmutil.writereporequirements(
1127 scmutil.writereporequirements(
1128 srcrepo, srcrepo.requirements | {b'upgradeinprogress'}
1128 srcrepo, srcrepo.requirements | {b'upgradeinprogress'}
1129 )
1129 )
1130
1130
1131 ui.status(_(b'starting in-place swap of repository data\n'))
1131 ui.status(_(b'starting in-place swap of repository data\n'))
1132 ui.status(_(b'replaced files will be backed up at %s\n') % backuppath)
1132 ui.status(_(b'replaced files will be backed up at %s\n') % backuppath)
1133
1133
1134 # Now swap in the new store directory. Doing it as a rename should make
1134 # Now swap in the new store directory. Doing it as a rename should make
1135 # the operation nearly instantaneous and atomic (at least in well-behaved
1135 # the operation nearly instantaneous and atomic (at least in well-behaved
1136 # environments).
1136 # environments).
1137 ui.status(_(b'replacing store...\n'))
1137 ui.status(_(b'replacing store...\n'))
1138 tstart = util.timer()
1138 tstart = util.timer()
1139 util.rename(srcrepo.spath, backupvfs.join(b'store'))
1139 util.rename(srcrepo.spath, backupvfs.join(b'store'))
1140 util.rename(dstrepo.spath, srcrepo.spath)
1140 util.rename(dstrepo.spath, srcrepo.spath)
1141 elapsed = util.timer() - tstart
1141 elapsed = util.timer() - tstart
1142 ui.status(
1142 ui.status(
1143 _(
1143 _(
1144 b'store replacement complete; repository was inconsistent for '
1144 b'store replacement complete; repository was inconsistent for '
1145 b'%0.1fs\n'
1145 b'%0.1fs\n'
1146 )
1146 )
1147 % elapsed
1147 % elapsed
1148 )
1148 )
1149
1149
1150 # We first write the requirements file. Any new requirements will lock
1150 # We first write the requirements file. Any new requirements will lock
1151 # out legacy clients.
1151 # out legacy clients.
1152 ui.status(
1152 ui.status(
1153 _(
1153 _(
1154 b'finalizing requirements file and making repository readable '
1154 b'finalizing requirements file and making repository readable '
1155 b'again\n'
1155 b'again\n'
1156 )
1156 )
1157 )
1157 )
1158 scmutil.writereporequirements(srcrepo, requirements)
1158 scmutil.writereporequirements(srcrepo, requirements)
1159
1159
1160 # The lock file from the old store won't be removed because nothing has a
1160 # The lock file from the old store won't be removed because nothing has a
1161 # reference to its new location. So clean it up manually. Alternatively, we
1161 # reference to its new location. So clean it up manually. Alternatively, we
1162 # could update srcrepo.svfs and other variables to point to the new
1162 # could update srcrepo.svfs and other variables to point to the new
1163 # location. This is simpler.
1163 # location. This is simpler.
1164 backupvfs.unlink(b'store/lock')
1164 backupvfs.unlink(b'store/lock')
1165
1165
1166 return backuppath
1166 return backuppath
1167
1167
1168
1168
1169 def upgraderepo(
1169 def upgraderepo(
1170 ui,
1170 ui,
1171 repo,
1171 repo,
1172 run=False,
1172 run=False,
1173 optimize=None,
1173 optimize=None,
1174 backup=True,
1174 backup=True,
1175 manifest=None,
1175 manifest=None,
1176 changelog=None,
1176 changelog=None,
1177 filelogs=None,
1177 filelogs=None,
1178 ):
1178 ):
1179 """Upgrade a repository in place."""
1179 """Upgrade a repository in place."""
1180 if optimize is None:
1180 if optimize is None:
1181 optimize = []
1181 optimize = []
1182 optimize = {legacy_opts_map.get(o, o) for o in optimize}
1182 optimize = {legacy_opts_map.get(o, o) for o in optimize}
1183 repo = repo.unfiltered()
1183 repo = repo.unfiltered()
1184
1184
1185 revlogs = set(UPGRADE_ALL_REVLOGS)
1185 revlogs = set(UPGRADE_ALL_REVLOGS)
1186 specentries = (
1186 specentries = (
1187 (UPGRADE_CHANGELOG, changelog),
1187 (UPGRADE_CHANGELOG, changelog),
1188 (UPGRADE_MANIFEST, manifest),
1188 (UPGRADE_MANIFEST, manifest),
1189 (UPGRADE_FILELOGS, filelogs),
1189 (UPGRADE_FILELOGS, filelogs),
1190 )
1190 )
1191 specified = [(y, x) for (y, x) in specentries if x is not None]
1191 specified = [(y, x) for (y, x) in specentries if x is not None]
1192 if specified:
1192 if specified:
1193 # we have some limitation on revlogs to be recloned
1193 # we have some limitation on revlogs to be recloned
1194 if any(x for y, x in specified):
1194 if any(x for y, x in specified):
1195 revlogs = set()
1195 revlogs = set()
1196 for upgrade, enabled in specified:
1196 for upgrade, enabled in specified:
1197 if enabled:
1197 if enabled:
1198 revlogs.add(upgrade)
1198 revlogs.add(upgrade)
1199 else:
1199 else:
1200 # none are enabled
1200 # none are enabled
1201 for upgrade, __ in specified:
1201 for upgrade, __ in specified:
1202 revlogs.discard(upgrade)
1202 revlogs.discard(upgrade)
1203
1203
1204 # Ensure the repository can be upgraded.
1204 # Ensure the repository can be upgraded.
1205 missingreqs = requiredsourcerequirements(repo) - repo.requirements
1205 missingreqs = requiredsourcerequirements(repo) - repo.requirements
1206 if missingreqs:
1206 if missingreqs:
1207 raise error.Abort(
1207 raise error.Abort(
1208 _(b'cannot upgrade repository; requirement missing: %s')
1208 _(b'cannot upgrade repository; requirement missing: %s')
1209 % _(b', ').join(sorted(missingreqs))
1209 % _(b', ').join(sorted(missingreqs))
1210 )
1210 )
1211
1211
1212 blockedreqs = blocksourcerequirements(repo) & repo.requirements
1212 blockedreqs = blocksourcerequirements(repo) & repo.requirements
1213 if blockedreqs:
1213 if blockedreqs:
1214 raise error.Abort(
1214 raise error.Abort(
1215 _(
1215 _(
1216 b'cannot upgrade repository; unsupported source '
1216 b'cannot upgrade repository; unsupported source '
1217 b'requirement: %s'
1217 b'requirement: %s'
1218 )
1218 )
1219 % _(b', ').join(sorted(blockedreqs))
1219 % _(b', ').join(sorted(blockedreqs))
1220 )
1220 )
1221
1221
1222 # FUTURE there is potentially a need to control the wanted requirements via
1222 # FUTURE there is potentially a need to control the wanted requirements via
1223 # command arguments or via an extension hook point.
1223 # command arguments or via an extension hook point.
1224 newreqs = localrepo.newreporequirements(
1224 newreqs = localrepo.newreporequirements(
1225 repo.ui, localrepo.defaultcreateopts(repo.ui)
1225 repo.ui, localrepo.defaultcreateopts(repo.ui)
1226 )
1226 )
1227 newreqs.update(preservedrequirements(repo))
1227 newreqs.update(preservedrequirements(repo))
1228
1228
1229 noremovereqs = (
1229 noremovereqs = (
1230 repo.requirements - newreqs - supportremovedrequirements(repo)
1230 repo.requirements - newreqs - supportremovedrequirements(repo)
1231 )
1231 )
1232 if noremovereqs:
1232 if noremovereqs:
1233 raise error.Abort(
1233 raise error.Abort(
1234 _(
1234 _(
1235 b'cannot upgrade repository; requirement would be '
1235 b'cannot upgrade repository; requirement would be '
1236 b'removed: %s'
1236 b'removed: %s'
1237 )
1237 )
1238 % _(b', ').join(sorted(noremovereqs))
1238 % _(b', ').join(sorted(noremovereqs))
1239 )
1239 )
1240
1240
1241 noaddreqs = newreqs - repo.requirements - allowednewrequirements(repo)
1241 noaddreqs = newreqs - repo.requirements - allowednewrequirements(repo)
1242 if noaddreqs:
1242 if noaddreqs:
1243 raise error.Abort(
1243 raise error.Abort(
1244 _(
1244 _(
1245 b'cannot upgrade repository; do not support adding '
1245 b'cannot upgrade repository; do not support adding '
1246 b'requirement: %s'
1246 b'requirement: %s'
1247 )
1247 )
1248 % _(b', ').join(sorted(noaddreqs))
1248 % _(b', ').join(sorted(noaddreqs))
1249 )
1249 )
1250
1250
1251 unsupportedreqs = newreqs - supporteddestrequirements(repo)
1251 unsupportedreqs = newreqs - supporteddestrequirements(repo)
1252 if unsupportedreqs:
1252 if unsupportedreqs:
1253 raise error.Abort(
1253 raise error.Abort(
1254 _(
1254 _(
1255 b'cannot upgrade repository; do not support '
1255 b'cannot upgrade repository; do not support '
1256 b'destination requirement: %s'
1256 b'destination requirement: %s'
1257 )
1257 )
1258 % _(b', ').join(sorted(unsupportedreqs))
1258 % _(b', ').join(sorted(unsupportedreqs))
1259 )
1259 )
1260
1260
1261 # Find and validate all improvements that can be made.
1261 # Find and validate all improvements that can be made.
1262 alloptimizations = findoptimizations(repo)
1262 alloptimizations = findoptimizations(repo)
1263
1263
1264 # Apply and Validate arguments.
1264 # Apply and Validate arguments.
1265 optimizations = []
1265 optimizations = []
1266 for o in alloptimizations:
1266 for o in alloptimizations:
1267 if o.name in optimize:
1267 if o.name in optimize:
1268 optimizations.append(o)
1268 optimizations.append(o)
1269 optimize.discard(o.name)
1269 optimize.discard(o.name)
1270
1270
1271 if optimize: # anything left is unknown
1271 if optimize: # anything left is unknown
1272 raise error.Abort(
1272 raise error.Abort(
1273 _(b'unknown optimization action requested: %s')
1273 _(b'unknown optimization action requested: %s')
1274 % b', '.join(sorted(optimize)),
1274 % b', '.join(sorted(optimize)),
1275 hint=_(b'run without arguments to see valid optimizations'),
1275 hint=_(b'run without arguments to see valid optimizations'),
1276 )
1276 )
1277
1277
1278 deficiencies = finddeficiencies(repo)
1278 deficiencies = finddeficiencies(repo)
1279 actions = determineactions(repo, deficiencies, repo.requirements, newreqs)
1279 actions = determineactions(repo, deficiencies, repo.requirements, newreqs)
1280 actions.extend(
1280 actions.extend(
1281 o
1281 o
1282 for o in sorted(optimizations)
1282 for o in sorted(optimizations)
1283 # determineactions could have added optimisation
1283 # determineactions could have added optimisation
1284 if o not in actions
1284 if o not in actions
1285 )
1285 )
1286
1286
1287 removedreqs = repo.requirements - newreqs
1287 removedreqs = repo.requirements - newreqs
1288 addedreqs = newreqs - repo.requirements
1288 addedreqs = newreqs - repo.requirements
1289
1289
1290 if revlogs != UPGRADE_ALL_REVLOGS:
1290 if revlogs != UPGRADE_ALL_REVLOGS:
1291 incompatible = RECLONES_REQUIREMENTS & (removedreqs | addedreqs)
1291 incompatible = RECLONES_REQUIREMENTS & (removedreqs | addedreqs)
1292 if incompatible:
1292 if incompatible:
1293 msg = _(
1293 msg = _(
1294 b'ignoring revlogs selection flags, format requirements '
1294 b'ignoring revlogs selection flags, format requirements '
1295 b'change: %s\n'
1295 b'change: %s\n'
1296 )
1296 )
1297 ui.warn(msg % b', '.join(sorted(incompatible)))
1297 ui.warn(msg % b', '.join(sorted(incompatible)))
1298 revlogs = UPGRADE_ALL_REVLOGS
1298 revlogs = UPGRADE_ALL_REVLOGS
1299
1299
1300 def write_labeled(l, label):
1300 def write_labeled(l, label):
1301 first = True
1301 first = True
1302 for r in sorted(l):
1302 for r in sorted(l):
1303 if not first:
1303 if not first:
1304 ui.write(b', ')
1304 ui.write(b', ')
1305 ui.write(r, label=label)
1305 ui.write(r, label=label)
1306 first = False
1306 first = False
1307
1307
1308 def printrequirements():
1308 def printrequirements():
1309 ui.write(_(b'requirements\n'))
1309 ui.write(_(b'requirements\n'))
1310 ui.write(_(b' preserved: '))
1310 ui.write(_(b' preserved: '))
1311 write_labeled(
1311 write_labeled(
1312 newreqs & repo.requirements, "upgrade-repo.requirement.preserved"
1312 newreqs & repo.requirements, "upgrade-repo.requirement.preserved"
1313 )
1313 )
1314 ui.write((b'\n'))
1314 ui.write((b'\n'))
1315 removed = repo.requirements - newreqs
1315 removed = repo.requirements - newreqs
1316 if repo.requirements - newreqs:
1316 if repo.requirements - newreqs:
1317 ui.write(_(b' removed: '))
1317 ui.write(_(b' removed: '))
1318 write_labeled(removed, "upgrade-repo.requirement.removed")
1318 write_labeled(removed, "upgrade-repo.requirement.removed")
1319 ui.write((b'\n'))
1319 ui.write((b'\n'))
1320 added = newreqs - repo.requirements
1320 added = newreqs - repo.requirements
1321 if added:
1321 if added:
1322 ui.write(_(b' added: '))
1322 ui.write(_(b' added: '))
1323 write_labeled(added, "upgrade-repo.requirement.added")
1323 write_labeled(added, "upgrade-repo.requirement.added")
1324 ui.write((b'\n'))
1324 ui.write((b'\n'))
1325 ui.write(b'\n')
1325 ui.write(b'\n')
1326
1326
1327 def printoptimisations():
1327 def printoptimisations():
1328 optimisations = [a for a in actions if a.type == OPTIMISATION]
1328 optimisations = [a for a in actions if a.type == OPTIMISATION]
1329 optimisations.sort(key=lambda a: a.name)
1329 optimisations.sort(key=lambda a: a.name)
1330 if optimisations:
1330 if optimisations:
1331 ui.write(_(b'optimisations: '))
1331 ui.write(_(b'optimisations: '))
1332 write_labeled(
1332 write_labeled(
1333 [a.name for a in optimisations],
1333 [a.name for a in optimisations],
1334 "upgrade-repo.optimisation.performed",
1334 "upgrade-repo.optimisation.performed",
1335 )
1335 )
1336 ui.write(b'\n\n')
1336 ui.write(b'\n\n')
1337
1337
1338 def printupgradeactions():
1338 def printupgradeactions():
1339 for a in actions:
1339 for a in actions:
1340 ui.status(b'%s\n %s\n\n' % (a.name, a.upgrademessage))
1340 ui.status(b'%s\n %s\n\n' % (a.name, a.upgrademessage))
1341
1341
1342 def print_affected_revlogs():
1343 if not revlogs:
1344 ui.write((b'no revlogs to process\n'))
1345 else:
1346 ui.write((b'processed revlogs:\n'))
1347 for r in sorted(revlogs):
1348 ui.write((b' - %s\n' % r))
1349 ui.write((b'\n'))
1350
1342 if not run:
1351 if not run:
1343 fromconfig = []
1352 fromconfig = []
1344 onlydefault = []
1353 onlydefault = []
1345
1354
1346 for d in deficiencies:
1355 for d in deficiencies:
1347 if d.fromconfig(repo):
1356 if d.fromconfig(repo):
1348 fromconfig.append(d)
1357 fromconfig.append(d)
1349 elif d.default:
1358 elif d.default:
1350 onlydefault.append(d)
1359 onlydefault.append(d)
1351
1360
1352 if fromconfig or onlydefault:
1361 if fromconfig or onlydefault:
1353
1362
1354 if fromconfig:
1363 if fromconfig:
1355 ui.status(
1364 ui.status(
1356 _(
1365 _(
1357 b'repository lacks features recommended by '
1366 b'repository lacks features recommended by '
1358 b'current config options:\n\n'
1367 b'current config options:\n\n'
1359 )
1368 )
1360 )
1369 )
1361 for i in fromconfig:
1370 for i in fromconfig:
1362 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
1371 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
1363
1372
1364 if onlydefault:
1373 if onlydefault:
1365 ui.status(
1374 ui.status(
1366 _(
1375 _(
1367 b'repository lacks features used by the default '
1376 b'repository lacks features used by the default '
1368 b'config options:\n\n'
1377 b'config options:\n\n'
1369 )
1378 )
1370 )
1379 )
1371 for i in onlydefault:
1380 for i in onlydefault:
1372 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
1381 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
1373
1382
1374 ui.status(b'\n')
1383 ui.status(b'\n')
1375 else:
1384 else:
1376 ui.status(
1385 ui.status(
1377 _(
1386 _(
1378 b'(no feature deficiencies found in existing '
1387 b'(no feature deficiencies found in existing '
1379 b'repository)\n'
1388 b'repository)\n'
1380 )
1389 )
1381 )
1390 )
1382
1391
1383 ui.status(
1392 ui.status(
1384 _(
1393 _(
1385 b'performing an upgrade with "--run" will make the following '
1394 b'performing an upgrade with "--run" will make the following '
1386 b'changes:\n\n'
1395 b'changes:\n\n'
1387 )
1396 )
1388 )
1397 )
1389
1398
1390 printrequirements()
1399 printrequirements()
1391 printoptimisations()
1400 printoptimisations()
1392 printupgradeactions()
1401 printupgradeactions()
1402 print_affected_revlogs()
1393
1403
1394 unusedoptimize = [i for i in alloptimizations if i not in actions]
1404 unusedoptimize = [i for i in alloptimizations if i not in actions]
1395
1405
1396 if unusedoptimize:
1406 if unusedoptimize:
1397 ui.status(
1407 ui.status(
1398 _(
1408 _(
1399 b'additional optimizations are available by specifying '
1409 b'additional optimizations are available by specifying '
1400 b'"--optimize <name>":\n\n'
1410 b'"--optimize <name>":\n\n'
1401 )
1411 )
1402 )
1412 )
1403 for i in unusedoptimize:
1413 for i in unusedoptimize:
1404 ui.status(_(b'%s\n %s\n\n') % (i.name, i.description))
1414 ui.status(_(b'%s\n %s\n\n') % (i.name, i.description))
1405 return
1415 return
1406
1416
1407 # Else we're in the run=true case.
1417 # Else we're in the run=true case.
1408 ui.write(_(b'upgrade will perform the following actions:\n\n'))
1418 ui.write(_(b'upgrade will perform the following actions:\n\n'))
1409 printrequirements()
1419 printrequirements()
1410 printoptimisations()
1420 printoptimisations()
1411 printupgradeactions()
1421 printupgradeactions()
1422 print_affected_revlogs()
1412
1423
1413 upgradeactions = [a.name for a in actions]
1424 upgradeactions = [a.name for a in actions]
1414
1425
1415 ui.status(_(b'beginning upgrade...\n'))
1426 ui.status(_(b'beginning upgrade...\n'))
1416 with repo.wlock(), repo.lock():
1427 with repo.wlock(), repo.lock():
1417 ui.status(_(b'repository locked and read-only\n'))
1428 ui.status(_(b'repository locked and read-only\n'))
1418 # Our strategy for upgrading the repository is to create a new,
1429 # Our strategy for upgrading the repository is to create a new,
1419 # temporary repository, write data to it, then do a swap of the
1430 # temporary repository, write data to it, then do a swap of the
1420 # data. There are less heavyweight ways to do this, but it is easier
1431 # data. There are less heavyweight ways to do this, but it is easier
1421 # to create a new repo object than to instantiate all the components
1432 # to create a new repo object than to instantiate all the components
1422 # (like the store) separately.
1433 # (like the store) separately.
1423 tmppath = pycompat.mkdtemp(prefix=b'upgrade.', dir=repo.path)
1434 tmppath = pycompat.mkdtemp(prefix=b'upgrade.', dir=repo.path)
1424 backuppath = None
1435 backuppath = None
1425 try:
1436 try:
1426 ui.status(
1437 ui.status(
1427 _(
1438 _(
1428 b'creating temporary repository to stage migrated '
1439 b'creating temporary repository to stage migrated '
1429 b'data: %s\n'
1440 b'data: %s\n'
1430 )
1441 )
1431 % tmppath
1442 % tmppath
1432 )
1443 )
1433
1444
1434 # clone ui without using ui.copy because repo.ui is protected
1445 # clone ui without using ui.copy because repo.ui is protected
1435 repoui = repo.ui.__class__(repo.ui)
1446 repoui = repo.ui.__class__(repo.ui)
1436 dstrepo = hg.repository(repoui, path=tmppath, create=True)
1447 dstrepo = hg.repository(repoui, path=tmppath, create=True)
1437
1448
1438 with dstrepo.wlock(), dstrepo.lock():
1449 with dstrepo.wlock(), dstrepo.lock():
1439 backuppath = _upgraderepo(
1450 backuppath = _upgraderepo(
1440 ui, repo, dstrepo, newreqs, upgradeactions, revlogs=revlogs
1451 ui, repo, dstrepo, newreqs, upgradeactions, revlogs=revlogs
1441 )
1452 )
1442 if not (backup or backuppath is None):
1453 if not (backup or backuppath is None):
1443 ui.status(
1454 ui.status(
1444 _(b'removing old repository content%s\n') % backuppath
1455 _(b'removing old repository content%s\n') % backuppath
1445 )
1456 )
1446 repo.vfs.rmtree(backuppath, forcibly=True)
1457 repo.vfs.rmtree(backuppath, forcibly=True)
1447 backuppath = None
1458 backuppath = None
1448
1459
1449 finally:
1460 finally:
1450 ui.status(_(b'removing temporary repository %s\n') % tmppath)
1461 ui.status(_(b'removing temporary repository %s\n') % tmppath)
1451 repo.vfs.rmtree(tmppath, forcibly=True)
1462 repo.vfs.rmtree(tmppath, forcibly=True)
1452
1463
1453 if backuppath and not ui.quiet:
1464 if backuppath and not ui.quiet:
1454 ui.warn(
1465 ui.warn(
1455 _(b'copy of old repository backed up at %s\n') % backuppath
1466 _(b'copy of old repository backed up at %s\n') % backuppath
1456 )
1467 )
1457 ui.warn(
1468 ui.warn(
1458 _(
1469 _(
1459 b'the old repository will not be deleted; remove '
1470 b'the old repository will not be deleted; remove '
1460 b'it to free up disk space once the upgraded '
1471 b'it to free up disk space once the upgraded '
1461 b'repository is verified\n'
1472 b'repository is verified\n'
1462 )
1473 )
1463 )
1474 )
1464
1475
1465 if sharedsafe.name in addedreqs:
1476 if sharedsafe.name in addedreqs:
1466 ui.warn(
1477 ui.warn(
1467 _(
1478 _(
1468 b'repository upgraded to share safe mode, existing'
1479 b'repository upgraded to share safe mode, existing'
1469 b' shares will still work in old non-safe mode. '
1480 b' shares will still work in old non-safe mode. '
1470 b'Re-share existing shares to use them in safe mode'
1481 b'Re-share existing shares to use them in safe mode'
1471 b' New shares will be created in safe mode.\n'
1482 b' New shares will be created in safe mode.\n'
1472 )
1483 )
1473 )
1484 )
1474 if sharedsafe.name in removedreqs:
1485 if sharedsafe.name in removedreqs:
1475 ui.warn(
1486 ui.warn(
1476 _(
1487 _(
1477 b'repository downgraded to not use share safe mode, '
1488 b'repository downgraded to not use share safe mode, '
1478 b'existing shares will not work and needs to'
1489 b'existing shares will not work and needs to'
1479 b' be reshared.\n'
1490 b' be reshared.\n'
1480 )
1491 )
1481 )
1492 )
@@ -1,1667 +1,1672 b''
1 #testcases filelog compatibility changeset sidedata upgraded
1 #testcases filelog compatibility changeset sidedata upgraded
2
2
3 =====================================================
3 =====================================================
4 Test Copy tracing for chain of copies involving merge
4 Test Copy tracing for chain of copies involving merge
5 =====================================================
5 =====================================================
6
6
7 This test files covers copies/rename case for a chains of commit where merges
7 This test files covers copies/rename case for a chains of commit where merges
8 are involved. It cheks we do not have unwanted update of behavior and that the
8 are involved. It cheks we do not have unwanted update of behavior and that the
9 different options to retrieve copies behave correctly.
9 different options to retrieve copies behave correctly.
10
10
11
11
12 Setup
12 Setup
13 =====
13 =====
14
14
15 use git diff to see rename
15 use git diff to see rename
16
16
17 $ cat << EOF >> $HGRCPATH
17 $ cat << EOF >> $HGRCPATH
18 > [diff]
18 > [diff]
19 > git=yes
19 > git=yes
20 > [command-templates]
20 > [command-templates]
21 > log={rev} {desc}\n
21 > log={rev} {desc}\n
22 > EOF
22 > EOF
23
23
24 #if compatibility
24 #if compatibility
25 $ cat >> $HGRCPATH << EOF
25 $ cat >> $HGRCPATH << EOF
26 > [experimental]
26 > [experimental]
27 > copies.read-from = compatibility
27 > copies.read-from = compatibility
28 > EOF
28 > EOF
29 #endif
29 #endif
30
30
31 #if changeset
31 #if changeset
32 $ cat >> $HGRCPATH << EOF
32 $ cat >> $HGRCPATH << EOF
33 > [experimental]
33 > [experimental]
34 > copies.read-from = changeset-only
34 > copies.read-from = changeset-only
35 > copies.write-to = changeset-only
35 > copies.write-to = changeset-only
36 > EOF
36 > EOF
37 #endif
37 #endif
38
38
39 #if sidedata
39 #if sidedata
40 $ cat >> $HGRCPATH << EOF
40 $ cat >> $HGRCPATH << EOF
41 > [format]
41 > [format]
42 > exp-use-side-data = yes
42 > exp-use-side-data = yes
43 > exp-use-copies-side-data-changeset = yes
43 > exp-use-copies-side-data-changeset = yes
44 > EOF
44 > EOF
45 #endif
45 #endif
46
46
47
47
48 $ hg init repo-chain
48 $ hg init repo-chain
49 $ cd repo-chain
49 $ cd repo-chain
50
50
51 Add some linear rename initialy
51 Add some linear rename initialy
52
52
53 $ echo a > a
53 $ echo a > a
54 $ echo b > b
54 $ echo b > b
55 $ echo h > h
55 $ echo h > h
56 $ hg ci -Am 'i-0 initial commit: a b h'
56 $ hg ci -Am 'i-0 initial commit: a b h'
57 adding a
57 adding a
58 adding b
58 adding b
59 adding h
59 adding h
60 $ hg mv a c
60 $ hg mv a c
61 $ hg ci -Am 'i-1: a -move-> c'
61 $ hg ci -Am 'i-1: a -move-> c'
62 $ hg mv c d
62 $ hg mv c d
63 $ hg ci -Am 'i-2: c -move-> d'
63 $ hg ci -Am 'i-2: c -move-> d'
64 $ hg log -G
64 $ hg log -G
65 @ 2 i-2: c -move-> d
65 @ 2 i-2: c -move-> d
66 |
66 |
67 o 1 i-1: a -move-> c
67 o 1 i-1: a -move-> c
68 |
68 |
69 o 0 i-0 initial commit: a b h
69 o 0 i-0 initial commit: a b h
70
70
71
71
72 And having another branch with renames on the other side
72 And having another branch with renames on the other side
73
73
74 $ hg mv d e
74 $ hg mv d e
75 $ hg ci -Am 'a-1: d -move-> e'
75 $ hg ci -Am 'a-1: d -move-> e'
76 $ hg mv e f
76 $ hg mv e f
77 $ hg ci -Am 'a-2: e -move-> f'
77 $ hg ci -Am 'a-2: e -move-> f'
78 $ hg log -G --rev '::.'
78 $ hg log -G --rev '::.'
79 @ 4 a-2: e -move-> f
79 @ 4 a-2: e -move-> f
80 |
80 |
81 o 3 a-1: d -move-> e
81 o 3 a-1: d -move-> e
82 |
82 |
83 o 2 i-2: c -move-> d
83 o 2 i-2: c -move-> d
84 |
84 |
85 o 1 i-1: a -move-> c
85 o 1 i-1: a -move-> c
86 |
86 |
87 o 0 i-0 initial commit: a b h
87 o 0 i-0 initial commit: a b h
88
88
89
89
90 Have a branching with nothing on one side
90 Have a branching with nothing on one side
91
91
92 $ hg up 'desc("i-2")'
92 $ hg up 'desc("i-2")'
93 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
93 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
94 $ echo foo > b
94 $ echo foo > b
95 $ hg ci -m 'b-1: b update'
95 $ hg ci -m 'b-1: b update'
96 created new head
96 created new head
97 $ hg log -G --rev '::.'
97 $ hg log -G --rev '::.'
98 @ 5 b-1: b update
98 @ 5 b-1: b update
99 |
99 |
100 o 2 i-2: c -move-> d
100 o 2 i-2: c -move-> d
101 |
101 |
102 o 1 i-1: a -move-> c
102 o 1 i-1: a -move-> c
103 |
103 |
104 o 0 i-0 initial commit: a b h
104 o 0 i-0 initial commit: a b h
105
105
106
106
107 Create a branch that delete a file previous renamed
107 Create a branch that delete a file previous renamed
108
108
109 $ hg up 'desc("i-2")'
109 $ hg up 'desc("i-2")'
110 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
111 $ hg rm d
111 $ hg rm d
112 $ hg ci -m 'c-1 delete d'
112 $ hg ci -m 'c-1 delete d'
113 created new head
113 created new head
114 $ hg log -G --rev '::.'
114 $ hg log -G --rev '::.'
115 @ 6 c-1 delete d
115 @ 6 c-1 delete d
116 |
116 |
117 o 2 i-2: c -move-> d
117 o 2 i-2: c -move-> d
118 |
118 |
119 o 1 i-1: a -move-> c
119 o 1 i-1: a -move-> c
120 |
120 |
121 o 0 i-0 initial commit: a b h
121 o 0 i-0 initial commit: a b h
122
122
123
123
124 Create a branch that delete a file previous renamed and recreate it
124 Create a branch that delete a file previous renamed and recreate it
125
125
126 $ hg up 'desc("i-2")'
126 $ hg up 'desc("i-2")'
127 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
127 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
128 $ hg rm d
128 $ hg rm d
129 $ hg ci -m 'd-1 delete d'
129 $ hg ci -m 'd-1 delete d'
130 created new head
130 created new head
131 $ echo bar > d
131 $ echo bar > d
132 $ hg add d
132 $ hg add d
133 $ hg ci -m 'd-2 re-add d'
133 $ hg ci -m 'd-2 re-add d'
134 $ hg log -G --rev '::.'
134 $ hg log -G --rev '::.'
135 @ 8 d-2 re-add d
135 @ 8 d-2 re-add d
136 |
136 |
137 o 7 d-1 delete d
137 o 7 d-1 delete d
138 |
138 |
139 o 2 i-2: c -move-> d
139 o 2 i-2: c -move-> d
140 |
140 |
141 o 1 i-1: a -move-> c
141 o 1 i-1: a -move-> c
142 |
142 |
143 o 0 i-0 initial commit: a b h
143 o 0 i-0 initial commit: a b h
144
144
145
145
146 Having another branch renaming a different file to the same filename as another
146 Having another branch renaming a different file to the same filename as another
147
147
148 $ hg up 'desc("i-2")'
148 $ hg up 'desc("i-2")'
149 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
149 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
150 $ hg mv b g
150 $ hg mv b g
151 $ hg ci -m 'e-1 b -move-> g'
151 $ hg ci -m 'e-1 b -move-> g'
152 created new head
152 created new head
153 $ hg mv g f
153 $ hg mv g f
154 $ hg ci -m 'e-2 g -move-> f'
154 $ hg ci -m 'e-2 g -move-> f'
155 $ hg log -G --rev '::.'
155 $ hg log -G --rev '::.'
156 @ 10 e-2 g -move-> f
156 @ 10 e-2 g -move-> f
157 |
157 |
158 o 9 e-1 b -move-> g
158 o 9 e-1 b -move-> g
159 |
159 |
160 o 2 i-2: c -move-> d
160 o 2 i-2: c -move-> d
161 |
161 |
162 o 1 i-1: a -move-> c
162 o 1 i-1: a -move-> c
163 |
163 |
164 o 0 i-0 initial commit: a b h
164 o 0 i-0 initial commit: a b h
165
165
166
166
167 Setup all merge
167 Setup all merge
168 ===============
168 ===============
169
169
170 This is done beforehand to validate that the upgrade process creates valid copy
170 This is done beforehand to validate that the upgrade process creates valid copy
171 information.
171 information.
172
172
173 merging with unrelated change does not interfere with the renames
173 merging with unrelated change does not interfere with the renames
174 ---------------------------------------------------------------
174 ---------------------------------------------------------------
175
175
176 - rename on one side
176 - rename on one side
177 - unrelated change on the other side
177 - unrelated change on the other side
178
178
179 $ hg up 'desc("b-1")'
179 $ hg up 'desc("b-1")'
180 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
180 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
181 $ hg merge 'desc("a-2")'
181 $ hg merge 'desc("a-2")'
182 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
182 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
183 (branch merge, don't forget to commit)
183 (branch merge, don't forget to commit)
184 $ hg ci -m 'mBAm-0 simple merge - one way'
184 $ hg ci -m 'mBAm-0 simple merge - one way'
185 $ hg up 'desc("a-2")'
185 $ hg up 'desc("a-2")'
186 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
186 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
187 $ hg merge 'desc("b-1")'
187 $ hg merge 'desc("b-1")'
188 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
188 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 (branch merge, don't forget to commit)
189 (branch merge, don't forget to commit)
190 $ hg ci -m 'mABm-0 simple merge - the other way'
190 $ hg ci -m 'mABm-0 simple merge - the other way'
191 created new head
191 created new head
192 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
192 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
193 @ 12 mABm-0 simple merge - the other way
193 @ 12 mABm-0 simple merge - the other way
194 |\
194 |\
195 +---o 11 mBAm-0 simple merge - one way
195 +---o 11 mBAm-0 simple merge - one way
196 | |/
196 | |/
197 | o 5 b-1: b update
197 | o 5 b-1: b update
198 | |
198 | |
199 o | 4 a-2: e -move-> f
199 o | 4 a-2: e -move-> f
200 | |
200 | |
201 o | 3 a-1: d -move-> e
201 o | 3 a-1: d -move-> e
202 |/
202 |/
203 o 2 i-2: c -move-> d
203 o 2 i-2: c -move-> d
204 |
204 |
205 o 1 i-1: a -move-> c
205 o 1 i-1: a -move-> c
206 |
206 |
207 o 0 i-0 initial commit: a b h
207 o 0 i-0 initial commit: a b h
208
208
209
209
210
210
211 merging with the side having a delete
211 merging with the side having a delete
212 -------------------------------------
212 -------------------------------------
213
213
214 case summary:
214 case summary:
215 - one with change to an unrelated file
215 - one with change to an unrelated file
216 - one deleting the change
216 - one deleting the change
217 and recreate an unrelated file after the merge
217 and recreate an unrelated file after the merge
218
218
219 $ hg up 'desc("b-1")'
219 $ hg up 'desc("b-1")'
220 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
220 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
221 $ hg merge 'desc("c-1")'
221 $ hg merge 'desc("c-1")'
222 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
222 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
223 (branch merge, don't forget to commit)
223 (branch merge, don't forget to commit)
224 $ hg ci -m 'mBCm-0 simple merge - one way'
224 $ hg ci -m 'mBCm-0 simple merge - one way'
225 $ echo bar > d
225 $ echo bar > d
226 $ hg add d
226 $ hg add d
227 $ hg ci -m 'mBCm-1 re-add d'
227 $ hg ci -m 'mBCm-1 re-add d'
228 $ hg up 'desc("c-1")'
228 $ hg up 'desc("c-1")'
229 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
229 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
230 $ hg merge 'desc("b-1")'
230 $ hg merge 'desc("b-1")'
231 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
231 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
232 (branch merge, don't forget to commit)
232 (branch merge, don't forget to commit)
233 $ hg ci -m 'mCBm-0 simple merge - the other way'
233 $ hg ci -m 'mCBm-0 simple merge - the other way'
234 created new head
234 created new head
235 $ echo bar > d
235 $ echo bar > d
236 $ hg add d
236 $ hg add d
237 $ hg ci -m 'mCBm-1 re-add d'
237 $ hg ci -m 'mCBm-1 re-add d'
238 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
238 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
239 @ 16 mCBm-1 re-add d
239 @ 16 mCBm-1 re-add d
240 |
240 |
241 o 15 mCBm-0 simple merge - the other way
241 o 15 mCBm-0 simple merge - the other way
242 |\
242 |\
243 | | o 14 mBCm-1 re-add d
243 | | o 14 mBCm-1 re-add d
244 | | |
244 | | |
245 +---o 13 mBCm-0 simple merge - one way
245 +---o 13 mBCm-0 simple merge - one way
246 | |/
246 | |/
247 | o 6 c-1 delete d
247 | o 6 c-1 delete d
248 | |
248 | |
249 o | 5 b-1: b update
249 o | 5 b-1: b update
250 |/
250 |/
251 o 2 i-2: c -move-> d
251 o 2 i-2: c -move-> d
252 |
252 |
253 o 1 i-1: a -move-> c
253 o 1 i-1: a -move-> c
254 |
254 |
255 o 0 i-0 initial commit: a b h
255 o 0 i-0 initial commit: a b h
256
256
257
257
258 Comparing with a merge re-adding the file afterward
258 Comparing with a merge re-adding the file afterward
259 ---------------------------------------------------
259 ---------------------------------------------------
260
260
261 Merge:
261 Merge:
262 - one with change to an unrelated file
262 - one with change to an unrelated file
263 - one deleting and recreating the change
263 - one deleting and recreating the change
264
264
265 $ hg up 'desc("b-1")'
265 $ hg up 'desc("b-1")'
266 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
266 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
267 $ hg merge 'desc("d-2")'
267 $ hg merge 'desc("d-2")'
268 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
268 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
269 (branch merge, don't forget to commit)
269 (branch merge, don't forget to commit)
270 $ hg ci -m 'mBDm-0 simple merge - one way'
270 $ hg ci -m 'mBDm-0 simple merge - one way'
271 $ hg up 'desc("d-2")'
271 $ hg up 'desc("d-2")'
272 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
272 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
273 $ hg merge 'desc("b-1")'
273 $ hg merge 'desc("b-1")'
274 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
274 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
275 (branch merge, don't forget to commit)
275 (branch merge, don't forget to commit)
276 $ hg ci -m 'mDBm-0 simple merge - the other way'
276 $ hg ci -m 'mDBm-0 simple merge - the other way'
277 created new head
277 created new head
278 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
278 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
279 @ 18 mDBm-0 simple merge - the other way
279 @ 18 mDBm-0 simple merge - the other way
280 |\
280 |\
281 +---o 17 mBDm-0 simple merge - one way
281 +---o 17 mBDm-0 simple merge - one way
282 | |/
282 | |/
283 | o 8 d-2 re-add d
283 | o 8 d-2 re-add d
284 | |
284 | |
285 | o 7 d-1 delete d
285 | o 7 d-1 delete d
286 | |
286 | |
287 o | 5 b-1: b update
287 o | 5 b-1: b update
288 |/
288 |/
289 o 2 i-2: c -move-> d
289 o 2 i-2: c -move-> d
290 |
290 |
291 o 1 i-1: a -move-> c
291 o 1 i-1: a -move-> c
292 |
292 |
293 o 0 i-0 initial commit: a b h
293 o 0 i-0 initial commit: a b h
294
294
295
295
296
296
297 Comparing with a merge with colliding rename
297 Comparing with a merge with colliding rename
298 --------------------------------------------
298 --------------------------------------------
299
299
300 - the "e-" branch renaming b to f (through 'g')
300 - the "e-" branch renaming b to f (through 'g')
301 - the "a-" branch renaming d to f (through e)
301 - the "a-" branch renaming d to f (through e)
302
302
303 $ hg up 'desc("a-2")'
303 $ hg up 'desc("a-2")'
304 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
304 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
305 $ hg merge 'desc("e-2")' --tool :union
305 $ hg merge 'desc("e-2")' --tool :union
306 merging f
306 merging f
307 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
307 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
308 (branch merge, don't forget to commit)
308 (branch merge, don't forget to commit)
309 $ hg ci -m 'mAEm-0 simple merge - one way'
309 $ hg ci -m 'mAEm-0 simple merge - one way'
310 $ hg up 'desc("e-2")'
310 $ hg up 'desc("e-2")'
311 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
311 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
312 $ hg merge 'desc("a-2")' --tool :union
312 $ hg merge 'desc("a-2")' --tool :union
313 merging f
313 merging f
314 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
314 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
315 (branch merge, don't forget to commit)
315 (branch merge, don't forget to commit)
316 $ hg ci -m 'mEAm-0 simple merge - the other way'
316 $ hg ci -m 'mEAm-0 simple merge - the other way'
317 created new head
317 created new head
318 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
318 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
319 @ 20 mEAm-0 simple merge - the other way
319 @ 20 mEAm-0 simple merge - the other way
320 |\
320 |\
321 +---o 19 mAEm-0 simple merge - one way
321 +---o 19 mAEm-0 simple merge - one way
322 | |/
322 | |/
323 | o 10 e-2 g -move-> f
323 | o 10 e-2 g -move-> f
324 | |
324 | |
325 | o 9 e-1 b -move-> g
325 | o 9 e-1 b -move-> g
326 | |
326 | |
327 o | 4 a-2: e -move-> f
327 o | 4 a-2: e -move-> f
328 | |
328 | |
329 o | 3 a-1: d -move-> e
329 o | 3 a-1: d -move-> e
330 |/
330 |/
331 o 2 i-2: c -move-> d
331 o 2 i-2: c -move-> d
332 |
332 |
333 o 1 i-1: a -move-> c
333 o 1 i-1: a -move-> c
334 |
334 |
335 o 0 i-0 initial commit: a b h
335 o 0 i-0 initial commit: a b h
336
336
337
337
338
338
339 Merge:
339 Merge:
340 - one with change to an unrelated file (b)
340 - one with change to an unrelated file (b)
341 - one overwriting a file (d) with a rename (from h to i to d)
341 - one overwriting a file (d) with a rename (from h to i to d)
342
342
343 $ hg up 'desc("i-2")'
343 $ hg up 'desc("i-2")'
344 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
344 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
345 $ hg mv h i
345 $ hg mv h i
346 $ hg commit -m "f-1: rename h -> i"
346 $ hg commit -m "f-1: rename h -> i"
347 created new head
347 created new head
348 $ hg mv --force i d
348 $ hg mv --force i d
349 $ hg commit -m "f-2: rename i -> d"
349 $ hg commit -m "f-2: rename i -> d"
350 $ hg debugindex d
350 $ hg debugindex d
351 rev linkrev nodeid p1 p2
351 rev linkrev nodeid p1 p2
352 0 2 169be882533b 000000000000 000000000000 (no-changeset !)
352 0 2 169be882533b 000000000000 000000000000 (no-changeset !)
353 0 2 b789fdd96dc2 000000000000 000000000000 (changeset !)
353 0 2 b789fdd96dc2 000000000000 000000000000 (changeset !)
354 1 8 b004912a8510 000000000000 000000000000
354 1 8 b004912a8510 000000000000 000000000000
355 2 22 4a067cf8965d 000000000000 000000000000 (no-changeset !)
355 2 22 4a067cf8965d 000000000000 000000000000 (no-changeset !)
356 2 22 fe6f8b4f507f 000000000000 000000000000 (changeset !)
356 2 22 fe6f8b4f507f 000000000000 000000000000 (changeset !)
357 $ hg up 'desc("b-1")'
357 $ hg up 'desc("b-1")'
358 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
358 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
359 $ hg merge 'desc("f-2")'
359 $ hg merge 'desc("f-2")'
360 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
360 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
361 (branch merge, don't forget to commit)
361 (branch merge, don't forget to commit)
362 $ hg ci -m 'mBFm-0 simple merge - one way'
362 $ hg ci -m 'mBFm-0 simple merge - one way'
363 $ hg up 'desc("f-2")'
363 $ hg up 'desc("f-2")'
364 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
364 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
365 $ hg merge 'desc("b-1")'
365 $ hg merge 'desc("b-1")'
366 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
366 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
367 (branch merge, don't forget to commit)
367 (branch merge, don't forget to commit)
368 $ hg ci -m 'mFBm-0 simple merge - the other way'
368 $ hg ci -m 'mFBm-0 simple merge - the other way'
369 created new head
369 created new head
370 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
370 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
371 @ 24 mFBm-0 simple merge - the other way
371 @ 24 mFBm-0 simple merge - the other way
372 |\
372 |\
373 +---o 23 mBFm-0 simple merge - one way
373 +---o 23 mBFm-0 simple merge - one way
374 | |/
374 | |/
375 | o 22 f-2: rename i -> d
375 | o 22 f-2: rename i -> d
376 | |
376 | |
377 | o 21 f-1: rename h -> i
377 | o 21 f-1: rename h -> i
378 | |
378 | |
379 o | 5 b-1: b update
379 o | 5 b-1: b update
380 |/
380 |/
381 o 2 i-2: c -move-> d
381 o 2 i-2: c -move-> d
382 |
382 |
383 o 1 i-1: a -move-> c
383 o 1 i-1: a -move-> c
384 |
384 |
385 o 0 i-0 initial commit: a b h
385 o 0 i-0 initial commit: a b h
386
386
387
387
388
388
389 Merge:
389 Merge:
390 - one with change to a file
390 - one with change to a file
391 - one deleting and recreating the file
391 - one deleting and recreating the file
392
392
393 Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
393 Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
394 consider history and rename on both branch of the merge.
394 consider history and rename on both branch of the merge.
395
395
396 $ hg up 'desc("i-2")'
396 $ hg up 'desc("i-2")'
397 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
397 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
398 $ echo "some update" >> d
398 $ echo "some update" >> d
399 $ hg commit -m "g-1: update d"
399 $ hg commit -m "g-1: update d"
400 created new head
400 created new head
401 $ hg up 'desc("d-2")'
401 $ hg up 'desc("d-2")'
402 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
402 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
403 $ hg merge 'desc("g-1")' --tool :union
403 $ hg merge 'desc("g-1")' --tool :union
404 merging d
404 merging d
405 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
405 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
406 (branch merge, don't forget to commit)
406 (branch merge, don't forget to commit)
407 $ hg ci -m 'mDGm-0 simple merge - one way'
407 $ hg ci -m 'mDGm-0 simple merge - one way'
408 $ hg up 'desc("g-1")'
408 $ hg up 'desc("g-1")'
409 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
409 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
410 $ hg merge 'desc("d-2")' --tool :union
410 $ hg merge 'desc("d-2")' --tool :union
411 merging d
411 merging d
412 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
412 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
413 (branch merge, don't forget to commit)
413 (branch merge, don't forget to commit)
414 $ hg ci -m 'mGDm-0 simple merge - the other way'
414 $ hg ci -m 'mGDm-0 simple merge - the other way'
415 created new head
415 created new head
416 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
416 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
417 @ 27 mGDm-0 simple merge - the other way
417 @ 27 mGDm-0 simple merge - the other way
418 |\
418 |\
419 +---o 26 mDGm-0 simple merge - one way
419 +---o 26 mDGm-0 simple merge - one way
420 | |/
420 | |/
421 | o 25 g-1: update d
421 | o 25 g-1: update d
422 | |
422 | |
423 o | 8 d-2 re-add d
423 o | 8 d-2 re-add d
424 | |
424 | |
425 o | 7 d-1 delete d
425 o | 7 d-1 delete d
426 |/
426 |/
427 o 2 i-2: c -move-> d
427 o 2 i-2: c -move-> d
428 |
428 |
429 o 1 i-1: a -move-> c
429 o 1 i-1: a -move-> c
430 |
430 |
431 o 0 i-0 initial commit: a b h
431 o 0 i-0 initial commit: a b h
432
432
433
433
434
434
435 Merge:
435 Merge:
436 - one with change to a file (d)
436 - one with change to a file (d)
437 - one overwriting that file with a rename (from h to i, to d)
437 - one overwriting that file with a rename (from h to i, to d)
438
438
439 This case is similar to BF/FB, but an actual merge happens, so both side of the
439 This case is similar to BF/FB, but an actual merge happens, so both side of the
440 history are relevant.
440 history are relevant.
441
441
442 Note:
442 Note:
443 | In this case, the merge get conflicting information since on one side we have
443 | In this case, the merge get conflicting information since on one side we have
444 | "a -> c -> d". and one the other one we have "h -> i -> d".
444 | "a -> c -> d". and one the other one we have "h -> i -> d".
445 |
445 |
446 | The current code arbitrarily pick one side
446 | The current code arbitrarily pick one side
447
447
448 $ hg up 'desc("f-2")'
448 $ hg up 'desc("f-2")'
449 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
449 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
450 $ hg merge 'desc("g-1")' --tool :union
450 $ hg merge 'desc("g-1")' --tool :union
451 merging d
451 merging d
452 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
452 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
453 (branch merge, don't forget to commit)
453 (branch merge, don't forget to commit)
454 $ hg ci -m 'mFGm-0 simple merge - one way'
454 $ hg ci -m 'mFGm-0 simple merge - one way'
455 created new head
455 created new head
456 $ hg up 'desc("g-1")'
456 $ hg up 'desc("g-1")'
457 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
457 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
458 $ hg merge 'desc("f-2")' --tool :union
458 $ hg merge 'desc("f-2")' --tool :union
459 merging d
459 merging d
460 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
460 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
461 (branch merge, don't forget to commit)
461 (branch merge, don't forget to commit)
462 $ hg ci -m 'mGFm-0 simple merge - the other way'
462 $ hg ci -m 'mGFm-0 simple merge - the other way'
463 created new head
463 created new head
464 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
464 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
465 @ 29 mGFm-0 simple merge - the other way
465 @ 29 mGFm-0 simple merge - the other way
466 |\
466 |\
467 +---o 28 mFGm-0 simple merge - one way
467 +---o 28 mFGm-0 simple merge - one way
468 | |/
468 | |/
469 | o 25 g-1: update d
469 | o 25 g-1: update d
470 | |
470 | |
471 o | 22 f-2: rename i -> d
471 o | 22 f-2: rename i -> d
472 | |
472 | |
473 o | 21 f-1: rename h -> i
473 o | 21 f-1: rename h -> i
474 |/
474 |/
475 o 2 i-2: c -move-> d
475 o 2 i-2: c -move-> d
476 |
476 |
477 o 1 i-1: a -move-> c
477 o 1 i-1: a -move-> c
478 |
478 |
479 o 0 i-0 initial commit: a b h
479 o 0 i-0 initial commit: a b h
480
480
481
481
482
482
483 Comparing with merging with a deletion (and keeping the file)
483 Comparing with merging with a deletion (and keeping the file)
484 -------------------------------------------------------------
484 -------------------------------------------------------------
485
485
486 Merge:
486 Merge:
487 - one removing a file (d)
487 - one removing a file (d)
488 - one updating that file
488 - one updating that file
489 - the merge keep the modified version of the file (canceling the delete)
489 - the merge keep the modified version of the file (canceling the delete)
490
490
491 In this case, the file keep on living after the merge. So we should not drop its
491 In this case, the file keep on living after the merge. So we should not drop its
492 copy tracing chain.
492 copy tracing chain.
493
493
494 $ hg up 'desc("c-1")'
494 $ hg up 'desc("c-1")'
495 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
495 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
496 $ hg merge 'desc("g-1")'
496 $ hg merge 'desc("g-1")'
497 file 'd' was deleted in local [working copy] but was modified in other [merge rev].
497 file 'd' was deleted in local [working copy] but was modified in other [merge rev].
498 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
498 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
499 What do you want to do? u
499 What do you want to do? u
500 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
500 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
501 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
501 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
502 [1]
502 [1]
503 $ hg resolve -t :other d
503 $ hg resolve -t :other d
504 (no more unresolved files)
504 (no more unresolved files)
505 $ hg ci -m "mCGm-0"
505 $ hg ci -m "mCGm-0"
506 created new head
506 created new head
507
507
508 $ hg up 'desc("g-1")'
508 $ hg up 'desc("g-1")'
509 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
509 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
510 $ hg merge 'desc("c-1")'
510 $ hg merge 'desc("c-1")'
511 file 'd' was deleted in other [merge rev] but was modified in local [working copy].
511 file 'd' was deleted in other [merge rev] but was modified in local [working copy].
512 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
512 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
513 What do you want to do? u
513 What do you want to do? u
514 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
514 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
515 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
515 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
516 [1]
516 [1]
517 $ hg resolve -t :local d
517 $ hg resolve -t :local d
518 (no more unresolved files)
518 (no more unresolved files)
519 $ hg ci -m "mGCm-0"
519 $ hg ci -m "mGCm-0"
520 created new head
520 created new head
521
521
522 $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
522 $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
523 @ 31 mGCm-0
523 @ 31 mGCm-0
524 |\
524 |\
525 +---o 30 mCGm-0
525 +---o 30 mCGm-0
526 | |/
526 | |/
527 | o 25 g-1: update d
527 | o 25 g-1: update d
528 | |
528 | |
529 o | 6 c-1 delete d
529 o | 6 c-1 delete d
530 |/
530 |/
531 o 2 i-2: c -move-> d
531 o 2 i-2: c -move-> d
532 |
532 |
533 o 1 i-1: a -move-> c
533 o 1 i-1: a -move-> c
534 |
534 |
535 o 0 i-0 initial commit: a b h
535 o 0 i-0 initial commit: a b h
536
536
537
537
538
538
539
539
540 Comparing with merge restoring an untouched deleted file
540 Comparing with merge restoring an untouched deleted file
541 --------------------------------------------------------
541 --------------------------------------------------------
542
542
543 Merge:
543 Merge:
544 - one removing a file (d)
544 - one removing a file (d)
545 - one leaving the file untouched
545 - one leaving the file untouched
546 - the merge actively restore the file to the same content.
546 - the merge actively restore the file to the same content.
547
547
548 In this case, the file keep on living after the merge. So we should not drop its
548 In this case, the file keep on living after the merge. So we should not drop its
549 copy tracing chain.
549 copy tracing chain.
550
550
551 $ hg up 'desc("c-1")'
551 $ hg up 'desc("c-1")'
552 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
552 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
553 $ hg merge 'desc("b-1")'
553 $ hg merge 'desc("b-1")'
554 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
554 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
555 (branch merge, don't forget to commit)
555 (branch merge, don't forget to commit)
556 $ hg revert --rev 'desc("b-1")' d
556 $ hg revert --rev 'desc("b-1")' d
557 $ hg ci -m "mCB-revert-m-0"
557 $ hg ci -m "mCB-revert-m-0"
558 created new head
558 created new head
559
559
560 $ hg up 'desc("b-1")'
560 $ hg up 'desc("b-1")'
561 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
561 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
562 $ hg merge 'desc("c-1")'
562 $ hg merge 'desc("c-1")'
563 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
563 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
564 (branch merge, don't forget to commit)
564 (branch merge, don't forget to commit)
565 $ hg revert --rev 'desc("b-1")' d
565 $ hg revert --rev 'desc("b-1")' d
566 $ hg ci -m "mBC-revert-m-0"
566 $ hg ci -m "mBC-revert-m-0"
567 created new head
567 created new head
568
568
569 $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
569 $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
570 @ 33 mBC-revert-m-0
570 @ 33 mBC-revert-m-0
571 |\
571 |\
572 +---o 32 mCB-revert-m-0
572 +---o 32 mCB-revert-m-0
573 | |/
573 | |/
574 | o 6 c-1 delete d
574 | o 6 c-1 delete d
575 | |
575 | |
576 o | 5 b-1: b update
576 o | 5 b-1: b update
577 |/
577 |/
578 o 2 i-2: c -move-> d
578 o 2 i-2: c -move-> d
579 |
579 |
580 o 1 i-1: a -move-> c
580 o 1 i-1: a -move-> c
581 |
581 |
582 o 0 i-0 initial commit: a b h
582 o 0 i-0 initial commit: a b h
583
583
584
584
585
585
586 $ hg up null --quiet
586 $ hg up null --quiet
587
587
588 Merging a branch where a rename was deleted with a branch where the same file was renamed
588 Merging a branch where a rename was deleted with a branch where the same file was renamed
589 ------------------------------------------------------------------------------------------
589 ------------------------------------------------------------------------------------------
590
590
591 Create a "conflicting" merge where `d` get removed on one branch before its
591 Create a "conflicting" merge where `d` get removed on one branch before its
592 rename information actually conflict with the other branch.
592 rename information actually conflict with the other branch.
593
593
594 (the copy information from the branch that was not deleted should win).
594 (the copy information from the branch that was not deleted should win).
595
595
596 $ hg up 'desc("i-0")'
596 $ hg up 'desc("i-0")'
597 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
597 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
598 $ hg mv b d
598 $ hg mv b d
599 $ hg ci -m "h-1: b -(move)-> d"
599 $ hg ci -m "h-1: b -(move)-> d"
600 created new head
600 created new head
601
601
602 $ hg up 'desc("c-1")'
602 $ hg up 'desc("c-1")'
603 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
603 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
604 $ hg merge 'desc("h-1")'
604 $ hg merge 'desc("h-1")'
605 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
605 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
606 (branch merge, don't forget to commit)
606 (branch merge, don't forget to commit)
607 $ hg ci -m "mCH-delete-before-conflict-m-0"
607 $ hg ci -m "mCH-delete-before-conflict-m-0"
608
608
609 $ hg up 'desc("h-1")'
609 $ hg up 'desc("h-1")'
610 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
610 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
611 $ hg merge 'desc("c-1")'
611 $ hg merge 'desc("c-1")'
612 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
612 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
613 (branch merge, don't forget to commit)
613 (branch merge, don't forget to commit)
614 $ hg ci -m "mHC-delete-before-conflict-m-0"
614 $ hg ci -m "mHC-delete-before-conflict-m-0"
615 created new head
615 created new head
616 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
616 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
617 @ 36 mHC-delete-before-conflict-m-0
617 @ 36 mHC-delete-before-conflict-m-0
618 |\
618 |\
619 +---o 35 mCH-delete-before-conflict-m-0
619 +---o 35 mCH-delete-before-conflict-m-0
620 | |/
620 | |/
621 | o 34 h-1: b -(move)-> d
621 | o 34 h-1: b -(move)-> d
622 | |
622 | |
623 o | 6 c-1 delete d
623 o | 6 c-1 delete d
624 | |
624 | |
625 o | 2 i-2: c -move-> d
625 o | 2 i-2: c -move-> d
626 | |
626 | |
627 o | 1 i-1: a -move-> c
627 o | 1 i-1: a -move-> c
628 |/
628 |/
629 o 0 i-0 initial commit: a b h
629 o 0 i-0 initial commit: a b h
630
630
631
631
632
632
633 Test that sidedata computations during upgrades are correct
633 Test that sidedata computations during upgrades are correct
634 ===========================================================
634 ===========================================================
635
635
636 We upgrade a repository that is not using sidedata (the filelog case) and
636 We upgrade a repository that is not using sidedata (the filelog case) and
637 check that the same side data have been generated as if they were computed at
637 check that the same side data have been generated as if they were computed at
638 commit time.
638 commit time.
639
639
640
640
641 #if upgraded
641 #if upgraded
642 $ cat >> $HGRCPATH << EOF
642 $ cat >> $HGRCPATH << EOF
643 > [format]
643 > [format]
644 > exp-use-side-data = yes
644 > exp-use-side-data = yes
645 > exp-use-copies-side-data-changeset = yes
645 > exp-use-copies-side-data-changeset = yes
646 > EOF
646 > EOF
647 $ hg debugformat -v
647 $ hg debugformat -v
648 format-variant repo config default
648 format-variant repo config default
649 fncache: yes yes yes
649 fncache: yes yes yes
650 dotencode: yes yes yes
650 dotencode: yes yes yes
651 generaldelta: yes yes yes
651 generaldelta: yes yes yes
652 exp-sharesafe: no no no
652 exp-sharesafe: no no no
653 sparserevlog: yes yes yes
653 sparserevlog: yes yes yes
654 sidedata: no yes no
654 sidedata: no yes no
655 persistent-nodemap: no no no
655 persistent-nodemap: no no no
656 copies-sdc: no yes no
656 copies-sdc: no yes no
657 plain-cl-delta: yes yes yes
657 plain-cl-delta: yes yes yes
658 compression: * (glob)
658 compression: * (glob)
659 compression-level: default default default
659 compression-level: default default default
660 $ hg debugupgraderepo --run --quiet
660 $ hg debugupgraderepo --run --quiet
661 upgrade will perform the following actions:
661 upgrade will perform the following actions:
662
662
663 requirements
663 requirements
664 preserved: * (glob)
664 preserved: * (glob)
665 added: exp-copies-sidedata-changeset, exp-sidedata-flag
665 added: exp-copies-sidedata-changeset, exp-sidedata-flag
666
666
667 processed revlogs:
668 - all-filelogs
669 - changelog
670 - manifest
671
667 #endif
672 #endif
668
673
669
674
670 #if no-compatibility no-filelog no-changeset
675 #if no-compatibility no-filelog no-changeset
671
676
672 $ for rev in `hg log --rev 'all()' -T '{rev}\n'`; do
677 $ for rev in `hg log --rev 'all()' -T '{rev}\n'`; do
673 > echo "##### revision $rev #####"
678 > echo "##### revision $rev #####"
674 > hg debugsidedata -c -v -- $rev
679 > hg debugsidedata -c -v -- $rev
675 > hg debugchangedfiles $rev
680 > hg debugchangedfiles $rev
676 > done
681 > done
677 ##### revision 0 #####
682 ##### revision 0 #####
678 1 sidedata entries
683 1 sidedata entries
679 entry-0014 size 34
684 entry-0014 size 34
680 '\x00\x00\x00\x03\x04\x00\x00\x00\x01\x00\x00\x00\x00\x04\x00\x00\x00\x02\x00\x00\x00\x00\x04\x00\x00\x00\x03\x00\x00\x00\x00abh'
685 '\x00\x00\x00\x03\x04\x00\x00\x00\x01\x00\x00\x00\x00\x04\x00\x00\x00\x02\x00\x00\x00\x00\x04\x00\x00\x00\x03\x00\x00\x00\x00abh'
681 added : a, ;
686 added : a, ;
682 added : b, ;
687 added : b, ;
683 added : h, ;
688 added : h, ;
684 ##### revision 1 #####
689 ##### revision 1 #####
685 1 sidedata entries
690 1 sidedata entries
686 entry-0014 size 24
691 entry-0014 size 24
687 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00ac'
692 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00ac'
688 removed : a, ;
693 removed : a, ;
689 added p1: c, a;
694 added p1: c, a;
690 ##### revision 2 #####
695 ##### revision 2 #####
691 1 sidedata entries
696 1 sidedata entries
692 entry-0014 size 24
697 entry-0014 size 24
693 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00cd'
698 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00cd'
694 removed : c, ;
699 removed : c, ;
695 added p1: d, c;
700 added p1: d, c;
696 ##### revision 3 #####
701 ##### revision 3 #####
697 1 sidedata entries
702 1 sidedata entries
698 entry-0014 size 24
703 entry-0014 size 24
699 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00de'
704 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00de'
700 removed : d, ;
705 removed : d, ;
701 added p1: e, d;
706 added p1: e, d;
702 ##### revision 4 #####
707 ##### revision 4 #####
703 1 sidedata entries
708 1 sidedata entries
704 entry-0014 size 24
709 entry-0014 size 24
705 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00ef'
710 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00ef'
706 removed : e, ;
711 removed : e, ;
707 added p1: f, e;
712 added p1: f, e;
708 ##### revision 5 #####
713 ##### revision 5 #####
709 1 sidedata entries
714 1 sidedata entries
710 entry-0014 size 14
715 entry-0014 size 14
711 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00b'
716 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00b'
712 touched : b, ;
717 touched : b, ;
713 ##### revision 6 #####
718 ##### revision 6 #####
714 1 sidedata entries
719 1 sidedata entries
715 entry-0014 size 14
720 entry-0014 size 14
716 '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
721 '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
717 removed : d, ;
722 removed : d, ;
718 ##### revision 7 #####
723 ##### revision 7 #####
719 1 sidedata entries
724 1 sidedata entries
720 entry-0014 size 14
725 entry-0014 size 14
721 '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
726 '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
722 removed : d, ;
727 removed : d, ;
723 ##### revision 8 #####
728 ##### revision 8 #####
724 1 sidedata entries
729 1 sidedata entries
725 entry-0014 size 14
730 entry-0014 size 14
726 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
731 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
727 added : d, ;
732 added : d, ;
728 ##### revision 9 #####
733 ##### revision 9 #####
729 1 sidedata entries
734 1 sidedata entries
730 entry-0014 size 24
735 entry-0014 size 24
731 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bg'
736 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bg'
732 removed : b, ;
737 removed : b, ;
733 added p1: g, b;
738 added p1: g, b;
734 ##### revision 10 #####
739 ##### revision 10 #####
735 1 sidedata entries
740 1 sidedata entries
736 entry-0014 size 24
741 entry-0014 size 24
737 '\x00\x00\x00\x02\x06\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00fg'
742 '\x00\x00\x00\x02\x06\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00fg'
738 added p1: f, g;
743 added p1: f, g;
739 removed : g, ;
744 removed : g, ;
740 ##### revision 11 #####
745 ##### revision 11 #####
741 1 sidedata entries
746 1 sidedata entries
742 entry-0014 size 4
747 entry-0014 size 4
743 '\x00\x00\x00\x00'
748 '\x00\x00\x00\x00'
744 ##### revision 12 #####
749 ##### revision 12 #####
745 1 sidedata entries
750 1 sidedata entries
746 entry-0014 size 4
751 entry-0014 size 4
747 '\x00\x00\x00\x00'
752 '\x00\x00\x00\x00'
748 ##### revision 13 #####
753 ##### revision 13 #####
749 1 sidedata entries
754 1 sidedata entries
750 entry-0014 size 4
755 entry-0014 size 4
751 '\x00\x00\x00\x00'
756 '\x00\x00\x00\x00'
752 ##### revision 14 #####
757 ##### revision 14 #####
753 1 sidedata entries
758 1 sidedata entries
754 entry-0014 size 14
759 entry-0014 size 14
755 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
760 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
756 added : d, ;
761 added : d, ;
757 ##### revision 15 #####
762 ##### revision 15 #####
758 1 sidedata entries
763 1 sidedata entries
759 entry-0014 size 4
764 entry-0014 size 4
760 '\x00\x00\x00\x00'
765 '\x00\x00\x00\x00'
761 ##### revision 16 #####
766 ##### revision 16 #####
762 1 sidedata entries
767 1 sidedata entries
763 entry-0014 size 14
768 entry-0014 size 14
764 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
769 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
765 added : d, ;
770 added : d, ;
766 ##### revision 17 #####
771 ##### revision 17 #####
767 1 sidedata entries
772 1 sidedata entries
768 entry-0014 size 4
773 entry-0014 size 4
769 '\x00\x00\x00\x00'
774 '\x00\x00\x00\x00'
770 ##### revision 18 #####
775 ##### revision 18 #####
771 1 sidedata entries
776 1 sidedata entries
772 entry-0014 size 4
777 entry-0014 size 4
773 '\x00\x00\x00\x00'
778 '\x00\x00\x00\x00'
774 ##### revision 19 #####
779 ##### revision 19 #####
775 1 sidedata entries
780 1 sidedata entries
776 entry-0014 size 14
781 entry-0014 size 14
777 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
782 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
778 merged : f, ;
783 merged : f, ;
779 ##### revision 20 #####
784 ##### revision 20 #####
780 1 sidedata entries
785 1 sidedata entries
781 entry-0014 size 14
786 entry-0014 size 14
782 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
787 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
783 merged : f, ;
788 merged : f, ;
784 ##### revision 21 #####
789 ##### revision 21 #####
785 1 sidedata entries
790 1 sidedata entries
786 entry-0014 size 24
791 entry-0014 size 24
787 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00hi'
792 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00hi'
788 removed : h, ;
793 removed : h, ;
789 added p1: i, h;
794 added p1: i, h;
790 ##### revision 22 #####
795 ##### revision 22 #####
791 1 sidedata entries
796 1 sidedata entries
792 entry-0014 size 24
797 entry-0014 size 24
793 '\x00\x00\x00\x02\x16\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00di'
798 '\x00\x00\x00\x02\x16\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00di'
794 touched p1: d, i;
799 touched p1: d, i;
795 removed : i, ;
800 removed : i, ;
796 ##### revision 23 #####
801 ##### revision 23 #####
797 1 sidedata entries
802 1 sidedata entries
798 entry-0014 size 4
803 entry-0014 size 4
799 '\x00\x00\x00\x00'
804 '\x00\x00\x00\x00'
800 ##### revision 24 #####
805 ##### revision 24 #####
801 1 sidedata entries
806 1 sidedata entries
802 entry-0014 size 4
807 entry-0014 size 4
803 '\x00\x00\x00\x00'
808 '\x00\x00\x00\x00'
804 ##### revision 25 #####
809 ##### revision 25 #####
805 1 sidedata entries
810 1 sidedata entries
806 entry-0014 size 14
811 entry-0014 size 14
807 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00d'
812 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00d'
808 touched : d, ;
813 touched : d, ;
809 ##### revision 26 #####
814 ##### revision 26 #####
810 1 sidedata entries
815 1 sidedata entries
811 entry-0014 size 14
816 entry-0014 size 14
812 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
817 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
813 merged : d, ;
818 merged : d, ;
814 ##### revision 27 #####
819 ##### revision 27 #####
815 1 sidedata entries
820 1 sidedata entries
816 entry-0014 size 14
821 entry-0014 size 14
817 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
822 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
818 merged : d, ;
823 merged : d, ;
819 ##### revision 28 #####
824 ##### revision 28 #####
820 1 sidedata entries
825 1 sidedata entries
821 entry-0014 size 14
826 entry-0014 size 14
822 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
827 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
823 merged : d, ;
828 merged : d, ;
824 ##### revision 29 #####
829 ##### revision 29 #####
825 1 sidedata entries
830 1 sidedata entries
826 entry-0014 size 14
831 entry-0014 size 14
827 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
832 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
828 merged : d, ;
833 merged : d, ;
829 ##### revision 30 #####
834 ##### revision 30 #####
830 1 sidedata entries
835 1 sidedata entries
831 entry-0014 size 14
836 entry-0014 size 14
832 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
837 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
833 salvaged : d, ;
838 salvaged : d, ;
834 ##### revision 31 #####
839 ##### revision 31 #####
835 1 sidedata entries
840 1 sidedata entries
836 entry-0014 size 14
841 entry-0014 size 14
837 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
842 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
838 salvaged : d, ;
843 salvaged : d, ;
839 ##### revision 32 #####
844 ##### revision 32 #####
840 1 sidedata entries
845 1 sidedata entries
841 entry-0014 size 14
846 entry-0014 size 14
842 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
847 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
843 salvaged : d, ;
848 salvaged : d, ;
844 ##### revision 33 #####
849 ##### revision 33 #####
845 1 sidedata entries
850 1 sidedata entries
846 entry-0014 size 14
851 entry-0014 size 14
847 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
852 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
848 salvaged : d, ;
853 salvaged : d, ;
849 ##### revision 34 #####
854 ##### revision 34 #####
850 1 sidedata entries
855 1 sidedata entries
851 entry-0014 size 24
856 entry-0014 size 24
852 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bd'
857 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bd'
853 removed : b, ;
858 removed : b, ;
854 added p1: d, b;
859 added p1: d, b;
855 ##### revision 35 #####
860 ##### revision 35 #####
856 1 sidedata entries
861 1 sidedata entries
857 entry-0014 size 4
862 entry-0014 size 4
858 '\x00\x00\x00\x00'
863 '\x00\x00\x00\x00'
859 ##### revision 36 #####
864 ##### revision 36 #####
860 1 sidedata entries
865 1 sidedata entries
861 entry-0014 size 4
866 entry-0014 size 4
862 '\x00\x00\x00\x00'
867 '\x00\x00\x00\x00'
863
868
864 #endif
869 #endif
865
870
866
871
867 Test copy information chaining
872 Test copy information chaining
868 ==============================
873 ==============================
869
874
870 merging with unrelated change does not interfere with the renames
875 merging with unrelated change does not interfere with the renames
871 ---------------------------------------------------------------
876 ---------------------------------------------------------------
872
877
873 - rename on one side
878 - rename on one side
874 - unrelated change on the other side
879 - unrelated change on the other side
875
880
876 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
881 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
877 o 12 mABm-0 simple merge - the other way
882 o 12 mABm-0 simple merge - the other way
878 |\
883 |\
879 +---o 11 mBAm-0 simple merge - one way
884 +---o 11 mBAm-0 simple merge - one way
880 | |/
885 | |/
881 | o 5 b-1: b update
886 | o 5 b-1: b update
882 | |
887 | |
883 o | 4 a-2: e -move-> f
888 o | 4 a-2: e -move-> f
884 | |
889 | |
885 o | 3 a-1: d -move-> e
890 o | 3 a-1: d -move-> e
886 |/
891 |/
887 o 2 i-2: c -move-> d
892 o 2 i-2: c -move-> d
888 |
893 |
889 o 1 i-1: a -move-> c
894 o 1 i-1: a -move-> c
890 |
895 |
891 o 0 i-0 initial commit: a b h
896 o 0 i-0 initial commit: a b h
892
897
893
898
894 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mABm")'
899 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mABm")'
895 A f
900 A f
896 d
901 d
897 R d
902 R d
898 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBAm")'
903 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBAm")'
899 A f
904 A f
900 d
905 d
901 R d
906 R d
902 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mABm")'
907 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mABm")'
903 M b
908 M b
904 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mBAm")'
909 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mBAm")'
905 M b
910 M b
906 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mABm")'
911 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mABm")'
907 M b
912 M b
908 A f
913 A f
909 d
914 d
910 R d
915 R d
911 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBAm")'
916 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBAm")'
912 M b
917 M b
913 A f
918 A f
914 d
919 d
915 R d
920 R d
916 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mABm")'
921 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mABm")'
917 M b
922 M b
918 A f
923 A f
919 a
924 a
920 R a
925 R a
921 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBAm")'
926 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBAm")'
922 M b
927 M b
923 A f
928 A f
924 a
929 a
925 R a
930 R a
926
931
927 merging with the side having a delete
932 merging with the side having a delete
928 -------------------------------------
933 -------------------------------------
929
934
930 case summary:
935 case summary:
931 - one with change to an unrelated file
936 - one with change to an unrelated file
932 - one deleting the change
937 - one deleting the change
933 and recreate an unrelated file after the merge
938 and recreate an unrelated file after the merge
934
939
935 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
940 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
936 o 16 mCBm-1 re-add d
941 o 16 mCBm-1 re-add d
937 |
942 |
938 o 15 mCBm-0 simple merge - the other way
943 o 15 mCBm-0 simple merge - the other way
939 |\
944 |\
940 | | o 14 mBCm-1 re-add d
945 | | o 14 mBCm-1 re-add d
941 | | |
946 | | |
942 +---o 13 mBCm-0 simple merge - one way
947 +---o 13 mBCm-0 simple merge - one way
943 | |/
948 | |/
944 | o 6 c-1 delete d
949 | o 6 c-1 delete d
945 | |
950 | |
946 o | 5 b-1: b update
951 o | 5 b-1: b update
947 |/
952 |/
948 o 2 i-2: c -move-> d
953 o 2 i-2: c -move-> d
949 |
954 |
950 o 1 i-1: a -move-> c
955 o 1 i-1: a -move-> c
951 |
956 |
952 o 0 i-0 initial commit: a b h
957 o 0 i-0 initial commit: a b h
953
958
954 - comparing from the merge
959 - comparing from the merge
955
960
956 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-0")'
961 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-0")'
957 R d
962 R d
958 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-0")'
963 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-0")'
959 R d
964 R d
960 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-0")'
965 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-0")'
961 M b
966 M b
962 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-0")'
967 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-0")'
963 M b
968 M b
964 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-0")'
969 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-0")'
965 M b
970 M b
966 R d
971 R d
967 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-0")'
972 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-0")'
968 M b
973 M b
969 R d
974 R d
970 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-0")'
975 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-0")'
971 M b
976 M b
972 R a
977 R a
973 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-0")'
978 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-0")'
974 M b
979 M b
975 R a
980 R a
976
981
977 - comparing with the merge children re-adding the file
982 - comparing with the merge children re-adding the file
978
983
979 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-1")'
984 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-1")'
980 M d
985 M d
981 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-1")'
986 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-1")'
982 M d
987 M d
983 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-1")'
988 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-1")'
984 M b
989 M b
985 A d
990 A d
986 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-1")'
991 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-1")'
987 M b
992 M b
988 A d
993 A d
989 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-1")'
994 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-1")'
990 M b
995 M b
991 M d
996 M d
992 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-1")'
997 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-1")'
993 M b
998 M b
994 M d
999 M d
995 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-1")'
1000 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-1")'
996 M b
1001 M b
997 A d
1002 A d
998 R a
1003 R a
999 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-1")'
1004 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-1")'
1000 M b
1005 M b
1001 A d
1006 A d
1002 R a
1007 R a
1003
1008
1004 Comparing with a merge re-adding the file afterward
1009 Comparing with a merge re-adding the file afterward
1005 ---------------------------------------------------
1010 ---------------------------------------------------
1006
1011
1007 Merge:
1012 Merge:
1008 - one with change to an unrelated file
1013 - one with change to an unrelated file
1009 - one deleting and recreating the change
1014 - one deleting and recreating the change
1010
1015
1011 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
1016 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
1012 o 18 mDBm-0 simple merge - the other way
1017 o 18 mDBm-0 simple merge - the other way
1013 |\
1018 |\
1014 +---o 17 mBDm-0 simple merge - one way
1019 +---o 17 mBDm-0 simple merge - one way
1015 | |/
1020 | |/
1016 | o 8 d-2 re-add d
1021 | o 8 d-2 re-add d
1017 | |
1022 | |
1018 | o 7 d-1 delete d
1023 | o 7 d-1 delete d
1019 | |
1024 | |
1020 o | 5 b-1: b update
1025 o | 5 b-1: b update
1021 |/
1026 |/
1022 o 2 i-2: c -move-> d
1027 o 2 i-2: c -move-> d
1023 |
1028 |
1024 o 1 i-1: a -move-> c
1029 o 1 i-1: a -move-> c
1025 |
1030 |
1026 o 0 i-0 initial commit: a b h
1031 o 0 i-0 initial commit: a b h
1027
1032
1028 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBDm-0")'
1033 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBDm-0")'
1029 M d
1034 M d
1030 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mDBm-0")'
1035 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mDBm-0")'
1031 M d
1036 M d
1032 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")'
1037 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")'
1033 M b
1038 M b
1034 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")'
1039 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")'
1035 M b
1040 M b
1036 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")'
1041 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")'
1037 M b
1042 M b
1038 M d
1043 M d
1039 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mDBm-0")'
1044 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mDBm-0")'
1040 M b
1045 M b
1041 M d
1046 M d
1042
1047
1043 The bugs makes recorded copy is different depending of where we started the merge from since
1048 The bugs makes recorded copy is different depending of where we started the merge from since
1044
1049
1045 $ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644 d'
1050 $ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644 d'
1046 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1051 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1047 $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644 d'
1052 $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644 d'
1048 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1053 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1049
1054
1050 $ hg manifest --debug --rev 'desc("d-2")' | grep '644 d'
1055 $ hg manifest --debug --rev 'desc("d-2")' | grep '644 d'
1051 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1056 b004912a8510032a0350a74daa2803dadfb00e12 644 d
1052 $ hg manifest --debug --rev 'desc("b-1")' | grep '644 d'
1057 $ hg manifest --debug --rev 'desc("b-1")' | grep '644 d'
1053 169be882533bc917905d46c0c951aa9a1e288dcf 644 d (no-changeset !)
1058 169be882533bc917905d46c0c951aa9a1e288dcf 644 d (no-changeset !)
1054 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 d (changeset !)
1059 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 d (changeset !)
1055 $ hg debugindex d | head -n 4
1060 $ hg debugindex d | head -n 4
1056 rev linkrev nodeid p1 p2
1061 rev linkrev nodeid p1 p2
1057 0 2 169be882533b 000000000000 000000000000 (no-changeset !)
1062 0 2 169be882533b 000000000000 000000000000 (no-changeset !)
1058 0 2 b789fdd96dc2 000000000000 000000000000 (changeset !)
1063 0 2 b789fdd96dc2 000000000000 000000000000 (changeset !)
1059 1 8 b004912a8510 000000000000 000000000000
1064 1 8 b004912a8510 000000000000 000000000000
1060 2 22 4a067cf8965d 000000000000 000000000000 (no-changeset !)
1065 2 22 4a067cf8965d 000000000000 000000000000 (no-changeset !)
1061 2 22 fe6f8b4f507f 000000000000 000000000000 (changeset !)
1066 2 22 fe6f8b4f507f 000000000000 000000000000 (changeset !)
1062
1067
1063 Log output should not include a merge commit as it did not happen
1068 Log output should not include a merge commit as it did not happen
1064
1069
1065 $ hg log -Gfr 'desc("mBDm-0")' d
1070 $ hg log -Gfr 'desc("mBDm-0")' d
1066 o 8 d-2 re-add d
1071 o 8 d-2 re-add d
1067 |
1072 |
1068 ~
1073 ~
1069
1074
1070 $ hg log -Gfr 'desc("mDBm-0")' d
1075 $ hg log -Gfr 'desc("mDBm-0")' d
1071 o 8 d-2 re-add d
1076 o 8 d-2 re-add d
1072 |
1077 |
1073 ~
1078 ~
1074
1079
1075 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")'
1080 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")'
1076 M b
1081 M b
1077 A d
1082 A d
1078 R a
1083 R a
1079 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")'
1084 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")'
1080 M b
1085 M b
1081 A d
1086 A d
1082 R a
1087 R a
1083
1088
1084
1089
1085 Comparing with a merge with colliding rename
1090 Comparing with a merge with colliding rename
1086 --------------------------------------------
1091 --------------------------------------------
1087
1092
1088 - the "e-" branch renaming b to f (through 'g')
1093 - the "e-" branch renaming b to f (through 'g')
1089 - the "a-" branch renaming d to f (through e)
1094 - the "a-" branch renaming d to f (through e)
1090
1095
1091 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
1096 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
1092 o 20 mEAm-0 simple merge - the other way
1097 o 20 mEAm-0 simple merge - the other way
1093 |\
1098 |\
1094 +---o 19 mAEm-0 simple merge - one way
1099 +---o 19 mAEm-0 simple merge - one way
1095 | |/
1100 | |/
1096 | o 10 e-2 g -move-> f
1101 | o 10 e-2 g -move-> f
1097 | |
1102 | |
1098 | o 9 e-1 b -move-> g
1103 | o 9 e-1 b -move-> g
1099 | |
1104 | |
1100 o | 4 a-2: e -move-> f
1105 o | 4 a-2: e -move-> f
1101 | |
1106 | |
1102 o | 3 a-1: d -move-> e
1107 o | 3 a-1: d -move-> e
1103 |/
1108 |/
1104 o 2 i-2: c -move-> d
1109 o 2 i-2: c -move-> d
1105 |
1110 |
1106 o 1 i-1: a -move-> c
1111 o 1 i-1: a -move-> c
1107 |
1112 |
1108 o 0 i-0 initial commit: a b h
1113 o 0 i-0 initial commit: a b h
1109
1114
1110 #if no-changeset
1115 #if no-changeset
1111 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
1116 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
1112 c39c6083dad048d5138618a46f123e2f397f4f18 644 f
1117 c39c6083dad048d5138618a46f123e2f397f4f18 644 f
1113 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
1118 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
1114 a9a8bc3860c9d8fa5f2f7e6ea8d40498322737fd 644 f
1119 a9a8bc3860c9d8fa5f2f7e6ea8d40498322737fd 644 f
1115 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
1120 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
1116 263ea25e220aaeb7b9bac551c702037849aa75e8 644 f
1121 263ea25e220aaeb7b9bac551c702037849aa75e8 644 f
1117 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
1122 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
1118 71b9b7e73d973572ade6dd765477fcee6890e8b1 644 f
1123 71b9b7e73d973572ade6dd765477fcee6890e8b1 644 f
1119 $ hg debugindex f
1124 $ hg debugindex f
1120 rev linkrev nodeid p1 p2
1125 rev linkrev nodeid p1 p2
1121 0 4 263ea25e220a 000000000000 000000000000
1126 0 4 263ea25e220a 000000000000 000000000000
1122 1 10 71b9b7e73d97 000000000000 000000000000
1127 1 10 71b9b7e73d97 000000000000 000000000000
1123 2 19 c39c6083dad0 263ea25e220a 71b9b7e73d97
1128 2 19 c39c6083dad0 263ea25e220a 71b9b7e73d97
1124 3 20 a9a8bc3860c9 71b9b7e73d97 263ea25e220a
1129 3 20 a9a8bc3860c9 71b9b7e73d97 263ea25e220a
1125 #else
1130 #else
1126 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
1131 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
1127 498e8799f49f9da1ca06bb2d6d4accf165c5b572 644 f
1132 498e8799f49f9da1ca06bb2d6d4accf165c5b572 644 f
1128 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
1133 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
1129 c5b506a7118667a38a9c9348a1f63b679e382f57 644 f
1134 c5b506a7118667a38a9c9348a1f63b679e382f57 644 f
1130 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
1135 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
1131 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 f
1136 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 f
1132 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
1137 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
1133 1e88685f5ddec574a34c70af492f95b6debc8741 644 f
1138 1e88685f5ddec574a34c70af492f95b6debc8741 644 f
1134 $ hg debugindex f
1139 $ hg debugindex f
1135 rev linkrev nodeid p1 p2
1140 rev linkrev nodeid p1 p2
1136 0 4 b789fdd96dc2 000000000000 000000000000
1141 0 4 b789fdd96dc2 000000000000 000000000000
1137 1 10 1e88685f5dde 000000000000 000000000000
1142 1 10 1e88685f5dde 000000000000 000000000000
1138 2 19 498e8799f49f b789fdd96dc2 1e88685f5dde
1143 2 19 498e8799f49f b789fdd96dc2 1e88685f5dde
1139 3 20 c5b506a71186 1e88685f5dde b789fdd96dc2
1144 3 20 c5b506a71186 1e88685f5dde b789fdd96dc2
1140 #endif
1145 #endif
1141
1146
1142 # Here the filelog based implementation is not looking at the rename
1147 # Here the filelog based implementation is not looking at the rename
1143 # information (because the file exist on both side). However the changelog
1148 # information (because the file exist on both side). However the changelog
1144 # based on works fine. We have different output.
1149 # based on works fine. We have different output.
1145
1150
1146 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAEm-0")'
1151 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAEm-0")'
1147 M f
1152 M f
1148 b (no-filelog !)
1153 b (no-filelog !)
1149 R b
1154 R b
1150 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEAm-0")'
1155 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEAm-0")'
1151 M f
1156 M f
1152 b (no-filelog !)
1157 b (no-filelog !)
1153 R b
1158 R b
1154 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAEm-0")'
1159 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAEm-0")'
1155 M f
1160 M f
1156 d (no-filelog !)
1161 d (no-filelog !)
1157 R d
1162 R d
1158 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEAm-0")'
1163 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEAm-0")'
1159 M f
1164 M f
1160 d (no-filelog !)
1165 d (no-filelog !)
1161 R d
1166 R d
1162 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")'
1167 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")'
1163 A f
1168 A f
1164 d
1169 d
1165 R d
1170 R d
1166 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")'
1171 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")'
1167 A f
1172 A f
1168 b
1173 b
1169 R b
1174 R b
1170
1175
1171 # From here, we run status against revision where both source file exists.
1176 # From here, we run status against revision where both source file exists.
1172 #
1177 #
1173 # The filelog based implementation picks an arbitrary side based on revision
1178 # The filelog based implementation picks an arbitrary side based on revision
1174 # numbers. So the same side "wins" whatever the parents order is. This is
1179 # numbers. So the same side "wins" whatever the parents order is. This is
1175 # sub-optimal because depending on revision numbers means the result can be
1180 # sub-optimal because depending on revision numbers means the result can be
1176 # different from one repository to the next.
1181 # different from one repository to the next.
1177 #
1182 #
1178 # The changeset based algorithm use the parent order to break tie on conflicting
1183 # The changeset based algorithm use the parent order to break tie on conflicting
1179 # information and will have a different order depending on who is p1 and p2.
1184 # information and will have a different order depending on who is p1 and p2.
1180 # That order is stable accross repositories. (data from p1 prevails)
1185 # That order is stable accross repositories. (data from p1 prevails)
1181
1186
1182 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAEm-0")'
1187 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAEm-0")'
1183 A f
1188 A f
1184 d
1189 d
1185 R b
1190 R b
1186 R d
1191 R d
1187 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEAm-0")'
1192 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEAm-0")'
1188 A f
1193 A f
1189 d (filelog !)
1194 d (filelog !)
1190 b (no-filelog !)
1195 b (no-filelog !)
1191 R b
1196 R b
1192 R d
1197 R d
1193 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm-0")'
1198 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm-0")'
1194 A f
1199 A f
1195 a
1200 a
1196 R a
1201 R a
1197 R b
1202 R b
1198 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm-0")'
1203 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm-0")'
1199 A f
1204 A f
1200 a (filelog !)
1205 a (filelog !)
1201 b (no-filelog !)
1206 b (no-filelog !)
1202 R a
1207 R a
1203 R b
1208 R b
1204
1209
1205
1210
1206 Note:
1211 Note:
1207 | In this case, one of the merge wrongly record a merge while there is none.
1212 | In this case, one of the merge wrongly record a merge while there is none.
1208 | This lead to bad copy tracing information to be dug up.
1213 | This lead to bad copy tracing information to be dug up.
1209
1214
1210
1215
1211 Merge:
1216 Merge:
1212 - one with change to an unrelated file (b)
1217 - one with change to an unrelated file (b)
1213 - one overwriting a file (d) with a rename (from h to i to d)
1218 - one overwriting a file (d) with a rename (from h to i to d)
1214
1219
1215 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
1220 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
1216 o 24 mFBm-0 simple merge - the other way
1221 o 24 mFBm-0 simple merge - the other way
1217 |\
1222 |\
1218 +---o 23 mBFm-0 simple merge - one way
1223 +---o 23 mBFm-0 simple merge - one way
1219 | |/
1224 | |/
1220 | o 22 f-2: rename i -> d
1225 | o 22 f-2: rename i -> d
1221 | |
1226 | |
1222 | o 21 f-1: rename h -> i
1227 | o 21 f-1: rename h -> i
1223 | |
1228 | |
1224 o | 5 b-1: b update
1229 o | 5 b-1: b update
1225 |/
1230 |/
1226 o 2 i-2: c -move-> d
1231 o 2 i-2: c -move-> d
1227 |
1232 |
1228 o 1 i-1: a -move-> c
1233 o 1 i-1: a -move-> c
1229 |
1234 |
1230 o 0 i-0 initial commit: a b h
1235 o 0 i-0 initial commit: a b h
1231
1236
1232 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBFm-0")'
1237 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBFm-0")'
1233 M b
1238 M b
1234 A d
1239 A d
1235 h
1240 h
1236 R a
1241 R a
1237 R h
1242 R h
1238 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFBm-0")'
1243 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFBm-0")'
1239 M b
1244 M b
1240 A d
1245 A d
1241 h
1246 h
1242 R a
1247 R a
1243 R h
1248 R h
1244 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBFm-0")'
1249 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBFm-0")'
1245 M d
1250 M d
1246 h (no-filelog !)
1251 h (no-filelog !)
1247 R h
1252 R h
1248 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mBFm-0")'
1253 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mBFm-0")'
1249 M b
1254 M b
1250 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mBFm-0")'
1255 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mBFm-0")'
1251 M b
1256 M b
1252 M d
1257 M d
1253 i (no-filelog !)
1258 i (no-filelog !)
1254 R i
1259 R i
1255 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mFBm-0")'
1260 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mFBm-0")'
1256 M d
1261 M d
1257 h (no-filelog !)
1262 h (no-filelog !)
1258 R h
1263 R h
1259 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFBm-0")'
1264 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFBm-0")'
1260 M b
1265 M b
1261 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFBm-0")'
1266 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFBm-0")'
1262 M b
1267 M b
1263 M d
1268 M d
1264 i (no-filelog !)
1269 i (no-filelog !)
1265 R i
1270 R i
1266
1271
1267 #if no-changeset
1272 #if no-changeset
1268 $ hg log -Gfr 'desc("mBFm-0")' d
1273 $ hg log -Gfr 'desc("mBFm-0")' d
1269 o 22 f-2: rename i -> d
1274 o 22 f-2: rename i -> d
1270 |
1275 |
1271 o 21 f-1: rename h -> i
1276 o 21 f-1: rename h -> i
1272 :
1277 :
1273 o 0 i-0 initial commit: a b h
1278 o 0 i-0 initial commit: a b h
1274
1279
1275 #else
1280 #else
1276 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1281 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1277 $ hg log -Gfr 'desc("mBFm-0")' d
1282 $ hg log -Gfr 'desc("mBFm-0")' d
1278 o 22 f-2: rename i -> d
1283 o 22 f-2: rename i -> d
1279 |
1284 |
1280 ~
1285 ~
1281 #endif
1286 #endif
1282
1287
1283 #if no-changeset
1288 #if no-changeset
1284 $ hg log -Gfr 'desc("mFBm-0")' d
1289 $ hg log -Gfr 'desc("mFBm-0")' d
1285 o 22 f-2: rename i -> d
1290 o 22 f-2: rename i -> d
1286 |
1291 |
1287 o 21 f-1: rename h -> i
1292 o 21 f-1: rename h -> i
1288 :
1293 :
1289 o 0 i-0 initial commit: a b h
1294 o 0 i-0 initial commit: a b h
1290
1295
1291 #else
1296 #else
1292 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1297 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1293 $ hg log -Gfr 'desc("mFBm-0")' d
1298 $ hg log -Gfr 'desc("mFBm-0")' d
1294 o 22 f-2: rename i -> d
1299 o 22 f-2: rename i -> d
1295 |
1300 |
1296 ~
1301 ~
1297 #endif
1302 #endif
1298
1303
1299
1304
1300 Merge:
1305 Merge:
1301 - one with change to a file
1306 - one with change to a file
1302 - one deleting and recreating the file
1307 - one deleting and recreating the file
1303
1308
1304 Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
1309 Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
1305 consider history and rename on both branch of the merge.
1310 consider history and rename on both branch of the merge.
1306
1311
1307 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
1312 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
1308 o 27 mGDm-0 simple merge - the other way
1313 o 27 mGDm-0 simple merge - the other way
1309 |\
1314 |\
1310 +---o 26 mDGm-0 simple merge - one way
1315 +---o 26 mDGm-0 simple merge - one way
1311 | |/
1316 | |/
1312 | o 25 g-1: update d
1317 | o 25 g-1: update d
1313 | |
1318 | |
1314 o | 8 d-2 re-add d
1319 o | 8 d-2 re-add d
1315 | |
1320 | |
1316 o | 7 d-1 delete d
1321 o | 7 d-1 delete d
1317 |/
1322 |/
1318 o 2 i-2: c -move-> d
1323 o 2 i-2: c -move-> d
1319 |
1324 |
1320 o 1 i-1: a -move-> c
1325 o 1 i-1: a -move-> c
1321 |
1326 |
1322 o 0 i-0 initial commit: a b h
1327 o 0 i-0 initial commit: a b h
1323
1328
1324 One side of the merge have a long history with rename. The other side of the
1329 One side of the merge have a long history with rename. The other side of the
1325 merge point to a new file with a smaller history. Each side is "valid".
1330 merge point to a new file with a smaller history. Each side is "valid".
1326
1331
1327 (and again the filelog based algorithm only explore one, with a pick based on
1332 (and again the filelog based algorithm only explore one, with a pick based on
1328 revision numbers)
1333 revision numbers)
1329
1334
1330 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDGm-0")'
1335 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDGm-0")'
1331 A d
1336 A d
1332 a (filelog !)
1337 a (filelog !)
1333 R a
1338 R a
1334 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGDm-0")'
1339 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGDm-0")'
1335 A d
1340 A d
1336 a
1341 a
1337 R a
1342 R a
1338 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDGm-0")'
1343 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDGm-0")'
1339 M d
1344 M d
1340 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mGDm-0")'
1345 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mGDm-0")'
1341 M d
1346 M d
1342 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mDGm-0")'
1347 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mDGm-0")'
1343 M d
1348 M d
1344 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGDm-0")'
1349 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGDm-0")'
1345 M d
1350 M d
1346
1351
1347 #if no-changeset
1352 #if no-changeset
1348 $ hg log -Gfr 'desc("mDGm-0")' d
1353 $ hg log -Gfr 'desc("mDGm-0")' d
1349 o 26 mDGm-0 simple merge - one way
1354 o 26 mDGm-0 simple merge - one way
1350 |\
1355 |\
1351 | o 25 g-1: update d
1356 | o 25 g-1: update d
1352 | |
1357 | |
1353 o | 8 d-2 re-add d
1358 o | 8 d-2 re-add d
1354 |/
1359 |/
1355 o 2 i-2: c -move-> d
1360 o 2 i-2: c -move-> d
1356 |
1361 |
1357 o 1 i-1: a -move-> c
1362 o 1 i-1: a -move-> c
1358 |
1363 |
1359 o 0 i-0 initial commit: a b h
1364 o 0 i-0 initial commit: a b h
1360
1365
1361 #else
1366 #else
1362 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1367 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1363 $ hg log -Gfr 'desc("mDGm-0")' d
1368 $ hg log -Gfr 'desc("mDGm-0")' d
1364 o 26 mDGm-0 simple merge - one way
1369 o 26 mDGm-0 simple merge - one way
1365 |\
1370 |\
1366 | o 25 g-1: update d
1371 | o 25 g-1: update d
1367 | |
1372 | |
1368 o | 8 d-2 re-add d
1373 o | 8 d-2 re-add d
1369 |/
1374 |/
1370 o 2 i-2: c -move-> d
1375 o 2 i-2: c -move-> d
1371 |
1376 |
1372 ~
1377 ~
1373 #endif
1378 #endif
1374
1379
1375
1380
1376 #if no-changeset
1381 #if no-changeset
1377 $ hg log -Gfr 'desc("mDGm-0")' d
1382 $ hg log -Gfr 'desc("mDGm-0")' d
1378 o 26 mDGm-0 simple merge - one way
1383 o 26 mDGm-0 simple merge - one way
1379 |\
1384 |\
1380 | o 25 g-1: update d
1385 | o 25 g-1: update d
1381 | |
1386 | |
1382 o | 8 d-2 re-add d
1387 o | 8 d-2 re-add d
1383 |/
1388 |/
1384 o 2 i-2: c -move-> d
1389 o 2 i-2: c -move-> d
1385 |
1390 |
1386 o 1 i-1: a -move-> c
1391 o 1 i-1: a -move-> c
1387 |
1392 |
1388 o 0 i-0 initial commit: a b h
1393 o 0 i-0 initial commit: a b h
1389
1394
1390 #else
1395 #else
1391 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1396 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1392 $ hg log -Gfr 'desc("mDGm-0")' d
1397 $ hg log -Gfr 'desc("mDGm-0")' d
1393 o 26 mDGm-0 simple merge - one way
1398 o 26 mDGm-0 simple merge - one way
1394 |\
1399 |\
1395 | o 25 g-1: update d
1400 | o 25 g-1: update d
1396 | |
1401 | |
1397 o | 8 d-2 re-add d
1402 o | 8 d-2 re-add d
1398 |/
1403 |/
1399 o 2 i-2: c -move-> d
1404 o 2 i-2: c -move-> d
1400 |
1405 |
1401 ~
1406 ~
1402 #endif
1407 #endif
1403
1408
1404
1409
1405 Merge:
1410 Merge:
1406 - one with change to a file (d)
1411 - one with change to a file (d)
1407 - one overwriting that file with a rename (from h to i, to d)
1412 - one overwriting that file with a rename (from h to i, to d)
1408
1413
1409 This case is similar to BF/FB, but an actual merge happens, so both side of the
1414 This case is similar to BF/FB, but an actual merge happens, so both side of the
1410 history are relevant.
1415 history are relevant.
1411
1416
1412 Note:
1417 Note:
1413 | In this case, the merge get conflicting information since on one side we have
1418 | In this case, the merge get conflicting information since on one side we have
1414 | "a -> c -> d". and one the other one we have "h -> i -> d".
1419 | "a -> c -> d". and one the other one we have "h -> i -> d".
1415 |
1420 |
1416 | The current code arbitrarily pick one side
1421 | The current code arbitrarily pick one side
1417
1422
1418 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
1423 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
1419 o 29 mGFm-0 simple merge - the other way
1424 o 29 mGFm-0 simple merge - the other way
1420 |\
1425 |\
1421 +---o 28 mFGm-0 simple merge - one way
1426 +---o 28 mFGm-0 simple merge - one way
1422 | |/
1427 | |/
1423 | o 25 g-1: update d
1428 | o 25 g-1: update d
1424 | |
1429 | |
1425 o | 22 f-2: rename i -> d
1430 o | 22 f-2: rename i -> d
1426 | |
1431 | |
1427 o | 21 f-1: rename h -> i
1432 o | 21 f-1: rename h -> i
1428 |/
1433 |/
1429 o 2 i-2: c -move-> d
1434 o 2 i-2: c -move-> d
1430 |
1435 |
1431 o 1 i-1: a -move-> c
1436 o 1 i-1: a -move-> c
1432 |
1437 |
1433 o 0 i-0 initial commit: a b h
1438 o 0 i-0 initial commit: a b h
1434
1439
1435 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm-0")'
1440 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm-0")'
1436 A d
1441 A d
1437 h
1442 h
1438 R a
1443 R a
1439 R h
1444 R h
1440 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGFm-0")'
1445 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGFm-0")'
1441 A d
1446 A d
1442 a (no-filelog !)
1447 a (no-filelog !)
1443 h (filelog !)
1448 h (filelog !)
1444 R a
1449 R a
1445 R h
1450 R h
1446 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFGm-0")'
1451 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFGm-0")'
1447 M d
1452 M d
1448 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mGFm-0")'
1453 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mGFm-0")'
1449 M d
1454 M d
1450 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFGm-0")'
1455 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFGm-0")'
1451 M d
1456 M d
1452 i (no-filelog !)
1457 i (no-filelog !)
1453 R i
1458 R i
1454 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mGFm-0")'
1459 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mGFm-0")'
1455 M d
1460 M d
1456 i (no-filelog !)
1461 i (no-filelog !)
1457 R i
1462 R i
1458 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mFGm-0")'
1463 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mFGm-0")'
1459 M d
1464 M d
1460 h (no-filelog !)
1465 h (no-filelog !)
1461 R h
1466 R h
1462 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGFm-0")'
1467 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGFm-0")'
1463 M d
1468 M d
1464 h (no-filelog !)
1469 h (no-filelog !)
1465 R h
1470 R h
1466
1471
1467 #if no-changeset
1472 #if no-changeset
1468 $ hg log -Gfr 'desc("mFGm-0")' d
1473 $ hg log -Gfr 'desc("mFGm-0")' d
1469 o 28 mFGm-0 simple merge - one way
1474 o 28 mFGm-0 simple merge - one way
1470 |\
1475 |\
1471 | o 25 g-1: update d
1476 | o 25 g-1: update d
1472 | |
1477 | |
1473 o | 22 f-2: rename i -> d
1478 o | 22 f-2: rename i -> d
1474 | |
1479 | |
1475 o | 21 f-1: rename h -> i
1480 o | 21 f-1: rename h -> i
1476 |/
1481 |/
1477 o 2 i-2: c -move-> d
1482 o 2 i-2: c -move-> d
1478 |
1483 |
1479 o 1 i-1: a -move-> c
1484 o 1 i-1: a -move-> c
1480 |
1485 |
1481 o 0 i-0 initial commit: a b h
1486 o 0 i-0 initial commit: a b h
1482
1487
1483 #else
1488 #else
1484 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1489 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1485 $ hg log -Gfr 'desc("mFGm-0")' d
1490 $ hg log -Gfr 'desc("mFGm-0")' d
1486 o 28 mFGm-0 simple merge - one way
1491 o 28 mFGm-0 simple merge - one way
1487 |\
1492 |\
1488 | o 25 g-1: update d
1493 | o 25 g-1: update d
1489 | |
1494 | |
1490 o | 22 f-2: rename i -> d
1495 o | 22 f-2: rename i -> d
1491 |/
1496 |/
1492 o 2 i-2: c -move-> d
1497 o 2 i-2: c -move-> d
1493 |
1498 |
1494 ~
1499 ~
1495 #endif
1500 #endif
1496
1501
1497 #if no-changeset
1502 #if no-changeset
1498 $ hg log -Gfr 'desc("mGFm-0")' d
1503 $ hg log -Gfr 'desc("mGFm-0")' d
1499 o 29 mGFm-0 simple merge - the other way
1504 o 29 mGFm-0 simple merge - the other way
1500 |\
1505 |\
1501 | o 25 g-1: update d
1506 | o 25 g-1: update d
1502 | |
1507 | |
1503 o | 22 f-2: rename i -> d
1508 o | 22 f-2: rename i -> d
1504 | |
1509 | |
1505 o | 21 f-1: rename h -> i
1510 o | 21 f-1: rename h -> i
1506 |/
1511 |/
1507 o 2 i-2: c -move-> d
1512 o 2 i-2: c -move-> d
1508 |
1513 |
1509 o 1 i-1: a -move-> c
1514 o 1 i-1: a -move-> c
1510 |
1515 |
1511 o 0 i-0 initial commit: a b h
1516 o 0 i-0 initial commit: a b h
1512
1517
1513 #else
1518 #else
1514 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1519 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
1515 $ hg log -Gfr 'desc("mGFm-0")' d
1520 $ hg log -Gfr 'desc("mGFm-0")' d
1516 o 29 mGFm-0 simple merge - the other way
1521 o 29 mGFm-0 simple merge - the other way
1517 |\
1522 |\
1518 | o 25 g-1: update d
1523 | o 25 g-1: update d
1519 | |
1524 | |
1520 o | 22 f-2: rename i -> d
1525 o | 22 f-2: rename i -> d
1521 |/
1526 |/
1522 o 2 i-2: c -move-> d
1527 o 2 i-2: c -move-> d
1523 |
1528 |
1524 ~
1529 ~
1525 #endif
1530 #endif
1526
1531
1527
1532
1528 Comparing with merging with a deletion (and keeping the file)
1533 Comparing with merging with a deletion (and keeping the file)
1529 -------------------------------------------------------------
1534 -------------------------------------------------------------
1530
1535
1531 Merge:
1536 Merge:
1532 - one removing a file (d)
1537 - one removing a file (d)
1533 - one updating that file
1538 - one updating that file
1534 - the merge keep the modified version of the file (canceling the delete)
1539 - the merge keep the modified version of the file (canceling the delete)
1535
1540
1536 In this case, the file keep on living after the merge. So we should not drop its
1541 In this case, the file keep on living after the merge. So we should not drop its
1537 copy tracing chain.
1542 copy tracing chain.
1538
1543
1539 $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
1544 $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
1540 o 31 mGCm-0
1545 o 31 mGCm-0
1541 |\
1546 |\
1542 +---o 30 mCGm-0
1547 +---o 30 mCGm-0
1543 | |/
1548 | |/
1544 | o 25 g-1: update d
1549 | o 25 g-1: update d
1545 | |
1550 | |
1546 o | 6 c-1 delete d
1551 o | 6 c-1 delete d
1547 |/
1552 |/
1548 o 2 i-2: c -move-> d
1553 o 2 i-2: c -move-> d
1549 |
1554 |
1550 o 1 i-1: a -move-> c
1555 o 1 i-1: a -move-> c
1551 |
1556 |
1552 o 0 i-0 initial commit: a b h
1557 o 0 i-0 initial commit: a b h
1553
1558
1554
1559
1555 'a' is the copy source of 'd'
1560 'a' is the copy source of 'd'
1556
1561
1557 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCGm-0")'
1562 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCGm-0")'
1558 A d
1563 A d
1559 a (no-compatibility no-changeset !)
1564 a (no-compatibility no-changeset !)
1560 R a
1565 R a
1561 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGCm-0")'
1566 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGCm-0")'
1562 A d
1567 A d
1563 a (no-compatibility no-changeset !)
1568 a (no-compatibility no-changeset !)
1564 R a
1569 R a
1565 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCGm-0")'
1570 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCGm-0")'
1566 A d
1571 A d
1567 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mGCm-0")'
1572 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mGCm-0")'
1568 A d
1573 A d
1569 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mCGm-0")'
1574 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mCGm-0")'
1570 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGCm-0")'
1575 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGCm-0")'
1571
1576
1572
1577
1573 Comparing with merge restoring an untouched deleted file
1578 Comparing with merge restoring an untouched deleted file
1574 --------------------------------------------------------
1579 --------------------------------------------------------
1575
1580
1576 Merge:
1581 Merge:
1577 - one removing a file (d)
1582 - one removing a file (d)
1578 - one leaving the file untouched
1583 - one leaving the file untouched
1579 - the merge actively restore the file to the same content.
1584 - the merge actively restore the file to the same content.
1580
1585
1581 In this case, the file keep on living after the merge. So we should not drop its
1586 In this case, the file keep on living after the merge. So we should not drop its
1582 copy tracing chain.
1587 copy tracing chain.
1583
1588
1584 $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
1589 $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
1585 o 33 mBC-revert-m-0
1590 o 33 mBC-revert-m-0
1586 |\
1591 |\
1587 +---o 32 mCB-revert-m-0
1592 +---o 32 mCB-revert-m-0
1588 | |/
1593 | |/
1589 | o 6 c-1 delete d
1594 | o 6 c-1 delete d
1590 | |
1595 | |
1591 o | 5 b-1: b update
1596 o | 5 b-1: b update
1592 |/
1597 |/
1593 o 2 i-2: c -move-> d
1598 o 2 i-2: c -move-> d
1594 |
1599 |
1595 o 1 i-1: a -move-> c
1600 o 1 i-1: a -move-> c
1596 |
1601 |
1597 o 0 i-0 initial commit: a b h
1602 o 0 i-0 initial commit: a b h
1598
1603
1599
1604
1600 'a' is the the copy source of 'd'
1605 'a' is the the copy source of 'd'
1601
1606
1602 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB-revert-m-0")'
1607 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB-revert-m-0")'
1603 M b
1608 M b
1604 A d
1609 A d
1605 a (no-compatibility no-changeset !)
1610 a (no-compatibility no-changeset !)
1606 R a
1611 R a
1607 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC-revert-m-0")'
1612 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC-revert-m-0")'
1608 M b
1613 M b
1609 A d
1614 A d
1610 a (no-compatibility no-changeset !)
1615 a (no-compatibility no-changeset !)
1611 R a
1616 R a
1612 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCB-revert-m-0")'
1617 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCB-revert-m-0")'
1613 M b
1618 M b
1614 A d
1619 A d
1615 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBC-revert-m-0")'
1620 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBC-revert-m-0")'
1616 M b
1621 M b
1617 A d
1622 A d
1618 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCB-revert-m-0")'
1623 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCB-revert-m-0")'
1619 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBC-revert-m-0")'
1624 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBC-revert-m-0")'
1620
1625
1621
1626
1622 Merging a branch where a rename was deleted with a branch where the same file was renamed
1627 Merging a branch where a rename was deleted with a branch where the same file was renamed
1623 ------------------------------------------------------------------------------------------
1628 ------------------------------------------------------------------------------------------
1624
1629
1625 Create a "conflicting" merge where `d` get removed on one branch before its
1630 Create a "conflicting" merge where `d` get removed on one branch before its
1626 rename information actually conflict with the other branch.
1631 rename information actually conflict with the other branch.
1627
1632
1628 (the copy information from the branch that was not deleted should win).
1633 (the copy information from the branch that was not deleted should win).
1629
1634
1630 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
1635 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
1631 @ 36 mHC-delete-before-conflict-m-0
1636 @ 36 mHC-delete-before-conflict-m-0
1632 |\
1637 |\
1633 +---o 35 mCH-delete-before-conflict-m-0
1638 +---o 35 mCH-delete-before-conflict-m-0
1634 | |/
1639 | |/
1635 | o 34 h-1: b -(move)-> d
1640 | o 34 h-1: b -(move)-> d
1636 | |
1641 | |
1637 o | 6 c-1 delete d
1642 o | 6 c-1 delete d
1638 | |
1643 | |
1639 o | 2 i-2: c -move-> d
1644 o | 2 i-2: c -move-> d
1640 | |
1645 | |
1641 o | 1 i-1: a -move-> c
1646 o | 1 i-1: a -move-> c
1642 |/
1647 |/
1643 o 0 i-0 initial commit: a b h
1648 o 0 i-0 initial commit: a b h
1644
1649
1645
1650
1646 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCH-delete-before-conflict-m")'
1651 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCH-delete-before-conflict-m")'
1647 A d
1652 A d
1648 b (no-compatibility no-changeset !)
1653 b (no-compatibility no-changeset !)
1649 R a
1654 R a
1650 R b
1655 R b
1651 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mHC-delete-before-conflict-m")'
1656 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mHC-delete-before-conflict-m")'
1652 A d
1657 A d
1653 b
1658 b
1654 R a
1659 R a
1655 R b
1660 R b
1656 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCH-delete-before-conflict-m")'
1661 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCH-delete-before-conflict-m")'
1657 A d
1662 A d
1658 b
1663 b
1659 R b
1664 R b
1660 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mHC-delete-before-conflict-m")'
1665 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mHC-delete-before-conflict-m")'
1661 A d
1666 A d
1662 b
1667 b
1663 R b
1668 R b
1664 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mCH-delete-before-conflict-m")'
1669 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mCH-delete-before-conflict-m")'
1665 R a
1670 R a
1666 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mHC-delete-before-conflict-m")'
1671 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mHC-delete-before-conflict-m")'
1667 R a
1672 R a
@@ -1,698 +1,703 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.worker-enable = False
68 > lfs.worker-enable = False
69 > [lfs]
69 > [lfs]
70 > threshold=10
70 > threshold=10
71 > [web]
71 > [web]
72 > allow_push=*
72 > allow_push=*
73 > push_ssl=False
73 > push_ssl=False
74 > EOF
74 > EOF
75
75
76 $ cp $HGRCPATH $HGRCPATH.orig
76 $ cp $HGRCPATH $HGRCPATH.orig
77
77
78 #if lfsremote-on
78 #if lfsremote-on
79 $ hg --config extensions.lfs= -R server \
79 $ hg --config extensions.lfs= -R server \
80 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log
80 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log
81 #else
81 #else
82 $ hg --config extensions.lfs=! -R server \
82 $ hg --config extensions.lfs=! -R server \
83 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log
83 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log
84 #endif
84 #endif
85
85
86 $ cat hg.pid >> $DAEMON_PIDS
86 $ cat hg.pid >> $DAEMON_PIDS
87 $ hg clone -q http://localhost:$HGPORT client
87 $ hg clone -q http://localhost:$HGPORT client
88 $ grep 'lfs' client/.hg/requires $SERVER_REQUIRES
88 $ grep 'lfs' client/.hg/requires $SERVER_REQUIRES
89 [1]
89 [1]
90
90
91 This trivial repo will force commandserver to load the extension, but not call
91 This trivial repo will force commandserver to load the extension, but not call
92 reposetup() on another repo actually being operated on. This gives coverage
92 reposetup() on another repo actually being operated on. This gives coverage
93 that wrapper functions are not assuming reposetup() was called.
93 that wrapper functions are not assuming reposetup() was called.
94
94
95 $ hg init $TESTTMP/cmdservelfs
95 $ hg init $TESTTMP/cmdservelfs
96 $ cat >> $TESTTMP/cmdservelfs/.hg/hgrc << EOF
96 $ cat >> $TESTTMP/cmdservelfs/.hg/hgrc << EOF
97 > [extensions]
97 > [extensions]
98 > lfs =
98 > lfs =
99 > EOF
99 > EOF
100
100
101 --------------------------------------------------------------------------------
101 --------------------------------------------------------------------------------
102 Case #1: client with non-lfs content and the extension disabled; server with
102 Case #1: client with non-lfs content and the extension disabled; server with
103 non-lfs content, and the extension enabled.
103 non-lfs content, and the extension enabled.
104
104
105 $ cd client
105 $ cd client
106 $ echo 'non-lfs' > nonlfs.txt
106 $ echo 'non-lfs' > nonlfs.txt
107 >>> from __future__ import absolute_import
107 >>> from __future__ import absolute_import
108 >>> from hgclient import check, readchannel, runcommand
108 >>> from hgclient import check, readchannel, runcommand
109 >>> @check
109 >>> @check
110 ... def diff(server):
110 ... def diff(server):
111 ... readchannel(server)
111 ... readchannel(server)
112 ... # run an arbitrary command in the repo with the extension loaded
112 ... # run an arbitrary command in the repo with the extension loaded
113 ... runcommand(server, [b'id', b'-R', b'../cmdservelfs'])
113 ... runcommand(server, [b'id', b'-R', b'../cmdservelfs'])
114 ... # now run a command in a repo without the extension to ensure that
114 ... # now run a command in a repo without the extension to ensure that
115 ... # files are added safely..
115 ... # files are added safely..
116 ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs'])
116 ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs'])
117 ... # .. and that scmutil.prefetchfiles() safely no-ops..
117 ... # .. and that scmutil.prefetchfiles() safely no-ops..
118 ... runcommand(server, [b'diff', b'-r', b'.~1'])
118 ... runcommand(server, [b'diff', b'-r', b'.~1'])
119 ... # .. and that debugupgraderepo safely no-ops.
119 ... # .. and that debugupgraderepo safely no-ops.
120 ... runcommand(server, [b'debugupgraderepo', b'-q', b'--run'])
120 ... runcommand(server, [b'debugupgraderepo', b'-q', b'--run'])
121 *** runcommand id -R ../cmdservelfs
121 *** runcommand id -R ../cmdservelfs
122 000000000000 tip
122 000000000000 tip
123 *** runcommand ci -Aqm non-lfs
123 *** runcommand ci -Aqm non-lfs
124 *** runcommand diff -r .~1
124 *** runcommand diff -r .~1
125 diff -r 000000000000 nonlfs.txt
125 diff -r 000000000000 nonlfs.txt
126 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
126 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
127 +++ b/nonlfs.txt Thu Jan 01 00:00:00 1970 +0000
127 +++ b/nonlfs.txt Thu Jan 01 00:00:00 1970 +0000
128 @@ -0,0 +1,1 @@
128 @@ -0,0 +1,1 @@
129 +non-lfs
129 +non-lfs
130 *** runcommand debugupgraderepo -q --run
130 *** runcommand debugupgraderepo -q --run
131 upgrade will perform the following actions:
131 upgrade will perform the following actions:
132
132
133 requirements
133 requirements
134 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
134 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
135
135
136 processed revlogs:
137 - all-filelogs
138 - changelog
139 - manifest
140
136
141
137 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
142 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
138 [1]
143 [1]
139
144
140 #if lfsremote-on
145 #if lfsremote-on
141
146
142 $ hg push -q
147 $ hg push -q
143 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
148 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
144 [1]
149 [1]
145
150
146 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client1_clone
151 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client1_clone
147 $ grep 'lfs' $TESTTMP/client1_clone/.hg/requires $SERVER_REQUIRES
152 $ grep 'lfs' $TESTTMP/client1_clone/.hg/requires $SERVER_REQUIRES
148 [1]
153 [1]
149
154
150 $ hg init $TESTTMP/client1_pull
155 $ hg init $TESTTMP/client1_pull
151 $ hg -R $TESTTMP/client1_pull pull -q http://localhost:$HGPORT
156 $ hg -R $TESTTMP/client1_pull pull -q http://localhost:$HGPORT
152 $ grep 'lfs' $TESTTMP/client1_pull/.hg/requires $SERVER_REQUIRES
157 $ grep 'lfs' $TESTTMP/client1_pull/.hg/requires $SERVER_REQUIRES
153 [1]
158 [1]
154
159
155 $ hg identify http://localhost:$HGPORT
160 $ hg identify http://localhost:$HGPORT
156 d437e1d24fbd
161 d437e1d24fbd
157
162
158 #endif
163 #endif
159
164
160 --------------------------------------------------------------------------------
165 --------------------------------------------------------------------------------
161 Case #2: client with non-lfs content and the extension enabled; server with
166 Case #2: client with non-lfs content and the extension enabled; server with
162 non-lfs content, and the extension state controlled by #testcases.
167 non-lfs content, and the extension state controlled by #testcases.
163
168
164 $ cat >> $HGRCPATH <<EOF
169 $ cat >> $HGRCPATH <<EOF
165 > [extensions]
170 > [extensions]
166 > lfs =
171 > lfs =
167 > EOF
172 > EOF
168 $ echo 'non-lfs' > nonlfs2.txt
173 $ echo 'non-lfs' > nonlfs2.txt
169 $ hg ci -Aqm 'non-lfs file with lfs client'
174 $ hg ci -Aqm 'non-lfs file with lfs client'
170
175
171 Since no lfs content has been added yet, the push is allowed, even when the
176 Since no lfs content has been added yet, the push is allowed, even when the
172 extension is not enabled remotely.
177 extension is not enabled remotely.
173
178
174 $ hg push -q
179 $ hg push -q
175 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
180 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
176 [1]
181 [1]
177
182
178 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client2_clone
183 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client2_clone
179 $ grep 'lfs' $TESTTMP/client2_clone/.hg/requires $SERVER_REQUIRES
184 $ grep 'lfs' $TESTTMP/client2_clone/.hg/requires $SERVER_REQUIRES
180 [1]
185 [1]
181
186
182 $ hg init $TESTTMP/client2_pull
187 $ hg init $TESTTMP/client2_pull
183 $ hg -R $TESTTMP/client2_pull pull -q http://localhost:$HGPORT
188 $ hg -R $TESTTMP/client2_pull pull -q http://localhost:$HGPORT
184 $ grep 'lfs' $TESTTMP/client2_pull/.hg/requires $SERVER_REQUIRES
189 $ grep 'lfs' $TESTTMP/client2_pull/.hg/requires $SERVER_REQUIRES
185 [1]
190 [1]
186
191
187 $ hg identify http://localhost:$HGPORT
192 $ hg identify http://localhost:$HGPORT
188 1477875038c6
193 1477875038c6
189
194
190 --------------------------------------------------------------------------------
195 --------------------------------------------------------------------------------
191 Case #3: client with lfs content and the extension enabled; server with
196 Case #3: client with lfs content and the extension enabled; server with
192 non-lfs content, and the extension state controlled by #testcases. The server
197 non-lfs content, and the extension state controlled by #testcases. The server
193 should have an 'lfs' requirement after it picks up its first commit with a blob.
198 should have an 'lfs' requirement after it picks up its first commit with a blob.
194
199
195 $ echo 'this is a big lfs file' > lfs.bin
200 $ echo 'this is a big lfs file' > lfs.bin
196 $ hg ci -Aqm 'lfs'
201 $ hg ci -Aqm 'lfs'
197 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
202 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
198 .hg/requires:lfs
203 .hg/requires:lfs
199
204
200 #if lfsremote-off
205 #if lfsremote-off
201 $ hg push -q
206 $ hg push -q
202 abort: required features are not supported in the destination: lfs
207 abort: required features are not supported in the destination: lfs
203 (enable the lfs extension on the server)
208 (enable the lfs extension on the server)
204 [255]
209 [255]
205 #else
210 #else
206 $ hg push -q
211 $ hg push -q
207 #endif
212 #endif
208 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
213 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
209 .hg/requires:lfs
214 .hg/requires:lfs
210 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
215 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
211
216
212 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client3_clone
217 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client3_clone
213 $ grep 'lfs' $TESTTMP/client3_clone/.hg/requires $SERVER_REQUIRES || true
218 $ grep 'lfs' $TESTTMP/client3_clone/.hg/requires $SERVER_REQUIRES || true
214 $TESTTMP/client3_clone/.hg/requires:lfs (lfsremote-on !)
219 $TESTTMP/client3_clone/.hg/requires:lfs (lfsremote-on !)
215 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
220 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
216
221
217 $ hg init $TESTTMP/client3_pull
222 $ hg init $TESTTMP/client3_pull
218 $ hg -R $TESTTMP/client3_pull pull -q http://localhost:$HGPORT
223 $ hg -R $TESTTMP/client3_pull pull -q http://localhost:$HGPORT
219 $ grep 'lfs' $TESTTMP/client3_pull/.hg/requires $SERVER_REQUIRES || true
224 $ grep 'lfs' $TESTTMP/client3_pull/.hg/requires $SERVER_REQUIRES || true
220 $TESTTMP/client3_pull/.hg/requires:lfs (lfsremote-on !)
225 $TESTTMP/client3_pull/.hg/requires:lfs (lfsremote-on !)
221 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
226 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
222
227
223 Test that the commit/changegroup requirement check hook can be run multiple
228 Test that the commit/changegroup requirement check hook can be run multiple
224 times.
229 times.
225
230
226 $ hg clone -qr 0 http://localhost:$HGPORT $TESTTMP/cmdserve_client3
231 $ hg clone -qr 0 http://localhost:$HGPORT $TESTTMP/cmdserve_client3
227
232
228 $ cd ../cmdserve_client3
233 $ cd ../cmdserve_client3
229
234
230 >>> from __future__ import absolute_import
235 >>> from __future__ import absolute_import
231 >>> from hgclient import check, readchannel, runcommand
236 >>> from hgclient import check, readchannel, runcommand
232 >>> @check
237 >>> @check
233 ... def addrequirement(server):
238 ... def addrequirement(server):
234 ... readchannel(server)
239 ... readchannel(server)
235 ... # change the repo in a way that adds the lfs requirement
240 ... # change the repo in a way that adds the lfs requirement
236 ... runcommand(server, [b'pull', b'-qu'])
241 ... runcommand(server, [b'pull', b'-qu'])
237 ... # Now cause the requirement adding hook to fire again, without going
242 ... # Now cause the requirement adding hook to fire again, without going
238 ... # through reposetup() again.
243 ... # through reposetup() again.
239 ... with open('file.txt', 'wb') as fp:
244 ... with open('file.txt', 'wb') as fp:
240 ... fp.write(b'data')
245 ... fp.write(b'data')
241 ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs'])
246 ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs'])
242 *** runcommand pull -qu
247 *** runcommand pull -qu
243 *** runcommand ci -Aqm non-lfs
248 *** runcommand ci -Aqm non-lfs
244
249
245 $ cd ../client
250 $ cd ../client
246
251
247 The difference here is the push failed above when the extension isn't
252 The difference here is the push failed above when the extension isn't
248 enabled on the server.
253 enabled on the server.
249 $ hg identify http://localhost:$HGPORT
254 $ hg identify http://localhost:$HGPORT
250 8374dc4052cb (lfsremote-on !)
255 8374dc4052cb (lfsremote-on !)
251 1477875038c6 (lfsremote-off !)
256 1477875038c6 (lfsremote-off !)
252
257
253 Don't bother testing the lfsremote-off cases- the server won't be able
258 Don't bother testing the lfsremote-off cases- the server won't be able
254 to launch if there's lfs content and the extension is disabled.
259 to launch if there's lfs content and the extension is disabled.
255
260
256 #if lfsremote-on
261 #if lfsremote-on
257
262
258 --------------------------------------------------------------------------------
263 --------------------------------------------------------------------------------
259 Case #4: client with non-lfs content and the extension disabled; server with
264 Case #4: client with non-lfs content and the extension disabled; server with
260 lfs content, and the extension enabled.
265 lfs content, and the extension enabled.
261
266
262 $ cat >> $HGRCPATH <<EOF
267 $ cat >> $HGRCPATH <<EOF
263 > [extensions]
268 > [extensions]
264 > lfs = !
269 > lfs = !
265 > EOF
270 > EOF
266
271
267 $ hg init $TESTTMP/client4
272 $ hg init $TESTTMP/client4
268 $ cd $TESTTMP/client4
273 $ cd $TESTTMP/client4
269 $ cat >> .hg/hgrc <<EOF
274 $ cat >> .hg/hgrc <<EOF
270 > [paths]
275 > [paths]
271 > default = http://localhost:$HGPORT
276 > default = http://localhost:$HGPORT
272 > EOF
277 > EOF
273 $ echo 'non-lfs' > nonlfs2.txt
278 $ echo 'non-lfs' > nonlfs2.txt
274 $ hg ci -Aqm 'non-lfs'
279 $ hg ci -Aqm 'non-lfs'
275 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
280 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
276 $TESTTMP/server/.hg/requires:lfs
281 $TESTTMP/server/.hg/requires:lfs
277
282
278 $ hg push -q --force
283 $ hg push -q --force
279 warning: repository is unrelated
284 warning: repository is unrelated
280 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
285 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
281 $TESTTMP/server/.hg/requires:lfs
286 $TESTTMP/server/.hg/requires:lfs
282
287
283 $ hg clone http://localhost:$HGPORT $TESTTMP/client4_clone
288 $ hg clone http://localhost:$HGPORT $TESTTMP/client4_clone
284 (remote is using large file support (lfs), but it is explicitly disabled in the local configuration)
289 (remote is using large file support (lfs), but it is explicitly disabled in the local configuration)
285 abort: repository requires features unknown to this Mercurial: lfs
290 abort: repository requires features unknown to this Mercurial: lfs
286 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
291 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
287 [255]
292 [255]
288 $ grep 'lfs' $TESTTMP/client4_clone/.hg/requires $SERVER_REQUIRES
293 $ grep 'lfs' $TESTTMP/client4_clone/.hg/requires $SERVER_REQUIRES
289 grep: $TESTTMP/client4_clone/.hg/requires: $ENOENT$
294 grep: $TESTTMP/client4_clone/.hg/requires: $ENOENT$
290 $TESTTMP/server/.hg/requires:lfs
295 $TESTTMP/server/.hg/requires:lfs
291 [2]
296 [2]
292
297
293 TODO: fail more gracefully.
298 TODO: fail more gracefully.
294
299
295 $ hg init $TESTTMP/client4_pull
300 $ hg init $TESTTMP/client4_pull
296 $ hg -R $TESTTMP/client4_pull pull http://localhost:$HGPORT
301 $ hg -R $TESTTMP/client4_pull pull http://localhost:$HGPORT
297 pulling from http://localhost:$HGPORT/
302 pulling from http://localhost:$HGPORT/
298 requesting all changes
303 requesting all changes
299 remote: abort: no common changegroup version
304 remote: abort: no common changegroup version
300 abort: pull failed on remote
305 abort: pull failed on remote
301 [255]
306 [255]
302 $ grep 'lfs' $TESTTMP/client4_pull/.hg/requires $SERVER_REQUIRES
307 $ grep 'lfs' $TESTTMP/client4_pull/.hg/requires $SERVER_REQUIRES
303 $TESTTMP/server/.hg/requires:lfs
308 $TESTTMP/server/.hg/requires:lfs
304
309
305 $ hg identify http://localhost:$HGPORT
310 $ hg identify http://localhost:$HGPORT
306 03b080fa9d93
311 03b080fa9d93
307
312
308 --------------------------------------------------------------------------------
313 --------------------------------------------------------------------------------
309 Case #5: client with non-lfs content and the extension enabled; server with
314 Case #5: client with non-lfs content and the extension enabled; server with
310 lfs content, and the extension enabled.
315 lfs content, and the extension enabled.
311
316
312 $ cat >> $HGRCPATH <<EOF
317 $ cat >> $HGRCPATH <<EOF
313 > [extensions]
318 > [extensions]
314 > lfs =
319 > lfs =
315 > EOF
320 > EOF
316 $ echo 'non-lfs' > nonlfs3.txt
321 $ echo 'non-lfs' > nonlfs3.txt
317 $ hg ci -Aqm 'non-lfs file with lfs client'
322 $ hg ci -Aqm 'non-lfs file with lfs client'
318
323
319 $ hg push -q
324 $ hg push -q
320 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
325 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
321 $TESTTMP/server/.hg/requires:lfs
326 $TESTTMP/server/.hg/requires:lfs
322
327
323 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client5_clone
328 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client5_clone
324 $ grep 'lfs' $TESTTMP/client5_clone/.hg/requires $SERVER_REQUIRES
329 $ grep 'lfs' $TESTTMP/client5_clone/.hg/requires $SERVER_REQUIRES
325 $TESTTMP/client5_clone/.hg/requires:lfs
330 $TESTTMP/client5_clone/.hg/requires:lfs
326 $TESTTMP/server/.hg/requires:lfs
331 $TESTTMP/server/.hg/requires:lfs
327
332
328 $ hg init $TESTTMP/client5_pull
333 $ hg init $TESTTMP/client5_pull
329 $ hg -R $TESTTMP/client5_pull pull -q http://localhost:$HGPORT
334 $ hg -R $TESTTMP/client5_pull pull -q http://localhost:$HGPORT
330 $ grep 'lfs' $TESTTMP/client5_pull/.hg/requires $SERVER_REQUIRES
335 $ grep 'lfs' $TESTTMP/client5_pull/.hg/requires $SERVER_REQUIRES
331 $TESTTMP/client5_pull/.hg/requires:lfs
336 $TESTTMP/client5_pull/.hg/requires:lfs
332 $TESTTMP/server/.hg/requires:lfs
337 $TESTTMP/server/.hg/requires:lfs
333
338
334 $ hg identify http://localhost:$HGPORT
339 $ hg identify http://localhost:$HGPORT
335 c729025cc5e3
340 c729025cc5e3
336
341
337 $ mv $HGRCPATH $HGRCPATH.tmp
342 $ mv $HGRCPATH $HGRCPATH.tmp
338 $ cp $HGRCPATH.orig $HGRCPATH
343 $ cp $HGRCPATH.orig $HGRCPATH
339
344
340 >>> from __future__ import absolute_import
345 >>> from __future__ import absolute_import
341 >>> from hgclient import bprint, check, readchannel, runcommand, stdout
346 >>> from hgclient import bprint, check, readchannel, runcommand, stdout
342 >>> @check
347 >>> @check
343 ... def checkflags(server):
348 ... def checkflags(server):
344 ... readchannel(server)
349 ... readchannel(server)
345 ... bprint(b'')
350 ... bprint(b'')
346 ... bprint(b'# LFS required- both lfs and non-lfs revlogs have 0x2000 flag')
351 ... bprint(b'# LFS required- both lfs and non-lfs revlogs have 0x2000 flag')
347 ... stdout.flush()
352 ... stdout.flush()
348 ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
353 ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
349 ... b'../server'])
354 ... b'../server'])
350 ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
355 ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
351 ... b'../server'])
356 ... b'../server'])
352 ... runcommand(server, [b'config', b'extensions', b'--cwd',
357 ... runcommand(server, [b'config', b'extensions', b'--cwd',
353 ... b'../server'])
358 ... b'../server'])
354 ...
359 ...
355 ... bprint(b"\n# LFS not enabled- revlogs don't have 0x2000 flag")
360 ... bprint(b"\n# LFS not enabled- revlogs don't have 0x2000 flag")
356 ... stdout.flush()
361 ... stdout.flush()
357 ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
362 ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
358 ... runcommand(server, [b'config', b'extensions'])
363 ... runcommand(server, [b'config', b'extensions'])
359
364
360 # LFS required- both lfs and non-lfs revlogs have 0x2000 flag
365 # LFS required- both lfs and non-lfs revlogs have 0x2000 flag
361 *** runcommand debugprocessors lfs.bin -R ../server
366 *** runcommand debugprocessors lfs.bin -R ../server
362 registered processor '0x8000'
367 registered processor '0x8000'
363 registered processor '0x800'
368 registered processor '0x800'
364 registered processor '0x2000'
369 registered processor '0x2000'
365 *** runcommand debugprocessors nonlfs2.txt -R ../server
370 *** runcommand debugprocessors nonlfs2.txt -R ../server
366 registered processor '0x8000'
371 registered processor '0x8000'
367 registered processor '0x800'
372 registered processor '0x800'
368 registered processor '0x2000'
373 registered processor '0x2000'
369 *** runcommand config extensions --cwd ../server
374 *** runcommand config extensions --cwd ../server
370 extensions.debugprocessors=$TESTTMP/debugprocessors.py
375 extensions.debugprocessors=$TESTTMP/debugprocessors.py
371 extensions.lfs=
376 extensions.lfs=
372
377
373 # LFS not enabled- revlogs don't have 0x2000 flag
378 # LFS not enabled- revlogs don't have 0x2000 flag
374 *** runcommand debugprocessors nonlfs3.txt
379 *** runcommand debugprocessors nonlfs3.txt
375 registered processor '0x8000'
380 registered processor '0x8000'
376 registered processor '0x800'
381 registered processor '0x800'
377 *** runcommand config extensions
382 *** runcommand config extensions
378 extensions.debugprocessors=$TESTTMP/debugprocessors.py
383 extensions.debugprocessors=$TESTTMP/debugprocessors.py
379
384
380 $ rm $HGRCPATH
385 $ rm $HGRCPATH
381 $ mv $HGRCPATH.tmp $HGRCPATH
386 $ mv $HGRCPATH.tmp $HGRCPATH
382
387
383 $ hg clone $TESTTMP/client $TESTTMP/nonlfs -qr 0 --config extensions.lfs=
388 $ hg clone $TESTTMP/client $TESTTMP/nonlfs -qr 0 --config extensions.lfs=
384 $ cat >> $TESTTMP/nonlfs/.hg/hgrc <<EOF
389 $ cat >> $TESTTMP/nonlfs/.hg/hgrc <<EOF
385 > [extensions]
390 > [extensions]
386 > lfs = !
391 > lfs = !
387 > EOF
392 > EOF
388
393
389 >>> from __future__ import absolute_import, print_function
394 >>> from __future__ import absolute_import, print_function
390 >>> from hgclient import bprint, check, readchannel, runcommand, stdout
395 >>> from hgclient import bprint, check, readchannel, runcommand, stdout
391 >>> @check
396 >>> @check
392 ... def checkflags2(server):
397 ... def checkflags2(server):
393 ... readchannel(server)
398 ... readchannel(server)
394 ... bprint(b'')
399 ... bprint(b'')
395 ... bprint(b'# LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag')
400 ... bprint(b'# LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag')
396 ... stdout.flush()
401 ... stdout.flush()
397 ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
402 ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
398 ... b'../server'])
403 ... b'../server'])
399 ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
404 ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
400 ... b'../server'])
405 ... b'../server'])
401 ... runcommand(server, [b'config', b'extensions', b'--cwd',
406 ... runcommand(server, [b'config', b'extensions', b'--cwd',
402 ... b'../server'])
407 ... b'../server'])
403 ...
408 ...
404 ... bprint(b'\n# LFS enabled without requirement- revlogs have 0x2000 flag')
409 ... bprint(b'\n# LFS enabled without requirement- revlogs have 0x2000 flag')
405 ... stdout.flush()
410 ... stdout.flush()
406 ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
411 ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
407 ... runcommand(server, [b'config', b'extensions'])
412 ... runcommand(server, [b'config', b'extensions'])
408 ...
413 ...
409 ... bprint(b"\n# LFS disabled locally- revlogs don't have 0x2000 flag")
414 ... bprint(b"\n# LFS disabled locally- revlogs don't have 0x2000 flag")
410 ... stdout.flush()
415 ... stdout.flush()
411 ... runcommand(server, [b'debugprocessors', b'nonlfs.txt', b'-R',
416 ... runcommand(server, [b'debugprocessors', b'nonlfs.txt', b'-R',
412 ... b'../nonlfs'])
417 ... b'../nonlfs'])
413 ... runcommand(server, [b'config', b'extensions', b'--cwd',
418 ... runcommand(server, [b'config', b'extensions', b'--cwd',
414 ... b'../nonlfs'])
419 ... b'../nonlfs'])
415
420
416 # LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag
421 # LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag
417 *** runcommand debugprocessors lfs.bin -R ../server
422 *** runcommand debugprocessors lfs.bin -R ../server
418 registered processor '0x8000'
423 registered processor '0x8000'
419 registered processor '0x800'
424 registered processor '0x800'
420 registered processor '0x2000'
425 registered processor '0x2000'
421 *** runcommand debugprocessors nonlfs2.txt -R ../server
426 *** runcommand debugprocessors nonlfs2.txt -R ../server
422 registered processor '0x8000'
427 registered processor '0x8000'
423 registered processor '0x800'
428 registered processor '0x800'
424 registered processor '0x2000'
429 registered processor '0x2000'
425 *** runcommand config extensions --cwd ../server
430 *** runcommand config extensions --cwd ../server
426 extensions.debugprocessors=$TESTTMP/debugprocessors.py
431 extensions.debugprocessors=$TESTTMP/debugprocessors.py
427 extensions.lfs=
432 extensions.lfs=
428
433
429 # LFS enabled without requirement- revlogs have 0x2000 flag
434 # LFS enabled without requirement- revlogs have 0x2000 flag
430 *** runcommand debugprocessors nonlfs3.txt
435 *** runcommand debugprocessors nonlfs3.txt
431 registered processor '0x8000'
436 registered processor '0x8000'
432 registered processor '0x800'
437 registered processor '0x800'
433 registered processor '0x2000'
438 registered processor '0x2000'
434 *** runcommand config extensions
439 *** runcommand config extensions
435 extensions.debugprocessors=$TESTTMP/debugprocessors.py
440 extensions.debugprocessors=$TESTTMP/debugprocessors.py
436 extensions.lfs=
441 extensions.lfs=
437
442
438 # LFS disabled locally- revlogs don't have 0x2000 flag
443 # LFS disabled locally- revlogs don't have 0x2000 flag
439 *** runcommand debugprocessors nonlfs.txt -R ../nonlfs
444 *** runcommand debugprocessors nonlfs.txt -R ../nonlfs
440 registered processor '0x8000'
445 registered processor '0x8000'
441 registered processor '0x800'
446 registered processor '0x800'
442 *** runcommand config extensions --cwd ../nonlfs
447 *** runcommand config extensions --cwd ../nonlfs
443 extensions.debugprocessors=$TESTTMP/debugprocessors.py
448 extensions.debugprocessors=$TESTTMP/debugprocessors.py
444 extensions.lfs=!
449 extensions.lfs=!
445
450
446 --------------------------------------------------------------------------------
451 --------------------------------------------------------------------------------
447 Case #6: client with lfs content and the extension enabled; server with
452 Case #6: client with lfs content and the extension enabled; server with
448 lfs content, and the extension enabled.
453 lfs content, and the extension enabled.
449
454
450 $ echo 'this is another lfs file' > lfs2.txt
455 $ echo 'this is another lfs file' > lfs2.txt
451 $ hg ci -Aqm 'lfs file with lfs client'
456 $ hg ci -Aqm 'lfs file with lfs client'
452
457
453 $ hg --config paths.default= push -v http://localhost:$HGPORT
458 $ hg --config paths.default= push -v http://localhost:$HGPORT
454 pushing to http://localhost:$HGPORT/
459 pushing to http://localhost:$HGPORT/
455 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
460 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
456 searching for changes
461 searching for changes
457 remote has heads on branch 'default' that are not known locally: 8374dc4052cb
462 remote has heads on branch 'default' that are not known locally: 8374dc4052cb
458 lfs: uploading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
463 lfs: uploading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
459 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
464 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
460 lfs: uploaded 1 files (25 bytes)
465 lfs: uploaded 1 files (25 bytes)
461 1 changesets found
466 1 changesets found
462 uncompressed size of bundle content:
467 uncompressed size of bundle content:
463 206 (changelog)
468 206 (changelog)
464 172 (manifests)
469 172 (manifests)
465 275 lfs2.txt
470 275 lfs2.txt
466 remote: adding changesets
471 remote: adding changesets
467 remote: adding manifests
472 remote: adding manifests
468 remote: adding file changes
473 remote: adding file changes
469 remote: added 1 changesets with 1 changes to 1 files
474 remote: added 1 changesets with 1 changes to 1 files
470 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
475 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
471 .hg/requires:lfs
476 .hg/requires:lfs
472 $TESTTMP/server/.hg/requires:lfs
477 $TESTTMP/server/.hg/requires:lfs
473
478
474 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client6_clone
479 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client6_clone
475 $ grep 'lfs' $TESTTMP/client6_clone/.hg/requires $SERVER_REQUIRES
480 $ grep 'lfs' $TESTTMP/client6_clone/.hg/requires $SERVER_REQUIRES
476 $TESTTMP/client6_clone/.hg/requires:lfs
481 $TESTTMP/client6_clone/.hg/requires:lfs
477 $TESTTMP/server/.hg/requires:lfs
482 $TESTTMP/server/.hg/requires:lfs
478
483
479 $ hg init $TESTTMP/client6_pull
484 $ hg init $TESTTMP/client6_pull
480 $ hg -R $TESTTMP/client6_pull pull -u -v http://localhost:$HGPORT
485 $ hg -R $TESTTMP/client6_pull pull -u -v http://localhost:$HGPORT
481 pulling from http://localhost:$HGPORT/
486 pulling from http://localhost:$HGPORT/
482 requesting all changes
487 requesting all changes
483 adding changesets
488 adding changesets
484 adding manifests
489 adding manifests
485 adding file changes
490 adding file changes
486 calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs
491 calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs
487 added 6 changesets with 5 changes to 5 files (+1 heads)
492 added 6 changesets with 5 changes to 5 files (+1 heads)
488 new changesets d437e1d24fbd:d3b84d50eacb
493 new changesets d437e1d24fbd:d3b84d50eacb
489 resolving manifests
494 resolving manifests
490 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
495 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
491 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
496 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
492 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
497 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
493 lfs: downloaded 1 files (25 bytes)
498 lfs: downloaded 1 files (25 bytes)
494 getting lfs2.txt
499 getting lfs2.txt
495 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
500 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
496 getting nonlfs2.txt
501 getting nonlfs2.txt
497 getting nonlfs3.txt
502 getting nonlfs3.txt
498 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
503 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
499 updated to "d3b84d50eacb: lfs file with lfs client"
504 updated to "d3b84d50eacb: lfs file with lfs client"
500 1 other heads for branch "default"
505 1 other heads for branch "default"
501 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
506 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
502 $ grep 'lfs' $TESTTMP/client6_pull/.hg/requires $SERVER_REQUIRES
507 $ grep 'lfs' $TESTTMP/client6_pull/.hg/requires $SERVER_REQUIRES
503 $TESTTMP/client6_pull/.hg/requires:lfs
508 $TESTTMP/client6_pull/.hg/requires:lfs
504 $TESTTMP/server/.hg/requires:lfs
509 $TESTTMP/server/.hg/requires:lfs
505
510
506 $ hg identify http://localhost:$HGPORT
511 $ hg identify http://localhost:$HGPORT
507 d3b84d50eacb
512 d3b84d50eacb
508
513
509 --------------------------------------------------------------------------------
514 --------------------------------------------------------------------------------
510 Misc: process dies early if a requirement exists and the extension is disabled
515 Misc: process dies early if a requirement exists and the extension is disabled
511
516
512 $ hg --config extensions.lfs=! summary
517 $ hg --config extensions.lfs=! summary
513 abort: repository requires features unknown to this Mercurial: lfs
518 abort: repository requires features unknown to this Mercurial: lfs
514 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
519 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
515 [255]
520 [255]
516
521
517 $ echo 'this is an lfs file' > $TESTTMP/client6_clone/lfspair1.bin
522 $ echo 'this is an lfs file' > $TESTTMP/client6_clone/lfspair1.bin
518 $ echo 'this is an lfs file too' > $TESTTMP/client6_clone/lfspair2.bin
523 $ echo 'this is an lfs file too' > $TESTTMP/client6_clone/lfspair2.bin
519 $ hg -R $TESTTMP/client6_clone ci -Aqm 'add lfs pair'
524 $ hg -R $TESTTMP/client6_clone ci -Aqm 'add lfs pair'
520 $ hg -R $TESTTMP/client6_clone push -q
525 $ hg -R $TESTTMP/client6_clone push -q
521
526
522 $ hg clone -qU http://localhost:$HGPORT $TESTTMP/bulkfetch
527 $ hg clone -qU http://localhost:$HGPORT $TESTTMP/bulkfetch
523
528
524 Cat doesn't prefetch unless data is needed (e.g. '-T {rawdata}' doesn't need it)
529 Cat doesn't prefetch unless data is needed (e.g. '-T {rawdata}' doesn't need it)
525
530
526 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T '{rawdata}\n{path}\n'
531 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T '{rawdata}\n{path}\n'
527 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
532 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
528 version https://git-lfs.github.com/spec/v1
533 version https://git-lfs.github.com/spec/v1
529 oid sha256:cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
534 oid sha256:cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
530 size 20
535 size 20
531 x-is-binary 0
536 x-is-binary 0
532
537
533 lfspair1.bin
538 lfspair1.bin
534
539
535 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T json
540 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T json
536 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
541 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
537 [lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
542 [lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
538 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
543 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
539 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
544 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
540 lfs: downloaded 1 files (20 bytes)
545 lfs: downloaded 1 files (20 bytes)
541 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
546 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
542
547
543 {
548 {
544 "data": "this is an lfs file\n",
549 "data": "this is an lfs file\n",
545 "path": "lfspair1.bin",
550 "path": "lfspair1.bin",
546 "rawdata": "version https://git-lfs.github.com/spec/v1\noid sha256:cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782\nsize 20\nx-is-binary 0\n"
551 "rawdata": "version https://git-lfs.github.com/spec/v1\noid sha256:cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782\nsize 20\nx-is-binary 0\n"
547 }
552 }
548 ]
553 ]
549
554
550 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
555 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
551
556
552 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T '{data}\n'
557 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T '{data}\n'
553 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
558 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
554 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
559 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
555 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
560 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
556 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
561 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
557 lfs: downloaded 1 files (20 bytes)
562 lfs: downloaded 1 files (20 bytes)
558 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
563 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
559 this is an lfs file
564 this is an lfs file
560
565
561 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair2.bin
566 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair2.bin
562 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
567 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
563 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
568 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
564 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
569 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
565 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
570 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
566 lfs: downloaded 1 files (24 bytes)
571 lfs: downloaded 1 files (24 bytes)
567 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
572 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
568 this is an lfs file too
573 this is an lfs file too
569
574
570 Export will prefetch all needed files across all needed revisions
575 Export will prefetch all needed files across all needed revisions
571
576
572 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
577 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
573 $ hg -R $TESTTMP/bulkfetch -v export -r 0:tip -o all.export
578 $ hg -R $TESTTMP/bulkfetch -v export -r 0:tip -o all.export
574 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
579 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
575 exporting patches:
580 exporting patches:
576 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
581 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
577 lfs: need to transfer 4 objects (92 bytes)
582 lfs: need to transfer 4 objects (92 bytes)
578 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
583 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
579 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
584 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
580 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
585 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
581 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
586 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
582 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
587 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
583 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
588 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
584 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
589 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
585 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
590 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
586 lfs: downloaded 4 files (92 bytes)
591 lfs: downloaded 4 files (92 bytes)
587 all.export
592 all.export
588 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
593 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
589 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
594 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
590 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
595 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
591 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
596 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
592
597
593 Export with selected files is used with `extdiff --patch`
598 Export with selected files is used with `extdiff --patch`
594
599
595 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
600 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
596 $ hg --config extensions.extdiff= \
601 $ hg --config extensions.extdiff= \
597 > -R $TESTTMP/bulkfetch -v extdiff -r 2:tip --patch $TESTTMP/bulkfetch/lfs.bin
602 > -R $TESTTMP/bulkfetch -v extdiff -r 2:tip --patch $TESTTMP/bulkfetch/lfs.bin
598 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
603 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
599 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
604 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
600 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
605 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
601 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
606 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
602 lfs: downloaded 1 files (23 bytes)
607 lfs: downloaded 1 files (23 bytes)
603 */hg-8374dc4052cb.patch (glob)
608 */hg-8374dc4052cb.patch (glob)
604 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
609 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
605 */hg-9640b57e77b1.patch (glob)
610 */hg-9640b57e77b1.patch (glob)
606 --- */hg-8374dc4052cb.patch * (glob)
611 --- */hg-8374dc4052cb.patch * (glob)
607 +++ */hg-9640b57e77b1.patch * (glob)
612 +++ */hg-9640b57e77b1.patch * (glob)
608 @@ -2,12 +2,7 @@
613 @@ -2,12 +2,7 @@
609 # User test
614 # User test
610 # Date 0 0
615 # Date 0 0
611 # Thu Jan 01 00:00:00 1970 +0000
616 # Thu Jan 01 00:00:00 1970 +0000
612 -# Node ID 8374dc4052cbd388e79d9dc4ddb29784097aa354
617 -# Node ID 8374dc4052cbd388e79d9dc4ddb29784097aa354
613 -# Parent 1477875038c60152e391238920a16381c627b487
618 -# Parent 1477875038c60152e391238920a16381c627b487
614 -lfs
619 -lfs
615 +# Node ID 9640b57e77b14c3a0144fb4478b6cc13e13ea0d1
620 +# Node ID 9640b57e77b14c3a0144fb4478b6cc13e13ea0d1
616 +# Parent d3b84d50eacbd56638e11abce6b8616aaba54420
621 +# Parent d3b84d50eacbd56638e11abce6b8616aaba54420
617 +add lfs pair
622 +add lfs pair
618
623
619 -diff -r 1477875038c6 -r 8374dc4052cb lfs.bin
624 -diff -r 1477875038c6 -r 8374dc4052cb lfs.bin
620 ---- /dev/null Thu Jan 01 00:00:00 1970 +0000
625 ---- /dev/null Thu Jan 01 00:00:00 1970 +0000
621 -+++ b/lfs.bin Thu Jan 01 00:00:00 1970 +0000
626 -+++ b/lfs.bin Thu Jan 01 00:00:00 1970 +0000
622 -@@ -0,0 +1,1 @@
627 -@@ -0,0 +1,1 @@
623 -+this is a big lfs file
628 -+this is a big lfs file
624 cleaning up temp directory
629 cleaning up temp directory
625 [1]
630 [1]
626
631
627 Diff will prefetch files
632 Diff will prefetch files
628
633
629 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
634 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
630 $ hg -R $TESTTMP/bulkfetch -v diff -r 2:tip
635 $ hg -R $TESTTMP/bulkfetch -v diff -r 2:tip
631 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
636 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
632 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
637 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
633 lfs: need to transfer 4 objects (92 bytes)
638 lfs: need to transfer 4 objects (92 bytes)
634 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
639 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
635 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
640 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
636 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
641 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
637 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
642 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
638 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
643 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
639 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
644 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
640 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
645 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
641 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
646 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
642 lfs: downloaded 4 files (92 bytes)
647 lfs: downloaded 4 files (92 bytes)
643 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
648 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
644 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
649 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
645 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
650 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
646 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
651 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
647 diff -r 8374dc4052cb -r 9640b57e77b1 lfs.bin
652 diff -r 8374dc4052cb -r 9640b57e77b1 lfs.bin
648 --- a/lfs.bin Thu Jan 01 00:00:00 1970 +0000
653 --- a/lfs.bin Thu Jan 01 00:00:00 1970 +0000
649 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
654 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
650 @@ -1,1 +0,0 @@
655 @@ -1,1 +0,0 @@
651 -this is a big lfs file
656 -this is a big lfs file
652 diff -r 8374dc4052cb -r 9640b57e77b1 lfs2.txt
657 diff -r 8374dc4052cb -r 9640b57e77b1 lfs2.txt
653 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
658 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
654 +++ b/lfs2.txt Thu Jan 01 00:00:00 1970 +0000
659 +++ b/lfs2.txt Thu Jan 01 00:00:00 1970 +0000
655 @@ -0,0 +1,1 @@
660 @@ -0,0 +1,1 @@
656 +this is another lfs file
661 +this is another lfs file
657 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair1.bin
662 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair1.bin
658 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
663 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
659 +++ b/lfspair1.bin Thu Jan 01 00:00:00 1970 +0000
664 +++ b/lfspair1.bin Thu Jan 01 00:00:00 1970 +0000
660 @@ -0,0 +1,1 @@
665 @@ -0,0 +1,1 @@
661 +this is an lfs file
666 +this is an lfs file
662 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair2.bin
667 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair2.bin
663 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
668 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
664 +++ b/lfspair2.bin Thu Jan 01 00:00:00 1970 +0000
669 +++ b/lfspair2.bin Thu Jan 01 00:00:00 1970 +0000
665 @@ -0,0 +1,1 @@
670 @@ -0,0 +1,1 @@
666 +this is an lfs file too
671 +this is an lfs file too
667 diff -r 8374dc4052cb -r 9640b57e77b1 nonlfs.txt
672 diff -r 8374dc4052cb -r 9640b57e77b1 nonlfs.txt
668 --- a/nonlfs.txt Thu Jan 01 00:00:00 1970 +0000
673 --- a/nonlfs.txt Thu Jan 01 00:00:00 1970 +0000
669 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
674 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
670 @@ -1,1 +0,0 @@
675 @@ -1,1 +0,0 @@
671 -non-lfs
676 -non-lfs
672 diff -r 8374dc4052cb -r 9640b57e77b1 nonlfs3.txt
677 diff -r 8374dc4052cb -r 9640b57e77b1 nonlfs3.txt
673 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
678 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
674 +++ b/nonlfs3.txt Thu Jan 01 00:00:00 1970 +0000
679 +++ b/nonlfs3.txt Thu Jan 01 00:00:00 1970 +0000
675 @@ -0,0 +1,1 @@
680 @@ -0,0 +1,1 @@
676 +non-lfs
681 +non-lfs
677
682
678 Only the files required by diff are prefetched
683 Only the files required by diff are prefetched
679
684
680 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
685 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
681 $ hg -R $TESTTMP/bulkfetch -v diff -r 2:tip $TESTTMP/bulkfetch/lfspair2.bin
686 $ hg -R $TESTTMP/bulkfetch -v diff -r 2:tip $TESTTMP/bulkfetch/lfspair2.bin
682 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
687 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
683 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
688 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
684 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
689 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
685 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
690 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
686 lfs: downloaded 1 files (24 bytes)
691 lfs: downloaded 1 files (24 bytes)
687 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
692 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
688 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair2.bin
693 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair2.bin
689 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
694 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
690 +++ b/lfspair2.bin Thu Jan 01 00:00:00 1970 +0000
695 +++ b/lfspair2.bin Thu Jan 01 00:00:00 1970 +0000
691 @@ -0,0 +1,1 @@
696 @@ -0,0 +1,1 @@
692 +this is an lfs file too
697 +this is an lfs file too
693
698
694 #endif
699 #endif
695
700
696 $ "$PYTHON" $TESTDIR/killdaemons.py $DAEMON_PIDS
701 $ "$PYTHON" $TESTDIR/killdaemons.py $DAEMON_PIDS
697
702
698 $ cat $TESTTMP/errors.log
703 $ cat $TESTTMP/errors.log
@@ -1,562 +1,577 b''
1 ===================================
1 ===================================
2 Test the persistent on-disk nodemap
2 Test the persistent on-disk nodemap
3 ===================================
3 ===================================
4
4
5 $ cat << EOF >> $HGRCPATH
5 $ cat << EOF >> $HGRCPATH
6 > [format]
6 > [format]
7 > use-persistent-nodemap=yes
7 > use-persistent-nodemap=yes
8 > [devel]
8 > [devel]
9 > persistent-nodemap=yes
9 > persistent-nodemap=yes
10 > EOF
10 > EOF
11 $ hg init test-repo
11 $ hg init test-repo
12 $ cd test-repo
12 $ cd test-repo
13 $ hg debugformat
13 $ hg debugformat
14 format-variant repo
14 format-variant repo
15 fncache: yes
15 fncache: yes
16 dotencode: yes
16 dotencode: yes
17 generaldelta: yes
17 generaldelta: yes
18 exp-sharesafe: no
18 exp-sharesafe: no
19 sparserevlog: yes
19 sparserevlog: yes
20 sidedata: no
20 sidedata: no
21 persistent-nodemap: yes
21 persistent-nodemap: yes
22 copies-sdc: no
22 copies-sdc: no
23 plain-cl-delta: yes
23 plain-cl-delta: yes
24 compression: zlib
24 compression: zlib
25 compression-level: default
25 compression-level: default
26 $ hg debugbuilddag .+5000 --new-file --config "storage.revlog.nodemap.mode=warn"
26 $ hg debugbuilddag .+5000 --new-file --config "storage.revlog.nodemap.mode=warn"
27 persistent nodemap in strict mode without efficient method (no-rust no-pure !)
27 persistent nodemap in strict mode without efficient method (no-rust no-pure !)
28 persistent nodemap in strict mode without efficient method (no-rust no-pure !)
28 persistent nodemap in strict mode without efficient method (no-rust no-pure !)
29 $ hg debugnodemap --metadata
29 $ hg debugnodemap --metadata
30 uid: ???????????????? (glob)
30 uid: ???????????????? (glob)
31 tip-rev: 5000
31 tip-rev: 5000
32 tip-node: 6b02b8c7b96654c25e86ba69eda198d7e6ad8b3c
32 tip-node: 6b02b8c7b96654c25e86ba69eda198d7e6ad8b3c
33 data-length: 121088
33 data-length: 121088
34 data-unused: 0
34 data-unused: 0
35 data-unused: 0.000%
35 data-unused: 0.000%
36 $ f --size .hg/store/00changelog.n
36 $ f --size .hg/store/00changelog.n
37 .hg/store/00changelog.n: size=70
37 .hg/store/00changelog.n: size=70
38
38
39 Simple lookup works
39 Simple lookup works
40
40
41 $ ANYNODE=`hg log --template '{node|short}\n' --rev tip`
41 $ ANYNODE=`hg log --template '{node|short}\n' --rev tip`
42 $ hg log -r "$ANYNODE" --template '{rev}\n'
42 $ hg log -r "$ANYNODE" --template '{rev}\n'
43 5000
43 5000
44
44
45
45
46 #if rust
46 #if rust
47
47
48 $ f --sha256 .hg/store/00changelog-*.nd
48 $ f --sha256 .hg/store/00changelog-*.nd
49 .hg/store/00changelog-????????????????.nd: sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd (glob)
49 .hg/store/00changelog-????????????????.nd: sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd (glob)
50
50
51 $ f --sha256 .hg/store/00manifest-*.nd
51 $ f --sha256 .hg/store/00manifest-*.nd
52 .hg/store/00manifest-????????????????.nd: sha256=97117b1c064ea2f86664a124589e47db0e254e8d34739b5c5cc5bf31c9da2b51 (glob)
52 .hg/store/00manifest-????????????????.nd: sha256=97117b1c064ea2f86664a124589e47db0e254e8d34739b5c5cc5bf31c9da2b51 (glob)
53 $ hg debugnodemap --dump-new | f --sha256 --size
53 $ hg debugnodemap --dump-new | f --sha256 --size
54 size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd
54 size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd
55 $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size
55 $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size
56 size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd
56 size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd
57 0000: 00 00 00 91 00 00 00 20 00 00 00 bb 00 00 00 e7 |....... ........|
57 0000: 00 00 00 91 00 00 00 20 00 00 00 bb 00 00 00 e7 |....... ........|
58 0010: 00 00 00 66 00 00 00 a1 00 00 01 13 00 00 01 22 |...f..........."|
58 0010: 00 00 00 66 00 00 00 a1 00 00 01 13 00 00 01 22 |...f..........."|
59 0020: 00 00 00 23 00 00 00 fc 00 00 00 ba 00 00 00 5e |...#...........^|
59 0020: 00 00 00 23 00 00 00 fc 00 00 00 ba 00 00 00 5e |...#...........^|
60 0030: 00 00 00 df 00 00 01 4e 00 00 01 65 00 00 00 ab |.......N...e....|
60 0030: 00 00 00 df 00 00 01 4e 00 00 01 65 00 00 00 ab |.......N...e....|
61 0040: 00 00 00 a9 00 00 00 95 00 00 00 73 00 00 00 38 |...........s...8|
61 0040: 00 00 00 a9 00 00 00 95 00 00 00 73 00 00 00 38 |...........s...8|
62 0050: 00 00 00 cc 00 00 00 92 00 00 00 90 00 00 00 69 |...............i|
62 0050: 00 00 00 cc 00 00 00 92 00 00 00 90 00 00 00 69 |...............i|
63 0060: 00 00 00 ec 00 00 00 8d 00 00 01 4f 00 00 00 12 |...........O....|
63 0060: 00 00 00 ec 00 00 00 8d 00 00 01 4f 00 00 00 12 |...........O....|
64 0070: 00 00 02 0c 00 00 00 77 00 00 00 9c 00 00 00 8f |.......w........|
64 0070: 00 00 02 0c 00 00 00 77 00 00 00 9c 00 00 00 8f |.......w........|
65 0080: 00 00 00 d5 00 00 00 6b 00 00 00 48 00 00 00 b3 |.......k...H....|
65 0080: 00 00 00 d5 00 00 00 6b 00 00 00 48 00 00 00 b3 |.......k...H....|
66 0090: 00 00 00 e5 00 00 00 b5 00 00 00 8e 00 00 00 ad |................|
66 0090: 00 00 00 e5 00 00 00 b5 00 00 00 8e 00 00 00 ad |................|
67 00a0: 00 00 00 7b 00 00 00 7c 00 00 00 0b 00 00 00 2b |...{...|.......+|
67 00a0: 00 00 00 7b 00 00 00 7c 00 00 00 0b 00 00 00 2b |...{...|.......+|
68 00b0: 00 00 00 c6 00 00 00 1e 00 00 01 08 00 00 00 11 |................|
68 00b0: 00 00 00 c6 00 00 00 1e 00 00 01 08 00 00 00 11 |................|
69 00c0: 00 00 01 30 00 00 00 26 00 00 01 9c 00 00 00 35 |...0...&.......5|
69 00c0: 00 00 01 30 00 00 00 26 00 00 01 9c 00 00 00 35 |...0...&.......5|
70 00d0: 00 00 00 b8 00 00 01 31 00 00 00 2c 00 00 00 55 |.......1...,...U|
70 00d0: 00 00 00 b8 00 00 01 31 00 00 00 2c 00 00 00 55 |.......1...,...U|
71 00e0: 00 00 00 8a 00 00 00 9a 00 00 00 0c 00 00 01 1e |................|
71 00e0: 00 00 00 8a 00 00 00 9a 00 00 00 0c 00 00 01 1e |................|
72 00f0: 00 00 00 a4 00 00 00 83 00 00 00 c9 00 00 00 8c |................|
72 00f0: 00 00 00 a4 00 00 00 83 00 00 00 c9 00 00 00 8c |................|
73
73
74
74
75 #else
75 #else
76
76
77 $ f --sha256 .hg/store/00changelog-*.nd
77 $ f --sha256 .hg/store/00changelog-*.nd
78 .hg/store/00changelog-????????????????.nd: sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 (glob)
78 .hg/store/00changelog-????????????????.nd: sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 (glob)
79 $ hg debugnodemap --dump-new | f --sha256 --size
79 $ hg debugnodemap --dump-new | f --sha256 --size
80 size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79
80 size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79
81 $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size
81 $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size
82 size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79
82 size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79
83 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
83 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
84 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
84 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
85 0020: ff ff ff ff ff ff f5 06 ff ff ff ff ff ff f3 e7 |................|
85 0020: ff ff ff ff ff ff f5 06 ff ff ff ff ff ff f3 e7 |................|
86 0030: ff ff ef ca ff ff ff ff ff ff ff ff ff ff ff ff |................|
86 0030: ff ff ef ca ff ff ff ff ff ff ff ff ff ff ff ff |................|
87 0040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
87 0040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
88 0050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ed 08 |................|
88 0050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ed 08 |................|
89 0060: ff ff ed 66 ff ff ff ff ff ff ff ff ff ff ff ff |...f............|
89 0060: ff ff ed 66 ff ff ff ff ff ff ff ff ff ff ff ff |...f............|
90 0070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
90 0070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
91 0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
91 0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
92 0090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f6 ed |................|
92 0090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f6 ed |................|
93 00a0: ff ff ff ff ff ff fe 61 ff ff ff ff ff ff ff ff |.......a........|
93 00a0: ff ff ff ff ff ff fe 61 ff ff ff ff ff ff ff ff |.......a........|
94 00b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
94 00b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
95 00c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
95 00c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
96 00d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
96 00d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
97 00e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f1 02 |................|
97 00e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f1 02 |................|
98 00f0: ff ff ff ff ff ff ed 1b ff ff ff ff ff ff ff ff |................|
98 00f0: ff ff ff ff ff ff ed 1b ff ff ff ff ff ff ff ff |................|
99
99
100 #endif
100 #endif
101
101
102 $ hg debugnodemap --check
102 $ hg debugnodemap --check
103 revision in index: 5001
103 revision in index: 5001
104 revision in nodemap: 5001
104 revision in nodemap: 5001
105
105
106 add a new commit
106 add a new commit
107
107
108 $ hg up
108 $ hg up
109 5001 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 5001 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 $ echo foo > foo
110 $ echo foo > foo
111 $ hg add foo
111 $ hg add foo
112
112
113 #if no-pure no-rust
113 #if no-pure no-rust
114
114
115 $ hg ci -m 'foo' --config "storage.revlog.nodemap.mode=strict"
115 $ hg ci -m 'foo' --config "storage.revlog.nodemap.mode=strict"
116 transaction abort!
116 transaction abort!
117 rollback completed
117 rollback completed
118 abort: persistent nodemap in strict mode without efficient method
118 abort: persistent nodemap in strict mode without efficient method
119 [255]
119 [255]
120
120
121 #endif
121 #endif
122
122
123 $ hg ci -m 'foo'
123 $ hg ci -m 'foo'
124
124
125 #if no-pure no-rust
125 #if no-pure no-rust
126 $ hg debugnodemap --metadata
126 $ hg debugnodemap --metadata
127 uid: ???????????????? (glob)
127 uid: ???????????????? (glob)
128 tip-rev: 5001
128 tip-rev: 5001
129 tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c
129 tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c
130 data-length: 121088
130 data-length: 121088
131 data-unused: 0
131 data-unused: 0
132 data-unused: 0.000%
132 data-unused: 0.000%
133 #else
133 #else
134 $ hg debugnodemap --metadata
134 $ hg debugnodemap --metadata
135 uid: ???????????????? (glob)
135 uid: ???????????????? (glob)
136 tip-rev: 5001
136 tip-rev: 5001
137 tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c
137 tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c
138 data-length: 121344
138 data-length: 121344
139 data-unused: 256
139 data-unused: 256
140 data-unused: 0.211%
140 data-unused: 0.211%
141 #endif
141 #endif
142
142
143 $ f --size .hg/store/00changelog.n
143 $ f --size .hg/store/00changelog.n
144 .hg/store/00changelog.n: size=70
144 .hg/store/00changelog.n: size=70
145
145
146 (The pure code use the debug code that perform incremental update, the C code reencode from scratch)
146 (The pure code use the debug code that perform incremental update, the C code reencode from scratch)
147
147
148 #if pure
148 #if pure
149 $ f --sha256 .hg/store/00changelog-*.nd --size
149 $ f --sha256 .hg/store/00changelog-*.nd --size
150 .hg/store/00changelog-????????????????.nd: size=121344, sha256=cce54c5da5bde3ad72a4938673ed4064c86231b9c64376b082b163fdb20f8f66 (glob)
150 .hg/store/00changelog-????????????????.nd: size=121344, sha256=cce54c5da5bde3ad72a4938673ed4064c86231b9c64376b082b163fdb20f8f66 (glob)
151 #endif
151 #endif
152
152
153 #if rust
153 #if rust
154 $ f --sha256 .hg/store/00changelog-*.nd --size
154 $ f --sha256 .hg/store/00changelog-*.nd --size
155 .hg/store/00changelog-????????????????.nd: size=121344, sha256=952b042fcf614ceb37b542b1b723e04f18f83efe99bee4e0f5ccd232ef470e58 (glob)
155 .hg/store/00changelog-????????????????.nd: size=121344, sha256=952b042fcf614ceb37b542b1b723e04f18f83efe99bee4e0f5ccd232ef470e58 (glob)
156 #endif
156 #endif
157
157
158 #if no-pure no-rust
158 #if no-pure no-rust
159 $ f --sha256 .hg/store/00changelog-*.nd --size
159 $ f --sha256 .hg/store/00changelog-*.nd --size
160 .hg/store/00changelog-????????????????.nd: size=121088, sha256=df7c06a035b96cb28c7287d349d603baef43240be7736fe34eea419a49702e17 (glob)
160 .hg/store/00changelog-????????????????.nd: size=121088, sha256=df7c06a035b96cb28c7287d349d603baef43240be7736fe34eea419a49702e17 (glob)
161 #endif
161 #endif
162
162
163 $ hg debugnodemap --check
163 $ hg debugnodemap --check
164 revision in index: 5002
164 revision in index: 5002
165 revision in nodemap: 5002
165 revision in nodemap: 5002
166
166
167 Test code path without mmap
167 Test code path without mmap
168 ---------------------------
168 ---------------------------
169
169
170 $ echo bar > bar
170 $ echo bar > bar
171 $ hg add bar
171 $ hg add bar
172 $ hg ci -m 'bar' --config storage.revlog.nodemap.mmap=no
172 $ hg ci -m 'bar' --config storage.revlog.nodemap.mmap=no
173
173
174 $ hg debugnodemap --check --config storage.revlog.nodemap.mmap=yes
174 $ hg debugnodemap --check --config storage.revlog.nodemap.mmap=yes
175 revision in index: 5003
175 revision in index: 5003
176 revision in nodemap: 5003
176 revision in nodemap: 5003
177 $ hg debugnodemap --check --config storage.revlog.nodemap.mmap=no
177 $ hg debugnodemap --check --config storage.revlog.nodemap.mmap=no
178 revision in index: 5003
178 revision in index: 5003
179 revision in nodemap: 5003
179 revision in nodemap: 5003
180
180
181
181
182 #if pure
182 #if pure
183 $ hg debugnodemap --metadata
183 $ hg debugnodemap --metadata
184 uid: ???????????????? (glob)
184 uid: ???????????????? (glob)
185 tip-rev: 5002
185 tip-rev: 5002
186 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
186 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
187 data-length: 121600
187 data-length: 121600
188 data-unused: 512
188 data-unused: 512
189 data-unused: 0.421%
189 data-unused: 0.421%
190 $ f --sha256 .hg/store/00changelog-*.nd --size
190 $ f --sha256 .hg/store/00changelog-*.nd --size
191 .hg/store/00changelog-????????????????.nd: size=121600, sha256=def52503d049ccb823974af313a98a935319ba61f40f3aa06a8be4d35c215054 (glob)
191 .hg/store/00changelog-????????????????.nd: size=121600, sha256=def52503d049ccb823974af313a98a935319ba61f40f3aa06a8be4d35c215054 (glob)
192 #endif
192 #endif
193 #if rust
193 #if rust
194 $ hg debugnodemap --metadata
194 $ hg debugnodemap --metadata
195 uid: ???????????????? (glob)
195 uid: ???????????????? (glob)
196 tip-rev: 5002
196 tip-rev: 5002
197 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
197 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
198 data-length: 121600
198 data-length: 121600
199 data-unused: 512
199 data-unused: 512
200 data-unused: 0.421%
200 data-unused: 0.421%
201 $ f --sha256 .hg/store/00changelog-*.nd --size
201 $ f --sha256 .hg/store/00changelog-*.nd --size
202 .hg/store/00changelog-????????????????.nd: size=121600, sha256=dacf5b5f1d4585fee7527d0e67cad5b1ba0930e6a0928f650f779aefb04ce3fb (glob)
202 .hg/store/00changelog-????????????????.nd: size=121600, sha256=dacf5b5f1d4585fee7527d0e67cad5b1ba0930e6a0928f650f779aefb04ce3fb (glob)
203 #endif
203 #endif
204 #if no-pure no-rust
204 #if no-pure no-rust
205 $ hg debugnodemap --metadata
205 $ hg debugnodemap --metadata
206 uid: ???????????????? (glob)
206 uid: ???????????????? (glob)
207 tip-rev: 5002
207 tip-rev: 5002
208 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
208 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
209 data-length: 121088
209 data-length: 121088
210 data-unused: 0
210 data-unused: 0
211 data-unused: 0.000%
211 data-unused: 0.000%
212 $ f --sha256 .hg/store/00changelog-*.nd --size
212 $ f --sha256 .hg/store/00changelog-*.nd --size
213 .hg/store/00changelog-????????????????.nd: size=121088, sha256=59fcede3e3cc587755916ceed29e3c33748cd1aa7d2f91828ac83e7979d935e8 (glob)
213 .hg/store/00changelog-????????????????.nd: size=121088, sha256=59fcede3e3cc587755916ceed29e3c33748cd1aa7d2f91828ac83e7979d935e8 (glob)
214 #endif
214 #endif
215
215
216 Test force warming the cache
216 Test force warming the cache
217
217
218 $ rm .hg/store/00changelog.n
218 $ rm .hg/store/00changelog.n
219 $ hg debugnodemap --metadata
219 $ hg debugnodemap --metadata
220 $ hg debugupdatecache
220 $ hg debugupdatecache
221 #if pure
221 #if pure
222 $ hg debugnodemap --metadata
222 $ hg debugnodemap --metadata
223 uid: ???????????????? (glob)
223 uid: ???????????????? (glob)
224 tip-rev: 5002
224 tip-rev: 5002
225 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
225 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
226 data-length: 121088
226 data-length: 121088
227 data-unused: 0
227 data-unused: 0
228 data-unused: 0.000%
228 data-unused: 0.000%
229 #else
229 #else
230 $ hg debugnodemap --metadata
230 $ hg debugnodemap --metadata
231 uid: ???????????????? (glob)
231 uid: ???????????????? (glob)
232 tip-rev: 5002
232 tip-rev: 5002
233 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
233 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
234 data-length: 121088
234 data-length: 121088
235 data-unused: 0
235 data-unused: 0
236 data-unused: 0.000%
236 data-unused: 0.000%
237 #endif
237 #endif
238
238
239 Check out of sync nodemap
239 Check out of sync nodemap
240 =========================
240 =========================
241
241
242 First copy old data on the side.
242 First copy old data on the side.
243
243
244 $ mkdir ../tmp-copies
244 $ mkdir ../tmp-copies
245 $ cp .hg/store/00changelog-????????????????.nd .hg/store/00changelog.n ../tmp-copies
245 $ cp .hg/store/00changelog-????????????????.nd .hg/store/00changelog.n ../tmp-copies
246
246
247 Nodemap lagging behind
247 Nodemap lagging behind
248 ----------------------
248 ----------------------
249
249
250 make a new commit
250 make a new commit
251
251
252 $ echo bar2 > bar
252 $ echo bar2 > bar
253 $ hg ci -m 'bar2'
253 $ hg ci -m 'bar2'
254 $ NODE=`hg log -r tip -T '{node}\n'`
254 $ NODE=`hg log -r tip -T '{node}\n'`
255 $ hg log -r "$NODE" -T '{rev}\n'
255 $ hg log -r "$NODE" -T '{rev}\n'
256 5003
256 5003
257
257
258 If the nodemap is lagging behind, it can catch up fine
258 If the nodemap is lagging behind, it can catch up fine
259
259
260 $ hg debugnodemap --metadata
260 $ hg debugnodemap --metadata
261 uid: ???????????????? (glob)
261 uid: ???????????????? (glob)
262 tip-rev: 5003
262 tip-rev: 5003
263 tip-node: c9329770f979ade2d16912267c38ba5f82fd37b3
263 tip-node: c9329770f979ade2d16912267c38ba5f82fd37b3
264 data-length: 121344 (pure !)
264 data-length: 121344 (pure !)
265 data-length: 121344 (rust !)
265 data-length: 121344 (rust !)
266 data-length: 121152 (no-rust no-pure !)
266 data-length: 121152 (no-rust no-pure !)
267 data-unused: 192 (pure !)
267 data-unused: 192 (pure !)
268 data-unused: 192 (rust !)
268 data-unused: 192 (rust !)
269 data-unused: 0 (no-rust no-pure !)
269 data-unused: 0 (no-rust no-pure !)
270 data-unused: 0.158% (pure !)
270 data-unused: 0.158% (pure !)
271 data-unused: 0.158% (rust !)
271 data-unused: 0.158% (rust !)
272 data-unused: 0.000% (no-rust no-pure !)
272 data-unused: 0.000% (no-rust no-pure !)
273 $ cp -f ../tmp-copies/* .hg/store/
273 $ cp -f ../tmp-copies/* .hg/store/
274 $ hg debugnodemap --metadata
274 $ hg debugnodemap --metadata
275 uid: ???????????????? (glob)
275 uid: ???????????????? (glob)
276 tip-rev: 5002
276 tip-rev: 5002
277 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
277 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
278 data-length: 121088
278 data-length: 121088
279 data-unused: 0
279 data-unused: 0
280 data-unused: 0.000%
280 data-unused: 0.000%
281 $ hg log -r "$NODE" -T '{rev}\n'
281 $ hg log -r "$NODE" -T '{rev}\n'
282 5003
282 5003
283
283
284 changelog altered
284 changelog altered
285 -----------------
285 -----------------
286
286
287 If the nodemap is not gated behind a requirements, an unaware client can alter
287 If the nodemap is not gated behind a requirements, an unaware client can alter
288 the repository so the revlog used to generate the nodemap is not longer
288 the repository so the revlog used to generate the nodemap is not longer
289 compatible with the persistent nodemap. We need to detect that.
289 compatible with the persistent nodemap. We need to detect that.
290
290
291 $ hg up "$NODE~5"
291 $ hg up "$NODE~5"
292 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
292 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
293 $ echo bar > babar
293 $ echo bar > babar
294 $ hg add babar
294 $ hg add babar
295 $ hg ci -m 'babar'
295 $ hg ci -m 'babar'
296 created new head
296 created new head
297 $ OTHERNODE=`hg log -r tip -T '{node}\n'`
297 $ OTHERNODE=`hg log -r tip -T '{node}\n'`
298 $ hg log -r "$OTHERNODE" -T '{rev}\n'
298 $ hg log -r "$OTHERNODE" -T '{rev}\n'
299 5004
299 5004
300
300
301 $ hg --config extensions.strip= strip --rev "$NODE~1" --no-backup
301 $ hg --config extensions.strip= strip --rev "$NODE~1" --no-backup
302
302
303 the nodemap should detect the changelog have been tampered with and recover.
303 the nodemap should detect the changelog have been tampered with and recover.
304
304
305 $ hg debugnodemap --metadata
305 $ hg debugnodemap --metadata
306 uid: ???????????????? (glob)
306 uid: ???????????????? (glob)
307 tip-rev: 5002
307 tip-rev: 5002
308 tip-node: b355ef8adce0949b8bdf6afc72ca853740d65944
308 tip-node: b355ef8adce0949b8bdf6afc72ca853740d65944
309 data-length: 121536 (pure !)
309 data-length: 121536 (pure !)
310 data-length: 121088 (rust !)
310 data-length: 121088 (rust !)
311 data-length: 121088 (no-pure no-rust !)
311 data-length: 121088 (no-pure no-rust !)
312 data-unused: 448 (pure !)
312 data-unused: 448 (pure !)
313 data-unused: 0 (rust !)
313 data-unused: 0 (rust !)
314 data-unused: 0 (no-pure no-rust !)
314 data-unused: 0 (no-pure no-rust !)
315 data-unused: 0.000% (rust !)
315 data-unused: 0.000% (rust !)
316 data-unused: 0.369% (pure !)
316 data-unused: 0.369% (pure !)
317 data-unused: 0.000% (no-pure no-rust !)
317 data-unused: 0.000% (no-pure no-rust !)
318
318
319 $ cp -f ../tmp-copies/* .hg/store/
319 $ cp -f ../tmp-copies/* .hg/store/
320 $ hg debugnodemap --metadata
320 $ hg debugnodemap --metadata
321 uid: ???????????????? (glob)
321 uid: ???????????????? (glob)
322 tip-rev: 5002
322 tip-rev: 5002
323 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
323 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
324 data-length: 121088
324 data-length: 121088
325 data-unused: 0
325 data-unused: 0
326 data-unused: 0.000%
326 data-unused: 0.000%
327 $ hg log -r "$OTHERNODE" -T '{rev}\n'
327 $ hg log -r "$OTHERNODE" -T '{rev}\n'
328 5002
328 5002
329
329
330 Check transaction related property
330 Check transaction related property
331 ==================================
331 ==================================
332
332
333 An up to date nodemap should be available to shell hooks,
333 An up to date nodemap should be available to shell hooks,
334
334
335 $ echo dsljfl > a
335 $ echo dsljfl > a
336 $ hg add a
336 $ hg add a
337 $ hg ci -m a
337 $ hg ci -m a
338 $ hg debugnodemap --metadata
338 $ hg debugnodemap --metadata
339 uid: ???????????????? (glob)
339 uid: ???????????????? (glob)
340 tip-rev: 5003
340 tip-rev: 5003
341 tip-node: a52c5079765b5865d97b993b303a18740113bbb2
341 tip-node: a52c5079765b5865d97b993b303a18740113bbb2
342 data-length: 121088
342 data-length: 121088
343 data-unused: 0
343 data-unused: 0
344 data-unused: 0.000%
344 data-unused: 0.000%
345 $ echo babar2 > babar
345 $ echo babar2 > babar
346 $ hg ci -m 'babar2' --config "hooks.pretxnclose.nodemap-test=hg debugnodemap --metadata"
346 $ hg ci -m 'babar2' --config "hooks.pretxnclose.nodemap-test=hg debugnodemap --metadata"
347 uid: ???????????????? (glob)
347 uid: ???????????????? (glob)
348 tip-rev: 5004
348 tip-rev: 5004
349 tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984
349 tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984
350 data-length: 121280 (pure !)
350 data-length: 121280 (pure !)
351 data-length: 121280 (rust !)
351 data-length: 121280 (rust !)
352 data-length: 121088 (no-pure no-rust !)
352 data-length: 121088 (no-pure no-rust !)
353 data-unused: 192 (pure !)
353 data-unused: 192 (pure !)
354 data-unused: 192 (rust !)
354 data-unused: 192 (rust !)
355 data-unused: 0 (no-pure no-rust !)
355 data-unused: 0 (no-pure no-rust !)
356 data-unused: 0.158% (pure !)
356 data-unused: 0.158% (pure !)
357 data-unused: 0.158% (rust !)
357 data-unused: 0.158% (rust !)
358 data-unused: 0.000% (no-pure no-rust !)
358 data-unused: 0.000% (no-pure no-rust !)
359 $ hg debugnodemap --metadata
359 $ hg debugnodemap --metadata
360 uid: ???????????????? (glob)
360 uid: ???????????????? (glob)
361 tip-rev: 5004
361 tip-rev: 5004
362 tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984
362 tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984
363 data-length: 121280 (pure !)
363 data-length: 121280 (pure !)
364 data-length: 121280 (rust !)
364 data-length: 121280 (rust !)
365 data-length: 121088 (no-pure no-rust !)
365 data-length: 121088 (no-pure no-rust !)
366 data-unused: 192 (pure !)
366 data-unused: 192 (pure !)
367 data-unused: 192 (rust !)
367 data-unused: 192 (rust !)
368 data-unused: 0 (no-pure no-rust !)
368 data-unused: 0 (no-pure no-rust !)
369 data-unused: 0.158% (pure !)
369 data-unused: 0.158% (pure !)
370 data-unused: 0.158% (rust !)
370 data-unused: 0.158% (rust !)
371 data-unused: 0.000% (no-pure no-rust !)
371 data-unused: 0.000% (no-pure no-rust !)
372
372
373 Another process does not see the pending nodemap content during run.
373 Another process does not see the pending nodemap content during run.
374
374
375 $ PATH=$RUNTESTDIR/testlib/:$PATH
375 $ PATH=$RUNTESTDIR/testlib/:$PATH
376 $ echo qpoasp > a
376 $ echo qpoasp > a
377 $ hg ci -m a2 \
377 $ hg ci -m a2 \
378 > --config "hooks.pretxnclose=wait-on-file 20 sync-repo-read sync-txn-pending" \
378 > --config "hooks.pretxnclose=wait-on-file 20 sync-repo-read sync-txn-pending" \
379 > --config "hooks.txnclose=touch sync-txn-close" > output.txt 2>&1 &
379 > --config "hooks.txnclose=touch sync-txn-close" > output.txt 2>&1 &
380
380
381 (read the repository while the commit transaction is pending)
381 (read the repository while the commit transaction is pending)
382
382
383 $ wait-on-file 20 sync-txn-pending && \
383 $ wait-on-file 20 sync-txn-pending && \
384 > hg debugnodemap --metadata && \
384 > hg debugnodemap --metadata && \
385 > wait-on-file 20 sync-txn-close sync-repo-read
385 > wait-on-file 20 sync-txn-close sync-repo-read
386 uid: ???????????????? (glob)
386 uid: ???????????????? (glob)
387 tip-rev: 5004
387 tip-rev: 5004
388 tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984
388 tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984
389 data-length: 121280 (pure !)
389 data-length: 121280 (pure !)
390 data-length: 121280 (rust !)
390 data-length: 121280 (rust !)
391 data-length: 121088 (no-pure no-rust !)
391 data-length: 121088 (no-pure no-rust !)
392 data-unused: 192 (pure !)
392 data-unused: 192 (pure !)
393 data-unused: 192 (rust !)
393 data-unused: 192 (rust !)
394 data-unused: 0 (no-pure no-rust !)
394 data-unused: 0 (no-pure no-rust !)
395 data-unused: 0.158% (pure !)
395 data-unused: 0.158% (pure !)
396 data-unused: 0.158% (rust !)
396 data-unused: 0.158% (rust !)
397 data-unused: 0.000% (no-pure no-rust !)
397 data-unused: 0.000% (no-pure no-rust !)
398 $ hg debugnodemap --metadata
398 $ hg debugnodemap --metadata
399 uid: ???????????????? (glob)
399 uid: ???????????????? (glob)
400 tip-rev: 5005
400 tip-rev: 5005
401 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
401 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
402 data-length: 121536 (pure !)
402 data-length: 121536 (pure !)
403 data-length: 121536 (rust !)
403 data-length: 121536 (rust !)
404 data-length: 121088 (no-pure no-rust !)
404 data-length: 121088 (no-pure no-rust !)
405 data-unused: 448 (pure !)
405 data-unused: 448 (pure !)
406 data-unused: 448 (rust !)
406 data-unused: 448 (rust !)
407 data-unused: 0 (no-pure no-rust !)
407 data-unused: 0 (no-pure no-rust !)
408 data-unused: 0.369% (pure !)
408 data-unused: 0.369% (pure !)
409 data-unused: 0.369% (rust !)
409 data-unused: 0.369% (rust !)
410 data-unused: 0.000% (no-pure no-rust !)
410 data-unused: 0.000% (no-pure no-rust !)
411
411
412 $ cat output.txt
412 $ cat output.txt
413
413
414 Check that a failing transaction will properly revert the data
414 Check that a failing transaction will properly revert the data
415
415
416 $ echo plakfe > a
416 $ echo plakfe > a
417 $ f --size --sha256 .hg/store/00changelog-*.nd
417 $ f --size --sha256 .hg/store/00changelog-*.nd
418 .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !)
418 .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !)
419 .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !)
419 .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !)
420 .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !)
420 .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !)
421 $ hg ci -m a3 --config "extensions.abort=$RUNTESTDIR/testlib/crash_transaction_late.py"
421 $ hg ci -m a3 --config "extensions.abort=$RUNTESTDIR/testlib/crash_transaction_late.py"
422 transaction abort!
422 transaction abort!
423 rollback completed
423 rollback completed
424 abort: This is a late abort
424 abort: This is a late abort
425 [255]
425 [255]
426 $ hg debugnodemap --metadata
426 $ hg debugnodemap --metadata
427 uid: ???????????????? (glob)
427 uid: ???????????????? (glob)
428 tip-rev: 5005
428 tip-rev: 5005
429 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
429 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
430 data-length: 121536 (pure !)
430 data-length: 121536 (pure !)
431 data-length: 121536 (rust !)
431 data-length: 121536 (rust !)
432 data-length: 121088 (no-pure no-rust !)
432 data-length: 121088 (no-pure no-rust !)
433 data-unused: 448 (pure !)
433 data-unused: 448 (pure !)
434 data-unused: 448 (rust !)
434 data-unused: 448 (rust !)
435 data-unused: 0 (no-pure no-rust !)
435 data-unused: 0 (no-pure no-rust !)
436 data-unused: 0.369% (pure !)
436 data-unused: 0.369% (pure !)
437 data-unused: 0.369% (rust !)
437 data-unused: 0.369% (rust !)
438 data-unused: 0.000% (no-pure no-rust !)
438 data-unused: 0.000% (no-pure no-rust !)
439 $ f --size --sha256 .hg/store/00changelog-*.nd
439 $ f --size --sha256 .hg/store/00changelog-*.nd
440 .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !)
440 .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !)
441 .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !)
441 .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !)
442 .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !)
442 .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !)
443
443
444 Check that removing content does not confuse the nodemap
444 Check that removing content does not confuse the nodemap
445 --------------------------------------------------------
445 --------------------------------------------------------
446
446
447 removing data with rollback
447 removing data with rollback
448
448
449 $ echo aso > a
449 $ echo aso > a
450 $ hg ci -m a4
450 $ hg ci -m a4
451 $ hg rollback
451 $ hg rollback
452 repository tip rolled back to revision 5005 (undo commit)
452 repository tip rolled back to revision 5005 (undo commit)
453 working directory now based on revision 5005
453 working directory now based on revision 5005
454 $ hg id -r .
454 $ hg id -r .
455 90d5d3ba2fc4 tip
455 90d5d3ba2fc4 tip
456
456
457 roming data with strip
457 roming data with strip
458
458
459 $ echo aso > a
459 $ echo aso > a
460 $ hg ci -m a4
460 $ hg ci -m a4
461 $ hg --config extensions.strip= strip -r . --no-backup
461 $ hg --config extensions.strip= strip -r . --no-backup
462 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
462 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
463 $ hg id -r . --traceback
463 $ hg id -r . --traceback
464 90d5d3ba2fc4 tip
464 90d5d3ba2fc4 tip
465
465
466 Test upgrade / downgrade
466 Test upgrade / downgrade
467 ========================
467 ========================
468
468
469 downgrading
469 downgrading
470
470
471 $ cat << EOF >> .hg/hgrc
471 $ cat << EOF >> .hg/hgrc
472 > [format]
472 > [format]
473 > use-persistent-nodemap=no
473 > use-persistent-nodemap=no
474 > EOF
474 > EOF
475 $ hg debugformat -v
475 $ hg debugformat -v
476 format-variant repo config default
476 format-variant repo config default
477 fncache: yes yes yes
477 fncache: yes yes yes
478 dotencode: yes yes yes
478 dotencode: yes yes yes
479 generaldelta: yes yes yes
479 generaldelta: yes yes yes
480 exp-sharesafe: no no no
480 exp-sharesafe: no no no
481 sparserevlog: yes yes yes
481 sparserevlog: yes yes yes
482 sidedata: no no no
482 sidedata: no no no
483 persistent-nodemap: yes no no
483 persistent-nodemap: yes no no
484 copies-sdc: no no no
484 copies-sdc: no no no
485 plain-cl-delta: yes yes yes
485 plain-cl-delta: yes yes yes
486 compression: zlib zlib zlib
486 compression: zlib zlib zlib
487 compression-level: default default default
487 compression-level: default default default
488 $ hg debugupgraderepo --run --no-backup --quiet
488 $ hg debugupgraderepo --run --no-backup --quiet
489 upgrade will perform the following actions:
489 upgrade will perform the following actions:
490
490
491 requirements
491 requirements
492 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
492 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
493 removed: persistent-nodemap
493 removed: persistent-nodemap
494
494
495 processed revlogs:
496 - all-filelogs
497 - changelog
498 - manifest
499
495 $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
500 $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
496 [1]
501 [1]
497 $ hg debugnodemap --metadata
502 $ hg debugnodemap --metadata
498
503
499
504
500 upgrading
505 upgrading
501
506
502 $ cat << EOF >> .hg/hgrc
507 $ cat << EOF >> .hg/hgrc
503 > [format]
508 > [format]
504 > use-persistent-nodemap=yes
509 > use-persistent-nodemap=yes
505 > EOF
510 > EOF
506 $ hg debugformat -v
511 $ hg debugformat -v
507 format-variant repo config default
512 format-variant repo config default
508 fncache: yes yes yes
513 fncache: yes yes yes
509 dotencode: yes yes yes
514 dotencode: yes yes yes
510 generaldelta: yes yes yes
515 generaldelta: yes yes yes
511 exp-sharesafe: no no no
516 exp-sharesafe: no no no
512 sparserevlog: yes yes yes
517 sparserevlog: yes yes yes
513 sidedata: no no no
518 sidedata: no no no
514 persistent-nodemap: no yes no
519 persistent-nodemap: no yes no
515 copies-sdc: no no no
520 copies-sdc: no no no
516 plain-cl-delta: yes yes yes
521 plain-cl-delta: yes yes yes
517 compression: zlib zlib zlib
522 compression: zlib zlib zlib
518 compression-level: default default default
523 compression-level: default default default
519 $ hg debugupgraderepo --run --no-backup --quiet
524 $ hg debugupgraderepo --run --no-backup --quiet
520 upgrade will perform the following actions:
525 upgrade will perform the following actions:
521
526
522 requirements
527 requirements
523 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
528 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
524 added: persistent-nodemap
529 added: persistent-nodemap
525
530
531 processed revlogs:
532 - all-filelogs
533 - changelog
534 - manifest
535
526 $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
536 $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
527 00changelog-*.nd (glob)
537 00changelog-*.nd (glob)
528 00changelog.n
538 00changelog.n
529 00manifest-*.nd (glob)
539 00manifest-*.nd (glob)
530 00manifest.n
540 00manifest.n
531
541
532 $ hg debugnodemap --metadata
542 $ hg debugnodemap --metadata
533 uid: * (glob)
543 uid: * (glob)
534 tip-rev: 5005
544 tip-rev: 5005
535 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
545 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
536 data-length: 121088
546 data-length: 121088
537 data-unused: 0
547 data-unused: 0
538 data-unused: 0.000%
548 data-unused: 0.000%
539
549
540 Running unrelated upgrade
550 Running unrelated upgrade
541
551
542 $ hg debugupgraderepo --run --no-backup --quiet --optimize re-delta-all
552 $ hg debugupgraderepo --run --no-backup --quiet --optimize re-delta-all
543 upgrade will perform the following actions:
553 upgrade will perform the following actions:
544
554
545 requirements
555 requirements
546 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store
556 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store
547
557
548 optimisations: re-delta-all
558 optimisations: re-delta-all
549
559
560 processed revlogs:
561 - all-filelogs
562 - changelog
563 - manifest
564
550 $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
565 $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
551 00changelog-*.nd (glob)
566 00changelog-*.nd (glob)
552 00changelog.n
567 00changelog.n
553 00manifest-*.nd (glob)
568 00manifest-*.nd (glob)
554 00manifest.n
569 00manifest.n
555
570
556 $ hg debugnodemap --metadata
571 $ hg debugnodemap --metadata
557 uid: * (glob)
572 uid: * (glob)
558 tip-rev: 5005
573 tip-rev: 5005
559 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
574 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
560 data-length: 121088
575 data-length: 121088
561 data-unused: 0
576 data-unused: 0
562 data-unused: 0.000%
577 data-unused: 0.000%
@@ -1,456 +1,486 b''
1 setup
1 setup
2
2
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > share =
5 > share =
6 > [format]
6 > [format]
7 > exp-share-safe = True
7 > exp-share-safe = True
8 > EOF
8 > EOF
9
9
10 prepare source repo
10 prepare source repo
11
11
12 $ hg init source
12 $ hg init source
13 $ cd source
13 $ cd source
14 $ cat .hg/requires
14 $ cat .hg/requires
15 exp-sharesafe
15 exp-sharesafe
16 $ cat .hg/store/requires
16 $ cat .hg/store/requires
17 dotencode
17 dotencode
18 fncache
18 fncache
19 generaldelta
19 generaldelta
20 revlogv1
20 revlogv1
21 sparserevlog
21 sparserevlog
22 store
22 store
23 $ hg debugrequirements
23 $ hg debugrequirements
24 dotencode
24 dotencode
25 exp-sharesafe
25 exp-sharesafe
26 fncache
26 fncache
27 generaldelta
27 generaldelta
28 revlogv1
28 revlogv1
29 sparserevlog
29 sparserevlog
30 store
30 store
31
31
32 $ echo a > a
32 $ echo a > a
33 $ hg ci -Aqm "added a"
33 $ hg ci -Aqm "added a"
34 $ echo b > b
34 $ echo b > b
35 $ hg ci -Aqm "added b"
35 $ hg ci -Aqm "added b"
36
36
37 $ HGEDITOR=cat hg config --shared
37 $ HGEDITOR=cat hg config --shared
38 abort: repository is not shared; can't use --shared
38 abort: repository is not shared; can't use --shared
39 [10]
39 [10]
40 $ cd ..
40 $ cd ..
41
41
42 Create a shared repo and check the requirements are shared and read correctly
42 Create a shared repo and check the requirements are shared and read correctly
43 $ hg share source shared1
43 $ hg share source shared1
44 updating working directory
44 updating working directory
45 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
45 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 $ cd shared1
46 $ cd shared1
47 $ cat .hg/requires
47 $ cat .hg/requires
48 exp-sharesafe
48 exp-sharesafe
49 shared
49 shared
50
50
51 $ hg debugrequirements -R ../source
51 $ hg debugrequirements -R ../source
52 dotencode
52 dotencode
53 exp-sharesafe
53 exp-sharesafe
54 fncache
54 fncache
55 generaldelta
55 generaldelta
56 revlogv1
56 revlogv1
57 sparserevlog
57 sparserevlog
58 store
58 store
59
59
60 $ hg debugrequirements
60 $ hg debugrequirements
61 dotencode
61 dotencode
62 exp-sharesafe
62 exp-sharesafe
63 fncache
63 fncache
64 generaldelta
64 generaldelta
65 revlogv1
65 revlogv1
66 shared
66 shared
67 sparserevlog
67 sparserevlog
68 store
68 store
69
69
70 $ echo c > c
70 $ echo c > c
71 $ hg ci -Aqm "added c"
71 $ hg ci -Aqm "added c"
72
72
73 Check that config of the source repository is also loaded
73 Check that config of the source repository is also loaded
74
74
75 $ hg showconfig ui.curses
75 $ hg showconfig ui.curses
76 [1]
76 [1]
77
77
78 $ echo "[ui]" >> ../source/.hg/hgrc
78 $ echo "[ui]" >> ../source/.hg/hgrc
79 $ echo "curses=true" >> ../source/.hg/hgrc
79 $ echo "curses=true" >> ../source/.hg/hgrc
80
80
81 $ hg showconfig ui.curses
81 $ hg showconfig ui.curses
82 true
82 true
83
83
84 Test that extensions of source repository are also loaded
84 Test that extensions of source repository are also loaded
85
85
86 $ hg debugextensions
86 $ hg debugextensions
87 share
87 share
88 $ hg extdiff -p echo
88 $ hg extdiff -p echo
89 hg: unknown command 'extdiff'
89 hg: unknown command 'extdiff'
90 'extdiff' is provided by the following extension:
90 'extdiff' is provided by the following extension:
91
91
92 extdiff command to allow external programs to compare revisions
92 extdiff command to allow external programs to compare revisions
93
93
94 (use 'hg help extensions' for information on enabling extensions)
94 (use 'hg help extensions' for information on enabling extensions)
95 [255]
95 [255]
96
96
97 $ echo "[extensions]" >> ../source/.hg/hgrc
97 $ echo "[extensions]" >> ../source/.hg/hgrc
98 $ echo "extdiff=" >> ../source/.hg/hgrc
98 $ echo "extdiff=" >> ../source/.hg/hgrc
99
99
100 $ hg debugextensions -R ../source
100 $ hg debugextensions -R ../source
101 extdiff
101 extdiff
102 share
102 share
103 $ hg extdiff -R ../source -p echo
103 $ hg extdiff -R ../source -p echo
104
104
105 BROKEN: the command below will not work if config of shared source is not loaded
105 BROKEN: the command below will not work if config of shared source is not loaded
106 on dispatch but debugextensions says that extension
106 on dispatch but debugextensions says that extension
107 is loaded
107 is loaded
108 $ hg debugextensions
108 $ hg debugextensions
109 extdiff
109 extdiff
110 share
110 share
111
111
112 $ hg extdiff -p echo
112 $ hg extdiff -p echo
113
113
114 However, local .hg/hgrc should override the config set by share source
114 However, local .hg/hgrc should override the config set by share source
115
115
116 $ echo "[ui]" >> .hg/hgrc
116 $ echo "[ui]" >> .hg/hgrc
117 $ echo "curses=false" >> .hg/hgrc
117 $ echo "curses=false" >> .hg/hgrc
118
118
119 $ hg showconfig ui.curses
119 $ hg showconfig ui.curses
120 false
120 false
121
121
122 $ HGEDITOR=cat hg config --shared
122 $ HGEDITOR=cat hg config --shared
123 [ui]
123 [ui]
124 curses=true
124 curses=true
125 [extensions]
125 [extensions]
126 extdiff=
126 extdiff=
127
127
128 $ HGEDITOR=cat hg config --local
128 $ HGEDITOR=cat hg config --local
129 [ui]
129 [ui]
130 curses=false
130 curses=false
131
131
132 Testing that hooks set in source repository also runs in shared repo
132 Testing that hooks set in source repository also runs in shared repo
133
133
134 $ cd ../source
134 $ cd ../source
135 $ cat <<EOF >> .hg/hgrc
135 $ cat <<EOF >> .hg/hgrc
136 > [extensions]
136 > [extensions]
137 > hooklib=
137 > hooklib=
138 > [hooks]
138 > [hooks]
139 > pretxnchangegroup.reject_merge_commits = \
139 > pretxnchangegroup.reject_merge_commits = \
140 > python:hgext.hooklib.reject_merge_commits.hook
140 > python:hgext.hooklib.reject_merge_commits.hook
141 > EOF
141 > EOF
142
142
143 $ cd ..
143 $ cd ..
144 $ hg clone source cloned
144 $ hg clone source cloned
145 updating to branch default
145 updating to branch default
146 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
147 $ cd cloned
147 $ cd cloned
148 $ hg up 0
148 $ hg up 0
149 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
149 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
150 $ echo bar > bar
150 $ echo bar > bar
151 $ hg ci -Aqm "added bar"
151 $ hg ci -Aqm "added bar"
152 $ hg merge
152 $ hg merge
153 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
154 (branch merge, don't forget to commit)
154 (branch merge, don't forget to commit)
155 $ hg ci -m "merge commit"
155 $ hg ci -m "merge commit"
156
156
157 $ hg push ../source
157 $ hg push ../source
158 pushing to ../source
158 pushing to ../source
159 searching for changes
159 searching for changes
160 adding changesets
160 adding changesets
161 adding manifests
161 adding manifests
162 adding file changes
162 adding file changes
163 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
163 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
164 transaction abort!
164 transaction abort!
165 rollback completed
165 rollback completed
166 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
166 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
167 [255]
167 [255]
168
168
169 $ hg push ../shared1
169 $ hg push ../shared1
170 pushing to ../shared1
170 pushing to ../shared1
171 searching for changes
171 searching for changes
172 adding changesets
172 adding changesets
173 adding manifests
173 adding manifests
174 adding file changes
174 adding file changes
175 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
175 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
176 transaction abort!
176 transaction abort!
177 rollback completed
177 rollback completed
178 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
178 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
179 [255]
179 [255]
180
180
181 Test that if share source config is untrusted, we dont read it
181 Test that if share source config is untrusted, we dont read it
182
182
183 $ cd ../shared1
183 $ cd ../shared1
184
184
185 $ cat << EOF > $TESTTMP/untrusted.py
185 $ cat << EOF > $TESTTMP/untrusted.py
186 > from mercurial import scmutil, util
186 > from mercurial import scmutil, util
187 > def uisetup(ui):
187 > def uisetup(ui):
188 > class untrustedui(ui.__class__):
188 > class untrustedui(ui.__class__):
189 > def _trusted(self, fp, f):
189 > def _trusted(self, fp, f):
190 > if util.normpath(fp.name).endswith(b'source/.hg/hgrc'):
190 > if util.normpath(fp.name).endswith(b'source/.hg/hgrc'):
191 > return False
191 > return False
192 > return super(untrustedui, self)._trusted(fp, f)
192 > return super(untrustedui, self)._trusted(fp, f)
193 > ui.__class__ = untrustedui
193 > ui.__class__ = untrustedui
194 > EOF
194 > EOF
195
195
196 $ hg showconfig hooks
196 $ hg showconfig hooks
197 hooks.pretxnchangegroup.reject_merge_commits=python:hgext.hooklib.reject_merge_commits.hook
197 hooks.pretxnchangegroup.reject_merge_commits=python:hgext.hooklib.reject_merge_commits.hook
198
198
199 $ hg showconfig hooks --config extensions.untrusted=$TESTTMP/untrusted.py
199 $ hg showconfig hooks --config extensions.untrusted=$TESTTMP/untrusted.py
200 [1]
200 [1]
201
201
202 Update the source repository format and check that shared repo works
202 Update the source repository format and check that shared repo works
203
203
204 $ cd ../source
204 $ cd ../source
205
205
206 Disable zstd related tests because its not present on pure version
206 Disable zstd related tests because its not present on pure version
207 #if zstd
207 #if zstd
208 $ echo "[format]" >> .hg/hgrc
208 $ echo "[format]" >> .hg/hgrc
209 $ echo "revlog-compression=zstd" >> .hg/hgrc
209 $ echo "revlog-compression=zstd" >> .hg/hgrc
210
210
211 $ hg debugupgraderepo --run -q
211 $ hg debugupgraderepo --run -q
212 upgrade will perform the following actions:
212 upgrade will perform the following actions:
213
213
214 requirements
214 requirements
215 preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlogv1, sparserevlog, store
215 preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlogv1, sparserevlog, store
216 added: revlog-compression-zstd
216 added: revlog-compression-zstd
217
217
218 processed revlogs:
219 - all-filelogs
220 - changelog
221 - manifest
222
218 $ hg log -r .
223 $ hg log -r .
219 changeset: 1:5f6d8a4bf34a
224 changeset: 1:5f6d8a4bf34a
220 user: test
225 user: test
221 date: Thu Jan 01 00:00:00 1970 +0000
226 date: Thu Jan 01 00:00:00 1970 +0000
222 summary: added b
227 summary: added b
223
228
224 #endif
229 #endif
225 $ echo "[format]" >> .hg/hgrc
230 $ echo "[format]" >> .hg/hgrc
226 $ echo "use-persistent-nodemap=True" >> .hg/hgrc
231 $ echo "use-persistent-nodemap=True" >> .hg/hgrc
227
232
228 $ hg debugupgraderepo --run -q -R ../shared1
233 $ hg debugupgraderepo --run -q -R ../shared1
229 abort: cannot upgrade repository; unsupported source requirement: shared
234 abort: cannot upgrade repository; unsupported source requirement: shared
230 [255]
235 [255]
231
236
232 $ hg debugupgraderepo --run -q
237 $ hg debugupgraderepo --run -q
233 upgrade will perform the following actions:
238 upgrade will perform the following actions:
234
239
235 requirements
240 requirements
236 preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
241 preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
237 preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
242 preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
238 added: persistent-nodemap
243 added: persistent-nodemap
239
244
245 processed revlogs:
246 - all-filelogs
247 - changelog
248 - manifest
249
240 $ hg log -r .
250 $ hg log -r .
241 changeset: 1:5f6d8a4bf34a
251 changeset: 1:5f6d8a4bf34a
242 user: test
252 user: test
243 date: Thu Jan 01 00:00:00 1970 +0000
253 date: Thu Jan 01 00:00:00 1970 +0000
244 summary: added b
254 summary: added b
245
255
246
256
247 Shared one should work
257 Shared one should work
248 $ cd ../shared1
258 $ cd ../shared1
249 $ hg log -r .
259 $ hg log -r .
250 changeset: 2:155349b645be
260 changeset: 2:155349b645be
251 tag: tip
261 tag: tip
252 user: test
262 user: test
253 date: Thu Jan 01 00:00:00 1970 +0000
263 date: Thu Jan 01 00:00:00 1970 +0000
254 summary: added c
264 summary: added c
255
265
256
266
257 Testing that nonsharedrc is loaded for source and not shared
267 Testing that nonsharedrc is loaded for source and not shared
258
268
259 $ cd ../source
269 $ cd ../source
260 $ touch .hg/hgrc-not-shared
270 $ touch .hg/hgrc-not-shared
261 $ echo "[ui]" >> .hg/hgrc-not-shared
271 $ echo "[ui]" >> .hg/hgrc-not-shared
262 $ echo "traceback=true" >> .hg/hgrc-not-shared
272 $ echo "traceback=true" >> .hg/hgrc-not-shared
263
273
264 $ hg showconfig ui.traceback
274 $ hg showconfig ui.traceback
265 true
275 true
266
276
267 $ HGEDITOR=cat hg config --non-shared
277 $ HGEDITOR=cat hg config --non-shared
268 [ui]
278 [ui]
269 traceback=true
279 traceback=true
270
280
271 $ cd ../shared1
281 $ cd ../shared1
272 $ hg showconfig ui.traceback
282 $ hg showconfig ui.traceback
273 [1]
283 [1]
274
284
275 Unsharing works
285 Unsharing works
276
286
277 $ hg unshare
287 $ hg unshare
278
288
279 Test that source config is added to the shared one after unshare, and the config
289 Test that source config is added to the shared one after unshare, and the config
280 of current repo is still respected over the config which came from source config
290 of current repo is still respected over the config which came from source config
281 $ cd ../cloned
291 $ cd ../cloned
282 $ hg push ../shared1
292 $ hg push ../shared1
283 pushing to ../shared1
293 pushing to ../shared1
284 searching for changes
294 searching for changes
285 adding changesets
295 adding changesets
286 adding manifests
296 adding manifests
287 adding file changes
297 adding file changes
288 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
298 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
289 transaction abort!
299 transaction abort!
290 rollback completed
300 rollback completed
291 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
301 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
292 [255]
302 [255]
293 $ hg showconfig ui.curses -R ../shared1
303 $ hg showconfig ui.curses -R ../shared1
294 false
304 false
295
305
296 $ cd ../
306 $ cd ../
297
307
298 Test that upgrading using debugupgraderepo works
308 Test that upgrading using debugupgraderepo works
299 =================================================
309 =================================================
300
310
301 $ hg init non-share-safe --config format.exp-share-safe=false
311 $ hg init non-share-safe --config format.exp-share-safe=false
302 $ cd non-share-safe
312 $ cd non-share-safe
303 $ hg debugrequirements
313 $ hg debugrequirements
304 dotencode
314 dotencode
305 fncache
315 fncache
306 generaldelta
316 generaldelta
307 revlogv1
317 revlogv1
308 sparserevlog
318 sparserevlog
309 store
319 store
310 $ echo foo > foo
320 $ echo foo > foo
311 $ hg ci -Aqm 'added foo'
321 $ hg ci -Aqm 'added foo'
312 $ echo bar > bar
322 $ echo bar > bar
313 $ hg ci -Aqm 'added bar'
323 $ hg ci -Aqm 'added bar'
314
324
315 Create a share before upgrading
325 Create a share before upgrading
316
326
317 $ cd ..
327 $ cd ..
318 $ hg share non-share-safe nss-share
328 $ hg share non-share-safe nss-share
319 updating working directory
329 updating working directory
320 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
330 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
321 $ hg debugrequirements -R nss-share
331 $ hg debugrequirements -R nss-share
322 dotencode
332 dotencode
323 fncache
333 fncache
324 generaldelta
334 generaldelta
325 revlogv1
335 revlogv1
326 shared
336 shared
327 sparserevlog
337 sparserevlog
328 store
338 store
329 $ cd non-share-safe
339 $ cd non-share-safe
330
340
331 Upgrade
341 Upgrade
332
342
333 $ hg debugupgraderepo -q
343 $ hg debugupgraderepo -q
334 requirements
344 requirements
335 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
345 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
336 added: exp-sharesafe
346 added: exp-sharesafe
337
347
348 processed revlogs:
349 - all-filelogs
350 - changelog
351 - manifest
352
338 $ hg debugupgraderepo --run -q
353 $ hg debugupgraderepo --run -q
339 upgrade will perform the following actions:
354 upgrade will perform the following actions:
340
355
341 requirements
356 requirements
342 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
357 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
343 added: exp-sharesafe
358 added: exp-sharesafe
344
359
360 processed revlogs:
361 - all-filelogs
362 - changelog
363 - manifest
364
345 repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode.
365 repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode.
346
366
347 $ hg debugrequirements
367 $ hg debugrequirements
348 dotencode
368 dotencode
349 exp-sharesafe
369 exp-sharesafe
350 fncache
370 fncache
351 generaldelta
371 generaldelta
352 revlogv1
372 revlogv1
353 sparserevlog
373 sparserevlog
354 store
374 store
355
375
356 $ cat .hg/requires
376 $ cat .hg/requires
357 exp-sharesafe
377 exp-sharesafe
358
378
359 $ cat .hg/store/requires
379 $ cat .hg/store/requires
360 dotencode
380 dotencode
361 fncache
381 fncache
362 generaldelta
382 generaldelta
363 revlogv1
383 revlogv1
364 sparserevlog
384 sparserevlog
365 store
385 store
366
386
367 $ hg log -GT "{node}: {desc}\n"
387 $ hg log -GT "{node}: {desc}\n"
368 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
388 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
369 |
389 |
370 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
390 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
371
391
372
392
373 Make sure existing shares still works
393 Make sure existing shares still works
374
394
375 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
395 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
376 warning: source repository supports share-safe functionality. Reshare to upgrade.
396 warning: source repository supports share-safe functionality. Reshare to upgrade.
377 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
397 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
378 |
398 |
379 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
399 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
380
400
381
401
382
402
383 Create a safe share from upgrade one
403 Create a safe share from upgrade one
384
404
385 $ cd ..
405 $ cd ..
386 $ hg share non-share-safe ss-share
406 $ hg share non-share-safe ss-share
387 updating working directory
407 updating working directory
388 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
408 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
389 $ cd ss-share
409 $ cd ss-share
390 $ hg log -GT "{node}: {desc}\n"
410 $ hg log -GT "{node}: {desc}\n"
391 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
411 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
392 |
412 |
393 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
413 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
394
414
395 $ cd ../non-share-safe
415 $ cd ../non-share-safe
396
416
397 Test that downgrading works too
417 Test that downgrading works too
398
418
399 $ cat >> $HGRCPATH <<EOF
419 $ cat >> $HGRCPATH <<EOF
400 > [extensions]
420 > [extensions]
401 > share =
421 > share =
402 > [format]
422 > [format]
403 > exp-share-safe = False
423 > exp-share-safe = False
404 > EOF
424 > EOF
405
425
406 $ hg debugupgraderepo -q
426 $ hg debugupgraderepo -q
407 requirements
427 requirements
408 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
428 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
409 removed: exp-sharesafe
429 removed: exp-sharesafe
410
430
431 processed revlogs:
432 - all-filelogs
433 - changelog
434 - manifest
435
411 $ hg debugupgraderepo -q --run
436 $ hg debugupgraderepo -q --run
412 upgrade will perform the following actions:
437 upgrade will perform the following actions:
413
438
414 requirements
439 requirements
415 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
440 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
416 removed: exp-sharesafe
441 removed: exp-sharesafe
417
442
443 processed revlogs:
444 - all-filelogs
445 - changelog
446 - manifest
447
418 repository downgraded to not use share safe mode, existing shares will not work and needs to be reshared.
448 repository downgraded to not use share safe mode, existing shares will not work and needs to be reshared.
419
449
420 $ hg debugrequirements
450 $ hg debugrequirements
421 dotencode
451 dotencode
422 fncache
452 fncache
423 generaldelta
453 generaldelta
424 revlogv1
454 revlogv1
425 sparserevlog
455 sparserevlog
426 store
456 store
427
457
428 $ cat .hg/requires
458 $ cat .hg/requires
429 dotencode
459 dotencode
430 fncache
460 fncache
431 generaldelta
461 generaldelta
432 revlogv1
462 revlogv1
433 sparserevlog
463 sparserevlog
434 store
464 store
435
465
436 $ test -f .hg/store/requires
466 $ test -f .hg/store/requires
437 [1]
467 [1]
438
468
439 $ hg log -GT "{node}: {desc}\n"
469 $ hg log -GT "{node}: {desc}\n"
440 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
470 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
441 |
471 |
442 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
472 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
443
473
444
474
445 Make sure existing shares still works
475 Make sure existing shares still works
446
476
447 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
477 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
448 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
478 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
449 |
479 |
450 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
480 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
451
481
452 $ hg unshare -R ../nss-share
482 $ hg unshare -R ../nss-share
453
483
454 $ hg log -GT "{node}: {desc}\n" -R ../ss-share
484 $ hg log -GT "{node}: {desc}\n" -R ../ss-share
455 abort: share source does not support exp-sharesafe requirement
485 abort: share source does not support exp-sharesafe requirement
456 [255]
486 [255]
@@ -1,1503 +1,1646 b''
1 #require no-reposimplestore
1 #require no-reposimplestore
2
2
3 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
4 > [extensions]
4 > [extensions]
5 > share =
5 > share =
6 > EOF
6 > EOF
7
7
8 store and revlogv1 are required in source
8 store and revlogv1 are required in source
9
9
10 $ hg --config format.usestore=false init no-store
10 $ hg --config format.usestore=false init no-store
11 $ hg -R no-store debugupgraderepo
11 $ hg -R no-store debugupgraderepo
12 abort: cannot upgrade repository; requirement missing: store
12 abort: cannot upgrade repository; requirement missing: store
13 [255]
13 [255]
14
14
15 $ hg init no-revlogv1
15 $ hg init no-revlogv1
16 $ cat > no-revlogv1/.hg/requires << EOF
16 $ cat > no-revlogv1/.hg/requires << EOF
17 > dotencode
17 > dotencode
18 > fncache
18 > fncache
19 > generaldelta
19 > generaldelta
20 > store
20 > store
21 > EOF
21 > EOF
22
22
23 $ hg -R no-revlogv1 debugupgraderepo
23 $ hg -R no-revlogv1 debugupgraderepo
24 abort: cannot upgrade repository; requirement missing: revlogv1
24 abort: cannot upgrade repository; requirement missing: revlogv1
25 [255]
25 [255]
26
26
27 Cannot upgrade shared repositories
27 Cannot upgrade shared repositories
28
28
29 $ hg init share-parent
29 $ hg init share-parent
30 $ hg -q share share-parent share-child
30 $ hg -q share share-parent share-child
31
31
32 $ hg -R share-child debugupgraderepo
32 $ hg -R share-child debugupgraderepo
33 abort: cannot upgrade repository; unsupported source requirement: shared
33 abort: cannot upgrade repository; unsupported source requirement: shared
34 [255]
34 [255]
35
35
36 Do not yet support upgrading treemanifest repos
36 Do not yet support upgrading treemanifest repos
37
37
38 $ hg --config experimental.treemanifest=true init treemanifest
38 $ hg --config experimental.treemanifest=true init treemanifest
39 $ hg -R treemanifest debugupgraderepo
39 $ hg -R treemanifest debugupgraderepo
40 abort: cannot upgrade repository; unsupported source requirement: treemanifest
40 abort: cannot upgrade repository; unsupported source requirement: treemanifest
41 [255]
41 [255]
42
42
43 Cannot add treemanifest requirement during upgrade
43 Cannot add treemanifest requirement during upgrade
44
44
45 $ hg init disallowaddedreq
45 $ hg init disallowaddedreq
46 $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
46 $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
47 abort: cannot upgrade repository; do not support adding requirement: treemanifest
47 abort: cannot upgrade repository; do not support adding requirement: treemanifest
48 [255]
48 [255]
49
49
50 An upgrade of a repository created with recommended settings only suggests optimizations
50 An upgrade of a repository created with recommended settings only suggests optimizations
51
51
52 $ hg init empty
52 $ hg init empty
53 $ cd empty
53 $ cd empty
54 $ hg debugformat
54 $ hg debugformat
55 format-variant repo
55 format-variant repo
56 fncache: yes
56 fncache: yes
57 dotencode: yes
57 dotencode: yes
58 generaldelta: yes
58 generaldelta: yes
59 exp-sharesafe: no
59 exp-sharesafe: no
60 sparserevlog: yes
60 sparserevlog: yes
61 sidedata: no
61 sidedata: no
62 persistent-nodemap: no
62 persistent-nodemap: no
63 copies-sdc: no
63 copies-sdc: no
64 plain-cl-delta: yes
64 plain-cl-delta: yes
65 compression: zlib
65 compression: zlib
66 compression-level: default
66 compression-level: default
67 $ hg debugformat --verbose
67 $ hg debugformat --verbose
68 format-variant repo config default
68 format-variant repo config default
69 fncache: yes yes yes
69 fncache: yes yes yes
70 dotencode: yes yes yes
70 dotencode: yes yes yes
71 generaldelta: yes yes yes
71 generaldelta: yes yes yes
72 exp-sharesafe: no no no
72 exp-sharesafe: no no no
73 sparserevlog: yes yes yes
73 sparserevlog: yes yes yes
74 sidedata: no no no
74 sidedata: no no no
75 persistent-nodemap: no no no
75 persistent-nodemap: no no no
76 copies-sdc: no no no
76 copies-sdc: no no no
77 plain-cl-delta: yes yes yes
77 plain-cl-delta: yes yes yes
78 compression: zlib zlib zlib
78 compression: zlib zlib zlib
79 compression-level: default default default
79 compression-level: default default default
80 $ hg debugformat --verbose --config format.usefncache=no
80 $ hg debugformat --verbose --config format.usefncache=no
81 format-variant repo config default
81 format-variant repo config default
82 fncache: yes no yes
82 fncache: yes no yes
83 dotencode: yes no yes
83 dotencode: yes no yes
84 generaldelta: yes yes yes
84 generaldelta: yes yes yes
85 exp-sharesafe: no no no
85 exp-sharesafe: no no no
86 sparserevlog: yes yes yes
86 sparserevlog: yes yes yes
87 sidedata: no no no
87 sidedata: no no no
88 persistent-nodemap: no no no
88 persistent-nodemap: no no no
89 copies-sdc: no no no
89 copies-sdc: no no no
90 plain-cl-delta: yes yes yes
90 plain-cl-delta: yes yes yes
91 compression: zlib zlib zlib
91 compression: zlib zlib zlib
92 compression-level: default default default
92 compression-level: default default default
93 $ hg debugformat --verbose --config format.usefncache=no --color=debug
93 $ hg debugformat --verbose --config format.usefncache=no --color=debug
94 format-variant repo config default
94 format-variant repo config default
95 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
95 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
96 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
96 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
97 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
97 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
98 [formatvariant.name.uptodate|exp-sharesafe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
98 [formatvariant.name.uptodate|exp-sharesafe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
99 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
99 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
100 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
100 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
101 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
101 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
102 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
102 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
103 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
103 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
104 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
104 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
105 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
105 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
106 $ hg debugformat -Tjson
106 $ hg debugformat -Tjson
107 [
107 [
108 {
108 {
109 "config": true,
109 "config": true,
110 "default": true,
110 "default": true,
111 "name": "fncache",
111 "name": "fncache",
112 "repo": true
112 "repo": true
113 },
113 },
114 {
114 {
115 "config": true,
115 "config": true,
116 "default": true,
116 "default": true,
117 "name": "dotencode",
117 "name": "dotencode",
118 "repo": true
118 "repo": true
119 },
119 },
120 {
120 {
121 "config": true,
121 "config": true,
122 "default": true,
122 "default": true,
123 "name": "generaldelta",
123 "name": "generaldelta",
124 "repo": true
124 "repo": true
125 },
125 },
126 {
126 {
127 "config": false,
127 "config": false,
128 "default": false,
128 "default": false,
129 "name": "exp-sharesafe",
129 "name": "exp-sharesafe",
130 "repo": false
130 "repo": false
131 },
131 },
132 {
132 {
133 "config": true,
133 "config": true,
134 "default": true,
134 "default": true,
135 "name": "sparserevlog",
135 "name": "sparserevlog",
136 "repo": true
136 "repo": true
137 },
137 },
138 {
138 {
139 "config": false,
139 "config": false,
140 "default": false,
140 "default": false,
141 "name": "sidedata",
141 "name": "sidedata",
142 "repo": false
142 "repo": false
143 },
143 },
144 {
144 {
145 "config": false,
145 "config": false,
146 "default": false,
146 "default": false,
147 "name": "persistent-nodemap",
147 "name": "persistent-nodemap",
148 "repo": false
148 "repo": false
149 },
149 },
150 {
150 {
151 "config": false,
151 "config": false,
152 "default": false,
152 "default": false,
153 "name": "copies-sdc",
153 "name": "copies-sdc",
154 "repo": false
154 "repo": false
155 },
155 },
156 {
156 {
157 "config": true,
157 "config": true,
158 "default": true,
158 "default": true,
159 "name": "plain-cl-delta",
159 "name": "plain-cl-delta",
160 "repo": true
160 "repo": true
161 },
161 },
162 {
162 {
163 "config": "zlib",
163 "config": "zlib",
164 "default": "zlib",
164 "default": "zlib",
165 "name": "compression",
165 "name": "compression",
166 "repo": "zlib"
166 "repo": "zlib"
167 },
167 },
168 {
168 {
169 "config": "default",
169 "config": "default",
170 "default": "default",
170 "default": "default",
171 "name": "compression-level",
171 "name": "compression-level",
172 "repo": "default"
172 "repo": "default"
173 }
173 }
174 ]
174 ]
175 $ hg debugupgraderepo
175 $ hg debugupgraderepo
176 (no feature deficiencies found in existing repository)
176 (no feature deficiencies found in existing repository)
177 performing an upgrade with "--run" will make the following changes:
177 performing an upgrade with "--run" will make the following changes:
178
178
179 requirements
179 requirements
180 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
180 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
181
181
182 processed revlogs:
183 - all-filelogs
184 - changelog
185 - manifest
186
182 additional optimizations are available by specifying "--optimize <name>":
187 additional optimizations are available by specifying "--optimize <name>":
183
188
184 re-delta-parent
189 re-delta-parent
185 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
190 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
186
191
187 re-delta-multibase
192 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
193 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
189
194
190 re-delta-all
195 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
196 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
192
197
193 re-delta-fulladd
198 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.
199 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
195
200
196
201
197 $ hg debugupgraderepo --quiet
202 $ hg debugupgraderepo --quiet
198 requirements
203 requirements
199 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
204 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
200
205
206 processed revlogs:
207 - all-filelogs
208 - changelog
209 - manifest
210
201
211
202 --optimize can be used to add optimizations
212 --optimize can be used to add optimizations
203
213
204 $ hg debugupgrade --optimize redeltaparent
214 $ hg debugupgrade --optimize redeltaparent
205 (no feature deficiencies found in existing repository)
215 (no feature deficiencies found in existing repository)
206 performing an upgrade with "--run" will make the following changes:
216 performing an upgrade with "--run" will make the following changes:
207
217
208 requirements
218 requirements
209 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
219 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
210
220
211 optimisations: re-delta-parent
221 optimisations: re-delta-parent
212
222
213 re-delta-parent
223 re-delta-parent
214 deltas within internal storage will choose a new base revision if needed
224 deltas within internal storage will choose a new base revision if needed
215
225
226 processed revlogs:
227 - all-filelogs
228 - changelog
229 - manifest
230
216 additional optimizations are available by specifying "--optimize <name>":
231 additional optimizations are available by specifying "--optimize <name>":
217
232
218 re-delta-multibase
233 re-delta-multibase
219 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
220
235
221 re-delta-all
236 re-delta-all
222 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
223
238
224 re-delta-fulladd
239 re-delta-fulladd
225 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.
226
241
227
242
228 modern form of the option
243 modern form of the option
229
244
230 $ hg debugupgrade --optimize re-delta-parent
245 $ hg debugupgrade --optimize re-delta-parent
231 (no feature deficiencies found in existing repository)
246 (no feature deficiencies found in existing repository)
232 performing an upgrade with "--run" will make the following changes:
247 performing an upgrade with "--run" will make the following changes:
233
248
234 requirements
249 requirements
235 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
250 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
236
251
237 optimisations: re-delta-parent
252 optimisations: re-delta-parent
238
253
239 re-delta-parent
254 re-delta-parent
240 deltas within internal storage will choose a new base revision if needed
255 deltas within internal storage will choose a new base revision if needed
241
256
257 processed revlogs:
258 - all-filelogs
259 - changelog
260 - manifest
261
242 additional optimizations are available by specifying "--optimize <name>":
262 additional optimizations are available by specifying "--optimize <name>":
243
263
244 re-delta-multibase
264 re-delta-multibase
245 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
265 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
246
266
247 re-delta-all
267 re-delta-all
248 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
268 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
249
269
250 re-delta-fulladd
270 re-delta-fulladd
251 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
271 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
252
272
253 $ hg debugupgrade --optimize re-delta-parent --quiet
273 $ hg debugupgrade --optimize re-delta-parent --quiet
254 requirements
274 requirements
255 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
275 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
256
276
257 optimisations: re-delta-parent
277 optimisations: re-delta-parent
258
278
279 processed revlogs:
280 - all-filelogs
281 - changelog
282 - manifest
283
259
284
260 unknown optimization:
285 unknown optimization:
261
286
262 $ hg debugupgrade --optimize foobar
287 $ hg debugupgrade --optimize foobar
263 abort: unknown optimization action requested: foobar
288 abort: unknown optimization action requested: foobar
264 (run without arguments to see valid optimizations)
289 (run without arguments to see valid optimizations)
265 [255]
290 [255]
266
291
267 Various sub-optimal detections work
292 Various sub-optimal detections work
268
293
269 $ cat > .hg/requires << EOF
294 $ cat > .hg/requires << EOF
270 > revlogv1
295 > revlogv1
271 > store
296 > store
272 > EOF
297 > EOF
273
298
274 $ hg debugformat
299 $ hg debugformat
275 format-variant repo
300 format-variant repo
276 fncache: no
301 fncache: no
277 dotencode: no
302 dotencode: no
278 generaldelta: no
303 generaldelta: no
279 exp-sharesafe: no
304 exp-sharesafe: no
280 sparserevlog: no
305 sparserevlog: no
281 sidedata: no
306 sidedata: no
282 persistent-nodemap: no
307 persistent-nodemap: no
283 copies-sdc: no
308 copies-sdc: no
284 plain-cl-delta: yes
309 plain-cl-delta: yes
285 compression: zlib
310 compression: zlib
286 compression-level: default
311 compression-level: default
287 $ hg debugformat --verbose
312 $ hg debugformat --verbose
288 format-variant repo config default
313 format-variant repo config default
289 fncache: no yes yes
314 fncache: no yes yes
290 dotencode: no yes yes
315 dotencode: no yes yes
291 generaldelta: no yes yes
316 generaldelta: no yes yes
292 exp-sharesafe: no no no
317 exp-sharesafe: no no no
293 sparserevlog: no yes yes
318 sparserevlog: no yes yes
294 sidedata: no no no
319 sidedata: no no no
295 persistent-nodemap: no no no
320 persistent-nodemap: no no no
296 copies-sdc: no no no
321 copies-sdc: no no no
297 plain-cl-delta: yes yes yes
322 plain-cl-delta: yes yes yes
298 compression: zlib zlib zlib
323 compression: zlib zlib zlib
299 compression-level: default default default
324 compression-level: default default default
300 $ hg debugformat --verbose --config format.usegeneraldelta=no
325 $ hg debugformat --verbose --config format.usegeneraldelta=no
301 format-variant repo config default
326 format-variant repo config default
302 fncache: no yes yes
327 fncache: no yes yes
303 dotencode: no yes yes
328 dotencode: no yes yes
304 generaldelta: no no yes
329 generaldelta: no no yes
305 exp-sharesafe: no no no
330 exp-sharesafe: no no no
306 sparserevlog: no no yes
331 sparserevlog: no no yes
307 sidedata: no no no
332 sidedata: no no no
308 persistent-nodemap: no no no
333 persistent-nodemap: no no no
309 copies-sdc: no no no
334 copies-sdc: no no no
310 plain-cl-delta: yes yes yes
335 plain-cl-delta: yes yes yes
311 compression: zlib zlib zlib
336 compression: zlib zlib zlib
312 compression-level: default default default
337 compression-level: default default default
313 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
338 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
314 format-variant repo config default
339 format-variant repo config default
315 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
340 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
316 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
341 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
317 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
342 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
318 [formatvariant.name.uptodate|exp-sharesafe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
343 [formatvariant.name.uptodate|exp-sharesafe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
319 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
344 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
320 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
345 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
321 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
346 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
322 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
347 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
323 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
348 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
324 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
349 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
325 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
350 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
326 $ hg debugupgraderepo
351 $ hg debugupgraderepo
327 repository lacks features recommended by current config options:
352 repository lacks features recommended by current config options:
328
353
329 fncache
354 fncache
330 long and reserved filenames may not work correctly; repository performance is sub-optimal
355 long and reserved filenames may not work correctly; repository performance is sub-optimal
331
356
332 dotencode
357 dotencode
333 storage of filenames beginning with a period or space may not work correctly
358 storage of filenames beginning with a period or space may not work correctly
334
359
335 generaldelta
360 generaldelta
336 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
361 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
337
362
338 sparserevlog
363 sparserevlog
339 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
364 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
340
365
341
366
342 performing an upgrade with "--run" will make the following changes:
367 performing an upgrade with "--run" will make the following changes:
343
368
344 requirements
369 requirements
345 preserved: revlogv1, store
370 preserved: revlogv1, store
346 added: dotencode, fncache, generaldelta, sparserevlog
371 added: dotencode, fncache, generaldelta, sparserevlog
347
372
348 fncache
373 fncache
349 repository will be more resilient to storing certain paths and performance of certain operations should be improved
374 repository will be more resilient to storing certain paths and performance of certain operations should be improved
350
375
351 dotencode
376 dotencode
352 repository will be better able to store files beginning with a space or period
377 repository will be better able to store files beginning with a space or period
353
378
354 generaldelta
379 generaldelta
355 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
380 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
356
381
357 sparserevlog
382 sparserevlog
358 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
383 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
359
384
385 processed revlogs:
386 - all-filelogs
387 - changelog
388 - manifest
389
360 additional optimizations are available by specifying "--optimize <name>":
390 additional optimizations are available by specifying "--optimize <name>":
361
391
362 re-delta-parent
392 re-delta-parent
363 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
393 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
364
394
365 re-delta-multibase
395 re-delta-multibase
366 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
396 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
367
397
368 re-delta-all
398 re-delta-all
369 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
399 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
370
400
371 re-delta-fulladd
401 re-delta-fulladd
372 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
402 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
373
403
374 $ hg debugupgraderepo --quiet
404 $ hg debugupgraderepo --quiet
375 requirements
405 requirements
376 preserved: revlogv1, store
406 preserved: revlogv1, store
377 added: dotencode, fncache, generaldelta, sparserevlog
407 added: dotencode, fncache, generaldelta, sparserevlog
378
408
409 processed revlogs:
410 - all-filelogs
411 - changelog
412 - manifest
413
379
414
380 $ hg --config format.dotencode=false debugupgraderepo
415 $ hg --config format.dotencode=false debugupgraderepo
381 repository lacks features recommended by current config options:
416 repository lacks features recommended by current config options:
382
417
383 fncache
418 fncache
384 long and reserved filenames may not work correctly; repository performance is sub-optimal
419 long and reserved filenames may not work correctly; repository performance is sub-optimal
385
420
386 generaldelta
421 generaldelta
387 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
422 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
388
423
389 sparserevlog
424 sparserevlog
390 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
425 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
391
426
392 repository lacks features used by the default config options:
427 repository lacks features used by the default config options:
393
428
394 dotencode
429 dotencode
395 storage of filenames beginning with a period or space may not work correctly
430 storage of filenames beginning with a period or space may not work correctly
396
431
397
432
398 performing an upgrade with "--run" will make the following changes:
433 performing an upgrade with "--run" will make the following changes:
399
434
400 requirements
435 requirements
401 preserved: revlogv1, store
436 preserved: revlogv1, store
402 added: fncache, generaldelta, sparserevlog
437 added: fncache, generaldelta, sparserevlog
403
438
404 fncache
439 fncache
405 repository will be more resilient to storing certain paths and performance of certain operations should be improved
440 repository will be more resilient to storing certain paths and performance of certain operations should be improved
406
441
407 generaldelta
442 generaldelta
408 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
443 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
409
444
410 sparserevlog
445 sparserevlog
411 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
446 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
412
447
448 processed revlogs:
449 - all-filelogs
450 - changelog
451 - manifest
452
413 additional optimizations are available by specifying "--optimize <name>":
453 additional optimizations are available by specifying "--optimize <name>":
414
454
415 re-delta-parent
455 re-delta-parent
416 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
456 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
417
457
418 re-delta-multibase
458 re-delta-multibase
419 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
459 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
420
460
421 re-delta-all
461 re-delta-all
422 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
462 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
423
463
424 re-delta-fulladd
464 re-delta-fulladd
425 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
465 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
426
466
427
467
428 $ cd ..
468 $ cd ..
429
469
430 Upgrading a repository that is already modern essentially no-ops
470 Upgrading a repository that is already modern essentially no-ops
431
471
432 $ hg init modern
472 $ hg init modern
433 $ hg -R modern debugupgraderepo --run
473 $ hg -R modern debugupgraderepo --run
434 upgrade will perform the following actions:
474 upgrade will perform the following actions:
435
475
436 requirements
476 requirements
437 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
477 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
438
478
479 processed revlogs:
480 - all-filelogs
481 - changelog
482 - manifest
483
439 beginning upgrade...
484 beginning upgrade...
440 repository locked and read-only
485 repository locked and read-only
441 creating temporary repository to stage migrated data: $TESTTMP/modern/.hg/upgrade.* (glob)
486 creating temporary repository to stage migrated data: $TESTTMP/modern/.hg/upgrade.* (glob)
442 (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)
443 data fully migrated to temporary repository
488 data fully migrated to temporary repository
444 marking source repository as being upgraded; clients will be unable to read from repository
489 marking source repository as being upgraded; clients will be unable to read from repository
445 starting in-place swap of repository data
490 starting in-place swap of repository data
446 replaced files will be backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
491 replaced files will be backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
447 replacing store...
492 replacing store...
448 store replacement complete; repository was inconsistent for *s (glob)
493 store replacement complete; repository was inconsistent for *s (glob)
449 finalizing requirements file and making repository readable again
494 finalizing requirements file and making repository readable again
450 removing temporary repository $TESTTMP/modern/.hg/upgrade.* (glob)
495 removing temporary repository $TESTTMP/modern/.hg/upgrade.* (glob)
451 copy of old repository backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
496 copy of old repository backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
452 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
497 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
453
498
454 Upgrading a repository to generaldelta works
499 Upgrading a repository to generaldelta works
455
500
456 $ hg --config format.usegeneraldelta=false init upgradegd
501 $ hg --config format.usegeneraldelta=false init upgradegd
457 $ cd upgradegd
502 $ cd upgradegd
458 $ touch f0
503 $ touch f0
459 $ hg -q commit -A -m initial
504 $ hg -q commit -A -m initial
460 $ mkdir FooBarDirectory.d
505 $ mkdir FooBarDirectory.d
461 $ touch FooBarDirectory.d/f1
506 $ touch FooBarDirectory.d/f1
462 $ hg -q commit -A -m 'add f1'
507 $ hg -q commit -A -m 'add f1'
463 $ hg -q up -r 0
508 $ hg -q up -r 0
464 >>> from __future__ import absolute_import, print_function
509 >>> from __future__ import absolute_import, print_function
465 >>> import random
510 >>> import random
466 >>> random.seed(0) # have a reproducible content
511 >>> random.seed(0) # have a reproducible content
467 >>> with open("f2", "wb") as f:
512 >>> with open("f2", "wb") as f:
468 ... for i in range(100000):
513 ... for i in range(100000):
469 ... f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None
514 ... f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None
470 $ hg -q commit -A -m 'add f2'
515 $ hg -q commit -A -m 'add f2'
471
516
472 make sure we have a .d file
517 make sure we have a .d file
473
518
474 $ ls -d .hg/store/data/*
519 $ ls -d .hg/store/data/*
475 .hg/store/data/_foo_bar_directory.d.hg
520 .hg/store/data/_foo_bar_directory.d.hg
476 .hg/store/data/f0.i
521 .hg/store/data/f0.i
477 .hg/store/data/f2.d
522 .hg/store/data/f2.d
478 .hg/store/data/f2.i
523 .hg/store/data/f2.i
479
524
480 $ hg debugupgraderepo --run --config format.sparse-revlog=false
525 $ hg debugupgraderepo --run --config format.sparse-revlog=false
481 upgrade will perform the following actions:
526 upgrade will perform the following actions:
482
527
483 requirements
528 requirements
484 preserved: dotencode, fncache, revlogv1, store
529 preserved: dotencode, fncache, revlogv1, store
485 added: generaldelta
530 added: generaldelta
486
531
487 generaldelta
532 generaldelta
488 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
533 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
489
534
535 processed revlogs:
536 - all-filelogs
537 - changelog
538 - manifest
539
490 beginning upgrade...
540 beginning upgrade...
491 repository locked and read-only
541 repository locked and read-only
492 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
542 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
493 (it is safe to interrupt this process any time before data migration completes)
543 (it is safe to interrupt this process any time before data migration completes)
494 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
544 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
495 migrating 519 KB in store; 1.05 MB tracked data
545 migrating 519 KB in store; 1.05 MB tracked data
496 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
546 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
497 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
547 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
498 migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data)
548 migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data)
499 finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes
549 finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes
500 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
550 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
501 finished migrating 3 changelog revisions; change in size: 0 bytes
551 finished migrating 3 changelog revisions; change in size: 0 bytes
502 finished migrating 9 total revisions; total change in store size: -17 bytes
552 finished migrating 9 total revisions; total change in store size: -17 bytes
503 copying phaseroots
553 copying phaseroots
504 data fully migrated to temporary repository
554 data fully migrated to temporary repository
505 marking source repository as being upgraded; clients will be unable to read from repository
555 marking source repository as being upgraded; clients will be unable to read from repository
506 starting in-place swap of repository data
556 starting in-place swap of repository data
507 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
557 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
508 replacing store...
558 replacing store...
509 store replacement complete; repository was inconsistent for *s (glob)
559 store replacement complete; repository was inconsistent for *s (glob)
510 finalizing requirements file and making repository readable again
560 finalizing requirements file and making repository readable again
511 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
561 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
512 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
562 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
513 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
563 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
514
564
515 Original requirements backed up
565 Original requirements backed up
516
566
517 $ cat .hg/upgradebackup.*/requires
567 $ cat .hg/upgradebackup.*/requires
518 dotencode
568 dotencode
519 fncache
569 fncache
520 revlogv1
570 revlogv1
521 store
571 store
522
572
523 generaldelta added to original requirements files
573 generaldelta added to original requirements files
524
574
525 $ cat .hg/requires
575 $ cat .hg/requires
526 dotencode
576 dotencode
527 fncache
577 fncache
528 generaldelta
578 generaldelta
529 revlogv1
579 revlogv1
530 store
580 store
531
581
532 store directory has files we expect
582 store directory has files we expect
533
583
534 $ ls .hg/store
584 $ ls .hg/store
535 00changelog.i
585 00changelog.i
536 00manifest.i
586 00manifest.i
537 data
587 data
538 fncache
588 fncache
539 phaseroots
589 phaseroots
540 undo
590 undo
541 undo.backupfiles
591 undo.backupfiles
542 undo.phaseroots
592 undo.phaseroots
543
593
544 manifest should be generaldelta
594 manifest should be generaldelta
545
595
546 $ hg debugrevlog -m | grep flags
596 $ hg debugrevlog -m | grep flags
547 flags : inline, generaldelta
597 flags : inline, generaldelta
548
598
549 verify should be happy
599 verify should be happy
550
600
551 $ hg verify
601 $ hg verify
552 checking changesets
602 checking changesets
553 checking manifests
603 checking manifests
554 crosschecking files in changesets and manifests
604 crosschecking files in changesets and manifests
555 checking files
605 checking files
556 checked 3 changesets with 3 changes to 3 files
606 checked 3 changesets with 3 changes to 3 files
557
607
558 old store should be backed up
608 old store should be backed up
559
609
560 $ ls -d .hg/upgradebackup.*/
610 $ ls -d .hg/upgradebackup.*/
561 .hg/upgradebackup.*/ (glob)
611 .hg/upgradebackup.*/ (glob)
562 $ ls .hg/upgradebackup.*/store
612 $ ls .hg/upgradebackup.*/store
563 00changelog.i
613 00changelog.i
564 00manifest.i
614 00manifest.i
565 data
615 data
566 fncache
616 fncache
567 phaseroots
617 phaseroots
568 undo
618 undo
569 undo.backup.fncache
619 undo.backup.fncache
570 undo.backupfiles
620 undo.backupfiles
571 undo.phaseroots
621 undo.phaseroots
572
622
573 unless --no-backup is passed
623 unless --no-backup is passed
574
624
575 $ rm -rf .hg/upgradebackup.*/
625 $ rm -rf .hg/upgradebackup.*/
576 $ hg debugupgraderepo --run --no-backup
626 $ hg debugupgraderepo --run --no-backup
577 upgrade will perform the following actions:
627 upgrade will perform the following actions:
578
628
579 requirements
629 requirements
580 preserved: dotencode, fncache, generaldelta, revlogv1, store
630 preserved: dotencode, fncache, generaldelta, revlogv1, store
581 added: sparserevlog
631 added: sparserevlog
582
632
583 sparserevlog
633 sparserevlog
584 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
634 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
585
635
636 processed revlogs:
637 - all-filelogs
638 - changelog
639 - manifest
640
586 beginning upgrade...
641 beginning upgrade...
587 repository locked and read-only
642 repository locked and read-only
588 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
643 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
589 (it is safe to interrupt this process any time before data migration completes)
644 (it is safe to interrupt this process any time before data migration completes)
590 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
645 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
591 migrating 519 KB in store; 1.05 MB tracked data
646 migrating 519 KB in store; 1.05 MB tracked data
592 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
647 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
593 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
648 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
594 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
649 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
595 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
650 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
596 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
651 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
597 finished migrating 3 changelog revisions; change in size: 0 bytes
652 finished migrating 3 changelog revisions; change in size: 0 bytes
598 finished migrating 9 total revisions; total change in store size: 0 bytes
653 finished migrating 9 total revisions; total change in store size: 0 bytes
599 copying phaseroots
654 copying phaseroots
600 data fully migrated to temporary repository
655 data fully migrated to temporary repository
601 marking source repository as being upgraded; clients will be unable to read from repository
656 marking source repository as being upgraded; clients will be unable to read from repository
602 starting in-place swap of repository data
657 starting in-place swap of repository data
603 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
658 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
604 replacing store...
659 replacing store...
605 store replacement complete; repository was inconsistent for * (glob)
660 store replacement complete; repository was inconsistent for * (glob)
606 finalizing requirements file and making repository readable again
661 finalizing requirements file and making repository readable again
607 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
662 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
608 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
663 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
609 $ ls -1 .hg/ | grep upgradebackup
664 $ ls -1 .hg/ | grep upgradebackup
610 [1]
665 [1]
611
666
612 We can restrict optimization to some revlog:
667 We can restrict optimization to some revlog:
613
668
614 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
669 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
615 upgrade will perform the following actions:
670 upgrade will perform the following actions:
616
671
617 requirements
672 requirements
618 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
673 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
619
674
620 optimisations: re-delta-parent
675 optimisations: re-delta-parent
621
676
622 re-delta-parent
677 re-delta-parent
623 deltas within internal storage will choose a new base revision if needed
678 deltas within internal storage will choose a new base revision if needed
624
679
680 processed revlogs:
681 - manifest
682
625 beginning upgrade...
683 beginning upgrade...
626 repository locked and read-only
684 repository locked and read-only
627 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
685 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
628 (it is safe to interrupt this process any time before data migration completes)
686 (it is safe to interrupt this process any time before data migration completes)
629 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
687 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
630 migrating 519 KB in store; 1.05 MB tracked data
688 migrating 519 KB in store; 1.05 MB tracked data
631 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
689 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
632 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
690 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
633 blindly copying data/f0.i containing 1 revisions
691 blindly copying data/f0.i containing 1 revisions
634 blindly copying data/f2.i containing 1 revisions
692 blindly copying data/f2.i containing 1 revisions
635 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
693 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
636 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
694 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
637 cloning 3 revisions from 00manifest.i
695 cloning 3 revisions from 00manifest.i
638 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
696 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
639 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
697 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
640 blindly copying 00changelog.i containing 3 revisions
698 blindly copying 00changelog.i containing 3 revisions
641 finished migrating 3 changelog revisions; change in size: 0 bytes
699 finished migrating 3 changelog revisions; change in size: 0 bytes
642 finished migrating 9 total revisions; total change in store size: 0 bytes
700 finished migrating 9 total revisions; total change in store size: 0 bytes
643 copying phaseroots
701 copying phaseroots
644 data fully migrated to temporary repository
702 data fully migrated to temporary repository
645 marking source repository as being upgraded; clients will be unable to read from repository
703 marking source repository as being upgraded; clients will be unable to read from repository
646 starting in-place swap of repository data
704 starting in-place swap of repository data
647 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
705 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
648 replacing store...
706 replacing store...
649 store replacement complete; repository was inconsistent for *s (glob)
707 store replacement complete; repository was inconsistent for *s (glob)
650 finalizing requirements file and making repository readable again
708 finalizing requirements file and making repository readable again
651 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
709 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
652 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
710 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
653
711
654 Check that the repo still works fine
712 Check that the repo still works fine
655
713
656 $ hg log -G --stat
714 $ hg log -G --stat
657 @ changeset: 2:76d4395f5413 (no-py3 !)
715 @ changeset: 2:76d4395f5413 (no-py3 !)
658 @ changeset: 2:fca376863211 (py3 !)
716 @ changeset: 2:fca376863211 (py3 !)
659 | tag: tip
717 | tag: tip
660 | parent: 0:ba592bf28da2
718 | parent: 0:ba592bf28da2
661 | user: test
719 | user: test
662 | date: Thu Jan 01 00:00:00 1970 +0000
720 | date: Thu Jan 01 00:00:00 1970 +0000
663 | summary: add f2
721 | summary: add f2
664 |
722 |
665 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
723 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
666 | 1 files changed, 100000 insertions(+), 0 deletions(-)
724 | 1 files changed, 100000 insertions(+), 0 deletions(-)
667 |
725 |
668 | o changeset: 1:2029ce2354e2
726 | o changeset: 1:2029ce2354e2
669 |/ user: test
727 |/ user: test
670 | date: Thu Jan 01 00:00:00 1970 +0000
728 | date: Thu Jan 01 00:00:00 1970 +0000
671 | summary: add f1
729 | summary: add f1
672 |
730 |
673 |
731 |
674 o changeset: 0:ba592bf28da2
732 o changeset: 0:ba592bf28da2
675 user: test
733 user: test
676 date: Thu Jan 01 00:00:00 1970 +0000
734 date: Thu Jan 01 00:00:00 1970 +0000
677 summary: initial
735 summary: initial
678
736
679
737
680
738
681 $ hg verify
739 $ hg verify
682 checking changesets
740 checking changesets
683 checking manifests
741 checking manifests
684 crosschecking files in changesets and manifests
742 crosschecking files in changesets and manifests
685 checking files
743 checking files
686 checked 3 changesets with 3 changes to 3 files
744 checked 3 changesets with 3 changes to 3 files
687
745
688 Check we can select negatively
746 Check we can select negatively
689
747
690 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
748 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
691 upgrade will perform the following actions:
749 upgrade will perform the following actions:
692
750
693 requirements
751 requirements
694 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
752 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
695
753
696 optimisations: re-delta-parent
754 optimisations: re-delta-parent
697
755
698 re-delta-parent
756 re-delta-parent
699 deltas within internal storage will choose a new base revision if needed
757 deltas within internal storage will choose a new base revision if needed
700
758
759 processed revlogs:
760 - all-filelogs
761 - changelog
762
701 beginning upgrade...
763 beginning upgrade...
702 repository locked and read-only
764 repository locked and read-only
703 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
765 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
704 (it is safe to interrupt this process any time before data migration completes)
766 (it is safe to interrupt this process any time before data migration completes)
705 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
767 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
706 migrating 519 KB in store; 1.05 MB tracked data
768 migrating 519 KB in store; 1.05 MB tracked data
707 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
769 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
708 cloning 1 revisions from data/FooBarDirectory.d/f1.i
770 cloning 1 revisions from data/FooBarDirectory.d/f1.i
709 cloning 1 revisions from data/f0.i
771 cloning 1 revisions from data/f0.i
710 cloning 1 revisions from data/f2.i
772 cloning 1 revisions from data/f2.i
711 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
773 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
712 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
774 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
713 blindly copying 00manifest.i containing 3 revisions
775 blindly copying 00manifest.i containing 3 revisions
714 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
776 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
715 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
777 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
716 cloning 3 revisions from 00changelog.i
778 cloning 3 revisions from 00changelog.i
717 finished migrating 3 changelog revisions; change in size: 0 bytes
779 finished migrating 3 changelog revisions; change in size: 0 bytes
718 finished migrating 9 total revisions; total change in store size: 0 bytes
780 finished migrating 9 total revisions; total change in store size: 0 bytes
719 copying phaseroots
781 copying phaseroots
720 data fully migrated to temporary repository
782 data fully migrated to temporary repository
721 marking source repository as being upgraded; clients will be unable to read from repository
783 marking source repository as being upgraded; clients will be unable to read from repository
722 starting in-place swap of repository data
784 starting in-place swap of repository data
723 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
785 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
724 replacing store...
786 replacing store...
725 store replacement complete; repository was inconsistent for *s (glob)
787 store replacement complete; repository was inconsistent for *s (glob)
726 finalizing requirements file and making repository readable again
788 finalizing requirements file and making repository readable again
727 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
789 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
728 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
790 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
729 $ hg verify
791 $ hg verify
730 checking changesets
792 checking changesets
731 checking manifests
793 checking manifests
732 crosschecking files in changesets and manifests
794 crosschecking files in changesets and manifests
733 checking files
795 checking files
734 checked 3 changesets with 3 changes to 3 files
796 checked 3 changesets with 3 changes to 3 files
735
797
736 Check that we can select changelog only
798 Check that we can select changelog only
737
799
738 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
800 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
739 upgrade will perform the following actions:
801 upgrade will perform the following actions:
740
802
741 requirements
803 requirements
742 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
804 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
743
805
744 optimisations: re-delta-parent
806 optimisations: re-delta-parent
745
807
746 re-delta-parent
808 re-delta-parent
747 deltas within internal storage will choose a new base revision if needed
809 deltas within internal storage will choose a new base revision if needed
748
810
811 processed revlogs:
812 - changelog
813
749 beginning upgrade...
814 beginning upgrade...
750 repository locked and read-only
815 repository locked and read-only
751 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
816 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
752 (it is safe to interrupt this process any time before data migration completes)
817 (it is safe to interrupt this process any time before data migration completes)
753 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
818 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
754 migrating 519 KB in store; 1.05 MB tracked data
819 migrating 519 KB in store; 1.05 MB tracked data
755 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
820 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
756 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
821 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
757 blindly copying data/f0.i containing 1 revisions
822 blindly copying data/f0.i containing 1 revisions
758 blindly copying data/f2.i containing 1 revisions
823 blindly copying data/f2.i containing 1 revisions
759 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
824 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
760 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
825 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
761 blindly copying 00manifest.i containing 3 revisions
826 blindly copying 00manifest.i containing 3 revisions
762 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
827 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
763 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
828 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
764 cloning 3 revisions from 00changelog.i
829 cloning 3 revisions from 00changelog.i
765 finished migrating 3 changelog revisions; change in size: 0 bytes
830 finished migrating 3 changelog revisions; change in size: 0 bytes
766 finished migrating 9 total revisions; total change in store size: 0 bytes
831 finished migrating 9 total revisions; total change in store size: 0 bytes
767 copying phaseroots
832 copying phaseroots
768 data fully migrated to temporary repository
833 data fully migrated to temporary repository
769 marking source repository as being upgraded; clients will be unable to read from repository
834 marking source repository as being upgraded; clients will be unable to read from repository
770 starting in-place swap of repository data
835 starting in-place swap of repository data
771 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
836 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
772 replacing store...
837 replacing store...
773 store replacement complete; repository was inconsistent for *s (glob)
838 store replacement complete; repository was inconsistent for *s (glob)
774 finalizing requirements file and making repository readable again
839 finalizing requirements file and making repository readable again
775 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
840 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
776 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
841 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
777 $ hg verify
842 $ hg verify
778 checking changesets
843 checking changesets
779 checking manifests
844 checking manifests
780 crosschecking files in changesets and manifests
845 crosschecking files in changesets and manifests
781 checking files
846 checking files
782 checked 3 changesets with 3 changes to 3 files
847 checked 3 changesets with 3 changes to 3 files
783
848
784 Check that we can select filelog only
849 Check that we can select filelog only
785
850
786 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
851 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
787 upgrade will perform the following actions:
852 upgrade will perform the following actions:
788
853
789 requirements
854 requirements
790 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
855 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
791
856
792 optimisations: re-delta-parent
857 optimisations: re-delta-parent
793
858
794 re-delta-parent
859 re-delta-parent
795 deltas within internal storage will choose a new base revision if needed
860 deltas within internal storage will choose a new base revision if needed
796
861
862 processed revlogs:
863 - all-filelogs
864
797 beginning upgrade...
865 beginning upgrade...
798 repository locked and read-only
866 repository locked and read-only
799 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
867 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
800 (it is safe to interrupt this process any time before data migration completes)
868 (it is safe to interrupt this process any time before data migration completes)
801 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
869 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
802 migrating 519 KB in store; 1.05 MB tracked data
870 migrating 519 KB in store; 1.05 MB tracked data
803 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
871 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
804 cloning 1 revisions from data/FooBarDirectory.d/f1.i
872 cloning 1 revisions from data/FooBarDirectory.d/f1.i
805 cloning 1 revisions from data/f0.i
873 cloning 1 revisions from data/f0.i
806 cloning 1 revisions from data/f2.i
874 cloning 1 revisions from data/f2.i
807 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
875 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
808 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
876 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
809 blindly copying 00manifest.i containing 3 revisions
877 blindly copying 00manifest.i containing 3 revisions
810 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
878 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
811 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
879 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
812 blindly copying 00changelog.i containing 3 revisions
880 blindly copying 00changelog.i containing 3 revisions
813 finished migrating 3 changelog revisions; change in size: 0 bytes
881 finished migrating 3 changelog revisions; change in size: 0 bytes
814 finished migrating 9 total revisions; total change in store size: 0 bytes
882 finished migrating 9 total revisions; total change in store size: 0 bytes
815 copying phaseroots
883 copying phaseroots
816 data fully migrated to temporary repository
884 data fully migrated to temporary repository
817 marking source repository as being upgraded; clients will be unable to read from repository
885 marking source repository as being upgraded; clients will be unable to read from repository
818 starting in-place swap of repository data
886 starting in-place swap of repository data
819 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
887 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
820 replacing store...
888 replacing store...
821 store replacement complete; repository was inconsistent for *s (glob)
889 store replacement complete; repository was inconsistent for *s (glob)
822 finalizing requirements file and making repository readable again
890 finalizing requirements file and making repository readable again
823 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
891 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
824 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
892 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
825 $ hg verify
893 $ hg verify
826 checking changesets
894 checking changesets
827 checking manifests
895 checking manifests
828 crosschecking files in changesets and manifests
896 crosschecking files in changesets and manifests
829 checking files
897 checking files
830 checked 3 changesets with 3 changes to 3 files
898 checked 3 changesets with 3 changes to 3 files
831
899
832
900
833 Check you can't skip revlog clone during important format downgrade
901 Check you can't skip revlog clone during important format downgrade
834
902
835 $ echo "[format]" > .hg/hgrc
903 $ echo "[format]" > .hg/hgrc
836 $ echo "sparse-revlog=no" >> .hg/hgrc
904 $ echo "sparse-revlog=no" >> .hg/hgrc
837 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
905 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
838 ignoring revlogs selection flags, format requirements change: sparserevlog
906 ignoring revlogs selection flags, format requirements change: sparserevlog
839 upgrade will perform the following actions:
907 upgrade will perform the following actions:
840
908
841 requirements
909 requirements
842 preserved: dotencode, fncache, generaldelta, revlogv1, store
910 preserved: dotencode, fncache, generaldelta, revlogv1, store
843 removed: sparserevlog
911 removed: sparserevlog
844
912
845 optimisations: re-delta-parent
913 optimisations: re-delta-parent
846
914
847 re-delta-parent
915 re-delta-parent
848 deltas within internal storage will choose a new base revision if needed
916 deltas within internal storage will choose a new base revision if needed
849
917
918 processed revlogs:
919 - all-filelogs
920 - changelog
921 - manifest
922
850 beginning upgrade...
923 beginning upgrade...
851 repository locked and read-only
924 repository locked and read-only
852 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
925 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
853 (it is safe to interrupt this process any time before data migration completes)
926 (it is safe to interrupt this process any time before data migration completes)
854 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
927 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
855 migrating 519 KB in store; 1.05 MB tracked data
928 migrating 519 KB in store; 1.05 MB tracked data
856 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
929 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
857 cloning 1 revisions from data/FooBarDirectory.d/f1.i
930 cloning 1 revisions from data/FooBarDirectory.d/f1.i
858 cloning 1 revisions from data/f0.i
931 cloning 1 revisions from data/f0.i
859 cloning 1 revisions from data/f2.i
932 cloning 1 revisions from data/f2.i
860 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
933 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
861 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
934 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
862 cloning 3 revisions from 00manifest.i
935 cloning 3 revisions from 00manifest.i
863 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
936 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
864 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
937 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
865 cloning 3 revisions from 00changelog.i
938 cloning 3 revisions from 00changelog.i
866 finished migrating 3 changelog revisions; change in size: 0 bytes
939 finished migrating 3 changelog revisions; change in size: 0 bytes
867 finished migrating 9 total revisions; total change in store size: 0 bytes
940 finished migrating 9 total revisions; total change in store size: 0 bytes
868 copying phaseroots
941 copying phaseroots
869 data fully migrated to temporary repository
942 data fully migrated to temporary repository
870 marking source repository as being upgraded; clients will be unable to read from repository
943 marking source repository as being upgraded; clients will be unable to read from repository
871 starting in-place swap of repository data
944 starting in-place swap of repository data
872 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
945 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
873 replacing store...
946 replacing store...
874 store replacement complete; repository was inconsistent for *s (glob)
947 store replacement complete; repository was inconsistent for *s (glob)
875 finalizing requirements file and making repository readable again
948 finalizing requirements file and making repository readable again
876 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
949 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
877 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
950 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
878 $ hg verify
951 $ hg verify
879 checking changesets
952 checking changesets
880 checking manifests
953 checking manifests
881 crosschecking files in changesets and manifests
954 crosschecking files in changesets and manifests
882 checking files
955 checking files
883 checked 3 changesets with 3 changes to 3 files
956 checked 3 changesets with 3 changes to 3 files
884
957
885 Check you can't skip revlog clone during important format upgrade
958 Check you can't skip revlog clone during important format upgrade
886
959
887 $ echo "sparse-revlog=yes" >> .hg/hgrc
960 $ echo "sparse-revlog=yes" >> .hg/hgrc
888 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
961 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
889 ignoring revlogs selection flags, format requirements change: sparserevlog
962 ignoring revlogs selection flags, format requirements change: sparserevlog
890 upgrade will perform the following actions:
963 upgrade will perform the following actions:
891
964
892 requirements
965 requirements
893 preserved: dotencode, fncache, generaldelta, revlogv1, store
966 preserved: dotencode, fncache, generaldelta, revlogv1, store
894 added: sparserevlog
967 added: sparserevlog
895
968
896 optimisations: re-delta-parent
969 optimisations: re-delta-parent
897
970
898 sparserevlog
971 sparserevlog
899 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
972 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
900
973
901 re-delta-parent
974 re-delta-parent
902 deltas within internal storage will choose a new base revision if needed
975 deltas within internal storage will choose a new base revision if needed
903
976
977 processed revlogs:
978 - all-filelogs
979 - changelog
980 - manifest
981
904 beginning upgrade...
982 beginning upgrade...
905 repository locked and read-only
983 repository locked and read-only
906 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
984 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
907 (it is safe to interrupt this process any time before data migration completes)
985 (it is safe to interrupt this process any time before data migration completes)
908 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
986 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
909 migrating 519 KB in store; 1.05 MB tracked data
987 migrating 519 KB in store; 1.05 MB tracked data
910 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
988 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
911 cloning 1 revisions from data/FooBarDirectory.d/f1.i
989 cloning 1 revisions from data/FooBarDirectory.d/f1.i
912 cloning 1 revisions from data/f0.i
990 cloning 1 revisions from data/f0.i
913 cloning 1 revisions from data/f2.i
991 cloning 1 revisions from data/f2.i
914 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
992 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
915 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
993 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
916 cloning 3 revisions from 00manifest.i
994 cloning 3 revisions from 00manifest.i
917 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
995 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
918 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
996 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
919 cloning 3 revisions from 00changelog.i
997 cloning 3 revisions from 00changelog.i
920 finished migrating 3 changelog revisions; change in size: 0 bytes
998 finished migrating 3 changelog revisions; change in size: 0 bytes
921 finished migrating 9 total revisions; total change in store size: 0 bytes
999 finished migrating 9 total revisions; total change in store size: 0 bytes
922 copying phaseroots
1000 copying phaseroots
923 data fully migrated to temporary repository
1001 data fully migrated to temporary repository
924 marking source repository as being upgraded; clients will be unable to read from repository
1002 marking source repository as being upgraded; clients will be unable to read from repository
925 starting in-place swap of repository data
1003 starting in-place swap of repository data
926 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
1004 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
927 replacing store...
1005 replacing store...
928 store replacement complete; repository was inconsistent for *s (glob)
1006 store replacement complete; repository was inconsistent for *s (glob)
929 finalizing requirements file and making repository readable again
1007 finalizing requirements file and making repository readable again
930 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
1008 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
931 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1009 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
932 $ hg verify
1010 $ hg verify
933 checking changesets
1011 checking changesets
934 checking manifests
1012 checking manifests
935 crosschecking files in changesets and manifests
1013 crosschecking files in changesets and manifests
936 checking files
1014 checking files
937 checked 3 changesets with 3 changes to 3 files
1015 checked 3 changesets with 3 changes to 3 files
938
1016
939 $ cd ..
1017 $ cd ..
940
1018
941 store files with special filenames aren't encoded during copy
1019 store files with special filenames aren't encoded during copy
942
1020
943 $ hg init store-filenames
1021 $ hg init store-filenames
944 $ cd store-filenames
1022 $ cd store-filenames
945 $ touch foo
1023 $ touch foo
946 $ hg -q commit -A -m initial
1024 $ hg -q commit -A -m initial
947 $ touch .hg/store/.XX_special_filename
1025 $ touch .hg/store/.XX_special_filename
948
1026
949 $ hg debugupgraderepo --run
1027 $ hg debugupgraderepo --run
950 upgrade will perform the following actions:
1028 upgrade will perform the following actions:
951
1029
952 requirements
1030 requirements
953 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1031 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
954
1032
1033 processed revlogs:
1034 - all-filelogs
1035 - changelog
1036 - manifest
1037
955 beginning upgrade...
1038 beginning upgrade...
956 repository locked and read-only
1039 repository locked and read-only
957 creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1040 creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
958 (it is safe to interrupt this process any time before data migration completes)
1041 (it is safe to interrupt this process any time before data migration completes)
959 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1042 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
960 migrating 301 bytes in store; 107 bytes tracked data
1043 migrating 301 bytes in store; 107 bytes tracked data
961 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1044 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
962 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1045 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
963 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1046 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
964 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1047 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
965 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1048 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
966 finished migrating 1 changelog revisions; change in size: 0 bytes
1049 finished migrating 1 changelog revisions; change in size: 0 bytes
967 finished migrating 3 total revisions; total change in store size: 0 bytes
1050 finished migrating 3 total revisions; total change in store size: 0 bytes
968 copying .XX_special_filename
1051 copying .XX_special_filename
969 copying phaseroots
1052 copying phaseroots
970 data fully migrated to temporary repository
1053 data fully migrated to temporary repository
971 marking source repository as being upgraded; clients will be unable to read from repository
1054 marking source repository as being upgraded; clients will be unable to read from repository
972 starting in-place swap of repository data
1055 starting in-place swap of repository data
973 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1056 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
974 replacing store...
1057 replacing store...
975 store replacement complete; repository was inconsistent for *s (glob)
1058 store replacement complete; repository was inconsistent for *s (glob)
976 finalizing requirements file and making repository readable again
1059 finalizing requirements file and making repository readable again
977 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1060 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
978 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1061 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
979 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1062 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
980 $ hg debugupgraderepo --run --optimize redeltafulladd
1063 $ hg debugupgraderepo --run --optimize redeltafulladd
981 upgrade will perform the following actions:
1064 upgrade will perform the following actions:
982
1065
983 requirements
1066 requirements
984 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1067 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
985
1068
986 optimisations: re-delta-fulladd
1069 optimisations: re-delta-fulladd
987
1070
988 re-delta-fulladd
1071 re-delta-fulladd
989 each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it
1072 each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it
990
1073
1074 processed revlogs:
1075 - all-filelogs
1076 - changelog
1077 - manifest
1078
991 beginning upgrade...
1079 beginning upgrade...
992 repository locked and read-only
1080 repository locked and read-only
993 creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1081 creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
994 (it is safe to interrupt this process any time before data migration completes)
1082 (it is safe to interrupt this process any time before data migration completes)
995 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1083 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
996 migrating 301 bytes in store; 107 bytes tracked data
1084 migrating 301 bytes in store; 107 bytes tracked data
997 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1085 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
998 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1086 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
999 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1087 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1000 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1088 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1001 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1089 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1002 finished migrating 1 changelog revisions; change in size: 0 bytes
1090 finished migrating 1 changelog revisions; change in size: 0 bytes
1003 finished migrating 3 total revisions; total change in store size: 0 bytes
1091 finished migrating 3 total revisions; total change in store size: 0 bytes
1004 copying .XX_special_filename
1092 copying .XX_special_filename
1005 copying phaseroots
1093 copying phaseroots
1006 data fully migrated to temporary repository
1094 data fully migrated to temporary repository
1007 marking source repository as being upgraded; clients will be unable to read from repository
1095 marking source repository as being upgraded; clients will be unable to read from repository
1008 starting in-place swap of repository data
1096 starting in-place swap of repository data
1009 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1097 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1010 replacing store...
1098 replacing store...
1011 store replacement complete; repository was inconsistent for *s (glob)
1099 store replacement complete; repository was inconsistent for *s (glob)
1012 finalizing requirements file and making repository readable again
1100 finalizing requirements file and making repository readable again
1013 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1101 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1014 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1102 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1015 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1103 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1016
1104
1017 fncache is valid after upgrade
1105 fncache is valid after upgrade
1018
1106
1019 $ hg debugrebuildfncache
1107 $ hg debugrebuildfncache
1020 fncache already up to date
1108 fncache already up to date
1021
1109
1022 $ cd ..
1110 $ cd ..
1023
1111
1024 Check upgrading a large file repository
1112 Check upgrading a large file repository
1025 ---------------------------------------
1113 ---------------------------------------
1026
1114
1027 $ hg init largefilesrepo
1115 $ hg init largefilesrepo
1028 $ cat << EOF >> largefilesrepo/.hg/hgrc
1116 $ cat << EOF >> largefilesrepo/.hg/hgrc
1029 > [extensions]
1117 > [extensions]
1030 > largefiles =
1118 > largefiles =
1031 > EOF
1119 > EOF
1032
1120
1033 $ cd largefilesrepo
1121 $ cd largefilesrepo
1034 $ touch foo
1122 $ touch foo
1035 $ hg add --large foo
1123 $ hg add --large foo
1036 $ hg -q commit -m initial
1124 $ hg -q commit -m initial
1037 $ cat .hg/requires
1125 $ cat .hg/requires
1038 dotencode
1126 dotencode
1039 fncache
1127 fncache
1040 generaldelta
1128 generaldelta
1041 largefiles
1129 largefiles
1042 revlogv1
1130 revlogv1
1043 sparserevlog
1131 sparserevlog
1044 store
1132 store
1045
1133
1046 $ hg debugupgraderepo --run
1134 $ hg debugupgraderepo --run
1047 upgrade will perform the following actions:
1135 upgrade will perform the following actions:
1048
1136
1049 requirements
1137 requirements
1050 preserved: dotencode, fncache, generaldelta, largefiles, revlogv1, sparserevlog, store
1138 preserved: dotencode, fncache, generaldelta, largefiles, revlogv1, sparserevlog, store
1051
1139
1140 processed revlogs:
1141 - all-filelogs
1142 - changelog
1143 - manifest
1144
1052 beginning upgrade...
1145 beginning upgrade...
1053 repository locked and read-only
1146 repository locked and read-only
1054 creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1147 creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1055 (it is safe to interrupt this process any time before data migration completes)
1148 (it is safe to interrupt this process any time before data migration completes)
1056 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1149 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1057 migrating 355 bytes in store; 160 bytes tracked data
1150 migrating 355 bytes in store; 160 bytes tracked data
1058 migrating 1 filelogs containing 1 revisions (106 bytes in store; 41 bytes tracked data)
1151 migrating 1 filelogs containing 1 revisions (106 bytes in store; 41 bytes tracked data)
1059 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1152 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1060 migrating 1 manifests containing 1 revisions (116 bytes in store; 51 bytes tracked data)
1153 migrating 1 manifests containing 1 revisions (116 bytes in store; 51 bytes tracked data)
1061 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1154 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1062 migrating changelog containing 1 revisions (133 bytes in store; 68 bytes tracked data)
1155 migrating changelog containing 1 revisions (133 bytes in store; 68 bytes tracked data)
1063 finished migrating 1 changelog revisions; change in size: 0 bytes
1156 finished migrating 1 changelog revisions; change in size: 0 bytes
1064 finished migrating 3 total revisions; total change in store size: 0 bytes
1157 finished migrating 3 total revisions; total change in store size: 0 bytes
1065 copying phaseroots
1158 copying phaseroots
1066 data fully migrated to temporary repository
1159 data fully migrated to temporary repository
1067 marking source repository as being upgraded; clients will be unable to read from repository
1160 marking source repository as being upgraded; clients will be unable to read from repository
1068 starting in-place swap of repository data
1161 starting in-place swap of repository data
1069 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1162 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1070 replacing store...
1163 replacing store...
1071 store replacement complete; repository was inconsistent for *s (glob)
1164 store replacement complete; repository was inconsistent for *s (glob)
1072 finalizing requirements file and making repository readable again
1165 finalizing requirements file and making repository readable again
1073 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1166 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1074 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1167 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1075 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1168 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1076 $ cat .hg/requires
1169 $ cat .hg/requires
1077 dotencode
1170 dotencode
1078 fncache
1171 fncache
1079 generaldelta
1172 generaldelta
1080 largefiles
1173 largefiles
1081 revlogv1
1174 revlogv1
1082 sparserevlog
1175 sparserevlog
1083 store
1176 store
1084
1177
1085 $ cat << EOF >> .hg/hgrc
1178 $ cat << EOF >> .hg/hgrc
1086 > [extensions]
1179 > [extensions]
1087 > lfs =
1180 > lfs =
1088 > [lfs]
1181 > [lfs]
1089 > threshold = 10
1182 > threshold = 10
1090 > EOF
1183 > EOF
1091 $ echo '123456789012345' > lfs.bin
1184 $ echo '123456789012345' > lfs.bin
1092 $ hg ci -Am 'lfs.bin'
1185 $ hg ci -Am 'lfs.bin'
1093 adding lfs.bin
1186 adding lfs.bin
1094 $ grep lfs .hg/requires
1187 $ grep lfs .hg/requires
1095 lfs
1188 lfs
1096 $ find .hg/store/lfs -type f
1189 $ find .hg/store/lfs -type f
1097 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1190 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1098
1191
1099 $ hg debugupgraderepo --run
1192 $ hg debugupgraderepo --run
1100 upgrade will perform the following actions:
1193 upgrade will perform the following actions:
1101
1194
1102 requirements
1195 requirements
1103 preserved: dotencode, fncache, generaldelta, largefiles, lfs, revlogv1, sparserevlog, store
1196 preserved: dotencode, fncache, generaldelta, largefiles, lfs, revlogv1, sparserevlog, store
1104
1197
1198 processed revlogs:
1199 - all-filelogs
1200 - changelog
1201 - manifest
1202
1105 beginning upgrade...
1203 beginning upgrade...
1106 repository locked and read-only
1204 repository locked and read-only
1107 creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1205 creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1108 (it is safe to interrupt this process any time before data migration completes)
1206 (it is safe to interrupt this process any time before data migration completes)
1109 migrating 6 total revisions (2 in filelogs, 2 in manifests, 2 in changelog)
1207 migrating 6 total revisions (2 in filelogs, 2 in manifests, 2 in changelog)
1110 migrating 801 bytes in store; 467 bytes tracked data
1208 migrating 801 bytes in store; 467 bytes tracked data
1111 migrating 2 filelogs containing 2 revisions (296 bytes in store; 182 bytes tracked data)
1209 migrating 2 filelogs containing 2 revisions (296 bytes in store; 182 bytes tracked data)
1112 finished migrating 2 filelog revisions across 2 filelogs; change in size: 0 bytes
1210 finished migrating 2 filelog revisions across 2 filelogs; change in size: 0 bytes
1113 migrating 1 manifests containing 2 revisions (241 bytes in store; 151 bytes tracked data)
1211 migrating 1 manifests containing 2 revisions (241 bytes in store; 151 bytes tracked data)
1114 finished migrating 2 manifest revisions across 1 manifests; change in size: 0 bytes
1212 finished migrating 2 manifest revisions across 1 manifests; change in size: 0 bytes
1115 migrating changelog containing 2 revisions (264 bytes in store; 134 bytes tracked data)
1213 migrating changelog containing 2 revisions (264 bytes in store; 134 bytes tracked data)
1116 finished migrating 2 changelog revisions; change in size: 0 bytes
1214 finished migrating 2 changelog revisions; change in size: 0 bytes
1117 finished migrating 6 total revisions; total change in store size: 0 bytes
1215 finished migrating 6 total revisions; total change in store size: 0 bytes
1118 copying phaseroots
1216 copying phaseroots
1119 copying lfs blob d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1217 copying lfs blob d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1120 data fully migrated to temporary repository
1218 data fully migrated to temporary repository
1121 marking source repository as being upgraded; clients will be unable to read from repository
1219 marking source repository as being upgraded; clients will be unable to read from repository
1122 starting in-place swap of repository data
1220 starting in-place swap of repository data
1123 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1221 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1124 replacing store...
1222 replacing store...
1125 store replacement complete; repository was inconsistent for *s (glob)
1223 store replacement complete; repository was inconsistent for *s (glob)
1126 finalizing requirements file and making repository readable again
1224 finalizing requirements file and making repository readable again
1127 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1225 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1128 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1226 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1129 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1227 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1130
1228
1131 $ grep lfs .hg/requires
1229 $ grep lfs .hg/requires
1132 lfs
1230 lfs
1133 $ find .hg/store/lfs -type f
1231 $ find .hg/store/lfs -type f
1134 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1232 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1135 $ hg verify
1233 $ hg verify
1136 checking changesets
1234 checking changesets
1137 checking manifests
1235 checking manifests
1138 crosschecking files in changesets and manifests
1236 crosschecking files in changesets and manifests
1139 checking files
1237 checking files
1140 checked 2 changesets with 2 changes to 2 files
1238 checked 2 changesets with 2 changes to 2 files
1141 $ hg debugdata lfs.bin 0
1239 $ hg debugdata lfs.bin 0
1142 version https://git-lfs.github.com/spec/v1
1240 version https://git-lfs.github.com/spec/v1
1143 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1241 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1144 size 16
1242 size 16
1145 x-is-binary 0
1243 x-is-binary 0
1146
1244
1147 $ cd ..
1245 $ cd ..
1148
1246
1149 repository config is taken in account
1247 repository config is taken in account
1150 -------------------------------------
1248 -------------------------------------
1151
1249
1152 $ cat << EOF >> $HGRCPATH
1250 $ cat << EOF >> $HGRCPATH
1153 > [format]
1251 > [format]
1154 > maxchainlen = 1
1252 > maxchainlen = 1
1155 > EOF
1253 > EOF
1156
1254
1157 $ hg init localconfig
1255 $ hg init localconfig
1158 $ cd localconfig
1256 $ cd localconfig
1159 $ cat << EOF > file
1257 $ cat << EOF > file
1160 > some content
1258 > some content
1161 > with some length
1259 > with some length
1162 > to make sure we get a delta
1260 > to make sure we get a delta
1163 > after changes
1261 > after changes
1164 > very long
1262 > very long
1165 > very long
1263 > very long
1166 > very long
1264 > very long
1167 > very long
1265 > very long
1168 > very long
1266 > very long
1169 > very long
1267 > very long
1170 > very long
1268 > very long
1171 > very long
1269 > very long
1172 > very long
1270 > very long
1173 > very long
1271 > very long
1174 > very long
1272 > very long
1175 > EOF
1273 > EOF
1176 $ hg -q commit -A -m A
1274 $ hg -q commit -A -m A
1177 $ echo "new line" >> file
1275 $ echo "new line" >> file
1178 $ hg -q commit -m B
1276 $ hg -q commit -m B
1179 $ echo "new line" >> file
1277 $ echo "new line" >> file
1180 $ hg -q commit -m C
1278 $ hg -q commit -m C
1181
1279
1182 $ cat << EOF >> .hg/hgrc
1280 $ cat << EOF >> .hg/hgrc
1183 > [format]
1281 > [format]
1184 > maxchainlen = 9001
1282 > maxchainlen = 9001
1185 > EOF
1283 > EOF
1186 $ hg config format
1284 $ hg config format
1187 format.maxchainlen=9001
1285 format.maxchainlen=9001
1188 $ hg debugdeltachain file
1286 $ hg debugdeltachain file
1189 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1287 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1190 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1288 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1191 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1289 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1192 2 1 2 0 other 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1290 2 1 2 0 other 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1193
1291
1194 $ hg debugupgraderepo --run --optimize redeltaall
1292 $ hg debugupgraderepo --run --optimize redeltaall
1195 upgrade will perform the following actions:
1293 upgrade will perform the following actions:
1196
1294
1197 requirements
1295 requirements
1198 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1296 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1199
1297
1200 optimisations: re-delta-all
1298 optimisations: re-delta-all
1201
1299
1202 re-delta-all
1300 re-delta-all
1203 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1301 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1204
1302
1303 processed revlogs:
1304 - all-filelogs
1305 - changelog
1306 - manifest
1307
1205 beginning upgrade...
1308 beginning upgrade...
1206 repository locked and read-only
1309 repository locked and read-only
1207 creating temporary repository to stage migrated data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1310 creating temporary repository to stage migrated data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1208 (it is safe to interrupt this process any time before data migration completes)
1311 (it is safe to interrupt this process any time before data migration completes)
1209 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1312 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1210 migrating 1019 bytes in store; 882 bytes tracked data
1313 migrating 1019 bytes in store; 882 bytes tracked data
1211 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
1314 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
1212 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
1315 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
1213 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
1316 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
1214 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1317 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1215 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
1318 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
1216 finished migrating 3 changelog revisions; change in size: 0 bytes
1319 finished migrating 3 changelog revisions; change in size: 0 bytes
1217 finished migrating 9 total revisions; total change in store size: -9 bytes
1320 finished migrating 9 total revisions; total change in store size: -9 bytes
1218 copying phaseroots
1321 copying phaseroots
1219 data fully migrated to temporary repository
1322 data fully migrated to temporary repository
1220 marking source repository as being upgraded; clients will be unable to read from repository
1323 marking source repository as being upgraded; clients will be unable to read from repository
1221 starting in-place swap of repository data
1324 starting in-place swap of repository data
1222 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1325 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1223 replacing store...
1326 replacing store...
1224 store replacement complete; repository was inconsistent for *s (glob)
1327 store replacement complete; repository was inconsistent for *s (glob)
1225 finalizing requirements file and making repository readable again
1328 finalizing requirements file and making repository readable again
1226 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1329 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1227 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1330 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1228 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1331 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1229 $ hg debugdeltachain file
1332 $ hg debugdeltachain file
1230 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1333 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1231 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1334 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1232 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1335 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1233 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1336 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1234 $ cd ..
1337 $ cd ..
1235
1338
1236 $ cat << EOF >> $HGRCPATH
1339 $ cat << EOF >> $HGRCPATH
1237 > [format]
1340 > [format]
1238 > maxchainlen = 9001
1341 > maxchainlen = 9001
1239 > EOF
1342 > EOF
1240
1343
1241 Check upgrading a sparse-revlog repository
1344 Check upgrading a sparse-revlog repository
1242 ---------------------------------------
1345 ---------------------------------------
1243
1346
1244 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1347 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1245 $ cd sparserevlogrepo
1348 $ cd sparserevlogrepo
1246 $ touch foo
1349 $ touch foo
1247 $ hg add foo
1350 $ hg add foo
1248 $ hg -q commit -m "foo"
1351 $ hg -q commit -m "foo"
1249 $ cat .hg/requires
1352 $ cat .hg/requires
1250 dotencode
1353 dotencode
1251 fncache
1354 fncache
1252 generaldelta
1355 generaldelta
1253 revlogv1
1356 revlogv1
1254 store
1357 store
1255
1358
1256 Check that we can add the sparse-revlog format requirement
1359 Check that we can add the sparse-revlog format requirement
1257 $ hg --config format.sparse-revlog=yes debugupgraderepo --run --quiet
1360 $ hg --config format.sparse-revlog=yes debugupgraderepo --run --quiet
1258 upgrade will perform the following actions:
1361 upgrade will perform the following actions:
1259
1362
1260 requirements
1363 requirements
1261 preserved: dotencode, fncache, generaldelta, revlogv1, store
1364 preserved: dotencode, fncache, generaldelta, revlogv1, store
1262 added: sparserevlog
1365 added: sparserevlog
1263
1366
1367 processed revlogs:
1368 - all-filelogs
1369 - changelog
1370 - manifest
1371
1264 $ cat .hg/requires
1372 $ cat .hg/requires
1265 dotencode
1373 dotencode
1266 fncache
1374 fncache
1267 generaldelta
1375 generaldelta
1268 revlogv1
1376 revlogv1
1269 sparserevlog
1377 sparserevlog
1270 store
1378 store
1271
1379
1272 Check that we can remove the sparse-revlog format requirement
1380 Check that we can remove the sparse-revlog format requirement
1273 $ hg --config format.sparse-revlog=no debugupgraderepo --run --quiet
1381 $ hg --config format.sparse-revlog=no debugupgraderepo --run --quiet
1274 upgrade will perform the following actions:
1382 upgrade will perform the following actions:
1275
1383
1276 requirements
1384 requirements
1277 preserved: dotencode, fncache, generaldelta, revlogv1, store
1385 preserved: dotencode, fncache, generaldelta, revlogv1, store
1278 removed: sparserevlog
1386 removed: sparserevlog
1279
1387
1388 processed revlogs:
1389 - all-filelogs
1390 - changelog
1391 - manifest
1392
1280 $ cat .hg/requires
1393 $ cat .hg/requires
1281 dotencode
1394 dotencode
1282 fncache
1395 fncache
1283 generaldelta
1396 generaldelta
1284 revlogv1
1397 revlogv1
1285 store
1398 store
1286
1399
1287 #if zstd
1400 #if zstd
1288
1401
1289 Check upgrading to a zstd revlog
1402 Check upgrading to a zstd revlog
1290 --------------------------------
1403 --------------------------------
1291
1404
1292 upgrade
1405 upgrade
1293
1406
1294 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup --quiet
1407 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup --quiet
1295 upgrade will perform the following actions:
1408 upgrade will perform the following actions:
1296
1409
1297 requirements
1410 requirements
1298 preserved: dotencode, fncache, generaldelta, revlogv1, store
1411 preserved: dotencode, fncache, generaldelta, revlogv1, store
1299 added: revlog-compression-zstd, sparserevlog
1412 added: revlog-compression-zstd, sparserevlog
1300
1413
1414 processed revlogs:
1415 - all-filelogs
1416 - changelog
1417 - manifest
1418
1301 $ hg debugformat -v
1419 $ hg debugformat -v
1302 format-variant repo config default
1420 format-variant repo config default
1303 fncache: yes yes yes
1421 fncache: yes yes yes
1304 dotencode: yes yes yes
1422 dotencode: yes yes yes
1305 generaldelta: yes yes yes
1423 generaldelta: yes yes yes
1306 exp-sharesafe: no no no
1424 exp-sharesafe: no no no
1307 sparserevlog: yes yes yes
1425 sparserevlog: yes yes yes
1308 sidedata: no no no
1426 sidedata: no no no
1309 persistent-nodemap: no no no
1427 persistent-nodemap: no no no
1310 copies-sdc: no no no
1428 copies-sdc: no no no
1311 plain-cl-delta: yes yes yes
1429 plain-cl-delta: yes yes yes
1312 compression: zstd zlib zlib
1430 compression: zstd zlib zlib
1313 compression-level: default default default
1431 compression-level: default default default
1314 $ cat .hg/requires
1432 $ cat .hg/requires
1315 dotencode
1433 dotencode
1316 fncache
1434 fncache
1317 generaldelta
1435 generaldelta
1318 revlog-compression-zstd
1436 revlog-compression-zstd
1319 revlogv1
1437 revlogv1
1320 sparserevlog
1438 sparserevlog
1321 store
1439 store
1322
1440
1323 downgrade
1441 downgrade
1324
1442
1325 $ hg debugupgraderepo --run --no-backup --quiet
1443 $ hg debugupgraderepo --run --no-backup --quiet
1326 upgrade will perform the following actions:
1444 upgrade will perform the following actions:
1327
1445
1328 requirements
1446 requirements
1329 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1447 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1330 removed: revlog-compression-zstd
1448 removed: revlog-compression-zstd
1331
1449
1450 processed revlogs:
1451 - all-filelogs
1452 - changelog
1453 - manifest
1454
1332 $ hg debugformat -v
1455 $ hg debugformat -v
1333 format-variant repo config default
1456 format-variant repo config default
1334 fncache: yes yes yes
1457 fncache: yes yes yes
1335 dotencode: yes yes yes
1458 dotencode: yes yes yes
1336 generaldelta: yes yes yes
1459 generaldelta: yes yes yes
1337 exp-sharesafe: no no no
1460 exp-sharesafe: no no no
1338 sparserevlog: yes yes yes
1461 sparserevlog: yes yes yes
1339 sidedata: no no no
1462 sidedata: no no no
1340 persistent-nodemap: no no no
1463 persistent-nodemap: no no no
1341 copies-sdc: no no no
1464 copies-sdc: no no no
1342 plain-cl-delta: yes yes yes
1465 plain-cl-delta: yes yes yes
1343 compression: zlib zlib zlib
1466 compression: zlib zlib zlib
1344 compression-level: default default default
1467 compression-level: default default default
1345 $ cat .hg/requires
1468 $ cat .hg/requires
1346 dotencode
1469 dotencode
1347 fncache
1470 fncache
1348 generaldelta
1471 generaldelta
1349 revlogv1
1472 revlogv1
1350 sparserevlog
1473 sparserevlog
1351 store
1474 store
1352
1475
1353 upgrade from hgrc
1476 upgrade from hgrc
1354
1477
1355 $ cat >> .hg/hgrc << EOF
1478 $ cat >> .hg/hgrc << EOF
1356 > [format]
1479 > [format]
1357 > revlog-compression=zstd
1480 > revlog-compression=zstd
1358 > EOF
1481 > EOF
1359 $ hg debugupgraderepo --run --no-backup --quiet
1482 $ hg debugupgraderepo --run --no-backup --quiet
1360 upgrade will perform the following actions:
1483 upgrade will perform the following actions:
1361
1484
1362 requirements
1485 requirements
1363 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1486 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1364 added: revlog-compression-zstd
1487 added: revlog-compression-zstd
1365
1488
1489 processed revlogs:
1490 - all-filelogs
1491 - changelog
1492 - manifest
1493
1366 $ hg debugformat -v
1494 $ hg debugformat -v
1367 format-variant repo config default
1495 format-variant repo config default
1368 fncache: yes yes yes
1496 fncache: yes yes yes
1369 dotencode: yes yes yes
1497 dotencode: yes yes yes
1370 generaldelta: yes yes yes
1498 generaldelta: yes yes yes
1371 exp-sharesafe: no no no
1499 exp-sharesafe: no no no
1372 sparserevlog: yes yes yes
1500 sparserevlog: yes yes yes
1373 sidedata: no no no
1501 sidedata: no no no
1374 persistent-nodemap: no no no
1502 persistent-nodemap: no no no
1375 copies-sdc: no no no
1503 copies-sdc: no no no
1376 plain-cl-delta: yes yes yes
1504 plain-cl-delta: yes yes yes
1377 compression: zstd zstd zlib
1505 compression: zstd zstd zlib
1378 compression-level: default default default
1506 compression-level: default default default
1379 $ cat .hg/requires
1507 $ cat .hg/requires
1380 dotencode
1508 dotencode
1381 fncache
1509 fncache
1382 generaldelta
1510 generaldelta
1383 revlog-compression-zstd
1511 revlog-compression-zstd
1384 revlogv1
1512 revlogv1
1385 sparserevlog
1513 sparserevlog
1386 store
1514 store
1387
1515
1388 #endif
1516 #endif
1389
1517
1390 Check upgrading to a side-data revlog
1518 Check upgrading to a side-data revlog
1391 -------------------------------------
1519 -------------------------------------
1392
1520
1393 upgrade
1521 upgrade
1394
1522
1395 $ hg --config format.exp-use-side-data=yes debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" --quiet
1523 $ hg --config format.exp-use-side-data=yes debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" --quiet
1396 upgrade will perform the following actions:
1524 upgrade will perform the following actions:
1397
1525
1398 requirements
1526 requirements
1399 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-zstd !)
1527 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-zstd !)
1400 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1528 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1401 added: exp-sidedata-flag (zstd !)
1529 added: exp-sidedata-flag (zstd !)
1402 added: exp-sidedata-flag, sparserevlog (no-zstd !)
1530 added: exp-sidedata-flag, sparserevlog (no-zstd !)
1403
1531
1532 processed revlogs:
1533 - all-filelogs
1534 - changelog
1535 - manifest
1536
1404 $ hg debugformat -v
1537 $ hg debugformat -v
1405 format-variant repo config default
1538 format-variant repo config default
1406 fncache: yes yes yes
1539 fncache: yes yes yes
1407 dotencode: yes yes yes
1540 dotencode: yes yes yes
1408 generaldelta: yes yes yes
1541 generaldelta: yes yes yes
1409 exp-sharesafe: no no no
1542 exp-sharesafe: no no no
1410 sparserevlog: yes yes yes
1543 sparserevlog: yes yes yes
1411 sidedata: yes no no
1544 sidedata: yes no no
1412 persistent-nodemap: no no no
1545 persistent-nodemap: no no no
1413 copies-sdc: no no no
1546 copies-sdc: no no no
1414 plain-cl-delta: yes yes yes
1547 plain-cl-delta: yes yes yes
1415 compression: zlib zlib zlib (no-zstd !)
1548 compression: zlib zlib zlib (no-zstd !)
1416 compression: zstd zstd zlib (zstd !)
1549 compression: zstd zstd zlib (zstd !)
1417 compression-level: default default default
1550 compression-level: default default default
1418 $ cat .hg/requires
1551 $ cat .hg/requires
1419 dotencode
1552 dotencode
1420 exp-sidedata-flag
1553 exp-sidedata-flag
1421 fncache
1554 fncache
1422 generaldelta
1555 generaldelta
1423 revlog-compression-zstd (zstd !)
1556 revlog-compression-zstd (zstd !)
1424 revlogv1
1557 revlogv1
1425 sparserevlog
1558 sparserevlog
1426 store
1559 store
1427 $ hg debugsidedata -c 0
1560 $ hg debugsidedata -c 0
1428 2 sidedata entries
1561 2 sidedata entries
1429 entry-0001 size 4
1562 entry-0001 size 4
1430 entry-0002 size 32
1563 entry-0002 size 32
1431
1564
1432 downgrade
1565 downgrade
1433
1566
1434 $ hg debugupgraderepo --config format.exp-use-side-data=no --run --no-backup --quiet
1567 $ hg debugupgraderepo --config format.exp-use-side-data=no --run --no-backup --quiet
1435 upgrade will perform the following actions:
1568 upgrade will perform the following actions:
1436
1569
1437 requirements
1570 requirements
1438 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
1571 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
1439 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1572 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1440 removed: exp-sidedata-flag
1573 removed: exp-sidedata-flag
1441
1574
1575 processed revlogs:
1576 - all-filelogs
1577 - changelog
1578 - manifest
1579
1442 $ hg debugformat -v
1580 $ hg debugformat -v
1443 format-variant repo config default
1581 format-variant repo config default
1444 fncache: yes yes yes
1582 fncache: yes yes yes
1445 dotencode: yes yes yes
1583 dotencode: yes yes yes
1446 generaldelta: yes yes yes
1584 generaldelta: yes yes yes
1447 exp-sharesafe: no no no
1585 exp-sharesafe: no no no
1448 sparserevlog: yes yes yes
1586 sparserevlog: yes yes yes
1449 sidedata: no no no
1587 sidedata: no no no
1450 persistent-nodemap: no no no
1588 persistent-nodemap: no no no
1451 copies-sdc: no no no
1589 copies-sdc: no no no
1452 plain-cl-delta: yes yes yes
1590 plain-cl-delta: yes yes yes
1453 compression: zlib zlib zlib (no-zstd !)
1591 compression: zlib zlib zlib (no-zstd !)
1454 compression: zstd zstd zlib (zstd !)
1592 compression: zstd zstd zlib (zstd !)
1455 compression-level: default default default
1593 compression-level: default default default
1456 $ cat .hg/requires
1594 $ cat .hg/requires
1457 dotencode
1595 dotencode
1458 fncache
1596 fncache
1459 generaldelta
1597 generaldelta
1460 revlog-compression-zstd (zstd !)
1598 revlog-compression-zstd (zstd !)
1461 revlogv1
1599 revlogv1
1462 sparserevlog
1600 sparserevlog
1463 store
1601 store
1464 $ hg debugsidedata -c 0
1602 $ hg debugsidedata -c 0
1465
1603
1466 upgrade from hgrc
1604 upgrade from hgrc
1467
1605
1468 $ cat >> .hg/hgrc << EOF
1606 $ cat >> .hg/hgrc << EOF
1469 > [format]
1607 > [format]
1470 > exp-use-side-data=yes
1608 > exp-use-side-data=yes
1471 > EOF
1609 > EOF
1472 $ hg debugupgraderepo --run --no-backup --quiet
1610 $ hg debugupgraderepo --run --no-backup --quiet
1473 upgrade will perform the following actions:
1611 upgrade will perform the following actions:
1474
1612
1475 requirements
1613 requirements
1476 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
1614 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
1477 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1615 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1478 added: exp-sidedata-flag
1616 added: exp-sidedata-flag
1479
1617
1618 processed revlogs:
1619 - all-filelogs
1620 - changelog
1621 - manifest
1622
1480 $ hg debugformat -v
1623 $ hg debugformat -v
1481 format-variant repo config default
1624 format-variant repo config default
1482 fncache: yes yes yes
1625 fncache: yes yes yes
1483 dotencode: yes yes yes
1626 dotencode: yes yes yes
1484 generaldelta: yes yes yes
1627 generaldelta: yes yes yes
1485 exp-sharesafe: no no no
1628 exp-sharesafe: no no no
1486 sparserevlog: yes yes yes
1629 sparserevlog: yes yes yes
1487 sidedata: yes yes no
1630 sidedata: yes yes no
1488 persistent-nodemap: no no no
1631 persistent-nodemap: no no no
1489 copies-sdc: no no no
1632 copies-sdc: no no no
1490 plain-cl-delta: yes yes yes
1633 plain-cl-delta: yes yes yes
1491 compression: zlib zlib zlib (no-zstd !)
1634 compression: zlib zlib zlib (no-zstd !)
1492 compression: zstd zstd zlib (zstd !)
1635 compression: zstd zstd zlib (zstd !)
1493 compression-level: default default default
1636 compression-level: default default default
1494 $ cat .hg/requires
1637 $ cat .hg/requires
1495 dotencode
1638 dotencode
1496 exp-sidedata-flag
1639 exp-sidedata-flag
1497 fncache
1640 fncache
1498 generaldelta
1641 generaldelta
1499 revlog-compression-zstd (zstd !)
1642 revlog-compression-zstd (zstd !)
1500 revlogv1
1643 revlogv1
1501 sparserevlog
1644 sparserevlog
1502 store
1645 store
1503 $ hg debugsidedata -c 0
1646 $ hg debugsidedata -c 0
General Comments 0
You need to be logged in to leave comments. Login now