##// END OF EJS Templates
sparse-revlog: enabled by default...
Boris Feld -
r40954:3764330f default
parent child Browse files
Show More
@@ -1,1460 +1,1460 b''
1 # configitems.py - centralized declaration of configuration option
1 # configitems.py - centralized declaration of configuration option
2 #
2 #
3 # Copyright 2017 Pierre-Yves David <pierre-yves.david@octobus.net>
3 # Copyright 2017 Pierre-Yves David <pierre-yves.david@octobus.net>
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 functools
10 import functools
11 import re
11 import re
12
12
13 from . import (
13 from . import (
14 encoding,
14 encoding,
15 error,
15 error,
16 )
16 )
17
17
18 def loadconfigtable(ui, extname, configtable):
18 def loadconfigtable(ui, extname, configtable):
19 """update config item known to the ui with the extension ones"""
19 """update config item known to the ui with the extension ones"""
20 for section, items in sorted(configtable.items()):
20 for section, items in sorted(configtable.items()):
21 knownitems = ui._knownconfig.setdefault(section, itemregister())
21 knownitems = ui._knownconfig.setdefault(section, itemregister())
22 knownkeys = set(knownitems)
22 knownkeys = set(knownitems)
23 newkeys = set(items)
23 newkeys = set(items)
24 for key in sorted(knownkeys & newkeys):
24 for key in sorted(knownkeys & newkeys):
25 msg = "extension '%s' overwrite config item '%s.%s'"
25 msg = "extension '%s' overwrite config item '%s.%s'"
26 msg %= (extname, section, key)
26 msg %= (extname, section, key)
27 ui.develwarn(msg, config='warn-config')
27 ui.develwarn(msg, config='warn-config')
28
28
29 knownitems.update(items)
29 knownitems.update(items)
30
30
31 class configitem(object):
31 class configitem(object):
32 """represent a known config item
32 """represent a known config item
33
33
34 :section: the official config section where to find this item,
34 :section: the official config section where to find this item,
35 :name: the official name within the section,
35 :name: the official name within the section,
36 :default: default value for this item,
36 :default: default value for this item,
37 :alias: optional list of tuples as alternatives,
37 :alias: optional list of tuples as alternatives,
38 :generic: this is a generic definition, match name using regular expression.
38 :generic: this is a generic definition, match name using regular expression.
39 """
39 """
40
40
41 def __init__(self, section, name, default=None, alias=(),
41 def __init__(self, section, name, default=None, alias=(),
42 generic=False, priority=0):
42 generic=False, priority=0):
43 self.section = section
43 self.section = section
44 self.name = name
44 self.name = name
45 self.default = default
45 self.default = default
46 self.alias = list(alias)
46 self.alias = list(alias)
47 self.generic = generic
47 self.generic = generic
48 self.priority = priority
48 self.priority = priority
49 self._re = None
49 self._re = None
50 if generic:
50 if generic:
51 self._re = re.compile(self.name)
51 self._re = re.compile(self.name)
52
52
53 class itemregister(dict):
53 class itemregister(dict):
54 """A specialized dictionary that can handle wild-card selection"""
54 """A specialized dictionary that can handle wild-card selection"""
55
55
56 def __init__(self):
56 def __init__(self):
57 super(itemregister, self).__init__()
57 super(itemregister, self).__init__()
58 self._generics = set()
58 self._generics = set()
59
59
60 def update(self, other):
60 def update(self, other):
61 super(itemregister, self).update(other)
61 super(itemregister, self).update(other)
62 self._generics.update(other._generics)
62 self._generics.update(other._generics)
63
63
64 def __setitem__(self, key, item):
64 def __setitem__(self, key, item):
65 super(itemregister, self).__setitem__(key, item)
65 super(itemregister, self).__setitem__(key, item)
66 if item.generic:
66 if item.generic:
67 self._generics.add(item)
67 self._generics.add(item)
68
68
69 def get(self, key):
69 def get(self, key):
70 baseitem = super(itemregister, self).get(key)
70 baseitem = super(itemregister, self).get(key)
71 if baseitem is not None and not baseitem.generic:
71 if baseitem is not None and not baseitem.generic:
72 return baseitem
72 return baseitem
73
73
74 # search for a matching generic item
74 # search for a matching generic item
75 generics = sorted(self._generics, key=(lambda x: (x.priority, x.name)))
75 generics = sorted(self._generics, key=(lambda x: (x.priority, x.name)))
76 for item in generics:
76 for item in generics:
77 # we use 'match' instead of 'search' to make the matching simpler
77 # we use 'match' instead of 'search' to make the matching simpler
78 # for people unfamiliar with regular expression. Having the match
78 # for people unfamiliar with regular expression. Having the match
79 # rooted to the start of the string will produce less surprising
79 # rooted to the start of the string will produce less surprising
80 # result for user writing simple regex for sub-attribute.
80 # result for user writing simple regex for sub-attribute.
81 #
81 #
82 # For example using "color\..*" match produces an unsurprising
82 # For example using "color\..*" match produces an unsurprising
83 # result, while using search could suddenly match apparently
83 # result, while using search could suddenly match apparently
84 # unrelated configuration that happens to contains "color."
84 # unrelated configuration that happens to contains "color."
85 # anywhere. This is a tradeoff where we favor requiring ".*" on
85 # anywhere. This is a tradeoff where we favor requiring ".*" on
86 # some match to avoid the need to prefix most pattern with "^".
86 # some match to avoid the need to prefix most pattern with "^".
87 # The "^" seems more error prone.
87 # The "^" seems more error prone.
88 if item._re.match(key):
88 if item._re.match(key):
89 return item
89 return item
90
90
91 return None
91 return None
92
92
93 coreitems = {}
93 coreitems = {}
94
94
95 def _register(configtable, *args, **kwargs):
95 def _register(configtable, *args, **kwargs):
96 item = configitem(*args, **kwargs)
96 item = configitem(*args, **kwargs)
97 section = configtable.setdefault(item.section, itemregister())
97 section = configtable.setdefault(item.section, itemregister())
98 if item.name in section:
98 if item.name in section:
99 msg = "duplicated config item registration for '%s.%s'"
99 msg = "duplicated config item registration for '%s.%s'"
100 raise error.ProgrammingError(msg % (item.section, item.name))
100 raise error.ProgrammingError(msg % (item.section, item.name))
101 section[item.name] = item
101 section[item.name] = item
102
102
103 # special value for case where the default is derived from other values
103 # special value for case where the default is derived from other values
104 dynamicdefault = object()
104 dynamicdefault = object()
105
105
106 # Registering actual config items
106 # Registering actual config items
107
107
108 def getitemregister(configtable):
108 def getitemregister(configtable):
109 f = functools.partial(_register, configtable)
109 f = functools.partial(_register, configtable)
110 # export pseudo enum as configitem.*
110 # export pseudo enum as configitem.*
111 f.dynamicdefault = dynamicdefault
111 f.dynamicdefault = dynamicdefault
112 return f
112 return f
113
113
114 coreconfigitem = getitemregister(coreitems)
114 coreconfigitem = getitemregister(coreitems)
115
115
116 coreconfigitem('alias', '.*',
116 coreconfigitem('alias', '.*',
117 default=dynamicdefault,
117 default=dynamicdefault,
118 generic=True,
118 generic=True,
119 )
119 )
120 coreconfigitem('annotate', 'nodates',
120 coreconfigitem('annotate', 'nodates',
121 default=False,
121 default=False,
122 )
122 )
123 coreconfigitem('annotate', 'showfunc',
123 coreconfigitem('annotate', 'showfunc',
124 default=False,
124 default=False,
125 )
125 )
126 coreconfigitem('annotate', 'unified',
126 coreconfigitem('annotate', 'unified',
127 default=None,
127 default=None,
128 )
128 )
129 coreconfigitem('annotate', 'git',
129 coreconfigitem('annotate', 'git',
130 default=False,
130 default=False,
131 )
131 )
132 coreconfigitem('annotate', 'ignorews',
132 coreconfigitem('annotate', 'ignorews',
133 default=False,
133 default=False,
134 )
134 )
135 coreconfigitem('annotate', 'ignorewsamount',
135 coreconfigitem('annotate', 'ignorewsamount',
136 default=False,
136 default=False,
137 )
137 )
138 coreconfigitem('annotate', 'ignoreblanklines',
138 coreconfigitem('annotate', 'ignoreblanklines',
139 default=False,
139 default=False,
140 )
140 )
141 coreconfigitem('annotate', 'ignorewseol',
141 coreconfigitem('annotate', 'ignorewseol',
142 default=False,
142 default=False,
143 )
143 )
144 coreconfigitem('annotate', 'nobinary',
144 coreconfigitem('annotate', 'nobinary',
145 default=False,
145 default=False,
146 )
146 )
147 coreconfigitem('annotate', 'noprefix',
147 coreconfigitem('annotate', 'noprefix',
148 default=False,
148 default=False,
149 )
149 )
150 coreconfigitem('annotate', 'word-diff',
150 coreconfigitem('annotate', 'word-diff',
151 default=False,
151 default=False,
152 )
152 )
153 coreconfigitem('auth', 'cookiefile',
153 coreconfigitem('auth', 'cookiefile',
154 default=None,
154 default=None,
155 )
155 )
156 # bookmarks.pushing: internal hack for discovery
156 # bookmarks.pushing: internal hack for discovery
157 coreconfigitem('bookmarks', 'pushing',
157 coreconfigitem('bookmarks', 'pushing',
158 default=list,
158 default=list,
159 )
159 )
160 # bundle.mainreporoot: internal hack for bundlerepo
160 # bundle.mainreporoot: internal hack for bundlerepo
161 coreconfigitem('bundle', 'mainreporoot',
161 coreconfigitem('bundle', 'mainreporoot',
162 default='',
162 default='',
163 )
163 )
164 coreconfigitem('censor', 'policy',
164 coreconfigitem('censor', 'policy',
165 default='abort',
165 default='abort',
166 )
166 )
167 coreconfigitem('chgserver', 'idletimeout',
167 coreconfigitem('chgserver', 'idletimeout',
168 default=3600,
168 default=3600,
169 )
169 )
170 coreconfigitem('chgserver', 'skiphash',
170 coreconfigitem('chgserver', 'skiphash',
171 default=False,
171 default=False,
172 )
172 )
173 coreconfigitem('cmdserver', 'log',
173 coreconfigitem('cmdserver', 'log',
174 default=None,
174 default=None,
175 )
175 )
176 coreconfigitem('cmdserver', 'max-log-files',
176 coreconfigitem('cmdserver', 'max-log-files',
177 default=7,
177 default=7,
178 )
178 )
179 coreconfigitem('cmdserver', 'max-log-size',
179 coreconfigitem('cmdserver', 'max-log-size',
180 default='1 MB',
180 default='1 MB',
181 )
181 )
182 coreconfigitem('cmdserver', 'message-encodings',
182 coreconfigitem('cmdserver', 'message-encodings',
183 default=list,
183 default=list,
184 )
184 )
185 coreconfigitem('cmdserver', 'track-log',
185 coreconfigitem('cmdserver', 'track-log',
186 default=lambda: ['chgserver', 'cmdserver'],
186 default=lambda: ['chgserver', 'cmdserver'],
187 )
187 )
188 coreconfigitem('color', '.*',
188 coreconfigitem('color', '.*',
189 default=None,
189 default=None,
190 generic=True,
190 generic=True,
191 )
191 )
192 coreconfigitem('color', 'mode',
192 coreconfigitem('color', 'mode',
193 default='auto',
193 default='auto',
194 )
194 )
195 coreconfigitem('color', 'pagermode',
195 coreconfigitem('color', 'pagermode',
196 default=dynamicdefault,
196 default=dynamicdefault,
197 )
197 )
198 coreconfigitem('commands', 'grep.all-files',
198 coreconfigitem('commands', 'grep.all-files',
199 default=False,
199 default=False,
200 )
200 )
201 coreconfigitem('commands', 'resolve.confirm',
201 coreconfigitem('commands', 'resolve.confirm',
202 default=False,
202 default=False,
203 )
203 )
204 coreconfigitem('commands', 'resolve.explicit-re-merge',
204 coreconfigitem('commands', 'resolve.explicit-re-merge',
205 default=False,
205 default=False,
206 )
206 )
207 coreconfigitem('commands', 'resolve.mark-check',
207 coreconfigitem('commands', 'resolve.mark-check',
208 default='none',
208 default='none',
209 )
209 )
210 coreconfigitem('commands', 'show.aliasprefix',
210 coreconfigitem('commands', 'show.aliasprefix',
211 default=list,
211 default=list,
212 )
212 )
213 coreconfigitem('commands', 'status.relative',
213 coreconfigitem('commands', 'status.relative',
214 default=False,
214 default=False,
215 )
215 )
216 coreconfigitem('commands', 'status.skipstates',
216 coreconfigitem('commands', 'status.skipstates',
217 default=[],
217 default=[],
218 )
218 )
219 coreconfigitem('commands', 'status.terse',
219 coreconfigitem('commands', 'status.terse',
220 default='',
220 default='',
221 )
221 )
222 coreconfigitem('commands', 'status.verbose',
222 coreconfigitem('commands', 'status.verbose',
223 default=False,
223 default=False,
224 )
224 )
225 coreconfigitem('commands', 'update.check',
225 coreconfigitem('commands', 'update.check',
226 default=None,
226 default=None,
227 )
227 )
228 coreconfigitem('commands', 'update.requiredest',
228 coreconfigitem('commands', 'update.requiredest',
229 default=False,
229 default=False,
230 )
230 )
231 coreconfigitem('committemplate', '.*',
231 coreconfigitem('committemplate', '.*',
232 default=None,
232 default=None,
233 generic=True,
233 generic=True,
234 )
234 )
235 coreconfigitem('convert', 'bzr.saverev',
235 coreconfigitem('convert', 'bzr.saverev',
236 default=True,
236 default=True,
237 )
237 )
238 coreconfigitem('convert', 'cvsps.cache',
238 coreconfigitem('convert', 'cvsps.cache',
239 default=True,
239 default=True,
240 )
240 )
241 coreconfigitem('convert', 'cvsps.fuzz',
241 coreconfigitem('convert', 'cvsps.fuzz',
242 default=60,
242 default=60,
243 )
243 )
244 coreconfigitem('convert', 'cvsps.logencoding',
244 coreconfigitem('convert', 'cvsps.logencoding',
245 default=None,
245 default=None,
246 )
246 )
247 coreconfigitem('convert', 'cvsps.mergefrom',
247 coreconfigitem('convert', 'cvsps.mergefrom',
248 default=None,
248 default=None,
249 )
249 )
250 coreconfigitem('convert', 'cvsps.mergeto',
250 coreconfigitem('convert', 'cvsps.mergeto',
251 default=None,
251 default=None,
252 )
252 )
253 coreconfigitem('convert', 'git.committeractions',
253 coreconfigitem('convert', 'git.committeractions',
254 default=lambda: ['messagedifferent'],
254 default=lambda: ['messagedifferent'],
255 )
255 )
256 coreconfigitem('convert', 'git.extrakeys',
256 coreconfigitem('convert', 'git.extrakeys',
257 default=list,
257 default=list,
258 )
258 )
259 coreconfigitem('convert', 'git.findcopiesharder',
259 coreconfigitem('convert', 'git.findcopiesharder',
260 default=False,
260 default=False,
261 )
261 )
262 coreconfigitem('convert', 'git.remoteprefix',
262 coreconfigitem('convert', 'git.remoteprefix',
263 default='remote',
263 default='remote',
264 )
264 )
265 coreconfigitem('convert', 'git.renamelimit',
265 coreconfigitem('convert', 'git.renamelimit',
266 default=400,
266 default=400,
267 )
267 )
268 coreconfigitem('convert', 'git.saverev',
268 coreconfigitem('convert', 'git.saverev',
269 default=True,
269 default=True,
270 )
270 )
271 coreconfigitem('convert', 'git.similarity',
271 coreconfigitem('convert', 'git.similarity',
272 default=50,
272 default=50,
273 )
273 )
274 coreconfigitem('convert', 'git.skipsubmodules',
274 coreconfigitem('convert', 'git.skipsubmodules',
275 default=False,
275 default=False,
276 )
276 )
277 coreconfigitem('convert', 'hg.clonebranches',
277 coreconfigitem('convert', 'hg.clonebranches',
278 default=False,
278 default=False,
279 )
279 )
280 coreconfigitem('convert', 'hg.ignoreerrors',
280 coreconfigitem('convert', 'hg.ignoreerrors',
281 default=False,
281 default=False,
282 )
282 )
283 coreconfigitem('convert', 'hg.revs',
283 coreconfigitem('convert', 'hg.revs',
284 default=None,
284 default=None,
285 )
285 )
286 coreconfigitem('convert', 'hg.saverev',
286 coreconfigitem('convert', 'hg.saverev',
287 default=False,
287 default=False,
288 )
288 )
289 coreconfigitem('convert', 'hg.sourcename',
289 coreconfigitem('convert', 'hg.sourcename',
290 default=None,
290 default=None,
291 )
291 )
292 coreconfigitem('convert', 'hg.startrev',
292 coreconfigitem('convert', 'hg.startrev',
293 default=None,
293 default=None,
294 )
294 )
295 coreconfigitem('convert', 'hg.tagsbranch',
295 coreconfigitem('convert', 'hg.tagsbranch',
296 default='default',
296 default='default',
297 )
297 )
298 coreconfigitem('convert', 'hg.usebranchnames',
298 coreconfigitem('convert', 'hg.usebranchnames',
299 default=True,
299 default=True,
300 )
300 )
301 coreconfigitem('convert', 'ignoreancestorcheck',
301 coreconfigitem('convert', 'ignoreancestorcheck',
302 default=False,
302 default=False,
303 )
303 )
304 coreconfigitem('convert', 'localtimezone',
304 coreconfigitem('convert', 'localtimezone',
305 default=False,
305 default=False,
306 )
306 )
307 coreconfigitem('convert', 'p4.encoding',
307 coreconfigitem('convert', 'p4.encoding',
308 default=dynamicdefault,
308 default=dynamicdefault,
309 )
309 )
310 coreconfigitem('convert', 'p4.startrev',
310 coreconfigitem('convert', 'p4.startrev',
311 default=0,
311 default=0,
312 )
312 )
313 coreconfigitem('convert', 'skiptags',
313 coreconfigitem('convert', 'skiptags',
314 default=False,
314 default=False,
315 )
315 )
316 coreconfigitem('convert', 'svn.debugsvnlog',
316 coreconfigitem('convert', 'svn.debugsvnlog',
317 default=True,
317 default=True,
318 )
318 )
319 coreconfigitem('convert', 'svn.trunk',
319 coreconfigitem('convert', 'svn.trunk',
320 default=None,
320 default=None,
321 )
321 )
322 coreconfigitem('convert', 'svn.tags',
322 coreconfigitem('convert', 'svn.tags',
323 default=None,
323 default=None,
324 )
324 )
325 coreconfigitem('convert', 'svn.branches',
325 coreconfigitem('convert', 'svn.branches',
326 default=None,
326 default=None,
327 )
327 )
328 coreconfigitem('convert', 'svn.startrev',
328 coreconfigitem('convert', 'svn.startrev',
329 default=0,
329 default=0,
330 )
330 )
331 coreconfigitem('debug', 'dirstate.delaywrite',
331 coreconfigitem('debug', 'dirstate.delaywrite',
332 default=0,
332 default=0,
333 )
333 )
334 coreconfigitem('defaults', '.*',
334 coreconfigitem('defaults', '.*',
335 default=None,
335 default=None,
336 generic=True,
336 generic=True,
337 )
337 )
338 coreconfigitem('devel', 'all-warnings',
338 coreconfigitem('devel', 'all-warnings',
339 default=False,
339 default=False,
340 )
340 )
341 coreconfigitem('devel', 'bundle2.debug',
341 coreconfigitem('devel', 'bundle2.debug',
342 default=False,
342 default=False,
343 )
343 )
344 coreconfigitem('devel', 'bundle.delta',
344 coreconfigitem('devel', 'bundle.delta',
345 default='',
345 default='',
346 )
346 )
347 coreconfigitem('devel', 'cache-vfs',
347 coreconfigitem('devel', 'cache-vfs',
348 default=None,
348 default=None,
349 )
349 )
350 coreconfigitem('devel', 'check-locks',
350 coreconfigitem('devel', 'check-locks',
351 default=False,
351 default=False,
352 )
352 )
353 coreconfigitem('devel', 'check-relroot',
353 coreconfigitem('devel', 'check-relroot',
354 default=False,
354 default=False,
355 )
355 )
356 coreconfigitem('devel', 'default-date',
356 coreconfigitem('devel', 'default-date',
357 default=None,
357 default=None,
358 )
358 )
359 coreconfigitem('devel', 'deprec-warn',
359 coreconfigitem('devel', 'deprec-warn',
360 default=False,
360 default=False,
361 )
361 )
362 coreconfigitem('devel', 'disableloaddefaultcerts',
362 coreconfigitem('devel', 'disableloaddefaultcerts',
363 default=False,
363 default=False,
364 )
364 )
365 coreconfigitem('devel', 'warn-empty-changegroup',
365 coreconfigitem('devel', 'warn-empty-changegroup',
366 default=False,
366 default=False,
367 )
367 )
368 coreconfigitem('devel', 'legacy.exchange',
368 coreconfigitem('devel', 'legacy.exchange',
369 default=list,
369 default=list,
370 )
370 )
371 coreconfigitem('devel', 'servercafile',
371 coreconfigitem('devel', 'servercafile',
372 default='',
372 default='',
373 )
373 )
374 coreconfigitem('devel', 'serverexactprotocol',
374 coreconfigitem('devel', 'serverexactprotocol',
375 default='',
375 default='',
376 )
376 )
377 coreconfigitem('devel', 'serverrequirecert',
377 coreconfigitem('devel', 'serverrequirecert',
378 default=False,
378 default=False,
379 )
379 )
380 coreconfigitem('devel', 'strip-obsmarkers',
380 coreconfigitem('devel', 'strip-obsmarkers',
381 default=True,
381 default=True,
382 )
382 )
383 coreconfigitem('devel', 'warn-config',
383 coreconfigitem('devel', 'warn-config',
384 default=None,
384 default=None,
385 )
385 )
386 coreconfigitem('devel', 'warn-config-default',
386 coreconfigitem('devel', 'warn-config-default',
387 default=None,
387 default=None,
388 )
388 )
389 coreconfigitem('devel', 'user.obsmarker',
389 coreconfigitem('devel', 'user.obsmarker',
390 default=None,
390 default=None,
391 )
391 )
392 coreconfigitem('devel', 'warn-config-unknown',
392 coreconfigitem('devel', 'warn-config-unknown',
393 default=None,
393 default=None,
394 )
394 )
395 coreconfigitem('devel', 'debug.copies',
395 coreconfigitem('devel', 'debug.copies',
396 default=False,
396 default=False,
397 )
397 )
398 coreconfigitem('devel', 'debug.extensions',
398 coreconfigitem('devel', 'debug.extensions',
399 default=False,
399 default=False,
400 )
400 )
401 coreconfigitem('devel', 'debug.peer-request',
401 coreconfigitem('devel', 'debug.peer-request',
402 default=False,
402 default=False,
403 )
403 )
404 coreconfigitem('diff', 'nodates',
404 coreconfigitem('diff', 'nodates',
405 default=False,
405 default=False,
406 )
406 )
407 coreconfigitem('diff', 'showfunc',
407 coreconfigitem('diff', 'showfunc',
408 default=False,
408 default=False,
409 )
409 )
410 coreconfigitem('diff', 'unified',
410 coreconfigitem('diff', 'unified',
411 default=None,
411 default=None,
412 )
412 )
413 coreconfigitem('diff', 'git',
413 coreconfigitem('diff', 'git',
414 default=False,
414 default=False,
415 )
415 )
416 coreconfigitem('diff', 'ignorews',
416 coreconfigitem('diff', 'ignorews',
417 default=False,
417 default=False,
418 )
418 )
419 coreconfigitem('diff', 'ignorewsamount',
419 coreconfigitem('diff', 'ignorewsamount',
420 default=False,
420 default=False,
421 )
421 )
422 coreconfigitem('diff', 'ignoreblanklines',
422 coreconfigitem('diff', 'ignoreblanklines',
423 default=False,
423 default=False,
424 )
424 )
425 coreconfigitem('diff', 'ignorewseol',
425 coreconfigitem('diff', 'ignorewseol',
426 default=False,
426 default=False,
427 )
427 )
428 coreconfigitem('diff', 'nobinary',
428 coreconfigitem('diff', 'nobinary',
429 default=False,
429 default=False,
430 )
430 )
431 coreconfigitem('diff', 'noprefix',
431 coreconfigitem('diff', 'noprefix',
432 default=False,
432 default=False,
433 )
433 )
434 coreconfigitem('diff', 'word-diff',
434 coreconfigitem('diff', 'word-diff',
435 default=False,
435 default=False,
436 )
436 )
437 coreconfigitem('email', 'bcc',
437 coreconfigitem('email', 'bcc',
438 default=None,
438 default=None,
439 )
439 )
440 coreconfigitem('email', 'cc',
440 coreconfigitem('email', 'cc',
441 default=None,
441 default=None,
442 )
442 )
443 coreconfigitem('email', 'charsets',
443 coreconfigitem('email', 'charsets',
444 default=list,
444 default=list,
445 )
445 )
446 coreconfigitem('email', 'from',
446 coreconfigitem('email', 'from',
447 default=None,
447 default=None,
448 )
448 )
449 coreconfigitem('email', 'method',
449 coreconfigitem('email', 'method',
450 default='smtp',
450 default='smtp',
451 )
451 )
452 coreconfigitem('email', 'reply-to',
452 coreconfigitem('email', 'reply-to',
453 default=None,
453 default=None,
454 )
454 )
455 coreconfigitem('email', 'to',
455 coreconfigitem('email', 'to',
456 default=None,
456 default=None,
457 )
457 )
458 coreconfigitem('experimental', 'archivemetatemplate',
458 coreconfigitem('experimental', 'archivemetatemplate',
459 default=dynamicdefault,
459 default=dynamicdefault,
460 )
460 )
461 coreconfigitem('experimental', 'auto-publish',
461 coreconfigitem('experimental', 'auto-publish',
462 default='publish',
462 default='publish',
463 )
463 )
464 coreconfigitem('experimental', 'bundle-phases',
464 coreconfigitem('experimental', 'bundle-phases',
465 default=False,
465 default=False,
466 )
466 )
467 coreconfigitem('experimental', 'bundle2-advertise',
467 coreconfigitem('experimental', 'bundle2-advertise',
468 default=True,
468 default=True,
469 )
469 )
470 coreconfigitem('experimental', 'bundle2-output-capture',
470 coreconfigitem('experimental', 'bundle2-output-capture',
471 default=False,
471 default=False,
472 )
472 )
473 coreconfigitem('experimental', 'bundle2.pushback',
473 coreconfigitem('experimental', 'bundle2.pushback',
474 default=False,
474 default=False,
475 )
475 )
476 coreconfigitem('experimental', 'bundle2lazylocking',
476 coreconfigitem('experimental', 'bundle2lazylocking',
477 default=False,
477 default=False,
478 )
478 )
479 coreconfigitem('experimental', 'bundlecomplevel',
479 coreconfigitem('experimental', 'bundlecomplevel',
480 default=None,
480 default=None,
481 )
481 )
482 coreconfigitem('experimental', 'bundlecomplevel.bzip2',
482 coreconfigitem('experimental', 'bundlecomplevel.bzip2',
483 default=None,
483 default=None,
484 )
484 )
485 coreconfigitem('experimental', 'bundlecomplevel.gzip',
485 coreconfigitem('experimental', 'bundlecomplevel.gzip',
486 default=None,
486 default=None,
487 )
487 )
488 coreconfigitem('experimental', 'bundlecomplevel.none',
488 coreconfigitem('experimental', 'bundlecomplevel.none',
489 default=None,
489 default=None,
490 )
490 )
491 coreconfigitem('experimental', 'bundlecomplevel.zstd',
491 coreconfigitem('experimental', 'bundlecomplevel.zstd',
492 default=None,
492 default=None,
493 )
493 )
494 coreconfigitem('experimental', 'changegroup3',
494 coreconfigitem('experimental', 'changegroup3',
495 default=False,
495 default=False,
496 )
496 )
497 coreconfigitem('experimental', 'clientcompressionengines',
497 coreconfigitem('experimental', 'clientcompressionengines',
498 default=list,
498 default=list,
499 )
499 )
500 coreconfigitem('experimental', 'copytrace',
500 coreconfigitem('experimental', 'copytrace',
501 default='on',
501 default='on',
502 )
502 )
503 coreconfigitem('experimental', 'copytrace.movecandidateslimit',
503 coreconfigitem('experimental', 'copytrace.movecandidateslimit',
504 default=100,
504 default=100,
505 )
505 )
506 coreconfigitem('experimental', 'copytrace.sourcecommitlimit',
506 coreconfigitem('experimental', 'copytrace.sourcecommitlimit',
507 default=100,
507 default=100,
508 )
508 )
509 coreconfigitem('experimental', 'crecordtest',
509 coreconfigitem('experimental', 'crecordtest',
510 default=None,
510 default=None,
511 )
511 )
512 coreconfigitem('experimental', 'directaccess',
512 coreconfigitem('experimental', 'directaccess',
513 default=False,
513 default=False,
514 )
514 )
515 coreconfigitem('experimental', 'directaccess.revnums',
515 coreconfigitem('experimental', 'directaccess.revnums',
516 default=False,
516 default=False,
517 )
517 )
518 coreconfigitem('experimental', 'editortmpinhg',
518 coreconfigitem('experimental', 'editortmpinhg',
519 default=False,
519 default=False,
520 )
520 )
521 coreconfigitem('experimental', 'evolution',
521 coreconfigitem('experimental', 'evolution',
522 default=list,
522 default=list,
523 )
523 )
524 coreconfigitem('experimental', 'evolution.allowdivergence',
524 coreconfigitem('experimental', 'evolution.allowdivergence',
525 default=False,
525 default=False,
526 alias=[('experimental', 'allowdivergence')]
526 alias=[('experimental', 'allowdivergence')]
527 )
527 )
528 coreconfigitem('experimental', 'evolution.allowunstable',
528 coreconfigitem('experimental', 'evolution.allowunstable',
529 default=None,
529 default=None,
530 )
530 )
531 coreconfigitem('experimental', 'evolution.createmarkers',
531 coreconfigitem('experimental', 'evolution.createmarkers',
532 default=None,
532 default=None,
533 )
533 )
534 coreconfigitem('experimental', 'evolution.effect-flags',
534 coreconfigitem('experimental', 'evolution.effect-flags',
535 default=True,
535 default=True,
536 alias=[('experimental', 'effect-flags')]
536 alias=[('experimental', 'effect-flags')]
537 )
537 )
538 coreconfigitem('experimental', 'evolution.exchange',
538 coreconfigitem('experimental', 'evolution.exchange',
539 default=None,
539 default=None,
540 )
540 )
541 coreconfigitem('experimental', 'evolution.bundle-obsmarker',
541 coreconfigitem('experimental', 'evolution.bundle-obsmarker',
542 default=False,
542 default=False,
543 )
543 )
544 coreconfigitem('experimental', 'evolution.report-instabilities',
544 coreconfigitem('experimental', 'evolution.report-instabilities',
545 default=True,
545 default=True,
546 )
546 )
547 coreconfigitem('experimental', 'evolution.track-operation',
547 coreconfigitem('experimental', 'evolution.track-operation',
548 default=True,
548 default=True,
549 )
549 )
550 coreconfigitem('experimental', 'maxdeltachainspan',
550 coreconfigitem('experimental', 'maxdeltachainspan',
551 default=-1,
551 default=-1,
552 )
552 )
553 coreconfigitem('experimental', 'mergetempdirprefix',
553 coreconfigitem('experimental', 'mergetempdirprefix',
554 default=None,
554 default=None,
555 )
555 )
556 coreconfigitem('experimental', 'narrow',
556 coreconfigitem('experimental', 'narrow',
557 default=False,
557 default=False,
558 )
558 )
559 coreconfigitem('experimental', 'nonnormalparanoidcheck',
559 coreconfigitem('experimental', 'nonnormalparanoidcheck',
560 default=False,
560 default=False,
561 )
561 )
562 coreconfigitem('experimental', 'exportableenviron',
562 coreconfigitem('experimental', 'exportableenviron',
563 default=list,
563 default=list,
564 )
564 )
565 coreconfigitem('experimental', 'extendedheader.index',
565 coreconfigitem('experimental', 'extendedheader.index',
566 default=None,
566 default=None,
567 )
567 )
568 coreconfigitem('experimental', 'extendedheader.similarity',
568 coreconfigitem('experimental', 'extendedheader.similarity',
569 default=False,
569 default=False,
570 )
570 )
571 coreconfigitem('experimental', 'format.compression',
571 coreconfigitem('experimental', 'format.compression',
572 default='zlib',
572 default='zlib',
573 )
573 )
574 coreconfigitem('experimental', 'graphshorten',
574 coreconfigitem('experimental', 'graphshorten',
575 default=False,
575 default=False,
576 )
576 )
577 coreconfigitem('experimental', 'graphstyle.parent',
577 coreconfigitem('experimental', 'graphstyle.parent',
578 default=dynamicdefault,
578 default=dynamicdefault,
579 )
579 )
580 coreconfigitem('experimental', 'graphstyle.missing',
580 coreconfigitem('experimental', 'graphstyle.missing',
581 default=dynamicdefault,
581 default=dynamicdefault,
582 )
582 )
583 coreconfigitem('experimental', 'graphstyle.grandparent',
583 coreconfigitem('experimental', 'graphstyle.grandparent',
584 default=dynamicdefault,
584 default=dynamicdefault,
585 )
585 )
586 coreconfigitem('experimental', 'hook-track-tags',
586 coreconfigitem('experimental', 'hook-track-tags',
587 default=False,
587 default=False,
588 )
588 )
589 coreconfigitem('experimental', 'httppeer.advertise-v2',
589 coreconfigitem('experimental', 'httppeer.advertise-v2',
590 default=False,
590 default=False,
591 )
591 )
592 coreconfigitem('experimental', 'httppeer.v2-encoder-order',
592 coreconfigitem('experimental', 'httppeer.v2-encoder-order',
593 default=None,
593 default=None,
594 )
594 )
595 coreconfigitem('experimental', 'httppostargs',
595 coreconfigitem('experimental', 'httppostargs',
596 default=False,
596 default=False,
597 )
597 )
598 coreconfigitem('experimental', 'mergedriver',
598 coreconfigitem('experimental', 'mergedriver',
599 default=None,
599 default=None,
600 )
600 )
601 coreconfigitem('experimental', 'nointerrupt', default=False)
601 coreconfigitem('experimental', 'nointerrupt', default=False)
602 coreconfigitem('experimental', 'nointerrupt-interactiveonly', default=True)
602 coreconfigitem('experimental', 'nointerrupt-interactiveonly', default=True)
603
603
604 coreconfigitem('experimental', 'obsmarkers-exchange-debug',
604 coreconfigitem('experimental', 'obsmarkers-exchange-debug',
605 default=False,
605 default=False,
606 )
606 )
607 coreconfigitem('experimental', 'remotenames',
607 coreconfigitem('experimental', 'remotenames',
608 default=False,
608 default=False,
609 )
609 )
610 coreconfigitem('experimental', 'removeemptydirs',
610 coreconfigitem('experimental', 'removeemptydirs',
611 default=True,
611 default=True,
612 )
612 )
613 coreconfigitem('experimental', 'revisions.prefixhexnode',
613 coreconfigitem('experimental', 'revisions.prefixhexnode',
614 default=False,
614 default=False,
615 )
615 )
616 coreconfigitem('experimental', 'revlogv2',
616 coreconfigitem('experimental', 'revlogv2',
617 default=None,
617 default=None,
618 )
618 )
619 coreconfigitem('experimental', 'revisions.disambiguatewithin',
619 coreconfigitem('experimental', 'revisions.disambiguatewithin',
620 default=None,
620 default=None,
621 )
621 )
622 coreconfigitem('experimental', 'server.filesdata.recommended-batch-size',
622 coreconfigitem('experimental', 'server.filesdata.recommended-batch-size',
623 default=50000,
623 default=50000,
624 )
624 )
625 coreconfigitem('experimental', 'server.manifestdata.recommended-batch-size',
625 coreconfigitem('experimental', 'server.manifestdata.recommended-batch-size',
626 default=100000,
626 default=100000,
627 )
627 )
628 coreconfigitem('experimental', 'server.stream-narrow-clones',
628 coreconfigitem('experimental', 'server.stream-narrow-clones',
629 default=False,
629 default=False,
630 )
630 )
631 coreconfigitem('experimental', 'single-head-per-branch',
631 coreconfigitem('experimental', 'single-head-per-branch',
632 default=False,
632 default=False,
633 )
633 )
634 coreconfigitem('experimental', 'sshserver.support-v2',
634 coreconfigitem('experimental', 'sshserver.support-v2',
635 default=False,
635 default=False,
636 )
636 )
637 coreconfigitem('experimental', 'sparse-read',
637 coreconfigitem('experimental', 'sparse-read',
638 default=False,
638 default=False,
639 )
639 )
640 coreconfigitem('experimental', 'sparse-read.density-threshold',
640 coreconfigitem('experimental', 'sparse-read.density-threshold',
641 default=0.50,
641 default=0.50,
642 )
642 )
643 coreconfigitem('experimental', 'sparse-read.min-gap-size',
643 coreconfigitem('experimental', 'sparse-read.min-gap-size',
644 default='65K',
644 default='65K',
645 )
645 )
646 coreconfigitem('experimental', 'treemanifest',
646 coreconfigitem('experimental', 'treemanifest',
647 default=False,
647 default=False,
648 )
648 )
649 coreconfigitem('experimental', 'update.atomic-file',
649 coreconfigitem('experimental', 'update.atomic-file',
650 default=False,
650 default=False,
651 )
651 )
652 coreconfigitem('experimental', 'sshpeer.advertise-v2',
652 coreconfigitem('experimental', 'sshpeer.advertise-v2',
653 default=False,
653 default=False,
654 )
654 )
655 coreconfigitem('experimental', 'web.apiserver',
655 coreconfigitem('experimental', 'web.apiserver',
656 default=False,
656 default=False,
657 )
657 )
658 coreconfigitem('experimental', 'web.api.http-v2',
658 coreconfigitem('experimental', 'web.api.http-v2',
659 default=False,
659 default=False,
660 )
660 )
661 coreconfigitem('experimental', 'web.api.debugreflect',
661 coreconfigitem('experimental', 'web.api.debugreflect',
662 default=False,
662 default=False,
663 )
663 )
664 coreconfigitem('experimental', 'worker.wdir-get-thread-safe',
664 coreconfigitem('experimental', 'worker.wdir-get-thread-safe',
665 default=False,
665 default=False,
666 )
666 )
667 coreconfigitem('experimental', 'xdiff',
667 coreconfigitem('experimental', 'xdiff',
668 default=False,
668 default=False,
669 )
669 )
670 coreconfigitem('extensions', '.*',
670 coreconfigitem('extensions', '.*',
671 default=None,
671 default=None,
672 generic=True,
672 generic=True,
673 )
673 )
674 coreconfigitem('extdata', '.*',
674 coreconfigitem('extdata', '.*',
675 default=None,
675 default=None,
676 generic=True,
676 generic=True,
677 )
677 )
678 coreconfigitem('format', 'chunkcachesize',
678 coreconfigitem('format', 'chunkcachesize',
679 default=None,
679 default=None,
680 )
680 )
681 coreconfigitem('format', 'dotencode',
681 coreconfigitem('format', 'dotencode',
682 default=True,
682 default=True,
683 )
683 )
684 coreconfigitem('format', 'generaldelta',
684 coreconfigitem('format', 'generaldelta',
685 default=False,
685 default=False,
686 )
686 )
687 coreconfigitem('format', 'manifestcachesize',
687 coreconfigitem('format', 'manifestcachesize',
688 default=None,
688 default=None,
689 )
689 )
690 coreconfigitem('format', 'maxchainlen',
690 coreconfigitem('format', 'maxchainlen',
691 default=dynamicdefault,
691 default=dynamicdefault,
692 )
692 )
693 coreconfigitem('format', 'obsstore-version',
693 coreconfigitem('format', 'obsstore-version',
694 default=None,
694 default=None,
695 )
695 )
696 coreconfigitem('format', 'sparse-revlog',
696 coreconfigitem('format', 'sparse-revlog',
697 default=False,
697 default=True,
698 )
698 )
699 coreconfigitem('format', 'usefncache',
699 coreconfigitem('format', 'usefncache',
700 default=True,
700 default=True,
701 )
701 )
702 coreconfigitem('format', 'usegeneraldelta',
702 coreconfigitem('format', 'usegeneraldelta',
703 default=True,
703 default=True,
704 )
704 )
705 coreconfigitem('format', 'usestore',
705 coreconfigitem('format', 'usestore',
706 default=True,
706 default=True,
707 )
707 )
708 coreconfigitem('format', 'internal-phase',
708 coreconfigitem('format', 'internal-phase',
709 default=False,
709 default=False,
710 )
710 )
711 coreconfigitem('fsmonitor', 'warn_when_unused',
711 coreconfigitem('fsmonitor', 'warn_when_unused',
712 default=True,
712 default=True,
713 )
713 )
714 coreconfigitem('fsmonitor', 'warn_update_file_count',
714 coreconfigitem('fsmonitor', 'warn_update_file_count',
715 default=50000,
715 default=50000,
716 )
716 )
717 coreconfigitem('help', 'hidden-command\..*',
717 coreconfigitem('help', 'hidden-command\..*',
718 default=False,
718 default=False,
719 generic=True,
719 generic=True,
720 )
720 )
721 coreconfigitem('help', 'hidden-topic\..*',
721 coreconfigitem('help', 'hidden-topic\..*',
722 default=False,
722 default=False,
723 generic=True,
723 generic=True,
724 )
724 )
725 coreconfigitem('hooks', '.*',
725 coreconfigitem('hooks', '.*',
726 default=dynamicdefault,
726 default=dynamicdefault,
727 generic=True,
727 generic=True,
728 )
728 )
729 coreconfigitem('hgweb-paths', '.*',
729 coreconfigitem('hgweb-paths', '.*',
730 default=list,
730 default=list,
731 generic=True,
731 generic=True,
732 )
732 )
733 coreconfigitem('hostfingerprints', '.*',
733 coreconfigitem('hostfingerprints', '.*',
734 default=list,
734 default=list,
735 generic=True,
735 generic=True,
736 )
736 )
737 coreconfigitem('hostsecurity', 'ciphers',
737 coreconfigitem('hostsecurity', 'ciphers',
738 default=None,
738 default=None,
739 )
739 )
740 coreconfigitem('hostsecurity', 'disabletls10warning',
740 coreconfigitem('hostsecurity', 'disabletls10warning',
741 default=False,
741 default=False,
742 )
742 )
743 coreconfigitem('hostsecurity', 'minimumprotocol',
743 coreconfigitem('hostsecurity', 'minimumprotocol',
744 default=dynamicdefault,
744 default=dynamicdefault,
745 )
745 )
746 coreconfigitem('hostsecurity', '.*:minimumprotocol$',
746 coreconfigitem('hostsecurity', '.*:minimumprotocol$',
747 default=dynamicdefault,
747 default=dynamicdefault,
748 generic=True,
748 generic=True,
749 )
749 )
750 coreconfigitem('hostsecurity', '.*:ciphers$',
750 coreconfigitem('hostsecurity', '.*:ciphers$',
751 default=dynamicdefault,
751 default=dynamicdefault,
752 generic=True,
752 generic=True,
753 )
753 )
754 coreconfigitem('hostsecurity', '.*:fingerprints$',
754 coreconfigitem('hostsecurity', '.*:fingerprints$',
755 default=list,
755 default=list,
756 generic=True,
756 generic=True,
757 )
757 )
758 coreconfigitem('hostsecurity', '.*:verifycertsfile$',
758 coreconfigitem('hostsecurity', '.*:verifycertsfile$',
759 default=None,
759 default=None,
760 generic=True,
760 generic=True,
761 )
761 )
762
762
763 coreconfigitem('http_proxy', 'always',
763 coreconfigitem('http_proxy', 'always',
764 default=False,
764 default=False,
765 )
765 )
766 coreconfigitem('http_proxy', 'host',
766 coreconfigitem('http_proxy', 'host',
767 default=None,
767 default=None,
768 )
768 )
769 coreconfigitem('http_proxy', 'no',
769 coreconfigitem('http_proxy', 'no',
770 default=list,
770 default=list,
771 )
771 )
772 coreconfigitem('http_proxy', 'passwd',
772 coreconfigitem('http_proxy', 'passwd',
773 default=None,
773 default=None,
774 )
774 )
775 coreconfigitem('http_proxy', 'user',
775 coreconfigitem('http_proxy', 'user',
776 default=None,
776 default=None,
777 )
777 )
778
778
779 coreconfigitem('http', 'timeout',
779 coreconfigitem('http', 'timeout',
780 default=None,
780 default=None,
781 )
781 )
782
782
783 coreconfigitem('logtoprocess', 'commandexception',
783 coreconfigitem('logtoprocess', 'commandexception',
784 default=None,
784 default=None,
785 )
785 )
786 coreconfigitem('logtoprocess', 'commandfinish',
786 coreconfigitem('logtoprocess', 'commandfinish',
787 default=None,
787 default=None,
788 )
788 )
789 coreconfigitem('logtoprocess', 'command',
789 coreconfigitem('logtoprocess', 'command',
790 default=None,
790 default=None,
791 )
791 )
792 coreconfigitem('logtoprocess', 'develwarn',
792 coreconfigitem('logtoprocess', 'develwarn',
793 default=None,
793 default=None,
794 )
794 )
795 coreconfigitem('logtoprocess', 'uiblocked',
795 coreconfigitem('logtoprocess', 'uiblocked',
796 default=None,
796 default=None,
797 )
797 )
798 coreconfigitem('merge', 'checkunknown',
798 coreconfigitem('merge', 'checkunknown',
799 default='abort',
799 default='abort',
800 )
800 )
801 coreconfigitem('merge', 'checkignored',
801 coreconfigitem('merge', 'checkignored',
802 default='abort',
802 default='abort',
803 )
803 )
804 coreconfigitem('experimental', 'merge.checkpathconflicts',
804 coreconfigitem('experimental', 'merge.checkpathconflicts',
805 default=False,
805 default=False,
806 )
806 )
807 coreconfigitem('merge', 'followcopies',
807 coreconfigitem('merge', 'followcopies',
808 default=True,
808 default=True,
809 )
809 )
810 coreconfigitem('merge', 'on-failure',
810 coreconfigitem('merge', 'on-failure',
811 default='continue',
811 default='continue',
812 )
812 )
813 coreconfigitem('merge', 'preferancestor',
813 coreconfigitem('merge', 'preferancestor',
814 default=lambda: ['*'],
814 default=lambda: ['*'],
815 )
815 )
816 coreconfigitem('merge', 'strict-capability-check',
816 coreconfigitem('merge', 'strict-capability-check',
817 default=False,
817 default=False,
818 )
818 )
819 coreconfigitem('merge-tools', '.*',
819 coreconfigitem('merge-tools', '.*',
820 default=None,
820 default=None,
821 generic=True,
821 generic=True,
822 )
822 )
823 coreconfigitem('merge-tools', br'.*\.args$',
823 coreconfigitem('merge-tools', br'.*\.args$',
824 default="$local $base $other",
824 default="$local $base $other",
825 generic=True,
825 generic=True,
826 priority=-1,
826 priority=-1,
827 )
827 )
828 coreconfigitem('merge-tools', br'.*\.binary$',
828 coreconfigitem('merge-tools', br'.*\.binary$',
829 default=False,
829 default=False,
830 generic=True,
830 generic=True,
831 priority=-1,
831 priority=-1,
832 )
832 )
833 coreconfigitem('merge-tools', br'.*\.check$',
833 coreconfigitem('merge-tools', br'.*\.check$',
834 default=list,
834 default=list,
835 generic=True,
835 generic=True,
836 priority=-1,
836 priority=-1,
837 )
837 )
838 coreconfigitem('merge-tools', br'.*\.checkchanged$',
838 coreconfigitem('merge-tools', br'.*\.checkchanged$',
839 default=False,
839 default=False,
840 generic=True,
840 generic=True,
841 priority=-1,
841 priority=-1,
842 )
842 )
843 coreconfigitem('merge-tools', br'.*\.executable$',
843 coreconfigitem('merge-tools', br'.*\.executable$',
844 default=dynamicdefault,
844 default=dynamicdefault,
845 generic=True,
845 generic=True,
846 priority=-1,
846 priority=-1,
847 )
847 )
848 coreconfigitem('merge-tools', br'.*\.fixeol$',
848 coreconfigitem('merge-tools', br'.*\.fixeol$',
849 default=False,
849 default=False,
850 generic=True,
850 generic=True,
851 priority=-1,
851 priority=-1,
852 )
852 )
853 coreconfigitem('merge-tools', br'.*\.gui$',
853 coreconfigitem('merge-tools', br'.*\.gui$',
854 default=False,
854 default=False,
855 generic=True,
855 generic=True,
856 priority=-1,
856 priority=-1,
857 )
857 )
858 coreconfigitem('merge-tools', br'.*\.mergemarkers$',
858 coreconfigitem('merge-tools', br'.*\.mergemarkers$',
859 default='basic',
859 default='basic',
860 generic=True,
860 generic=True,
861 priority=-1,
861 priority=-1,
862 )
862 )
863 coreconfigitem('merge-tools', br'.*\.mergemarkertemplate$',
863 coreconfigitem('merge-tools', br'.*\.mergemarkertemplate$',
864 default=dynamicdefault, # take from ui.mergemarkertemplate
864 default=dynamicdefault, # take from ui.mergemarkertemplate
865 generic=True,
865 generic=True,
866 priority=-1,
866 priority=-1,
867 )
867 )
868 coreconfigitem('merge-tools', br'.*\.priority$',
868 coreconfigitem('merge-tools', br'.*\.priority$',
869 default=0,
869 default=0,
870 generic=True,
870 generic=True,
871 priority=-1,
871 priority=-1,
872 )
872 )
873 coreconfigitem('merge-tools', br'.*\.premerge$',
873 coreconfigitem('merge-tools', br'.*\.premerge$',
874 default=dynamicdefault,
874 default=dynamicdefault,
875 generic=True,
875 generic=True,
876 priority=-1,
876 priority=-1,
877 )
877 )
878 coreconfigitem('merge-tools', br'.*\.symlink$',
878 coreconfigitem('merge-tools', br'.*\.symlink$',
879 default=False,
879 default=False,
880 generic=True,
880 generic=True,
881 priority=-1,
881 priority=-1,
882 )
882 )
883 coreconfigitem('pager', 'attend-.*',
883 coreconfigitem('pager', 'attend-.*',
884 default=dynamicdefault,
884 default=dynamicdefault,
885 generic=True,
885 generic=True,
886 )
886 )
887 coreconfigitem('pager', 'ignore',
887 coreconfigitem('pager', 'ignore',
888 default=list,
888 default=list,
889 )
889 )
890 coreconfigitem('pager', 'pager',
890 coreconfigitem('pager', 'pager',
891 default=dynamicdefault,
891 default=dynamicdefault,
892 )
892 )
893 coreconfigitem('patch', 'eol',
893 coreconfigitem('patch', 'eol',
894 default='strict',
894 default='strict',
895 )
895 )
896 coreconfigitem('patch', 'fuzz',
896 coreconfigitem('patch', 'fuzz',
897 default=2,
897 default=2,
898 )
898 )
899 coreconfigitem('paths', 'default',
899 coreconfigitem('paths', 'default',
900 default=None,
900 default=None,
901 )
901 )
902 coreconfigitem('paths', 'default-push',
902 coreconfigitem('paths', 'default-push',
903 default=None,
903 default=None,
904 )
904 )
905 coreconfigitem('paths', '.*',
905 coreconfigitem('paths', '.*',
906 default=None,
906 default=None,
907 generic=True,
907 generic=True,
908 )
908 )
909 coreconfigitem('phases', 'checksubrepos',
909 coreconfigitem('phases', 'checksubrepos',
910 default='follow',
910 default='follow',
911 )
911 )
912 coreconfigitem('phases', 'new-commit',
912 coreconfigitem('phases', 'new-commit',
913 default='draft',
913 default='draft',
914 )
914 )
915 coreconfigitem('phases', 'publish',
915 coreconfigitem('phases', 'publish',
916 default=True,
916 default=True,
917 )
917 )
918 coreconfigitem('profiling', 'enabled',
918 coreconfigitem('profiling', 'enabled',
919 default=False,
919 default=False,
920 )
920 )
921 coreconfigitem('profiling', 'format',
921 coreconfigitem('profiling', 'format',
922 default='text',
922 default='text',
923 )
923 )
924 coreconfigitem('profiling', 'freq',
924 coreconfigitem('profiling', 'freq',
925 default=1000,
925 default=1000,
926 )
926 )
927 coreconfigitem('profiling', 'limit',
927 coreconfigitem('profiling', 'limit',
928 default=30,
928 default=30,
929 )
929 )
930 coreconfigitem('profiling', 'nested',
930 coreconfigitem('profiling', 'nested',
931 default=0,
931 default=0,
932 )
932 )
933 coreconfigitem('profiling', 'output',
933 coreconfigitem('profiling', 'output',
934 default=None,
934 default=None,
935 )
935 )
936 coreconfigitem('profiling', 'showmax',
936 coreconfigitem('profiling', 'showmax',
937 default=0.999,
937 default=0.999,
938 )
938 )
939 coreconfigitem('profiling', 'showmin',
939 coreconfigitem('profiling', 'showmin',
940 default=dynamicdefault,
940 default=dynamicdefault,
941 )
941 )
942 coreconfigitem('profiling', 'sort',
942 coreconfigitem('profiling', 'sort',
943 default='inlinetime',
943 default='inlinetime',
944 )
944 )
945 coreconfigitem('profiling', 'statformat',
945 coreconfigitem('profiling', 'statformat',
946 default='hotpath',
946 default='hotpath',
947 )
947 )
948 coreconfigitem('profiling', 'time-track',
948 coreconfigitem('profiling', 'time-track',
949 default=dynamicdefault,
949 default=dynamicdefault,
950 )
950 )
951 coreconfigitem('profiling', 'type',
951 coreconfigitem('profiling', 'type',
952 default='stat',
952 default='stat',
953 )
953 )
954 coreconfigitem('progress', 'assume-tty',
954 coreconfigitem('progress', 'assume-tty',
955 default=False,
955 default=False,
956 )
956 )
957 coreconfigitem('progress', 'changedelay',
957 coreconfigitem('progress', 'changedelay',
958 default=1,
958 default=1,
959 )
959 )
960 coreconfigitem('progress', 'clear-complete',
960 coreconfigitem('progress', 'clear-complete',
961 default=True,
961 default=True,
962 )
962 )
963 coreconfigitem('progress', 'debug',
963 coreconfigitem('progress', 'debug',
964 default=False,
964 default=False,
965 )
965 )
966 coreconfigitem('progress', 'delay',
966 coreconfigitem('progress', 'delay',
967 default=3,
967 default=3,
968 )
968 )
969 coreconfigitem('progress', 'disable',
969 coreconfigitem('progress', 'disable',
970 default=False,
970 default=False,
971 )
971 )
972 coreconfigitem('progress', 'estimateinterval',
972 coreconfigitem('progress', 'estimateinterval',
973 default=60.0,
973 default=60.0,
974 )
974 )
975 coreconfigitem('progress', 'format',
975 coreconfigitem('progress', 'format',
976 default=lambda: ['topic', 'bar', 'number', 'estimate'],
976 default=lambda: ['topic', 'bar', 'number', 'estimate'],
977 )
977 )
978 coreconfigitem('progress', 'refresh',
978 coreconfigitem('progress', 'refresh',
979 default=0.1,
979 default=0.1,
980 )
980 )
981 coreconfigitem('progress', 'width',
981 coreconfigitem('progress', 'width',
982 default=dynamicdefault,
982 default=dynamicdefault,
983 )
983 )
984 coreconfigitem('push', 'pushvars.server',
984 coreconfigitem('push', 'pushvars.server',
985 default=False,
985 default=False,
986 )
986 )
987 coreconfigitem('storage', 'mmap-threshold',
987 coreconfigitem('storage', 'mmap-threshold',
988 default='1MB',
988 default='1MB',
989 alias=[('experimental', 'mmapindexthreshold')],
989 alias=[('experimental', 'mmapindexthreshold')],
990 )
990 )
991 coreconfigitem('storage', 'new-repo-backend',
991 coreconfigitem('storage', 'new-repo-backend',
992 default='revlogv1',
992 default='revlogv1',
993 )
993 )
994 coreconfigitem('storage', 'revlog.optimize-delta-parent-choice',
994 coreconfigitem('storage', 'revlog.optimize-delta-parent-choice',
995 default=True,
995 default=True,
996 alias=[('format', 'aggressivemergedeltas')],
996 alias=[('format', 'aggressivemergedeltas')],
997 )
997 )
998 coreconfigitem('server', 'bookmarks-pushkey-compat',
998 coreconfigitem('server', 'bookmarks-pushkey-compat',
999 default=True,
999 default=True,
1000 )
1000 )
1001 coreconfigitem('server', 'bundle1',
1001 coreconfigitem('server', 'bundle1',
1002 default=True,
1002 default=True,
1003 )
1003 )
1004 coreconfigitem('server', 'bundle1gd',
1004 coreconfigitem('server', 'bundle1gd',
1005 default=None,
1005 default=None,
1006 )
1006 )
1007 coreconfigitem('server', 'bundle1.pull',
1007 coreconfigitem('server', 'bundle1.pull',
1008 default=None,
1008 default=None,
1009 )
1009 )
1010 coreconfigitem('server', 'bundle1gd.pull',
1010 coreconfigitem('server', 'bundle1gd.pull',
1011 default=None,
1011 default=None,
1012 )
1012 )
1013 coreconfigitem('server', 'bundle1.push',
1013 coreconfigitem('server', 'bundle1.push',
1014 default=None,
1014 default=None,
1015 )
1015 )
1016 coreconfigitem('server', 'bundle1gd.push',
1016 coreconfigitem('server', 'bundle1gd.push',
1017 default=None,
1017 default=None,
1018 )
1018 )
1019 coreconfigitem('server', 'bundle2.stream',
1019 coreconfigitem('server', 'bundle2.stream',
1020 default=True,
1020 default=True,
1021 alias=[('experimental', 'bundle2.stream')]
1021 alias=[('experimental', 'bundle2.stream')]
1022 )
1022 )
1023 coreconfigitem('server', 'compressionengines',
1023 coreconfigitem('server', 'compressionengines',
1024 default=list,
1024 default=list,
1025 )
1025 )
1026 coreconfigitem('server', 'concurrent-push-mode',
1026 coreconfigitem('server', 'concurrent-push-mode',
1027 default='strict',
1027 default='strict',
1028 )
1028 )
1029 coreconfigitem('server', 'disablefullbundle',
1029 coreconfigitem('server', 'disablefullbundle',
1030 default=False,
1030 default=False,
1031 )
1031 )
1032 coreconfigitem('server', 'maxhttpheaderlen',
1032 coreconfigitem('server', 'maxhttpheaderlen',
1033 default=1024,
1033 default=1024,
1034 )
1034 )
1035 coreconfigitem('server', 'pullbundle',
1035 coreconfigitem('server', 'pullbundle',
1036 default=False,
1036 default=False,
1037 )
1037 )
1038 coreconfigitem('server', 'preferuncompressed',
1038 coreconfigitem('server', 'preferuncompressed',
1039 default=False,
1039 default=False,
1040 )
1040 )
1041 coreconfigitem('server', 'streamunbundle',
1041 coreconfigitem('server', 'streamunbundle',
1042 default=False,
1042 default=False,
1043 )
1043 )
1044 coreconfigitem('server', 'uncompressed',
1044 coreconfigitem('server', 'uncompressed',
1045 default=True,
1045 default=True,
1046 )
1046 )
1047 coreconfigitem('server', 'uncompressedallowsecret',
1047 coreconfigitem('server', 'uncompressedallowsecret',
1048 default=False,
1048 default=False,
1049 )
1049 )
1050 coreconfigitem('server', 'validate',
1050 coreconfigitem('server', 'validate',
1051 default=False,
1051 default=False,
1052 )
1052 )
1053 coreconfigitem('server', 'zliblevel',
1053 coreconfigitem('server', 'zliblevel',
1054 default=-1,
1054 default=-1,
1055 )
1055 )
1056 coreconfigitem('server', 'zstdlevel',
1056 coreconfigitem('server', 'zstdlevel',
1057 default=3,
1057 default=3,
1058 )
1058 )
1059 coreconfigitem('share', 'pool',
1059 coreconfigitem('share', 'pool',
1060 default=None,
1060 default=None,
1061 )
1061 )
1062 coreconfigitem('share', 'poolnaming',
1062 coreconfigitem('share', 'poolnaming',
1063 default='identity',
1063 default='identity',
1064 )
1064 )
1065 coreconfigitem('smtp', 'host',
1065 coreconfigitem('smtp', 'host',
1066 default=None,
1066 default=None,
1067 )
1067 )
1068 coreconfigitem('smtp', 'local_hostname',
1068 coreconfigitem('smtp', 'local_hostname',
1069 default=None,
1069 default=None,
1070 )
1070 )
1071 coreconfigitem('smtp', 'password',
1071 coreconfigitem('smtp', 'password',
1072 default=None,
1072 default=None,
1073 )
1073 )
1074 coreconfigitem('smtp', 'port',
1074 coreconfigitem('smtp', 'port',
1075 default=dynamicdefault,
1075 default=dynamicdefault,
1076 )
1076 )
1077 coreconfigitem('smtp', 'tls',
1077 coreconfigitem('smtp', 'tls',
1078 default='none',
1078 default='none',
1079 )
1079 )
1080 coreconfigitem('smtp', 'username',
1080 coreconfigitem('smtp', 'username',
1081 default=None,
1081 default=None,
1082 )
1082 )
1083 coreconfigitem('sparse', 'missingwarning',
1083 coreconfigitem('sparse', 'missingwarning',
1084 default=True,
1084 default=True,
1085 )
1085 )
1086 coreconfigitem('subrepos', 'allowed',
1086 coreconfigitem('subrepos', 'allowed',
1087 default=dynamicdefault, # to make backporting simpler
1087 default=dynamicdefault, # to make backporting simpler
1088 )
1088 )
1089 coreconfigitem('subrepos', 'hg:allowed',
1089 coreconfigitem('subrepos', 'hg:allowed',
1090 default=dynamicdefault,
1090 default=dynamicdefault,
1091 )
1091 )
1092 coreconfigitem('subrepos', 'git:allowed',
1092 coreconfigitem('subrepos', 'git:allowed',
1093 default=dynamicdefault,
1093 default=dynamicdefault,
1094 )
1094 )
1095 coreconfigitem('subrepos', 'svn:allowed',
1095 coreconfigitem('subrepos', 'svn:allowed',
1096 default=dynamicdefault,
1096 default=dynamicdefault,
1097 )
1097 )
1098 coreconfigitem('templates', '.*',
1098 coreconfigitem('templates', '.*',
1099 default=None,
1099 default=None,
1100 generic=True,
1100 generic=True,
1101 )
1101 )
1102 coreconfigitem('trusted', 'groups',
1102 coreconfigitem('trusted', 'groups',
1103 default=list,
1103 default=list,
1104 )
1104 )
1105 coreconfigitem('trusted', 'users',
1105 coreconfigitem('trusted', 'users',
1106 default=list,
1106 default=list,
1107 )
1107 )
1108 coreconfigitem('ui', '_usedassubrepo',
1108 coreconfigitem('ui', '_usedassubrepo',
1109 default=False,
1109 default=False,
1110 )
1110 )
1111 coreconfigitem('ui', 'allowemptycommit',
1111 coreconfigitem('ui', 'allowemptycommit',
1112 default=False,
1112 default=False,
1113 )
1113 )
1114 coreconfigitem('ui', 'archivemeta',
1114 coreconfigitem('ui', 'archivemeta',
1115 default=True,
1115 default=True,
1116 )
1116 )
1117 coreconfigitem('ui', 'askusername',
1117 coreconfigitem('ui', 'askusername',
1118 default=False,
1118 default=False,
1119 )
1119 )
1120 coreconfigitem('ui', 'clonebundlefallback',
1120 coreconfigitem('ui', 'clonebundlefallback',
1121 default=False,
1121 default=False,
1122 )
1122 )
1123 coreconfigitem('ui', 'clonebundleprefers',
1123 coreconfigitem('ui', 'clonebundleprefers',
1124 default=list,
1124 default=list,
1125 )
1125 )
1126 coreconfigitem('ui', 'clonebundles',
1126 coreconfigitem('ui', 'clonebundles',
1127 default=True,
1127 default=True,
1128 )
1128 )
1129 coreconfigitem('ui', 'color',
1129 coreconfigitem('ui', 'color',
1130 default='auto',
1130 default='auto',
1131 )
1131 )
1132 coreconfigitem('ui', 'commitsubrepos',
1132 coreconfigitem('ui', 'commitsubrepos',
1133 default=False,
1133 default=False,
1134 )
1134 )
1135 coreconfigitem('ui', 'debug',
1135 coreconfigitem('ui', 'debug',
1136 default=False,
1136 default=False,
1137 )
1137 )
1138 coreconfigitem('ui', 'debugger',
1138 coreconfigitem('ui', 'debugger',
1139 default=None,
1139 default=None,
1140 )
1140 )
1141 coreconfigitem('ui', 'editor',
1141 coreconfigitem('ui', 'editor',
1142 default=dynamicdefault,
1142 default=dynamicdefault,
1143 )
1143 )
1144 coreconfigitem('ui', 'fallbackencoding',
1144 coreconfigitem('ui', 'fallbackencoding',
1145 default=None,
1145 default=None,
1146 )
1146 )
1147 coreconfigitem('ui', 'forcecwd',
1147 coreconfigitem('ui', 'forcecwd',
1148 default=None,
1148 default=None,
1149 )
1149 )
1150 coreconfigitem('ui', 'forcemerge',
1150 coreconfigitem('ui', 'forcemerge',
1151 default=None,
1151 default=None,
1152 )
1152 )
1153 coreconfigitem('ui', 'formatdebug',
1153 coreconfigitem('ui', 'formatdebug',
1154 default=False,
1154 default=False,
1155 )
1155 )
1156 coreconfigitem('ui', 'formatjson',
1156 coreconfigitem('ui', 'formatjson',
1157 default=False,
1157 default=False,
1158 )
1158 )
1159 coreconfigitem('ui', 'formatted',
1159 coreconfigitem('ui', 'formatted',
1160 default=None,
1160 default=None,
1161 )
1161 )
1162 coreconfigitem('ui', 'graphnodetemplate',
1162 coreconfigitem('ui', 'graphnodetemplate',
1163 default=None,
1163 default=None,
1164 )
1164 )
1165 coreconfigitem('ui', 'history-editing-backup',
1165 coreconfigitem('ui', 'history-editing-backup',
1166 default=True,
1166 default=True,
1167 )
1167 )
1168 coreconfigitem('ui', 'interactive',
1168 coreconfigitem('ui', 'interactive',
1169 default=None,
1169 default=None,
1170 )
1170 )
1171 coreconfigitem('ui', 'interface',
1171 coreconfigitem('ui', 'interface',
1172 default=None,
1172 default=None,
1173 )
1173 )
1174 coreconfigitem('ui', 'interface.chunkselector',
1174 coreconfigitem('ui', 'interface.chunkselector',
1175 default=None,
1175 default=None,
1176 )
1176 )
1177 coreconfigitem('ui', 'large-file-limit',
1177 coreconfigitem('ui', 'large-file-limit',
1178 default=10000000,
1178 default=10000000,
1179 )
1179 )
1180 coreconfigitem('ui', 'logblockedtimes',
1180 coreconfigitem('ui', 'logblockedtimes',
1181 default=False,
1181 default=False,
1182 )
1182 )
1183 coreconfigitem('ui', 'logtemplate',
1183 coreconfigitem('ui', 'logtemplate',
1184 default=None,
1184 default=None,
1185 )
1185 )
1186 coreconfigitem('ui', 'merge',
1186 coreconfigitem('ui', 'merge',
1187 default=None,
1187 default=None,
1188 )
1188 )
1189 coreconfigitem('ui', 'mergemarkers',
1189 coreconfigitem('ui', 'mergemarkers',
1190 default='basic',
1190 default='basic',
1191 )
1191 )
1192 coreconfigitem('ui', 'mergemarkertemplate',
1192 coreconfigitem('ui', 'mergemarkertemplate',
1193 default=('{node|short} '
1193 default=('{node|short} '
1194 '{ifeq(tags, "tip", "", '
1194 '{ifeq(tags, "tip", "", '
1195 'ifeq(tags, "", "", "{tags} "))}'
1195 'ifeq(tags, "", "", "{tags} "))}'
1196 '{if(bookmarks, "{bookmarks} ")}'
1196 '{if(bookmarks, "{bookmarks} ")}'
1197 '{ifeq(branch, "default", "", "{branch} ")}'
1197 '{ifeq(branch, "default", "", "{branch} ")}'
1198 '- {author|user}: {desc|firstline}')
1198 '- {author|user}: {desc|firstline}')
1199 )
1199 )
1200 coreconfigitem('ui', 'message-output',
1200 coreconfigitem('ui', 'message-output',
1201 default='stdio',
1201 default='stdio',
1202 )
1202 )
1203 coreconfigitem('ui', 'nontty',
1203 coreconfigitem('ui', 'nontty',
1204 default=False,
1204 default=False,
1205 )
1205 )
1206 coreconfigitem('ui', 'origbackuppath',
1206 coreconfigitem('ui', 'origbackuppath',
1207 default=None,
1207 default=None,
1208 )
1208 )
1209 coreconfigitem('ui', 'paginate',
1209 coreconfigitem('ui', 'paginate',
1210 default=True,
1210 default=True,
1211 )
1211 )
1212 coreconfigitem('ui', 'patch',
1212 coreconfigitem('ui', 'patch',
1213 default=None,
1213 default=None,
1214 )
1214 )
1215 coreconfigitem('ui', 'pre-merge-tool-output-template',
1215 coreconfigitem('ui', 'pre-merge-tool-output-template',
1216 default=None,
1216 default=None,
1217 )
1217 )
1218 coreconfigitem('ui', 'portablefilenames',
1218 coreconfigitem('ui', 'portablefilenames',
1219 default='warn',
1219 default='warn',
1220 )
1220 )
1221 coreconfigitem('ui', 'promptecho',
1221 coreconfigitem('ui', 'promptecho',
1222 default=False,
1222 default=False,
1223 )
1223 )
1224 coreconfigitem('ui', 'quiet',
1224 coreconfigitem('ui', 'quiet',
1225 default=False,
1225 default=False,
1226 )
1226 )
1227 coreconfigitem('ui', 'quietbookmarkmove',
1227 coreconfigitem('ui', 'quietbookmarkmove',
1228 default=False,
1228 default=False,
1229 )
1229 )
1230 coreconfigitem('ui', 'remotecmd',
1230 coreconfigitem('ui', 'remotecmd',
1231 default='hg',
1231 default='hg',
1232 )
1232 )
1233 coreconfigitem('ui', 'report_untrusted',
1233 coreconfigitem('ui', 'report_untrusted',
1234 default=True,
1234 default=True,
1235 )
1235 )
1236 coreconfigitem('ui', 'rollback',
1236 coreconfigitem('ui', 'rollback',
1237 default=True,
1237 default=True,
1238 )
1238 )
1239 coreconfigitem('ui', 'signal-safe-lock',
1239 coreconfigitem('ui', 'signal-safe-lock',
1240 default=True,
1240 default=True,
1241 )
1241 )
1242 coreconfigitem('ui', 'slash',
1242 coreconfigitem('ui', 'slash',
1243 default=False,
1243 default=False,
1244 )
1244 )
1245 coreconfigitem('ui', 'ssh',
1245 coreconfigitem('ui', 'ssh',
1246 default='ssh',
1246 default='ssh',
1247 )
1247 )
1248 coreconfigitem('ui', 'ssherrorhint',
1248 coreconfigitem('ui', 'ssherrorhint',
1249 default=None,
1249 default=None,
1250 )
1250 )
1251 coreconfigitem('ui', 'statuscopies',
1251 coreconfigitem('ui', 'statuscopies',
1252 default=False,
1252 default=False,
1253 )
1253 )
1254 coreconfigitem('ui', 'strict',
1254 coreconfigitem('ui', 'strict',
1255 default=False,
1255 default=False,
1256 )
1256 )
1257 coreconfigitem('ui', 'style',
1257 coreconfigitem('ui', 'style',
1258 default='',
1258 default='',
1259 )
1259 )
1260 coreconfigitem('ui', 'supportcontact',
1260 coreconfigitem('ui', 'supportcontact',
1261 default=None,
1261 default=None,
1262 )
1262 )
1263 coreconfigitem('ui', 'textwidth',
1263 coreconfigitem('ui', 'textwidth',
1264 default=78,
1264 default=78,
1265 )
1265 )
1266 coreconfigitem('ui', 'timeout',
1266 coreconfigitem('ui', 'timeout',
1267 default='600',
1267 default='600',
1268 )
1268 )
1269 coreconfigitem('ui', 'timeout.warn',
1269 coreconfigitem('ui', 'timeout.warn',
1270 default=0,
1270 default=0,
1271 )
1271 )
1272 coreconfigitem('ui', 'traceback',
1272 coreconfigitem('ui', 'traceback',
1273 default=False,
1273 default=False,
1274 )
1274 )
1275 coreconfigitem('ui', 'tweakdefaults',
1275 coreconfigitem('ui', 'tweakdefaults',
1276 default=False,
1276 default=False,
1277 )
1277 )
1278 coreconfigitem('ui', 'username',
1278 coreconfigitem('ui', 'username',
1279 alias=[('ui', 'user')]
1279 alias=[('ui', 'user')]
1280 )
1280 )
1281 coreconfigitem('ui', 'verbose',
1281 coreconfigitem('ui', 'verbose',
1282 default=False,
1282 default=False,
1283 )
1283 )
1284 coreconfigitem('verify', 'skipflags',
1284 coreconfigitem('verify', 'skipflags',
1285 default=None,
1285 default=None,
1286 )
1286 )
1287 coreconfigitem('web', 'allowbz2',
1287 coreconfigitem('web', 'allowbz2',
1288 default=False,
1288 default=False,
1289 )
1289 )
1290 coreconfigitem('web', 'allowgz',
1290 coreconfigitem('web', 'allowgz',
1291 default=False,
1291 default=False,
1292 )
1292 )
1293 coreconfigitem('web', 'allow-pull',
1293 coreconfigitem('web', 'allow-pull',
1294 alias=[('web', 'allowpull')],
1294 alias=[('web', 'allowpull')],
1295 default=True,
1295 default=True,
1296 )
1296 )
1297 coreconfigitem('web', 'allow-push',
1297 coreconfigitem('web', 'allow-push',
1298 alias=[('web', 'allow_push')],
1298 alias=[('web', 'allow_push')],
1299 default=list,
1299 default=list,
1300 )
1300 )
1301 coreconfigitem('web', 'allowzip',
1301 coreconfigitem('web', 'allowzip',
1302 default=False,
1302 default=False,
1303 )
1303 )
1304 coreconfigitem('web', 'archivesubrepos',
1304 coreconfigitem('web', 'archivesubrepos',
1305 default=False,
1305 default=False,
1306 )
1306 )
1307 coreconfigitem('web', 'cache',
1307 coreconfigitem('web', 'cache',
1308 default=True,
1308 default=True,
1309 )
1309 )
1310 coreconfigitem('web', 'contact',
1310 coreconfigitem('web', 'contact',
1311 default=None,
1311 default=None,
1312 )
1312 )
1313 coreconfigitem('web', 'deny_push',
1313 coreconfigitem('web', 'deny_push',
1314 default=list,
1314 default=list,
1315 )
1315 )
1316 coreconfigitem('web', 'guessmime',
1316 coreconfigitem('web', 'guessmime',
1317 default=False,
1317 default=False,
1318 )
1318 )
1319 coreconfigitem('web', 'hidden',
1319 coreconfigitem('web', 'hidden',
1320 default=False,
1320 default=False,
1321 )
1321 )
1322 coreconfigitem('web', 'labels',
1322 coreconfigitem('web', 'labels',
1323 default=list,
1323 default=list,
1324 )
1324 )
1325 coreconfigitem('web', 'logoimg',
1325 coreconfigitem('web', 'logoimg',
1326 default='hglogo.png',
1326 default='hglogo.png',
1327 )
1327 )
1328 coreconfigitem('web', 'logourl',
1328 coreconfigitem('web', 'logourl',
1329 default='https://mercurial-scm.org/',
1329 default='https://mercurial-scm.org/',
1330 )
1330 )
1331 coreconfigitem('web', 'accesslog',
1331 coreconfigitem('web', 'accesslog',
1332 default='-',
1332 default='-',
1333 )
1333 )
1334 coreconfigitem('web', 'address',
1334 coreconfigitem('web', 'address',
1335 default='',
1335 default='',
1336 )
1336 )
1337 coreconfigitem('web', 'allow-archive',
1337 coreconfigitem('web', 'allow-archive',
1338 alias=[('web', 'allow_archive')],
1338 alias=[('web', 'allow_archive')],
1339 default=list,
1339 default=list,
1340 )
1340 )
1341 coreconfigitem('web', 'allow_read',
1341 coreconfigitem('web', 'allow_read',
1342 default=list,
1342 default=list,
1343 )
1343 )
1344 coreconfigitem('web', 'baseurl',
1344 coreconfigitem('web', 'baseurl',
1345 default=None,
1345 default=None,
1346 )
1346 )
1347 coreconfigitem('web', 'cacerts',
1347 coreconfigitem('web', 'cacerts',
1348 default=None,
1348 default=None,
1349 )
1349 )
1350 coreconfigitem('web', 'certificate',
1350 coreconfigitem('web', 'certificate',
1351 default=None,
1351 default=None,
1352 )
1352 )
1353 coreconfigitem('web', 'collapse',
1353 coreconfigitem('web', 'collapse',
1354 default=False,
1354 default=False,
1355 )
1355 )
1356 coreconfigitem('web', 'csp',
1356 coreconfigitem('web', 'csp',
1357 default=None,
1357 default=None,
1358 )
1358 )
1359 coreconfigitem('web', 'deny_read',
1359 coreconfigitem('web', 'deny_read',
1360 default=list,
1360 default=list,
1361 )
1361 )
1362 coreconfigitem('web', 'descend',
1362 coreconfigitem('web', 'descend',
1363 default=True,
1363 default=True,
1364 )
1364 )
1365 coreconfigitem('web', 'description',
1365 coreconfigitem('web', 'description',
1366 default="",
1366 default="",
1367 )
1367 )
1368 coreconfigitem('web', 'encoding',
1368 coreconfigitem('web', 'encoding',
1369 default=lambda: encoding.encoding,
1369 default=lambda: encoding.encoding,
1370 )
1370 )
1371 coreconfigitem('web', 'errorlog',
1371 coreconfigitem('web', 'errorlog',
1372 default='-',
1372 default='-',
1373 )
1373 )
1374 coreconfigitem('web', 'ipv6',
1374 coreconfigitem('web', 'ipv6',
1375 default=False,
1375 default=False,
1376 )
1376 )
1377 coreconfigitem('web', 'maxchanges',
1377 coreconfigitem('web', 'maxchanges',
1378 default=10,
1378 default=10,
1379 )
1379 )
1380 coreconfigitem('web', 'maxfiles',
1380 coreconfigitem('web', 'maxfiles',
1381 default=10,
1381 default=10,
1382 )
1382 )
1383 coreconfigitem('web', 'maxshortchanges',
1383 coreconfigitem('web', 'maxshortchanges',
1384 default=60,
1384 default=60,
1385 )
1385 )
1386 coreconfigitem('web', 'motd',
1386 coreconfigitem('web', 'motd',
1387 default='',
1387 default='',
1388 )
1388 )
1389 coreconfigitem('web', 'name',
1389 coreconfigitem('web', 'name',
1390 default=dynamicdefault,
1390 default=dynamicdefault,
1391 )
1391 )
1392 coreconfigitem('web', 'port',
1392 coreconfigitem('web', 'port',
1393 default=8000,
1393 default=8000,
1394 )
1394 )
1395 coreconfigitem('web', 'prefix',
1395 coreconfigitem('web', 'prefix',
1396 default='',
1396 default='',
1397 )
1397 )
1398 coreconfigitem('web', 'push_ssl',
1398 coreconfigitem('web', 'push_ssl',
1399 default=True,
1399 default=True,
1400 )
1400 )
1401 coreconfigitem('web', 'refreshinterval',
1401 coreconfigitem('web', 'refreshinterval',
1402 default=20,
1402 default=20,
1403 )
1403 )
1404 coreconfigitem('web', 'server-header',
1404 coreconfigitem('web', 'server-header',
1405 default=None,
1405 default=None,
1406 )
1406 )
1407 coreconfigitem('web', 'static',
1407 coreconfigitem('web', 'static',
1408 default=None,
1408 default=None,
1409 )
1409 )
1410 coreconfigitem('web', 'staticurl',
1410 coreconfigitem('web', 'staticurl',
1411 default=None,
1411 default=None,
1412 )
1412 )
1413 coreconfigitem('web', 'stripes',
1413 coreconfigitem('web', 'stripes',
1414 default=1,
1414 default=1,
1415 )
1415 )
1416 coreconfigitem('web', 'style',
1416 coreconfigitem('web', 'style',
1417 default='paper',
1417 default='paper',
1418 )
1418 )
1419 coreconfigitem('web', 'templates',
1419 coreconfigitem('web', 'templates',
1420 default=None,
1420 default=None,
1421 )
1421 )
1422 coreconfigitem('web', 'view',
1422 coreconfigitem('web', 'view',
1423 default='served',
1423 default='served',
1424 )
1424 )
1425 coreconfigitem('worker', 'backgroundclose',
1425 coreconfigitem('worker', 'backgroundclose',
1426 default=dynamicdefault,
1426 default=dynamicdefault,
1427 )
1427 )
1428 # Windows defaults to a limit of 512 open files. A buffer of 128
1428 # Windows defaults to a limit of 512 open files. A buffer of 128
1429 # should give us enough headway.
1429 # should give us enough headway.
1430 coreconfigitem('worker', 'backgroundclosemaxqueue',
1430 coreconfigitem('worker', 'backgroundclosemaxqueue',
1431 default=384,
1431 default=384,
1432 )
1432 )
1433 coreconfigitem('worker', 'backgroundcloseminfilecount',
1433 coreconfigitem('worker', 'backgroundcloseminfilecount',
1434 default=2048,
1434 default=2048,
1435 )
1435 )
1436 coreconfigitem('worker', 'backgroundclosethreadcount',
1436 coreconfigitem('worker', 'backgroundclosethreadcount',
1437 default=4,
1437 default=4,
1438 )
1438 )
1439 coreconfigitem('worker', 'enabled',
1439 coreconfigitem('worker', 'enabled',
1440 default=True,
1440 default=True,
1441 )
1441 )
1442 coreconfigitem('worker', 'numcpus',
1442 coreconfigitem('worker', 'numcpus',
1443 default=None,
1443 default=None,
1444 )
1444 )
1445
1445
1446 # Rebase related configuration moved to core because other extension are doing
1446 # Rebase related configuration moved to core because other extension are doing
1447 # strange things. For example, shelve import the extensions to reuse some bit
1447 # strange things. For example, shelve import the extensions to reuse some bit
1448 # without formally loading it.
1448 # without formally loading it.
1449 coreconfigitem('commands', 'rebase.requiredest',
1449 coreconfigitem('commands', 'rebase.requiredest',
1450 default=False,
1450 default=False,
1451 )
1451 )
1452 coreconfigitem('experimental', 'rebaseskipobsolete',
1452 coreconfigitem('experimental', 'rebaseskipobsolete',
1453 default=True,
1453 default=True,
1454 )
1454 )
1455 coreconfigitem('rebase', 'singletransaction',
1455 coreconfigitem('rebase', 'singletransaction',
1456 default=False,
1456 default=False,
1457 )
1457 )
1458 coreconfigitem('rebase', 'experimental.inmemory',
1458 coreconfigitem('rebase', 'experimental.inmemory',
1459 default=False,
1459 default=False,
1460 )
1460 )
@@ -1,897 +1,897 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 . import (
13 from . import (
14 changelog,
14 changelog,
15 error,
15 error,
16 filelog,
16 filelog,
17 hg,
17 hg,
18 localrepo,
18 localrepo,
19 manifest,
19 manifest,
20 pycompat,
20 pycompat,
21 revlog,
21 revlog,
22 scmutil,
22 scmutil,
23 util,
23 util,
24 vfs as vfsmod,
24 vfs as vfsmod,
25 )
25 )
26
26
27 def requiredsourcerequirements(repo):
27 def requiredsourcerequirements(repo):
28 """Obtain requirements required to be present to upgrade a repo.
28 """Obtain requirements required to be present to upgrade a repo.
29
29
30 An upgrade will not be allowed if the repository doesn't have the
30 An upgrade will not be allowed if the repository doesn't have the
31 requirements returned by this function.
31 requirements returned by this function.
32 """
32 """
33 return {
33 return {
34 # Introduced in Mercurial 0.9.2.
34 # Introduced in Mercurial 0.9.2.
35 'revlogv1',
35 'revlogv1',
36 # Introduced in Mercurial 0.9.2.
36 # Introduced in Mercurial 0.9.2.
37 'store',
37 'store',
38 }
38 }
39
39
40 def blocksourcerequirements(repo):
40 def blocksourcerequirements(repo):
41 """Obtain requirements that will prevent an upgrade from occurring.
41 """Obtain requirements that will prevent an upgrade from occurring.
42
42
43 An upgrade cannot be performed if the source repository contains a
43 An upgrade cannot be performed if the source repository contains a
44 requirements in the returned set.
44 requirements in the returned set.
45 """
45 """
46 return {
46 return {
47 # The upgrade code does not yet support these experimental features.
47 # The upgrade code does not yet support these experimental features.
48 # This is an artificial limitation.
48 # This is an artificial limitation.
49 'treemanifest',
49 'treemanifest',
50 # This was a precursor to generaldelta and was never enabled by default.
50 # This was a precursor to generaldelta and was never enabled by default.
51 # It should (hopefully) not exist in the wild.
51 # It should (hopefully) not exist in the wild.
52 'parentdelta',
52 'parentdelta',
53 # Upgrade should operate on the actual store, not the shared link.
53 # Upgrade should operate on the actual store, not the shared link.
54 'shared',
54 'shared',
55 }
55 }
56
56
57 def supportremovedrequirements(repo):
57 def supportremovedrequirements(repo):
58 """Obtain requirements that can be removed during an upgrade.
58 """Obtain requirements that can be removed during an upgrade.
59
59
60 If an upgrade were to create a repository that dropped a requirement,
60 If an upgrade were to create a repository that dropped a requirement,
61 the dropped requirement must appear in the returned set for the upgrade
61 the dropped requirement must appear in the returned set for the upgrade
62 to be allowed.
62 to be allowed.
63 """
63 """
64 return {
64 return {
65 localrepo.SPARSEREVLOG_REQUIREMENT,
65 localrepo.SPARSEREVLOG_REQUIREMENT,
66 }
66 }
67
67
68 def supporteddestrequirements(repo):
68 def supporteddestrequirements(repo):
69 """Obtain requirements that upgrade supports in the destination.
69 """Obtain requirements that upgrade supports in the destination.
70
70
71 If the result of the upgrade would create requirements not in this set,
71 If the result of the upgrade would create requirements not in this set,
72 the upgrade is disallowed.
72 the upgrade is disallowed.
73
73
74 Extensions should monkeypatch this to add their custom requirements.
74 Extensions should monkeypatch this to add their custom requirements.
75 """
75 """
76 return {
76 return {
77 'dotencode',
77 'dotencode',
78 'fncache',
78 'fncache',
79 'generaldelta',
79 'generaldelta',
80 'revlogv1',
80 'revlogv1',
81 'store',
81 'store',
82 localrepo.SPARSEREVLOG_REQUIREMENT,
82 localrepo.SPARSEREVLOG_REQUIREMENT,
83 }
83 }
84
84
85 def allowednewrequirements(repo):
85 def allowednewrequirements(repo):
86 """Obtain requirements that can be added to a repository during upgrade.
86 """Obtain requirements that can be added to a repository during upgrade.
87
87
88 This is used to disallow proposed requirements from being added when
88 This is used to disallow proposed requirements from being added when
89 they weren't present before.
89 they weren't present before.
90
90
91 We use a list of allowed requirement additions instead of a list of known
91 We use a list of allowed requirement additions instead of a list of known
92 bad additions because the whitelist approach is safer and will prevent
92 bad additions because the whitelist approach is safer and will prevent
93 future, unknown requirements from accidentally being added.
93 future, unknown requirements from accidentally being added.
94 """
94 """
95 return {
95 return {
96 'dotencode',
96 'dotencode',
97 'fncache',
97 'fncache',
98 'generaldelta',
98 'generaldelta',
99 localrepo.SPARSEREVLOG_REQUIREMENT,
99 localrepo.SPARSEREVLOG_REQUIREMENT,
100 }
100 }
101
101
102 def preservedrequirements(repo):
102 def preservedrequirements(repo):
103 return set()
103 return set()
104
104
105 deficiency = 'deficiency'
105 deficiency = 'deficiency'
106 optimisation = 'optimization'
106 optimisation = 'optimization'
107
107
108 class improvement(object):
108 class improvement(object):
109 """Represents an improvement that can be made as part of an upgrade.
109 """Represents an improvement that can be made as part of an upgrade.
110
110
111 The following attributes are defined on each instance:
111 The following attributes are defined on each instance:
112
112
113 name
113 name
114 Machine-readable string uniquely identifying this improvement. It
114 Machine-readable string uniquely identifying this improvement. It
115 will be mapped to an action later in the upgrade process.
115 will be mapped to an action later in the upgrade process.
116
116
117 type
117 type
118 Either ``deficiency`` or ``optimisation``. A deficiency is an obvious
118 Either ``deficiency`` or ``optimisation``. A deficiency is an obvious
119 problem. An optimization is an action (sometimes optional) that
119 problem. An optimization is an action (sometimes optional) that
120 can be taken to further improve the state of the repository.
120 can be taken to further improve the state of the repository.
121
121
122 description
122 description
123 Message intended for humans explaining the improvement in more detail,
123 Message intended for humans explaining the improvement in more detail,
124 including the implications of it. For ``deficiency`` types, should be
124 including the implications of it. For ``deficiency`` types, should be
125 worded in the present tense. For ``optimisation`` types, should be
125 worded in the present tense. For ``optimisation`` types, should be
126 worded in the future tense.
126 worded in the future tense.
127
127
128 upgrademessage
128 upgrademessage
129 Message intended for humans explaining what an upgrade addressing this
129 Message intended for humans explaining what an upgrade addressing this
130 issue will do. Should be worded in the future tense.
130 issue will do. Should be worded in the future tense.
131 """
131 """
132 def __init__(self, name, type, description, upgrademessage):
132 def __init__(self, name, type, description, upgrademessage):
133 self.name = name
133 self.name = name
134 self.type = type
134 self.type = type
135 self.description = description
135 self.description = description
136 self.upgrademessage = upgrademessage
136 self.upgrademessage = upgrademessage
137
137
138 def __eq__(self, other):
138 def __eq__(self, other):
139 if not isinstance(other, improvement):
139 if not isinstance(other, improvement):
140 # This is what python tell use to do
140 # This is what python tell use to do
141 return NotImplemented
141 return NotImplemented
142 return self.name == other.name
142 return self.name == other.name
143
143
144 def __ne__(self, other):
144 def __ne__(self, other):
145 return not self == other
145 return not self == other
146
146
147 def __hash__(self):
147 def __hash__(self):
148 return hash(self.name)
148 return hash(self.name)
149
149
150 allformatvariant = []
150 allformatvariant = []
151
151
152 def registerformatvariant(cls):
152 def registerformatvariant(cls):
153 allformatvariant.append(cls)
153 allformatvariant.append(cls)
154 return cls
154 return cls
155
155
156 class formatvariant(improvement):
156 class formatvariant(improvement):
157 """an improvement subclass dedicated to repository format"""
157 """an improvement subclass dedicated to repository format"""
158 type = deficiency
158 type = deficiency
159 ### The following attributes should be defined for each class:
159 ### The following attributes should be defined for each class:
160
160
161 # machine-readable string uniquely identifying this improvement. it will be
161 # machine-readable string uniquely identifying this improvement. it will be
162 # mapped to an action later in the upgrade process.
162 # mapped to an action later in the upgrade process.
163 name = None
163 name = None
164
164
165 # message intended for humans explaining the improvement in more detail,
165 # message intended for humans explaining the improvement in more detail,
166 # including the implications of it ``deficiency`` types, should be worded
166 # including the implications of it ``deficiency`` types, should be worded
167 # in the present tense.
167 # in the present tense.
168 description = None
168 description = None
169
169
170 # message intended for humans explaining what an upgrade addressing this
170 # message intended for humans explaining what an upgrade addressing this
171 # issue will do. should be worded in the future tense.
171 # issue will do. should be worded in the future tense.
172 upgrademessage = None
172 upgrademessage = None
173
173
174 # value of current Mercurial default for new repository
174 # value of current Mercurial default for new repository
175 default = None
175 default = None
176
176
177 def __init__(self):
177 def __init__(self):
178 raise NotImplementedError()
178 raise NotImplementedError()
179
179
180 @staticmethod
180 @staticmethod
181 def fromrepo(repo):
181 def fromrepo(repo):
182 """current value of the variant in the repository"""
182 """current value of the variant in the repository"""
183 raise NotImplementedError()
183 raise NotImplementedError()
184
184
185 @staticmethod
185 @staticmethod
186 def fromconfig(repo):
186 def fromconfig(repo):
187 """current value of the variant in the configuration"""
187 """current value of the variant in the configuration"""
188 raise NotImplementedError()
188 raise NotImplementedError()
189
189
190 class requirementformatvariant(formatvariant):
190 class requirementformatvariant(formatvariant):
191 """formatvariant based on a 'requirement' name.
191 """formatvariant based on a 'requirement' name.
192
192
193 Many format variant are controlled by a 'requirement'. We define a small
193 Many format variant are controlled by a 'requirement'. We define a small
194 subclass to factor the code.
194 subclass to factor the code.
195 """
195 """
196
196
197 # the requirement that control this format variant
197 # the requirement that control this format variant
198 _requirement = None
198 _requirement = None
199
199
200 @staticmethod
200 @staticmethod
201 def _newreporequirements(ui):
201 def _newreporequirements(ui):
202 return localrepo.newreporequirements(
202 return localrepo.newreporequirements(
203 ui, localrepo.defaultcreateopts(ui))
203 ui, localrepo.defaultcreateopts(ui))
204
204
205 @classmethod
205 @classmethod
206 def fromrepo(cls, repo):
206 def fromrepo(cls, repo):
207 assert cls._requirement is not None
207 assert cls._requirement is not None
208 return cls._requirement in repo.requirements
208 return cls._requirement in repo.requirements
209
209
210 @classmethod
210 @classmethod
211 def fromconfig(cls, repo):
211 def fromconfig(cls, repo):
212 assert cls._requirement is not None
212 assert cls._requirement is not None
213 return cls._requirement in cls._newreporequirements(repo.ui)
213 return cls._requirement in cls._newreporequirements(repo.ui)
214
214
215 @registerformatvariant
215 @registerformatvariant
216 class fncache(requirementformatvariant):
216 class fncache(requirementformatvariant):
217 name = 'fncache'
217 name = 'fncache'
218
218
219 _requirement = 'fncache'
219 _requirement = 'fncache'
220
220
221 default = True
221 default = True
222
222
223 description = _('long and reserved filenames may not work correctly; '
223 description = _('long and reserved filenames may not work correctly; '
224 'repository performance is sub-optimal')
224 'repository performance is sub-optimal')
225
225
226 upgrademessage = _('repository will be more resilient to storing '
226 upgrademessage = _('repository will be more resilient to storing '
227 'certain paths and performance of certain '
227 'certain paths and performance of certain '
228 'operations should be improved')
228 'operations should be improved')
229
229
230 @registerformatvariant
230 @registerformatvariant
231 class dotencode(requirementformatvariant):
231 class dotencode(requirementformatvariant):
232 name = 'dotencode'
232 name = 'dotencode'
233
233
234 _requirement = 'dotencode'
234 _requirement = 'dotencode'
235
235
236 default = True
236 default = True
237
237
238 description = _('storage of filenames beginning with a period or '
238 description = _('storage of filenames beginning with a period or '
239 'space may not work correctly')
239 'space may not work correctly')
240
240
241 upgrademessage = _('repository will be better able to store files '
241 upgrademessage = _('repository will be better able to store files '
242 'beginning with a space or period')
242 'beginning with a space or period')
243
243
244 @registerformatvariant
244 @registerformatvariant
245 class generaldelta(requirementformatvariant):
245 class generaldelta(requirementformatvariant):
246 name = 'generaldelta'
246 name = 'generaldelta'
247
247
248 _requirement = 'generaldelta'
248 _requirement = 'generaldelta'
249
249
250 default = True
250 default = True
251
251
252 description = _('deltas within internal storage are unable to '
252 description = _('deltas within internal storage are unable to '
253 'choose optimal revisions; repository is larger and '
253 'choose optimal revisions; repository is larger and '
254 'slower than it could be; interaction with other '
254 'slower than it could be; interaction with other '
255 'repositories may require extra network and CPU '
255 'repositories may require extra network and CPU '
256 'resources, making "hg push" and "hg pull" slower')
256 'resources, making "hg push" and "hg pull" slower')
257
257
258 upgrademessage = _('repository storage will be able to create '
258 upgrademessage = _('repository storage will be able to create '
259 'optimal deltas; new repository data will be '
259 'optimal deltas; new repository data will be '
260 'smaller and read times should decrease; '
260 'smaller and read times should decrease; '
261 'interacting with other repositories using this '
261 'interacting with other repositories using this '
262 'storage model should require less network and '
262 'storage model should require less network and '
263 'CPU resources, making "hg push" and "hg pull" '
263 'CPU resources, making "hg push" and "hg pull" '
264 'faster')
264 'faster')
265
265
266 @registerformatvariant
266 @registerformatvariant
267 class sparserevlog(requirementformatvariant):
267 class sparserevlog(requirementformatvariant):
268 name = 'sparserevlog'
268 name = 'sparserevlog'
269
269
270 _requirement = localrepo.SPARSEREVLOG_REQUIREMENT
270 _requirement = localrepo.SPARSEREVLOG_REQUIREMENT
271
271
272 default = False
272 default = True
273
273
274 description = _('in order to limit disk reading and memory usage on older '
274 description = _('in order to limit disk reading and memory usage on older '
275 'version, the span of a delta chain from its root to its '
275 'version, the span of a delta chain from its root to its '
276 'end is limited, whatever the relevant data in this span. '
276 'end is limited, whatever the relevant data in this span. '
277 'This can severly limit Mercurial ability to build good '
277 'This can severly limit Mercurial ability to build good '
278 'chain of delta resulting is much more storage space being '
278 'chain of delta resulting is much more storage space being '
279 'taken and limit reusability of on disk delta during '
279 'taken and limit reusability of on disk delta during '
280 'exchange.'
280 'exchange.'
281 )
281 )
282
282
283 upgrademessage = _('Revlog supports delta chain with more unused data '
283 upgrademessage = _('Revlog supports delta chain with more unused data '
284 'between payload. These gaps will be skipped at read '
284 'between payload. These gaps will be skipped at read '
285 'time. This allows for better delta chains, making a '
285 'time. This allows for better delta chains, making a '
286 'better compression and faster exchange with server.')
286 'better compression and faster exchange with server.')
287
287
288 @registerformatvariant
288 @registerformatvariant
289 class removecldeltachain(formatvariant):
289 class removecldeltachain(formatvariant):
290 name = 'plain-cl-delta'
290 name = 'plain-cl-delta'
291
291
292 default = True
292 default = True
293
293
294 description = _('changelog storage is using deltas instead of '
294 description = _('changelog storage is using deltas instead of '
295 'raw entries; changelog reading and any '
295 'raw entries; changelog reading and any '
296 'operation relying on changelog data are slower '
296 'operation relying on changelog data are slower '
297 'than they could be')
297 'than they could be')
298
298
299 upgrademessage = _('changelog storage will be reformated to '
299 upgrademessage = _('changelog storage will be reformated to '
300 'store raw entries; changelog reading will be '
300 'store raw entries; changelog reading will be '
301 'faster; changelog size may be reduced')
301 'faster; changelog size may be reduced')
302
302
303 @staticmethod
303 @staticmethod
304 def fromrepo(repo):
304 def fromrepo(repo):
305 # Mercurial 4.0 changed changelogs to not use delta chains. Search for
305 # Mercurial 4.0 changed changelogs to not use delta chains. Search for
306 # changelogs with deltas.
306 # changelogs with deltas.
307 cl = repo.changelog
307 cl = repo.changelog
308 chainbase = cl.chainbase
308 chainbase = cl.chainbase
309 return all(rev == chainbase(rev) for rev in cl)
309 return all(rev == chainbase(rev) for rev in cl)
310
310
311 @staticmethod
311 @staticmethod
312 def fromconfig(repo):
312 def fromconfig(repo):
313 return True
313 return True
314
314
315 @registerformatvariant
315 @registerformatvariant
316 class compressionengine(formatvariant):
316 class compressionengine(formatvariant):
317 name = 'compression'
317 name = 'compression'
318 default = 'zlib'
318 default = 'zlib'
319
319
320 description = _('Compresion algorithm used to compress data. '
320 description = _('Compresion algorithm used to compress data. '
321 'Some engine are faster than other')
321 'Some engine are faster than other')
322
322
323 upgrademessage = _('revlog content will be recompressed with the new '
323 upgrademessage = _('revlog content will be recompressed with the new '
324 'algorithm.')
324 'algorithm.')
325
325
326 @classmethod
326 @classmethod
327 def fromrepo(cls, repo):
327 def fromrepo(cls, repo):
328 for req in repo.requirements:
328 for req in repo.requirements:
329 if req.startswith('exp-compression-'):
329 if req.startswith('exp-compression-'):
330 return req.split('-', 2)[2]
330 return req.split('-', 2)[2]
331 return 'zlib'
331 return 'zlib'
332
332
333 @classmethod
333 @classmethod
334 def fromconfig(cls, repo):
334 def fromconfig(cls, repo):
335 return repo.ui.config('experimental', 'format.compression')
335 return repo.ui.config('experimental', 'format.compression')
336
336
337 def finddeficiencies(repo):
337 def finddeficiencies(repo):
338 """returns a list of deficiencies that the repo suffer from"""
338 """returns a list of deficiencies that the repo suffer from"""
339 deficiencies = []
339 deficiencies = []
340
340
341 # We could detect lack of revlogv1 and store here, but they were added
341 # We could detect lack of revlogv1 and store here, but they were added
342 # in 0.9.2 and we don't support upgrading repos without these
342 # in 0.9.2 and we don't support upgrading repos without these
343 # requirements, so let's not bother.
343 # requirements, so let's not bother.
344
344
345 for fv in allformatvariant:
345 for fv in allformatvariant:
346 if not fv.fromrepo(repo):
346 if not fv.fromrepo(repo):
347 deficiencies.append(fv)
347 deficiencies.append(fv)
348
348
349 return deficiencies
349 return deficiencies
350
350
351 def findoptimizations(repo):
351 def findoptimizations(repo):
352 """Determine optimisation that could be used during upgrade"""
352 """Determine optimisation that could be used during upgrade"""
353 # These are unconditionally added. There is logic later that figures out
353 # These are unconditionally added. There is logic later that figures out
354 # which ones to apply.
354 # which ones to apply.
355 optimizations = []
355 optimizations = []
356
356
357 optimizations.append(improvement(
357 optimizations.append(improvement(
358 name='redeltaparent',
358 name='redeltaparent',
359 type=optimisation,
359 type=optimisation,
360 description=_('deltas within internal storage will be recalculated to '
360 description=_('deltas within internal storage will be recalculated to '
361 'choose an optimal base revision where this was not '
361 'choose an optimal base revision where this was not '
362 'already done; the size of the repository may shrink and '
362 'already done; the size of the repository may shrink and '
363 'various operations may become faster; the first time '
363 'various operations may become faster; the first time '
364 'this optimization is performed could slow down upgrade '
364 'this optimization is performed could slow down upgrade '
365 'execution considerably; subsequent invocations should '
365 'execution considerably; subsequent invocations should '
366 'not run noticeably slower'),
366 'not run noticeably slower'),
367 upgrademessage=_('deltas within internal storage will choose a new '
367 upgrademessage=_('deltas within internal storage will choose a new '
368 'base revision if needed')))
368 'base revision if needed')))
369
369
370 optimizations.append(improvement(
370 optimizations.append(improvement(
371 name='redeltamultibase',
371 name='redeltamultibase',
372 type=optimisation,
372 type=optimisation,
373 description=_('deltas within internal storage will be recalculated '
373 description=_('deltas within internal storage will be recalculated '
374 'against multiple base revision and the smallest '
374 'against multiple base revision and the smallest '
375 'difference will be used; the size of the repository may '
375 'difference will be used; the size of the repository may '
376 'shrink significantly when there are many merges; this '
376 'shrink significantly when there are many merges; this '
377 'optimization will slow down execution in proportion to '
377 'optimization will slow down execution in proportion to '
378 'the number of merges in the repository and the amount '
378 'the number of merges in the repository and the amount '
379 'of files in the repository; this slow down should not '
379 'of files in the repository; this slow down should not '
380 'be significant unless there are tens of thousands of '
380 'be significant unless there are tens of thousands of '
381 'files and thousands of merges'),
381 'files and thousands of merges'),
382 upgrademessage=_('deltas within internal storage will choose an '
382 upgrademessage=_('deltas within internal storage will choose an '
383 'optimal delta by computing deltas against multiple '
383 'optimal delta by computing deltas against multiple '
384 'parents; may slow down execution time '
384 'parents; may slow down execution time '
385 'significantly')))
385 'significantly')))
386
386
387 optimizations.append(improvement(
387 optimizations.append(improvement(
388 name='redeltaall',
388 name='redeltaall',
389 type=optimisation,
389 type=optimisation,
390 description=_('deltas within internal storage will always be '
390 description=_('deltas within internal storage will always be '
391 'recalculated without reusing prior deltas; this will '
391 'recalculated without reusing prior deltas; this will '
392 'likely make execution run several times slower; this '
392 'likely make execution run several times slower; this '
393 'optimization is typically not needed'),
393 'optimization is typically not needed'),
394 upgrademessage=_('deltas within internal storage will be fully '
394 upgrademessage=_('deltas within internal storage will be fully '
395 'recomputed; this will likely drastically slow down '
395 'recomputed; this will likely drastically slow down '
396 'execution time')))
396 'execution time')))
397
397
398 optimizations.append(improvement(
398 optimizations.append(improvement(
399 name='redeltafulladd',
399 name='redeltafulladd',
400 type=optimisation,
400 type=optimisation,
401 description=_('every revision will be re-added as if it was new '
401 description=_('every revision will be re-added as if it was new '
402 'content. It will go through the full storage '
402 'content. It will go through the full storage '
403 'mechanism giving extensions a chance to process it '
403 'mechanism giving extensions a chance to process it '
404 '(eg. lfs). This is similar to "redeltaall" but even '
404 '(eg. lfs). This is similar to "redeltaall" but even '
405 'slower since more logic is involved.'),
405 'slower since more logic is involved.'),
406 upgrademessage=_('each revision will be added as new content to the '
406 upgrademessage=_('each revision will be added as new content to the '
407 'internal storage; this will likely drastically slow '
407 'internal storage; this will likely drastically slow '
408 'down execution time, but some extensions might need '
408 'down execution time, but some extensions might need '
409 'it')))
409 'it')))
410
410
411 return optimizations
411 return optimizations
412
412
413 def determineactions(repo, deficiencies, sourcereqs, destreqs):
413 def determineactions(repo, deficiencies, sourcereqs, destreqs):
414 """Determine upgrade actions that will be performed.
414 """Determine upgrade actions that will be performed.
415
415
416 Given a list of improvements as returned by ``finddeficiencies`` and
416 Given a list of improvements as returned by ``finddeficiencies`` and
417 ``findoptimizations``, determine the list of upgrade actions that
417 ``findoptimizations``, determine the list of upgrade actions that
418 will be performed.
418 will be performed.
419
419
420 The role of this function is to filter improvements if needed, apply
420 The role of this function is to filter improvements if needed, apply
421 recommended optimizations from the improvements list that make sense,
421 recommended optimizations from the improvements list that make sense,
422 etc.
422 etc.
423
423
424 Returns a list of action names.
424 Returns a list of action names.
425 """
425 """
426 newactions = []
426 newactions = []
427
427
428 knownreqs = supporteddestrequirements(repo)
428 knownreqs = supporteddestrequirements(repo)
429
429
430 for d in deficiencies:
430 for d in deficiencies:
431 name = d.name
431 name = d.name
432
432
433 # If the action is a requirement that doesn't show up in the
433 # If the action is a requirement that doesn't show up in the
434 # destination requirements, prune the action.
434 # destination requirements, prune the action.
435 if name in knownreqs and name not in destreqs:
435 if name in knownreqs and name not in destreqs:
436 continue
436 continue
437
437
438 newactions.append(d)
438 newactions.append(d)
439
439
440 # FUTURE consider adding some optimizations here for certain transitions.
440 # FUTURE consider adding some optimizations here for certain transitions.
441 # e.g. adding generaldelta could schedule parent redeltas.
441 # e.g. adding generaldelta could schedule parent redeltas.
442
442
443 return newactions
443 return newactions
444
444
445 def _revlogfrompath(repo, path):
445 def _revlogfrompath(repo, path):
446 """Obtain a revlog from a repo path.
446 """Obtain a revlog from a repo path.
447
447
448 An instance of the appropriate class is returned.
448 An instance of the appropriate class is returned.
449 """
449 """
450 if path == '00changelog.i':
450 if path == '00changelog.i':
451 return changelog.changelog(repo.svfs)
451 return changelog.changelog(repo.svfs)
452 elif path.endswith('00manifest.i'):
452 elif path.endswith('00manifest.i'):
453 mandir = path[:-len('00manifest.i')]
453 mandir = path[:-len('00manifest.i')]
454 return manifest.manifestrevlog(repo.svfs, tree=mandir)
454 return manifest.manifestrevlog(repo.svfs, tree=mandir)
455 else:
455 else:
456 #reverse of "/".join(("data", path + ".i"))
456 #reverse of "/".join(("data", path + ".i"))
457 return filelog.filelog(repo.svfs, path[5:-2])
457 return filelog.filelog(repo.svfs, path[5:-2])
458
458
459 def _copyrevlogs(ui, srcrepo, dstrepo, tr, deltareuse, forcedeltabothparents):
459 def _copyrevlogs(ui, srcrepo, dstrepo, tr, deltareuse, forcedeltabothparents):
460 """Copy revlogs between 2 repos."""
460 """Copy revlogs between 2 repos."""
461 revcount = 0
461 revcount = 0
462 srcsize = 0
462 srcsize = 0
463 srcrawsize = 0
463 srcrawsize = 0
464 dstsize = 0
464 dstsize = 0
465 fcount = 0
465 fcount = 0
466 frevcount = 0
466 frevcount = 0
467 fsrcsize = 0
467 fsrcsize = 0
468 frawsize = 0
468 frawsize = 0
469 fdstsize = 0
469 fdstsize = 0
470 mcount = 0
470 mcount = 0
471 mrevcount = 0
471 mrevcount = 0
472 msrcsize = 0
472 msrcsize = 0
473 mrawsize = 0
473 mrawsize = 0
474 mdstsize = 0
474 mdstsize = 0
475 crevcount = 0
475 crevcount = 0
476 csrcsize = 0
476 csrcsize = 0
477 crawsize = 0
477 crawsize = 0
478 cdstsize = 0
478 cdstsize = 0
479
479
480 # Perform a pass to collect metadata. This validates we can open all
480 # Perform a pass to collect metadata. This validates we can open all
481 # source files and allows a unified progress bar to be displayed.
481 # source files and allows a unified progress bar to be displayed.
482 for unencoded, encoded, size in srcrepo.store.walk():
482 for unencoded, encoded, size in srcrepo.store.walk():
483 if unencoded.endswith('.d'):
483 if unencoded.endswith('.d'):
484 continue
484 continue
485
485
486 rl = _revlogfrompath(srcrepo, unencoded)
486 rl = _revlogfrompath(srcrepo, unencoded)
487
487
488 info = rl.storageinfo(exclusivefiles=True, revisionscount=True,
488 info = rl.storageinfo(exclusivefiles=True, revisionscount=True,
489 trackedsize=True, storedsize=True)
489 trackedsize=True, storedsize=True)
490
490
491 revcount += info['revisionscount'] or 0
491 revcount += info['revisionscount'] or 0
492 datasize = info['storedsize'] or 0
492 datasize = info['storedsize'] or 0
493 rawsize = info['trackedsize'] or 0
493 rawsize = info['trackedsize'] or 0
494
494
495 srcsize += datasize
495 srcsize += datasize
496 srcrawsize += rawsize
496 srcrawsize += rawsize
497
497
498 # This is for the separate progress bars.
498 # This is for the separate progress bars.
499 if isinstance(rl, changelog.changelog):
499 if isinstance(rl, changelog.changelog):
500 crevcount += len(rl)
500 crevcount += len(rl)
501 csrcsize += datasize
501 csrcsize += datasize
502 crawsize += rawsize
502 crawsize += rawsize
503 elif isinstance(rl, manifest.manifestrevlog):
503 elif isinstance(rl, manifest.manifestrevlog):
504 mcount += 1
504 mcount += 1
505 mrevcount += len(rl)
505 mrevcount += len(rl)
506 msrcsize += datasize
506 msrcsize += datasize
507 mrawsize += rawsize
507 mrawsize += rawsize
508 elif isinstance(rl, filelog.filelog):
508 elif isinstance(rl, filelog.filelog):
509 fcount += 1
509 fcount += 1
510 frevcount += len(rl)
510 frevcount += len(rl)
511 fsrcsize += datasize
511 fsrcsize += datasize
512 frawsize += rawsize
512 frawsize += rawsize
513 else:
513 else:
514 error.ProgrammingError('unknown revlog type')
514 error.ProgrammingError('unknown revlog type')
515
515
516 if not revcount:
516 if not revcount:
517 return
517 return
518
518
519 ui.write(_('migrating %d total revisions (%d in filelogs, %d in manifests, '
519 ui.write(_('migrating %d total revisions (%d in filelogs, %d in manifests, '
520 '%d in changelog)\n') %
520 '%d in changelog)\n') %
521 (revcount, frevcount, mrevcount, crevcount))
521 (revcount, frevcount, mrevcount, crevcount))
522 ui.write(_('migrating %s in store; %s tracked data\n') % (
522 ui.write(_('migrating %s in store; %s tracked data\n') % (
523 (util.bytecount(srcsize), util.bytecount(srcrawsize))))
523 (util.bytecount(srcsize), util.bytecount(srcrawsize))))
524
524
525 # Used to keep track of progress.
525 # Used to keep track of progress.
526 progress = None
526 progress = None
527 def oncopiedrevision(rl, rev, node):
527 def oncopiedrevision(rl, rev, node):
528 progress.increment()
528 progress.increment()
529
529
530 # Do the actual copying.
530 # Do the actual copying.
531 # FUTURE this operation can be farmed off to worker processes.
531 # FUTURE this operation can be farmed off to worker processes.
532 seen = set()
532 seen = set()
533 for unencoded, encoded, size in srcrepo.store.walk():
533 for unencoded, encoded, size in srcrepo.store.walk():
534 if unencoded.endswith('.d'):
534 if unencoded.endswith('.d'):
535 continue
535 continue
536
536
537 oldrl = _revlogfrompath(srcrepo, unencoded)
537 oldrl = _revlogfrompath(srcrepo, unencoded)
538 newrl = _revlogfrompath(dstrepo, unencoded)
538 newrl = _revlogfrompath(dstrepo, unencoded)
539
539
540 if isinstance(oldrl, changelog.changelog) and 'c' not in seen:
540 if isinstance(oldrl, changelog.changelog) and 'c' not in seen:
541 ui.write(_('finished migrating %d manifest revisions across %d '
541 ui.write(_('finished migrating %d manifest revisions across %d '
542 'manifests; change in size: %s\n') %
542 'manifests; change in size: %s\n') %
543 (mrevcount, mcount, util.bytecount(mdstsize - msrcsize)))
543 (mrevcount, mcount, util.bytecount(mdstsize - msrcsize)))
544
544
545 ui.write(_('migrating changelog containing %d revisions '
545 ui.write(_('migrating changelog containing %d revisions '
546 '(%s in store; %s tracked data)\n') %
546 '(%s in store; %s tracked data)\n') %
547 (crevcount, util.bytecount(csrcsize),
547 (crevcount, util.bytecount(csrcsize),
548 util.bytecount(crawsize)))
548 util.bytecount(crawsize)))
549 seen.add('c')
549 seen.add('c')
550 progress = srcrepo.ui.makeprogress(_('changelog revisions'),
550 progress = srcrepo.ui.makeprogress(_('changelog revisions'),
551 total=crevcount)
551 total=crevcount)
552 elif isinstance(oldrl, manifest.manifestrevlog) and 'm' not in seen:
552 elif isinstance(oldrl, manifest.manifestrevlog) and 'm' not in seen:
553 ui.write(_('finished migrating %d filelog revisions across %d '
553 ui.write(_('finished migrating %d filelog revisions across %d '
554 'filelogs; change in size: %s\n') %
554 'filelogs; change in size: %s\n') %
555 (frevcount, fcount, util.bytecount(fdstsize - fsrcsize)))
555 (frevcount, fcount, util.bytecount(fdstsize - fsrcsize)))
556
556
557 ui.write(_('migrating %d manifests containing %d revisions '
557 ui.write(_('migrating %d manifests containing %d revisions '
558 '(%s in store; %s tracked data)\n') %
558 '(%s in store; %s tracked data)\n') %
559 (mcount, mrevcount, util.bytecount(msrcsize),
559 (mcount, mrevcount, util.bytecount(msrcsize),
560 util.bytecount(mrawsize)))
560 util.bytecount(mrawsize)))
561 seen.add('m')
561 seen.add('m')
562 if progress:
562 if progress:
563 progress.complete()
563 progress.complete()
564 progress = srcrepo.ui.makeprogress(_('manifest revisions'),
564 progress = srcrepo.ui.makeprogress(_('manifest revisions'),
565 total=mrevcount)
565 total=mrevcount)
566 elif 'f' not in seen:
566 elif 'f' not in seen:
567 ui.write(_('migrating %d filelogs containing %d revisions '
567 ui.write(_('migrating %d filelogs containing %d revisions '
568 '(%s in store; %s tracked data)\n') %
568 '(%s in store; %s tracked data)\n') %
569 (fcount, frevcount, util.bytecount(fsrcsize),
569 (fcount, frevcount, util.bytecount(fsrcsize),
570 util.bytecount(frawsize)))
570 util.bytecount(frawsize)))
571 seen.add('f')
571 seen.add('f')
572 if progress:
572 if progress:
573 progress.complete()
573 progress.complete()
574 progress = srcrepo.ui.makeprogress(_('file revisions'),
574 progress = srcrepo.ui.makeprogress(_('file revisions'),
575 total=frevcount)
575 total=frevcount)
576
576
577
577
578 ui.note(_('cloning %d revisions from %s\n') % (len(oldrl), unencoded))
578 ui.note(_('cloning %d revisions from %s\n') % (len(oldrl), unencoded))
579 oldrl.clone(tr, newrl, addrevisioncb=oncopiedrevision,
579 oldrl.clone(tr, newrl, addrevisioncb=oncopiedrevision,
580 deltareuse=deltareuse,
580 deltareuse=deltareuse,
581 forcedeltabothparents=forcedeltabothparents)
581 forcedeltabothparents=forcedeltabothparents)
582
582
583 info = newrl.storageinfo(storedsize=True)
583 info = newrl.storageinfo(storedsize=True)
584 datasize = info['storedsize'] or 0
584 datasize = info['storedsize'] or 0
585
585
586 dstsize += datasize
586 dstsize += datasize
587
587
588 if isinstance(newrl, changelog.changelog):
588 if isinstance(newrl, changelog.changelog):
589 cdstsize += datasize
589 cdstsize += datasize
590 elif isinstance(newrl, manifest.manifestrevlog):
590 elif isinstance(newrl, manifest.manifestrevlog):
591 mdstsize += datasize
591 mdstsize += datasize
592 else:
592 else:
593 fdstsize += datasize
593 fdstsize += datasize
594
594
595 progress.complete()
595 progress.complete()
596
596
597 ui.write(_('finished migrating %d changelog revisions; change in size: '
597 ui.write(_('finished migrating %d changelog revisions; change in size: '
598 '%s\n') % (crevcount, util.bytecount(cdstsize - csrcsize)))
598 '%s\n') % (crevcount, util.bytecount(cdstsize - csrcsize)))
599
599
600 ui.write(_('finished migrating %d total revisions; total change in store '
600 ui.write(_('finished migrating %d total revisions; total change in store '
601 'size: %s\n') % (revcount, util.bytecount(dstsize - srcsize)))
601 'size: %s\n') % (revcount, util.bytecount(dstsize - srcsize)))
602
602
603 def _filterstorefile(srcrepo, dstrepo, requirements, path, mode, st):
603 def _filterstorefile(srcrepo, dstrepo, requirements, path, mode, st):
604 """Determine whether to copy a store file during upgrade.
604 """Determine whether to copy a store file during upgrade.
605
605
606 This function is called when migrating store files from ``srcrepo`` to
606 This function is called when migrating store files from ``srcrepo`` to
607 ``dstrepo`` as part of upgrading a repository.
607 ``dstrepo`` as part of upgrading a repository.
608
608
609 Args:
609 Args:
610 srcrepo: repo we are copying from
610 srcrepo: repo we are copying from
611 dstrepo: repo we are copying to
611 dstrepo: repo we are copying to
612 requirements: set of requirements for ``dstrepo``
612 requirements: set of requirements for ``dstrepo``
613 path: store file being examined
613 path: store file being examined
614 mode: the ``ST_MODE`` file type of ``path``
614 mode: the ``ST_MODE`` file type of ``path``
615 st: ``stat`` data structure for ``path``
615 st: ``stat`` data structure for ``path``
616
616
617 Function should return ``True`` if the file is to be copied.
617 Function should return ``True`` if the file is to be copied.
618 """
618 """
619 # Skip revlogs.
619 # Skip revlogs.
620 if path.endswith(('.i', '.d')):
620 if path.endswith(('.i', '.d')):
621 return False
621 return False
622 # Skip transaction related files.
622 # Skip transaction related files.
623 if path.startswith('undo'):
623 if path.startswith('undo'):
624 return False
624 return False
625 # Only copy regular files.
625 # Only copy regular files.
626 if mode != stat.S_IFREG:
626 if mode != stat.S_IFREG:
627 return False
627 return False
628 # Skip other skipped files.
628 # Skip other skipped files.
629 if path in ('lock', 'fncache'):
629 if path in ('lock', 'fncache'):
630 return False
630 return False
631
631
632 return True
632 return True
633
633
634 def _finishdatamigration(ui, srcrepo, dstrepo, requirements):
634 def _finishdatamigration(ui, srcrepo, dstrepo, requirements):
635 """Hook point for extensions to perform additional actions during upgrade.
635 """Hook point for extensions to perform additional actions during upgrade.
636
636
637 This function is called after revlogs and store files have been copied but
637 This function is called after revlogs and store files have been copied but
638 before the new store is swapped into the original location.
638 before the new store is swapped into the original location.
639 """
639 """
640
640
641 def _upgraderepo(ui, srcrepo, dstrepo, requirements, actions):
641 def _upgraderepo(ui, srcrepo, dstrepo, requirements, actions):
642 """Do the low-level work of upgrading a repository.
642 """Do the low-level work of upgrading a repository.
643
643
644 The upgrade is effectively performed as a copy between a source
644 The upgrade is effectively performed as a copy between a source
645 repository and a temporary destination repository.
645 repository and a temporary destination repository.
646
646
647 The source repository is unmodified for as long as possible so the
647 The source repository is unmodified for as long as possible so the
648 upgrade can abort at any time without causing loss of service for
648 upgrade can abort at any time without causing loss of service for
649 readers and without corrupting the source repository.
649 readers and without corrupting the source repository.
650 """
650 """
651 assert srcrepo.currentwlock()
651 assert srcrepo.currentwlock()
652 assert dstrepo.currentwlock()
652 assert dstrepo.currentwlock()
653
653
654 ui.write(_('(it is safe to interrupt this process any time before '
654 ui.write(_('(it is safe to interrupt this process any time before '
655 'data migration completes)\n'))
655 'data migration completes)\n'))
656
656
657 if 'redeltaall' in actions:
657 if 'redeltaall' in actions:
658 deltareuse = revlog.revlog.DELTAREUSENEVER
658 deltareuse = revlog.revlog.DELTAREUSENEVER
659 elif 'redeltaparent' in actions:
659 elif 'redeltaparent' in actions:
660 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
660 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
661 elif 'redeltamultibase' in actions:
661 elif 'redeltamultibase' in actions:
662 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
662 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
663 elif 'redeltafulladd' in actions:
663 elif 'redeltafulladd' in actions:
664 deltareuse = revlog.revlog.DELTAREUSEFULLADD
664 deltareuse = revlog.revlog.DELTAREUSEFULLADD
665 else:
665 else:
666 deltareuse = revlog.revlog.DELTAREUSEALWAYS
666 deltareuse = revlog.revlog.DELTAREUSEALWAYS
667
667
668 with dstrepo.transaction('upgrade') as tr:
668 with dstrepo.transaction('upgrade') as tr:
669 _copyrevlogs(ui, srcrepo, dstrepo, tr, deltareuse,
669 _copyrevlogs(ui, srcrepo, dstrepo, tr, deltareuse,
670 'redeltamultibase' in actions)
670 'redeltamultibase' in actions)
671
671
672 # Now copy other files in the store directory.
672 # Now copy other files in the store directory.
673 # The sorted() makes execution deterministic.
673 # The sorted() makes execution deterministic.
674 for p, kind, st in sorted(srcrepo.store.vfs.readdir('', stat=True)):
674 for p, kind, st in sorted(srcrepo.store.vfs.readdir('', stat=True)):
675 if not _filterstorefile(srcrepo, dstrepo, requirements,
675 if not _filterstorefile(srcrepo, dstrepo, requirements,
676 p, kind, st):
676 p, kind, st):
677 continue
677 continue
678
678
679 srcrepo.ui.write(_('copying %s\n') % p)
679 srcrepo.ui.write(_('copying %s\n') % p)
680 src = srcrepo.store.rawvfs.join(p)
680 src = srcrepo.store.rawvfs.join(p)
681 dst = dstrepo.store.rawvfs.join(p)
681 dst = dstrepo.store.rawvfs.join(p)
682 util.copyfile(src, dst, copystat=True)
682 util.copyfile(src, dst, copystat=True)
683
683
684 _finishdatamigration(ui, srcrepo, dstrepo, requirements)
684 _finishdatamigration(ui, srcrepo, dstrepo, requirements)
685
685
686 ui.write(_('data fully migrated to temporary repository\n'))
686 ui.write(_('data fully migrated to temporary repository\n'))
687
687
688 backuppath = pycompat.mkdtemp(prefix='upgradebackup.', dir=srcrepo.path)
688 backuppath = pycompat.mkdtemp(prefix='upgradebackup.', dir=srcrepo.path)
689 backupvfs = vfsmod.vfs(backuppath)
689 backupvfs = vfsmod.vfs(backuppath)
690
690
691 # Make a backup of requires file first, as it is the first to be modified.
691 # Make a backup of requires file first, as it is the first to be modified.
692 util.copyfile(srcrepo.vfs.join('requires'), backupvfs.join('requires'))
692 util.copyfile(srcrepo.vfs.join('requires'), backupvfs.join('requires'))
693
693
694 # We install an arbitrary requirement that clients must not support
694 # We install an arbitrary requirement that clients must not support
695 # as a mechanism to lock out new clients during the data swap. This is
695 # as a mechanism to lock out new clients during the data swap. This is
696 # better than allowing a client to continue while the repository is in
696 # better than allowing a client to continue while the repository is in
697 # an inconsistent state.
697 # an inconsistent state.
698 ui.write(_('marking source repository as being upgraded; clients will be '
698 ui.write(_('marking source repository as being upgraded; clients will be '
699 'unable to read from repository\n'))
699 'unable to read from repository\n'))
700 scmutil.writerequires(srcrepo.vfs,
700 scmutil.writerequires(srcrepo.vfs,
701 srcrepo.requirements | {'upgradeinprogress'})
701 srcrepo.requirements | {'upgradeinprogress'})
702
702
703 ui.write(_('starting in-place swap of repository data\n'))
703 ui.write(_('starting in-place swap of repository data\n'))
704 ui.write(_('replaced files will be backed up at %s\n') %
704 ui.write(_('replaced files will be backed up at %s\n') %
705 backuppath)
705 backuppath)
706
706
707 # Now swap in the new store directory. Doing it as a rename should make
707 # Now swap in the new store directory. Doing it as a rename should make
708 # the operation nearly instantaneous and atomic (at least in well-behaved
708 # the operation nearly instantaneous and atomic (at least in well-behaved
709 # environments).
709 # environments).
710 ui.write(_('replacing store...\n'))
710 ui.write(_('replacing store...\n'))
711 tstart = util.timer()
711 tstart = util.timer()
712 util.rename(srcrepo.spath, backupvfs.join('store'))
712 util.rename(srcrepo.spath, backupvfs.join('store'))
713 util.rename(dstrepo.spath, srcrepo.spath)
713 util.rename(dstrepo.spath, srcrepo.spath)
714 elapsed = util.timer() - tstart
714 elapsed = util.timer() - tstart
715 ui.write(_('store replacement complete; repository was inconsistent for '
715 ui.write(_('store replacement complete; repository was inconsistent for '
716 '%0.1fs\n') % elapsed)
716 '%0.1fs\n') % elapsed)
717
717
718 # We first write the requirements file. Any new requirements will lock
718 # We first write the requirements file. Any new requirements will lock
719 # out legacy clients.
719 # out legacy clients.
720 ui.write(_('finalizing requirements file and making repository readable '
720 ui.write(_('finalizing requirements file and making repository readable '
721 'again\n'))
721 'again\n'))
722 scmutil.writerequires(srcrepo.vfs, requirements)
722 scmutil.writerequires(srcrepo.vfs, requirements)
723
723
724 # The lock file from the old store won't be removed because nothing has a
724 # The lock file from the old store won't be removed because nothing has a
725 # reference to its new location. So clean it up manually. Alternatively, we
725 # reference to its new location. So clean it up manually. Alternatively, we
726 # could update srcrepo.svfs and other variables to point to the new
726 # could update srcrepo.svfs and other variables to point to the new
727 # location. This is simpler.
727 # location. This is simpler.
728 backupvfs.unlink('store/lock')
728 backupvfs.unlink('store/lock')
729
729
730 return backuppath
730 return backuppath
731
731
732 def upgraderepo(ui, repo, run=False, optimize=None):
732 def upgraderepo(ui, repo, run=False, optimize=None):
733 """Upgrade a repository in place."""
733 """Upgrade a repository in place."""
734 optimize = set(optimize or [])
734 optimize = set(optimize or [])
735 repo = repo.unfiltered()
735 repo = repo.unfiltered()
736
736
737 # Ensure the repository can be upgraded.
737 # Ensure the repository can be upgraded.
738 missingreqs = requiredsourcerequirements(repo) - repo.requirements
738 missingreqs = requiredsourcerequirements(repo) - repo.requirements
739 if missingreqs:
739 if missingreqs:
740 raise error.Abort(_('cannot upgrade repository; requirement '
740 raise error.Abort(_('cannot upgrade repository; requirement '
741 'missing: %s') % _(', ').join(sorted(missingreqs)))
741 'missing: %s') % _(', ').join(sorted(missingreqs)))
742
742
743 blockedreqs = blocksourcerequirements(repo) & repo.requirements
743 blockedreqs = blocksourcerequirements(repo) & repo.requirements
744 if blockedreqs:
744 if blockedreqs:
745 raise error.Abort(_('cannot upgrade repository; unsupported source '
745 raise error.Abort(_('cannot upgrade repository; unsupported source '
746 'requirement: %s') %
746 'requirement: %s') %
747 _(', ').join(sorted(blockedreqs)))
747 _(', ').join(sorted(blockedreqs)))
748
748
749 # FUTURE there is potentially a need to control the wanted requirements via
749 # FUTURE there is potentially a need to control the wanted requirements via
750 # command arguments or via an extension hook point.
750 # command arguments or via an extension hook point.
751 newreqs = localrepo.newreporequirements(
751 newreqs = localrepo.newreporequirements(
752 repo.ui, localrepo.defaultcreateopts(repo.ui))
752 repo.ui, localrepo.defaultcreateopts(repo.ui))
753 newreqs.update(preservedrequirements(repo))
753 newreqs.update(preservedrequirements(repo))
754
754
755 noremovereqs = (repo.requirements - newreqs -
755 noremovereqs = (repo.requirements - newreqs -
756 supportremovedrequirements(repo))
756 supportremovedrequirements(repo))
757 if noremovereqs:
757 if noremovereqs:
758 raise error.Abort(_('cannot upgrade repository; requirement would be '
758 raise error.Abort(_('cannot upgrade repository; requirement would be '
759 'removed: %s') % _(', ').join(sorted(noremovereqs)))
759 'removed: %s') % _(', ').join(sorted(noremovereqs)))
760
760
761 noaddreqs = (newreqs - repo.requirements -
761 noaddreqs = (newreqs - repo.requirements -
762 allowednewrequirements(repo))
762 allowednewrequirements(repo))
763 if noaddreqs:
763 if noaddreqs:
764 raise error.Abort(_('cannot upgrade repository; do not support adding '
764 raise error.Abort(_('cannot upgrade repository; do not support adding '
765 'requirement: %s') %
765 'requirement: %s') %
766 _(', ').join(sorted(noaddreqs)))
766 _(', ').join(sorted(noaddreqs)))
767
767
768 unsupportedreqs = newreqs - supporteddestrequirements(repo)
768 unsupportedreqs = newreqs - supporteddestrequirements(repo)
769 if unsupportedreqs:
769 if unsupportedreqs:
770 raise error.Abort(_('cannot upgrade repository; do not support '
770 raise error.Abort(_('cannot upgrade repository; do not support '
771 'destination requirement: %s') %
771 'destination requirement: %s') %
772 _(', ').join(sorted(unsupportedreqs)))
772 _(', ').join(sorted(unsupportedreqs)))
773
773
774 # Find and validate all improvements that can be made.
774 # Find and validate all improvements that can be made.
775 alloptimizations = findoptimizations(repo)
775 alloptimizations = findoptimizations(repo)
776
776
777 # Apply and Validate arguments.
777 # Apply and Validate arguments.
778 optimizations = []
778 optimizations = []
779 for o in alloptimizations:
779 for o in alloptimizations:
780 if o.name in optimize:
780 if o.name in optimize:
781 optimizations.append(o)
781 optimizations.append(o)
782 optimize.discard(o.name)
782 optimize.discard(o.name)
783
783
784 if optimize: # anything left is unknown
784 if optimize: # anything left is unknown
785 raise error.Abort(_('unknown optimization action requested: %s') %
785 raise error.Abort(_('unknown optimization action requested: %s') %
786 ', '.join(sorted(optimize)),
786 ', '.join(sorted(optimize)),
787 hint=_('run without arguments to see valid '
787 hint=_('run without arguments to see valid '
788 'optimizations'))
788 'optimizations'))
789
789
790 deficiencies = finddeficiencies(repo)
790 deficiencies = finddeficiencies(repo)
791 actions = determineactions(repo, deficiencies, repo.requirements, newreqs)
791 actions = determineactions(repo, deficiencies, repo.requirements, newreqs)
792 actions.extend(o for o in sorted(optimizations)
792 actions.extend(o for o in sorted(optimizations)
793 # determineactions could have added optimisation
793 # determineactions could have added optimisation
794 if o not in actions)
794 if o not in actions)
795
795
796 def printrequirements():
796 def printrequirements():
797 ui.write(_('requirements\n'))
797 ui.write(_('requirements\n'))
798 ui.write(_(' preserved: %s\n') %
798 ui.write(_(' preserved: %s\n') %
799 _(', ').join(sorted(newreqs & repo.requirements)))
799 _(', ').join(sorted(newreqs & repo.requirements)))
800
800
801 if repo.requirements - newreqs:
801 if repo.requirements - newreqs:
802 ui.write(_(' removed: %s\n') %
802 ui.write(_(' removed: %s\n') %
803 _(', ').join(sorted(repo.requirements - newreqs)))
803 _(', ').join(sorted(repo.requirements - newreqs)))
804
804
805 if newreqs - repo.requirements:
805 if newreqs - repo.requirements:
806 ui.write(_(' added: %s\n') %
806 ui.write(_(' added: %s\n') %
807 _(', ').join(sorted(newreqs - repo.requirements)))
807 _(', ').join(sorted(newreqs - repo.requirements)))
808
808
809 ui.write('\n')
809 ui.write('\n')
810
810
811 def printupgradeactions():
811 def printupgradeactions():
812 for a in actions:
812 for a in actions:
813 ui.write('%s\n %s\n\n' % (a.name, a.upgrademessage))
813 ui.write('%s\n %s\n\n' % (a.name, a.upgrademessage))
814
814
815 if not run:
815 if not run:
816 fromconfig = []
816 fromconfig = []
817 onlydefault = []
817 onlydefault = []
818
818
819 for d in deficiencies:
819 for d in deficiencies:
820 if d.fromconfig(repo):
820 if d.fromconfig(repo):
821 fromconfig.append(d)
821 fromconfig.append(d)
822 elif d.default:
822 elif d.default:
823 onlydefault.append(d)
823 onlydefault.append(d)
824
824
825 if fromconfig or onlydefault:
825 if fromconfig or onlydefault:
826
826
827 if fromconfig:
827 if fromconfig:
828 ui.write(_('repository lacks features recommended by '
828 ui.write(_('repository lacks features recommended by '
829 'current config options:\n\n'))
829 'current config options:\n\n'))
830 for i in fromconfig:
830 for i in fromconfig:
831 ui.write('%s\n %s\n\n' % (i.name, i.description))
831 ui.write('%s\n %s\n\n' % (i.name, i.description))
832
832
833 if onlydefault:
833 if onlydefault:
834 ui.write(_('repository lacks features used by the default '
834 ui.write(_('repository lacks features used by the default '
835 'config options:\n\n'))
835 'config options:\n\n'))
836 for i in onlydefault:
836 for i in onlydefault:
837 ui.write('%s\n %s\n\n' % (i.name, i.description))
837 ui.write('%s\n %s\n\n' % (i.name, i.description))
838
838
839 ui.write('\n')
839 ui.write('\n')
840 else:
840 else:
841 ui.write(_('(no feature deficiencies found in existing '
841 ui.write(_('(no feature deficiencies found in existing '
842 'repository)\n'))
842 'repository)\n'))
843
843
844 ui.write(_('performing an upgrade with "--run" will make the following '
844 ui.write(_('performing an upgrade with "--run" will make the following '
845 'changes:\n\n'))
845 'changes:\n\n'))
846
846
847 printrequirements()
847 printrequirements()
848 printupgradeactions()
848 printupgradeactions()
849
849
850 unusedoptimize = [i for i in alloptimizations if i not in actions]
850 unusedoptimize = [i for i in alloptimizations if i not in actions]
851
851
852 if unusedoptimize:
852 if unusedoptimize:
853 ui.write(_('additional optimizations are available by specifying '
853 ui.write(_('additional optimizations are available by specifying '
854 '"--optimize <name>":\n\n'))
854 '"--optimize <name>":\n\n'))
855 for i in unusedoptimize:
855 for i in unusedoptimize:
856 ui.write(_('%s\n %s\n\n') % (i.name, i.description))
856 ui.write(_('%s\n %s\n\n') % (i.name, i.description))
857 return
857 return
858
858
859 # Else we're in the run=true case.
859 # Else we're in the run=true case.
860 ui.write(_('upgrade will perform the following actions:\n\n'))
860 ui.write(_('upgrade will perform the following actions:\n\n'))
861 printrequirements()
861 printrequirements()
862 printupgradeactions()
862 printupgradeactions()
863
863
864 upgradeactions = [a.name for a in actions]
864 upgradeactions = [a.name for a in actions]
865
865
866 ui.write(_('beginning upgrade...\n'))
866 ui.write(_('beginning upgrade...\n'))
867 with repo.wlock(), repo.lock():
867 with repo.wlock(), repo.lock():
868 ui.write(_('repository locked and read-only\n'))
868 ui.write(_('repository locked and read-only\n'))
869 # Our strategy for upgrading the repository is to create a new,
869 # Our strategy for upgrading the repository is to create a new,
870 # temporary repository, write data to it, then do a swap of the
870 # temporary repository, write data to it, then do a swap of the
871 # data. There are less heavyweight ways to do this, but it is easier
871 # data. There are less heavyweight ways to do this, but it is easier
872 # to create a new repo object than to instantiate all the components
872 # to create a new repo object than to instantiate all the components
873 # (like the store) separately.
873 # (like the store) separately.
874 tmppath = pycompat.mkdtemp(prefix='upgrade.', dir=repo.path)
874 tmppath = pycompat.mkdtemp(prefix='upgrade.', dir=repo.path)
875 backuppath = None
875 backuppath = None
876 try:
876 try:
877 ui.write(_('creating temporary repository to stage migrated '
877 ui.write(_('creating temporary repository to stage migrated '
878 'data: %s\n') % tmppath)
878 'data: %s\n') % tmppath)
879
879
880 # clone ui without using ui.copy because repo.ui is protected
880 # clone ui without using ui.copy because repo.ui is protected
881 repoui = repo.ui.__class__(repo.ui)
881 repoui = repo.ui.__class__(repo.ui)
882 dstrepo = hg.repository(repoui, path=tmppath, create=True)
882 dstrepo = hg.repository(repoui, path=tmppath, create=True)
883
883
884 with dstrepo.wlock(), dstrepo.lock():
884 with dstrepo.wlock(), dstrepo.lock():
885 backuppath = _upgraderepo(ui, repo, dstrepo, newreqs,
885 backuppath = _upgraderepo(ui, repo, dstrepo, newreqs,
886 upgradeactions)
886 upgradeactions)
887
887
888 finally:
888 finally:
889 ui.write(_('removing temporary repository %s\n') % tmppath)
889 ui.write(_('removing temporary repository %s\n') % tmppath)
890 repo.vfs.rmtree(tmppath, forcibly=True)
890 repo.vfs.rmtree(tmppath, forcibly=True)
891
891
892 if backuppath:
892 if backuppath:
893 ui.warn(_('copy of old repository backed up at %s\n') %
893 ui.warn(_('copy of old repository backed up at %s\n') %
894 backuppath)
894 backuppath)
895 ui.warn(_('the old repository will not be deleted; remove '
895 ui.warn(_('the old repository will not be deleted; remove '
896 'it to free up disk space once the upgraded '
896 'it to free up disk space once the upgraded '
897 'repository is verified\n'))
897 'repository is verified\n'))
@@ -1,757 +1,771 b''
1 #require no-reposimplestore
1 #require no-reposimplestore
2
2
3 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
4 > [extensions]
4 > [extensions]
5 > share =
5 > share =
6 > EOF
6 > EOF
7
7
8 store and revlogv1 are required in source
8 store and revlogv1 are required in source
9
9
10 $ hg --config format.usestore=false init no-store
10 $ hg --config format.usestore=false init no-store
11 $ hg -R no-store debugupgraderepo
11 $ hg -R no-store debugupgraderepo
12 abort: cannot upgrade repository; requirement missing: store
12 abort: cannot upgrade repository; requirement missing: store
13 [255]
13 [255]
14
14
15 $ hg init no-revlogv1
15 $ hg init no-revlogv1
16 $ cat > no-revlogv1/.hg/requires << EOF
16 $ cat > no-revlogv1/.hg/requires << EOF
17 > dotencode
17 > dotencode
18 > fncache
18 > fncache
19 > generaldelta
19 > generaldelta
20 > store
20 > store
21 > EOF
21 > EOF
22
22
23 $ hg -R no-revlogv1 debugupgraderepo
23 $ hg -R no-revlogv1 debugupgraderepo
24 abort: cannot upgrade repository; requirement missing: revlogv1
24 abort: cannot upgrade repository; requirement missing: revlogv1
25 [255]
25 [255]
26
26
27 Cannot upgrade shared repositories
27 Cannot upgrade shared repositories
28
28
29 $ hg init share-parent
29 $ hg init share-parent
30 $ hg -q share share-parent share-child
30 $ hg -q share share-parent share-child
31
31
32 $ hg -R share-child debugupgraderepo
32 $ hg -R share-child debugupgraderepo
33 abort: cannot upgrade repository; unsupported source requirement: shared
33 abort: cannot upgrade repository; unsupported source requirement: shared
34 [255]
34 [255]
35
35
36 Do not yet support upgrading treemanifest repos
36 Do not yet support upgrading treemanifest repos
37
37
38 $ hg --config experimental.treemanifest=true init treemanifest
38 $ hg --config experimental.treemanifest=true init treemanifest
39 $ hg -R treemanifest debugupgraderepo
39 $ hg -R treemanifest debugupgraderepo
40 abort: cannot upgrade repository; unsupported source requirement: treemanifest
40 abort: cannot upgrade repository; unsupported source requirement: treemanifest
41 [255]
41 [255]
42
42
43 Cannot add treemanifest requirement during upgrade
43 Cannot add treemanifest requirement during upgrade
44
44
45 $ hg init disallowaddedreq
45 $ hg init disallowaddedreq
46 $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
46 $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
47 abort: cannot upgrade repository; do not support adding requirement: treemanifest
47 abort: cannot upgrade repository; do not support adding requirement: treemanifest
48 [255]
48 [255]
49
49
50 An upgrade of a repository created with recommended settings only suggests optimizations
50 An upgrade of a repository created with recommended settings only suggests optimizations
51
51
52 $ hg init empty
52 $ hg init empty
53 $ cd empty
53 $ cd empty
54 $ hg debugformat
54 $ hg debugformat
55 format-variant repo
55 format-variant repo
56 fncache: yes
56 fncache: yes
57 dotencode: yes
57 dotencode: yes
58 generaldelta: yes
58 generaldelta: yes
59 sparserevlog: no
59 sparserevlog: yes
60 plain-cl-delta: yes
60 plain-cl-delta: yes
61 compression: zlib
61 compression: zlib
62 $ hg debugformat --verbose
62 $ hg debugformat --verbose
63 format-variant repo config default
63 format-variant repo config default
64 fncache: yes yes yes
64 fncache: yes yes yes
65 dotencode: yes yes yes
65 dotencode: yes yes yes
66 generaldelta: yes yes yes
66 generaldelta: yes yes yes
67 sparserevlog: no no no
67 sparserevlog: yes yes yes
68 plain-cl-delta: yes yes yes
68 plain-cl-delta: yes yes yes
69 compression: zlib zlib zlib
69 compression: zlib zlib zlib
70 $ hg debugformat --verbose --config format.usefncache=no
70 $ hg debugformat --verbose --config format.usefncache=no
71 format-variant repo config default
71 format-variant repo config default
72 fncache: yes no yes
72 fncache: yes no yes
73 dotencode: yes no yes
73 dotencode: yes no yes
74 generaldelta: yes yes yes
74 generaldelta: yes yes yes
75 sparserevlog: no no no
75 sparserevlog: yes yes yes
76 plain-cl-delta: yes yes yes
76 plain-cl-delta: yes yes yes
77 compression: zlib zlib zlib
77 compression: zlib zlib zlib
78 $ hg debugformat --verbose --config format.usefncache=no --color=debug
78 $ hg debugformat --verbose --config format.usefncache=no --color=debug
79 format-variant repo config default
79 format-variant repo config default
80 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
80 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
81 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
81 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
82 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
82 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
83 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
83 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
84 [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
84 [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
85 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
85 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
86 $ hg debugformat -Tjson
86 $ hg debugformat -Tjson
87 [
87 [
88 {
88 {
89 "config": true,
89 "config": true,
90 "default": true,
90 "default": true,
91 "name": "fncache",
91 "name": "fncache",
92 "repo": true
92 "repo": true
93 },
93 },
94 {
94 {
95 "config": true,
95 "config": true,
96 "default": true,
96 "default": true,
97 "name": "dotencode",
97 "name": "dotencode",
98 "repo": true
98 "repo": true
99 },
99 },
100 {
100 {
101 "config": true,
101 "config": true,
102 "default": true,
102 "default": true,
103 "name": "generaldelta",
103 "name": "generaldelta",
104 "repo": true
104 "repo": true
105 },
105 },
106 {
106 {
107 "config": false,
107 "config": true,
108 "default": false,
108 "default": true,
109 "name": "sparserevlog",
109 "name": "sparserevlog",
110 "repo": false
110 "repo": true
111 },
111 },
112 {
112 {
113 "config": true,
113 "config": true,
114 "default": true,
114 "default": true,
115 "name": "plain-cl-delta",
115 "name": "plain-cl-delta",
116 "repo": true
116 "repo": true
117 },
117 },
118 {
118 {
119 "config": "zlib",
119 "config": "zlib",
120 "default": "zlib",
120 "default": "zlib",
121 "name": "compression",
121 "name": "compression",
122 "repo": "zlib"
122 "repo": "zlib"
123 }
123 }
124 ]
124 ]
125 $ hg debugupgraderepo
125 $ hg debugupgraderepo
126 (no feature deficiencies found in existing repository)
126 (no feature deficiencies found in existing repository)
127 performing an upgrade with "--run" will make the following changes:
127 performing an upgrade with "--run" will make the following changes:
128
128
129 requirements
129 requirements
130 preserved: dotencode, fncache, generaldelta, revlogv1, store
130 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
131
131
132 additional optimizations are available by specifying "--optimize <name>":
132 additional optimizations are available by specifying "--optimize <name>":
133
133
134 redeltaparent
134 redeltaparent
135 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
135 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
136
136
137 redeltamultibase
137 redeltamultibase
138 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
138 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
139
139
140 redeltaall
140 redeltaall
141 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
141 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
142
142
143 redeltafulladd
143 redeltafulladd
144 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 "redeltaall" but even slower since more logic is involved.
144 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 "redeltaall" but even slower since more logic is involved.
145
145
146
146
147 --optimize can be used to add optimizations
147 --optimize can be used to add optimizations
148
148
149 $ hg debugupgrade --optimize redeltaparent
149 $ hg debugupgrade --optimize redeltaparent
150 (no feature deficiencies found in existing repository)
150 (no feature deficiencies found in existing repository)
151 performing an upgrade with "--run" will make the following changes:
151 performing an upgrade with "--run" will make the following changes:
152
152
153 requirements
153 requirements
154 preserved: dotencode, fncache, generaldelta, revlogv1, store
154 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
155
155
156 redeltaparent
156 redeltaparent
157 deltas within internal storage will choose a new base revision if needed
157 deltas within internal storage will choose a new base revision if needed
158
158
159 additional optimizations are available by specifying "--optimize <name>":
159 additional optimizations are available by specifying "--optimize <name>":
160
160
161 redeltamultibase
161 redeltamultibase
162 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
162 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
163
163
164 redeltaall
164 redeltaall
165 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
165 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
166
166
167 redeltafulladd
167 redeltafulladd
168 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 "redeltaall" but even slower since more logic is involved.
168 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 "redeltaall" but even slower since more logic is involved.
169
169
170
170
171 Various sub-optimal detections work
171 Various sub-optimal detections work
172
172
173 $ cat > .hg/requires << EOF
173 $ cat > .hg/requires << EOF
174 > revlogv1
174 > revlogv1
175 > store
175 > store
176 > EOF
176 > EOF
177
177
178 $ hg debugformat
178 $ hg debugformat
179 format-variant repo
179 format-variant repo
180 fncache: no
180 fncache: no
181 dotencode: no
181 dotencode: no
182 generaldelta: no
182 generaldelta: no
183 sparserevlog: no
183 sparserevlog: no
184 plain-cl-delta: yes
184 plain-cl-delta: yes
185 compression: zlib
185 compression: zlib
186 $ hg debugformat --verbose
186 $ hg debugformat --verbose
187 format-variant repo config default
187 format-variant repo config default
188 fncache: no yes yes
188 fncache: no yes yes
189 dotencode: no yes yes
189 dotencode: no yes yes
190 generaldelta: no yes yes
190 generaldelta: no yes yes
191 sparserevlog: no no no
191 sparserevlog: no yes yes
192 plain-cl-delta: yes yes yes
192 plain-cl-delta: yes yes yes
193 compression: zlib zlib zlib
193 compression: zlib zlib zlib
194 $ hg debugformat --verbose --config format.usegeneraldelta=no
194 $ hg debugformat --verbose --config format.usegeneraldelta=no
195 format-variant repo config default
195 format-variant repo config default
196 fncache: no yes yes
196 fncache: no yes yes
197 dotencode: no yes yes
197 dotencode: no yes yes
198 generaldelta: no no yes
198 generaldelta: no no yes
199 sparserevlog: no no no
199 sparserevlog: no no yes
200 plain-cl-delta: yes yes yes
200 plain-cl-delta: yes yes yes
201 compression: zlib zlib zlib
201 compression: zlib zlib zlib
202 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
202 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
203 format-variant repo config default
203 format-variant repo config default
204 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
204 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
205 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
205 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
206 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
206 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
207 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
207 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
208 [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
208 [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
209 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
209 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
210 $ hg debugupgraderepo
210 $ hg debugupgraderepo
211 repository lacks features recommended by current config options:
211 repository lacks features recommended by current config options:
212
212
213 fncache
213 fncache
214 long and reserved filenames may not work correctly; repository performance is sub-optimal
214 long and reserved filenames may not work correctly; repository performance is sub-optimal
215
215
216 dotencode
216 dotencode
217 storage of filenames beginning with a period or space may not work correctly
217 storage of filenames beginning with a period or space may not work correctly
218
218
219 generaldelta
219 generaldelta
220 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
220 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
221
221
222 sparserevlog
223 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.
224
222
225
223 performing an upgrade with "--run" will make the following changes:
226 performing an upgrade with "--run" will make the following changes:
224
227
225 requirements
228 requirements
226 preserved: revlogv1, store
229 preserved: revlogv1, store
227 added: dotencode, fncache, generaldelta
230 added: dotencode, fncache, generaldelta, sparserevlog
228
231
229 fncache
232 fncache
230 repository will be more resilient to storing certain paths and performance of certain operations should be improved
233 repository will be more resilient to storing certain paths and performance of certain operations should be improved
231
234
232 dotencode
235 dotencode
233 repository will be better able to store files beginning with a space or period
236 repository will be better able to store files beginning with a space or period
234
237
235 generaldelta
238 generaldelta
236 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
239 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
237
240
241 sparserevlog
242 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.
243
238 additional optimizations are available by specifying "--optimize <name>":
244 additional optimizations are available by specifying "--optimize <name>":
239
245
240 redeltaparent
246 redeltaparent
241 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
247 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
242
248
243 redeltamultibase
249 redeltamultibase
244 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
250 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
245
251
246 redeltaall
252 redeltaall
247 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
253 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
248
254
249 redeltafulladd
255 redeltafulladd
250 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 "redeltaall" but even slower since more logic is involved.
256 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 "redeltaall" but even slower since more logic is involved.
251
257
252
258
253 $ hg --config format.dotencode=false debugupgraderepo
259 $ hg --config format.dotencode=false debugupgraderepo
254 repository lacks features recommended by current config options:
260 repository lacks features recommended by current config options:
255
261
256 fncache
262 fncache
257 long and reserved filenames may not work correctly; repository performance is sub-optimal
263 long and reserved filenames may not work correctly; repository performance is sub-optimal
258
264
259 generaldelta
265 generaldelta
260 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
266 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
261
267
268 sparserevlog
269 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.
270
262 repository lacks features used by the default config options:
271 repository lacks features used by the default config options:
263
272
264 dotencode
273 dotencode
265 storage of filenames beginning with a period or space may not work correctly
274 storage of filenames beginning with a period or space may not work correctly
266
275
267
276
268 performing an upgrade with "--run" will make the following changes:
277 performing an upgrade with "--run" will make the following changes:
269
278
270 requirements
279 requirements
271 preserved: revlogv1, store
280 preserved: revlogv1, store
272 added: fncache, generaldelta
281 added: fncache, generaldelta, sparserevlog
273
282
274 fncache
283 fncache
275 repository will be more resilient to storing certain paths and performance of certain operations should be improved
284 repository will be more resilient to storing certain paths and performance of certain operations should be improved
276
285
277 generaldelta
286 generaldelta
278 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
287 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
279
288
289 sparserevlog
290 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.
291
280 additional optimizations are available by specifying "--optimize <name>":
292 additional optimizations are available by specifying "--optimize <name>":
281
293
282 redeltaparent
294 redeltaparent
283 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
295 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
284
296
285 redeltamultibase
297 redeltamultibase
286 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
298 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
287
299
288 redeltaall
300 redeltaall
289 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
301 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
290
302
291 redeltafulladd
303 redeltafulladd
292 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 "redeltaall" but even slower since more logic is involved.
304 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 "redeltaall" but even slower since more logic is involved.
293
305
294
306
295 $ cd ..
307 $ cd ..
296
308
297 Upgrading a repository that is already modern essentially no-ops
309 Upgrading a repository that is already modern essentially no-ops
298
310
299 $ hg init modern
311 $ hg init modern
300 $ hg -R modern debugupgraderepo --run
312 $ hg -R modern debugupgraderepo --run
301 upgrade will perform the following actions:
313 upgrade will perform the following actions:
302
314
303 requirements
315 requirements
304 preserved: dotencode, fncache, generaldelta, revlogv1, store
316 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
305
317
306 beginning upgrade...
318 beginning upgrade...
307 repository locked and read-only
319 repository locked and read-only
308 creating temporary repository to stage migrated data: $TESTTMP/modern/.hg/upgrade.* (glob)
320 creating temporary repository to stage migrated data: $TESTTMP/modern/.hg/upgrade.* (glob)
309 (it is safe to interrupt this process any time before data migration completes)
321 (it is safe to interrupt this process any time before data migration completes)
310 data fully migrated to temporary repository
322 data fully migrated to temporary repository
311 marking source repository as being upgraded; clients will be unable to read from repository
323 marking source repository as being upgraded; clients will be unable to read from repository
312 starting in-place swap of repository data
324 starting in-place swap of repository data
313 replaced files will be backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
325 replaced files will be backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
314 replacing store...
326 replacing store...
315 store replacement complete; repository was inconsistent for *s (glob)
327 store replacement complete; repository was inconsistent for *s (glob)
316 finalizing requirements file and making repository readable again
328 finalizing requirements file and making repository readable again
317 removing temporary repository $TESTTMP/modern/.hg/upgrade.* (glob)
329 removing temporary repository $TESTTMP/modern/.hg/upgrade.* (glob)
318 copy of old repository backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
330 copy of old repository backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
319 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
331 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
320
332
321 Upgrading a repository to generaldelta works
333 Upgrading a repository to generaldelta works
322
334
323 $ hg --config format.usegeneraldelta=false init upgradegd
335 $ hg --config format.usegeneraldelta=false init upgradegd
324 $ cd upgradegd
336 $ cd upgradegd
325 $ touch f0
337 $ touch f0
326 $ hg -q commit -A -m initial
338 $ hg -q commit -A -m initial
327 $ touch f1
339 $ touch f1
328 $ hg -q commit -A -m 'add f1'
340 $ hg -q commit -A -m 'add f1'
329 $ hg -q up -r 0
341 $ hg -q up -r 0
330 $ touch f2
342 $ touch f2
331 $ hg -q commit -A -m 'add f2'
343 $ hg -q commit -A -m 'add f2'
332
344
333 $ hg debugupgraderepo --run --config format.sparse-revlog=false
345 $ hg debugupgraderepo --run --config format.sparse-revlog=false
334 upgrade will perform the following actions:
346 upgrade will perform the following actions:
335
347
336 requirements
348 requirements
337 preserved: dotencode, fncache, revlogv1, store
349 preserved: dotencode, fncache, revlogv1, store
338 added: generaldelta
350 added: generaldelta
339
351
340 generaldelta
352 generaldelta
341 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
353 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
342
354
343 beginning upgrade...
355 beginning upgrade...
344 repository locked and read-only
356 repository locked and read-only
345 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
357 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
346 (it is safe to interrupt this process any time before data migration completes)
358 (it is safe to interrupt this process any time before data migration completes)
347 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
359 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
348 migrating 917 bytes in store; 401 bytes tracked data
360 migrating 917 bytes in store; 401 bytes tracked data
349 migrating 3 filelogs containing 3 revisions (192 bytes in store; 0 bytes tracked data)
361 migrating 3 filelogs containing 3 revisions (192 bytes in store; 0 bytes tracked data)
350 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
362 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
351 migrating 1 manifests containing 3 revisions (349 bytes in store; 220 bytes tracked data)
363 migrating 1 manifests containing 3 revisions (349 bytes in store; 220 bytes tracked data)
352 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
364 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
353 migrating changelog containing 3 revisions (376 bytes in store; 181 bytes tracked data)
365 migrating changelog containing 3 revisions (376 bytes in store; 181 bytes tracked data)
354 finished migrating 3 changelog revisions; change in size: 0 bytes
366 finished migrating 3 changelog revisions; change in size: 0 bytes
355 finished migrating 9 total revisions; total change in store size: 0 bytes
367 finished migrating 9 total revisions; total change in store size: 0 bytes
356 copying phaseroots
368 copying phaseroots
357 data fully migrated to temporary repository
369 data fully migrated to temporary repository
358 marking source repository as being upgraded; clients will be unable to read from repository
370 marking source repository as being upgraded; clients will be unable to read from repository
359 starting in-place swap of repository data
371 starting in-place swap of repository data
360 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
372 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
361 replacing store...
373 replacing store...
362 store replacement complete; repository was inconsistent for *s (glob)
374 store replacement complete; repository was inconsistent for *s (glob)
363 finalizing requirements file and making repository readable again
375 finalizing requirements file and making repository readable again
364 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
376 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
365 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
377 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
366 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
378 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
367
379
368 Original requirements backed up
380 Original requirements backed up
369
381
370 $ cat .hg/upgradebackup.*/requires
382 $ cat .hg/upgradebackup.*/requires
371 dotencode
383 dotencode
372 fncache
384 fncache
373 revlogv1
385 revlogv1
374 store
386 store
375
387
376 generaldelta added to original requirements files
388 generaldelta added to original requirements files
377
389
378 $ cat .hg/requires
390 $ cat .hg/requires
379 dotencode
391 dotencode
380 fncache
392 fncache
381 generaldelta
393 generaldelta
382 revlogv1
394 revlogv1
383 store
395 store
384
396
385 store directory has files we expect
397 store directory has files we expect
386
398
387 $ ls .hg/store
399 $ ls .hg/store
388 00changelog.i
400 00changelog.i
389 00manifest.i
401 00manifest.i
390 data
402 data
391 fncache
403 fncache
392 phaseroots
404 phaseroots
393 undo
405 undo
394 undo.backupfiles
406 undo.backupfiles
395 undo.phaseroots
407 undo.phaseroots
396
408
397 manifest should be generaldelta
409 manifest should be generaldelta
398
410
399 $ hg debugrevlog -m | grep flags
411 $ hg debugrevlog -m | grep flags
400 flags : inline, generaldelta
412 flags : inline, generaldelta
401
413
402 verify should be happy
414 verify should be happy
403
415
404 $ hg verify
416 $ hg verify
405 checking changesets
417 checking changesets
406 checking manifests
418 checking manifests
407 crosschecking files in changesets and manifests
419 crosschecking files in changesets and manifests
408 checking files
420 checking files
409 checked 3 changesets with 3 changes to 3 files
421 checked 3 changesets with 3 changes to 3 files
410
422
411 old store should be backed up
423 old store should be backed up
412
424
413 $ ls .hg/upgradebackup.*/store
425 $ ls .hg/upgradebackup.*/store
414 00changelog.i
426 00changelog.i
415 00manifest.i
427 00manifest.i
416 data
428 data
417 fncache
429 fncache
418 phaseroots
430 phaseroots
419 undo
431 undo
420 undo.backup.fncache
432 undo.backup.fncache
421 undo.backupfiles
433 undo.backupfiles
422 undo.phaseroots
434 undo.phaseroots
423
435
424 $ cd ..
436 $ cd ..
425
437
426 store files with special filenames aren't encoded during copy
438 store files with special filenames aren't encoded during copy
427
439
428 $ hg init store-filenames
440 $ hg init store-filenames
429 $ cd store-filenames
441 $ cd store-filenames
430 $ touch foo
442 $ touch foo
431 $ hg -q commit -A -m initial
443 $ hg -q commit -A -m initial
432 $ touch .hg/store/.XX_special_filename
444 $ touch .hg/store/.XX_special_filename
433
445
434 $ hg debugupgraderepo --run
446 $ hg debugupgraderepo --run
435 upgrade will perform the following actions:
447 upgrade will perform the following actions:
436
448
437 requirements
449 requirements
438 preserved: dotencode, fncache, generaldelta, revlogv1, store
450 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
439
451
440 beginning upgrade...
452 beginning upgrade...
441 repository locked and read-only
453 repository locked and read-only
442 creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
454 creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
443 (it is safe to interrupt this process any time before data migration completes)
455 (it is safe to interrupt this process any time before data migration completes)
444 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
456 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
445 migrating 301 bytes in store; 107 bytes tracked data
457 migrating 301 bytes in store; 107 bytes tracked data
446 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
458 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
447 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
459 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
448 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
460 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
449 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
461 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
450 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
462 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
451 finished migrating 1 changelog revisions; change in size: 0 bytes
463 finished migrating 1 changelog revisions; change in size: 0 bytes
452 finished migrating 3 total revisions; total change in store size: 0 bytes
464 finished migrating 3 total revisions; total change in store size: 0 bytes
453 copying .XX_special_filename
465 copying .XX_special_filename
454 copying phaseroots
466 copying phaseroots
455 data fully migrated to temporary repository
467 data fully migrated to temporary repository
456 marking source repository as being upgraded; clients will be unable to read from repository
468 marking source repository as being upgraded; clients will be unable to read from repository
457 starting in-place swap of repository data
469 starting in-place swap of repository data
458 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
470 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
459 replacing store...
471 replacing store...
460 store replacement complete; repository was inconsistent for *s (glob)
472 store replacement complete; repository was inconsistent for *s (glob)
461 finalizing requirements file and making repository readable again
473 finalizing requirements file and making repository readable again
462 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
474 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
463 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
475 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
464 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
476 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
465 $ hg debugupgraderepo --run --optimize redeltafulladd
477 $ hg debugupgraderepo --run --optimize redeltafulladd
466 upgrade will perform the following actions:
478 upgrade will perform the following actions:
467
479
468 requirements
480 requirements
469 preserved: dotencode, fncache, generaldelta, revlogv1, store
481 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
470
482
471 redeltafulladd
483 redeltafulladd
472 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
484 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
473
485
474 beginning upgrade...
486 beginning upgrade...
475 repository locked and read-only
487 repository locked and read-only
476 creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
488 creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
477 (it is safe to interrupt this process any time before data migration completes)
489 (it is safe to interrupt this process any time before data migration completes)
478 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
490 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
479 migrating 301 bytes in store; 107 bytes tracked data
491 migrating 301 bytes in store; 107 bytes tracked data
480 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
492 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
481 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
493 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
482 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
494 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
483 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
495 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
484 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
496 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
485 finished migrating 1 changelog revisions; change in size: 0 bytes
497 finished migrating 1 changelog revisions; change in size: 0 bytes
486 finished migrating 3 total revisions; total change in store size: 0 bytes
498 finished migrating 3 total revisions; total change in store size: 0 bytes
487 copying .XX_special_filename
499 copying .XX_special_filename
488 copying phaseroots
500 copying phaseroots
489 data fully migrated to temporary repository
501 data fully migrated to temporary repository
490 marking source repository as being upgraded; clients will be unable to read from repository
502 marking source repository as being upgraded; clients will be unable to read from repository
491 starting in-place swap of repository data
503 starting in-place swap of repository data
492 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
504 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
493 replacing store...
505 replacing store...
494 store replacement complete; repository was inconsistent for *s (glob)
506 store replacement complete; repository was inconsistent for *s (glob)
495 finalizing requirements file and making repository readable again
507 finalizing requirements file and making repository readable again
496 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
508 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
497 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
509 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
498 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
510 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
499
511
500 fncache is valid after upgrade
512 fncache is valid after upgrade
501
513
502 $ hg debugrebuildfncache
514 $ hg debugrebuildfncache
503 fncache already up to date
515 fncache already up to date
504
516
505 $ cd ..
517 $ cd ..
506
518
507 Check upgrading a large file repository
519 Check upgrading a large file repository
508 ---------------------------------------
520 ---------------------------------------
509
521
510 $ hg init largefilesrepo
522 $ hg init largefilesrepo
511 $ cat << EOF >> largefilesrepo/.hg/hgrc
523 $ cat << EOF >> largefilesrepo/.hg/hgrc
512 > [extensions]
524 > [extensions]
513 > largefiles =
525 > largefiles =
514 > EOF
526 > EOF
515
527
516 $ cd largefilesrepo
528 $ cd largefilesrepo
517 $ touch foo
529 $ touch foo
518 $ hg add --large foo
530 $ hg add --large foo
519 $ hg -q commit -m initial
531 $ hg -q commit -m initial
520 $ cat .hg/requires
532 $ cat .hg/requires
521 dotencode
533 dotencode
522 fncache
534 fncache
523 generaldelta
535 generaldelta
524 largefiles
536 largefiles
525 revlogv1
537 revlogv1
538 sparserevlog
526 store
539 store
527
540
528 $ hg debugupgraderepo --run
541 $ hg debugupgraderepo --run
529 upgrade will perform the following actions:
542 upgrade will perform the following actions:
530
543
531 requirements
544 requirements
532 preserved: dotencode, fncache, generaldelta, largefiles, revlogv1, store
545 preserved: dotencode, fncache, generaldelta, largefiles, revlogv1, sparserevlog, store
533
546
534 beginning upgrade...
547 beginning upgrade...
535 repository locked and read-only
548 repository locked and read-only
536 creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
549 creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
537 (it is safe to interrupt this process any time before data migration completes)
550 (it is safe to interrupt this process any time before data migration completes)
538 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
551 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
539 migrating 355 bytes in store; 160 bytes tracked data
552 migrating 355 bytes in store; 160 bytes tracked data
540 migrating 1 filelogs containing 1 revisions (106 bytes in store; 41 bytes tracked data)
553 migrating 1 filelogs containing 1 revisions (106 bytes in store; 41 bytes tracked data)
541 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
554 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
542 migrating 1 manifests containing 1 revisions (116 bytes in store; 51 bytes tracked data)
555 migrating 1 manifests containing 1 revisions (116 bytes in store; 51 bytes tracked data)
543 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
556 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
544 migrating changelog containing 1 revisions (133 bytes in store; 68 bytes tracked data)
557 migrating changelog containing 1 revisions (133 bytes in store; 68 bytes tracked data)
545 finished migrating 1 changelog revisions; change in size: 0 bytes
558 finished migrating 1 changelog revisions; change in size: 0 bytes
546 finished migrating 3 total revisions; total change in store size: 0 bytes
559 finished migrating 3 total revisions; total change in store size: 0 bytes
547 copying phaseroots
560 copying phaseroots
548 data fully migrated to temporary repository
561 data fully migrated to temporary repository
549 marking source repository as being upgraded; clients will be unable to read from repository
562 marking source repository as being upgraded; clients will be unable to read from repository
550 starting in-place swap of repository data
563 starting in-place swap of repository data
551 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
564 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
552 replacing store...
565 replacing store...
553 store replacement complete; repository was inconsistent for *s (glob)
566 store replacement complete; repository was inconsistent for *s (glob)
554 finalizing requirements file and making repository readable again
567 finalizing requirements file and making repository readable again
555 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
568 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
556 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
569 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
557 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
570 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
558 $ cat .hg/requires
571 $ cat .hg/requires
559 dotencode
572 dotencode
560 fncache
573 fncache
561 generaldelta
574 generaldelta
562 largefiles
575 largefiles
563 revlogv1
576 revlogv1
577 sparserevlog
564 store
578 store
565
579
566 $ cat << EOF >> .hg/hgrc
580 $ cat << EOF >> .hg/hgrc
567 > [extensions]
581 > [extensions]
568 > lfs =
582 > lfs =
569 > [lfs]
583 > [lfs]
570 > threshold = 10
584 > threshold = 10
571 > EOF
585 > EOF
572 $ echo '123456789012345' > lfs.bin
586 $ echo '123456789012345' > lfs.bin
573 $ hg ci -Am 'lfs.bin'
587 $ hg ci -Am 'lfs.bin'
574 adding lfs.bin
588 adding lfs.bin
575 $ grep lfs .hg/requires
589 $ grep lfs .hg/requires
576 lfs
590 lfs
577 $ find .hg/store/lfs -type f
591 $ find .hg/store/lfs -type f
578 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
592 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
579
593
580 $ hg debugupgraderepo --run
594 $ hg debugupgraderepo --run
581 upgrade will perform the following actions:
595 upgrade will perform the following actions:
582
596
583 requirements
597 requirements
584 preserved: dotencode, fncache, generaldelta, largefiles, lfs, revlogv1, store
598 preserved: dotencode, fncache, generaldelta, largefiles, lfs, revlogv1, sparserevlog, store
585
599
586 beginning upgrade...
600 beginning upgrade...
587 repository locked and read-only
601 repository locked and read-only
588 creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
602 creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
589 (it is safe to interrupt this process any time before data migration completes)
603 (it is safe to interrupt this process any time before data migration completes)
590 migrating 6 total revisions (2 in filelogs, 2 in manifests, 2 in changelog)
604 migrating 6 total revisions (2 in filelogs, 2 in manifests, 2 in changelog)
591 migrating 801 bytes in store; 467 bytes tracked data
605 migrating 801 bytes in store; 467 bytes tracked data
592 migrating 2 filelogs containing 2 revisions (296 bytes in store; 182 bytes tracked data)
606 migrating 2 filelogs containing 2 revisions (296 bytes in store; 182 bytes tracked data)
593 finished migrating 2 filelog revisions across 2 filelogs; change in size: 0 bytes
607 finished migrating 2 filelog revisions across 2 filelogs; change in size: 0 bytes
594 migrating 1 manifests containing 2 revisions (241 bytes in store; 151 bytes tracked data)
608 migrating 1 manifests containing 2 revisions (241 bytes in store; 151 bytes tracked data)
595 finished migrating 2 manifest revisions across 1 manifests; change in size: 0 bytes
609 finished migrating 2 manifest revisions across 1 manifests; change in size: 0 bytes
596 migrating changelog containing 2 revisions (264 bytes in store; 134 bytes tracked data)
610 migrating changelog containing 2 revisions (264 bytes in store; 134 bytes tracked data)
597 finished migrating 2 changelog revisions; change in size: 0 bytes
611 finished migrating 2 changelog revisions; change in size: 0 bytes
598 finished migrating 6 total revisions; total change in store size: 0 bytes
612 finished migrating 6 total revisions; total change in store size: 0 bytes
599 copying phaseroots
613 copying phaseroots
600 copying lfs blob d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
614 copying lfs blob d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
601 data fully migrated to temporary repository
615 data fully migrated to temporary repository
602 marking source repository as being upgraded; clients will be unable to read from repository
616 marking source repository as being upgraded; clients will be unable to read from repository
603 starting in-place swap of repository data
617 starting in-place swap of repository data
604 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
618 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
605 replacing store...
619 replacing store...
606 store replacement complete; repository was inconsistent for *s (glob)
620 store replacement complete; repository was inconsistent for *s (glob)
607 finalizing requirements file and making repository readable again
621 finalizing requirements file and making repository readable again
608 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
622 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
609 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
623 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
610 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
624 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
611
625
612 $ grep lfs .hg/requires
626 $ grep lfs .hg/requires
613 lfs
627 lfs
614 $ find .hg/store/lfs -type f
628 $ find .hg/store/lfs -type f
615 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
629 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
616 $ hg verify
630 $ hg verify
617 checking changesets
631 checking changesets
618 checking manifests
632 checking manifests
619 crosschecking files in changesets and manifests
633 crosschecking files in changesets and manifests
620 checking files
634 checking files
621 checked 2 changesets with 2 changes to 2 files
635 checked 2 changesets with 2 changes to 2 files
622 $ hg debugdata lfs.bin 0
636 $ hg debugdata lfs.bin 0
623 version https://git-lfs.github.com/spec/v1
637 version https://git-lfs.github.com/spec/v1
624 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
638 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
625 size 16
639 size 16
626 x-is-binary 0
640 x-is-binary 0
627
641
628 $ cd ..
642 $ cd ..
629
643
630 repository config is taken in account
644 repository config is taken in account
631 -------------------------------------
645 -------------------------------------
632
646
633 $ cat << EOF >> $HGRCPATH
647 $ cat << EOF >> $HGRCPATH
634 > [format]
648 > [format]
635 > maxchainlen = 1
649 > maxchainlen = 1
636 > EOF
650 > EOF
637
651
638 $ hg init localconfig
652 $ hg init localconfig
639 $ cd localconfig
653 $ cd localconfig
640 $ cat << EOF > file
654 $ cat << EOF > file
641 > some content
655 > some content
642 > with some length
656 > with some length
643 > to make sure we get a delta
657 > to make sure we get a delta
644 > after changes
658 > after changes
645 > very long
659 > very long
646 > very long
660 > very long
647 > very long
661 > very long
648 > very long
662 > very long
649 > very long
663 > very long
650 > very long
664 > very long
651 > very long
665 > very long
652 > very long
666 > very long
653 > very long
667 > very long
654 > very long
668 > very long
655 > very long
669 > very long
656 > EOF
670 > EOF
657 $ hg -q commit -A -m A
671 $ hg -q commit -A -m A
658 $ echo "new line" >> file
672 $ echo "new line" >> file
659 $ hg -q commit -m B
673 $ hg -q commit -m B
660 $ echo "new line" >> file
674 $ echo "new line" >> file
661 $ hg -q commit -m C
675 $ hg -q commit -m C
662
676
663 $ cat << EOF >> .hg/hgrc
677 $ cat << EOF >> .hg/hgrc
664 > [format]
678 > [format]
665 > maxchainlen = 9001
679 > maxchainlen = 9001
666 > EOF
680 > EOF
667 $ hg config format
681 $ hg config format
668 format.maxchainlen=9001
682 format.maxchainlen=9001
669 $ hg debugdeltachain file
683 $ hg debugdeltachain file
670 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
684 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
671 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000
685 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
672 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000
686 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
673 2 2 1 -1 base 84 200 84 0.42000 84 0 0.00000
687 2 1 2 0 other 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
674
688
675 $ hg debugupgraderepo --run --optimize redeltaall
689 $ hg debugupgraderepo --run --optimize redeltaall
676 upgrade will perform the following actions:
690 upgrade will perform the following actions:
677
691
678 requirements
692 requirements
679 preserved: dotencode, fncache, generaldelta, revlogv1, store
693 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
680
694
681 redeltaall
695 redeltaall
682 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
696 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
683
697
684 beginning upgrade...
698 beginning upgrade...
685 repository locked and read-only
699 repository locked and read-only
686 creating temporary repository to stage migrated data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
700 creating temporary repository to stage migrated data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
687 (it is safe to interrupt this process any time before data migration completes)
701 (it is safe to interrupt this process any time before data migration completes)
688 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
702 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
689 migrating 1.05 KB in store; 882 bytes tracked data
703 migrating 1019 bytes in store; 882 bytes tracked data
690 migrating 1 filelogs containing 3 revisions (374 bytes in store; 573 bytes tracked data)
704 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
691 finished migrating 3 filelog revisions across 1 filelogs; change in size: -63 bytes
705 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
692 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
706 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
693 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
707 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
694 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
708 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
695 finished migrating 3 changelog revisions; change in size: 0 bytes
709 finished migrating 3 changelog revisions; change in size: 0 bytes
696 finished migrating 9 total revisions; total change in store size: -63 bytes
710 finished migrating 9 total revisions; total change in store size: -9 bytes
697 copying phaseroots
711 copying phaseroots
698 data fully migrated to temporary repository
712 data fully migrated to temporary repository
699 marking source repository as being upgraded; clients will be unable to read from repository
713 marking source repository as being upgraded; clients will be unable to read from repository
700 starting in-place swap of repository data
714 starting in-place swap of repository data
701 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
715 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
702 replacing store...
716 replacing store...
703 store replacement complete; repository was inconsistent for *s (glob)
717 store replacement complete; repository was inconsistent for *s (glob)
704 finalizing requirements file and making repository readable again
718 finalizing requirements file and making repository readable again
705 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
719 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
706 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
720 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
707 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
721 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
708 $ hg debugdeltachain file
722 $ hg debugdeltachain file
709 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
723 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
710 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000
724 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
711 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000
725 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
712 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000
726 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
713 $ cd ..
727 $ cd ..
714
728
715 $ cat << EOF >> $HGRCPATH
729 $ cat << EOF >> $HGRCPATH
716 > [format]
730 > [format]
717 > maxchainlen = 9001
731 > maxchainlen = 9001
718 > EOF
732 > EOF
719
733
720 Check upgrading a sparse-revlog repository
734 Check upgrading a sparse-revlog repository
721 ---------------------------------------
735 ---------------------------------------
722
736
723 $ hg init sparserevlogrepo --config format.sparse-revlog=no
737 $ hg init sparserevlogrepo --config format.sparse-revlog=no
724 $ cd sparserevlogrepo
738 $ cd sparserevlogrepo
725 $ touch foo
739 $ touch foo
726 $ hg add foo
740 $ hg add foo
727 $ hg -q commit -m "foo"
741 $ hg -q commit -m "foo"
728 $ cat .hg/requires
742 $ cat .hg/requires
729 dotencode
743 dotencode
730 fncache
744 fncache
731 generaldelta
745 generaldelta
732 revlogv1
746 revlogv1
733 store
747 store
734
748
735 Check that we can add the sparse-revlog format requirement
749 Check that we can add the sparse-revlog format requirement
736 $ hg --config format.sparse-revlog=yes debugupgraderepo --run >/dev/null
750 $ hg --config format.sparse-revlog=yes debugupgraderepo --run >/dev/null
737 copy of old repository backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
751 copy of old repository backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
738 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
752 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
739 $ cat .hg/requires
753 $ cat .hg/requires
740 dotencode
754 dotencode
741 fncache
755 fncache
742 generaldelta
756 generaldelta
743 revlogv1
757 revlogv1
744 sparserevlog
758 sparserevlog
745 store
759 store
746
760
747 Check that we can remove the sparse-revlog format requirement
761 Check that we can remove the sparse-revlog format requirement
748 $ hg --config format.sparse-revlog=no debugupgraderepo --run >/dev/null
762 $ hg --config format.sparse-revlog=no debugupgraderepo --run >/dev/null
749 copy of old repository backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
763 copy of old repository backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
750 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
764 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
751 $ cat .hg/requires
765 $ cat .hg/requires
752 dotencode
766 dotencode
753 fncache
767 fncache
754 generaldelta
768 generaldelta
755 revlogv1
769 revlogv1
756 store
770 store
757 $ cd ..
771 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now