##// END OF EJS Templates
config: rename `revlog` section into `storage`...
Boris Feld -
r38767:ae17555e @89 stable
parent child Browse files
Show More
@@ -1,1383 +1,1383 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 # bundle.reorder: experimental config
164 # bundle.reorder: experimental config
165 coreconfigitem('bundle', 'reorder',
165 coreconfigitem('bundle', 'reorder',
166 default='auto',
166 default='auto',
167 )
167 )
168 coreconfigitem('censor', 'policy',
168 coreconfigitem('censor', 'policy',
169 default='abort',
169 default='abort',
170 )
170 )
171 coreconfigitem('chgserver', 'idletimeout',
171 coreconfigitem('chgserver', 'idletimeout',
172 default=3600,
172 default=3600,
173 )
173 )
174 coreconfigitem('chgserver', 'skiphash',
174 coreconfigitem('chgserver', 'skiphash',
175 default=False,
175 default=False,
176 )
176 )
177 coreconfigitem('cmdserver', 'log',
177 coreconfigitem('cmdserver', 'log',
178 default=None,
178 default=None,
179 )
179 )
180 coreconfigitem('color', '.*',
180 coreconfigitem('color', '.*',
181 default=None,
181 default=None,
182 generic=True,
182 generic=True,
183 )
183 )
184 coreconfigitem('color', 'mode',
184 coreconfigitem('color', 'mode',
185 default='auto',
185 default='auto',
186 )
186 )
187 coreconfigitem('color', 'pagermode',
187 coreconfigitem('color', 'pagermode',
188 default=dynamicdefault,
188 default=dynamicdefault,
189 )
189 )
190 coreconfigitem('commands', 'grep.all-files',
190 coreconfigitem('commands', 'grep.all-files',
191 default=False,
191 default=False,
192 )
192 )
193 coreconfigitem('commands', 'show.aliasprefix',
193 coreconfigitem('commands', 'show.aliasprefix',
194 default=list,
194 default=list,
195 )
195 )
196 coreconfigitem('commands', 'status.relative',
196 coreconfigitem('commands', 'status.relative',
197 default=False,
197 default=False,
198 )
198 )
199 coreconfigitem('commands', 'status.skipstates',
199 coreconfigitem('commands', 'status.skipstates',
200 default=[],
200 default=[],
201 )
201 )
202 coreconfigitem('commands', 'status.terse',
202 coreconfigitem('commands', 'status.terse',
203 default='',
203 default='',
204 )
204 )
205 coreconfigitem('commands', 'status.verbose',
205 coreconfigitem('commands', 'status.verbose',
206 default=False,
206 default=False,
207 )
207 )
208 coreconfigitem('commands', 'update.check',
208 coreconfigitem('commands', 'update.check',
209 default=None,
209 default=None,
210 )
210 )
211 coreconfigitem('commands', 'update.requiredest',
211 coreconfigitem('commands', 'update.requiredest',
212 default=False,
212 default=False,
213 )
213 )
214 coreconfigitem('committemplate', '.*',
214 coreconfigitem('committemplate', '.*',
215 default=None,
215 default=None,
216 generic=True,
216 generic=True,
217 )
217 )
218 coreconfigitem('convert', 'bzr.saverev',
218 coreconfigitem('convert', 'bzr.saverev',
219 default=True,
219 default=True,
220 )
220 )
221 coreconfigitem('convert', 'cvsps.cache',
221 coreconfigitem('convert', 'cvsps.cache',
222 default=True,
222 default=True,
223 )
223 )
224 coreconfigitem('convert', 'cvsps.fuzz',
224 coreconfigitem('convert', 'cvsps.fuzz',
225 default=60,
225 default=60,
226 )
226 )
227 coreconfigitem('convert', 'cvsps.logencoding',
227 coreconfigitem('convert', 'cvsps.logencoding',
228 default=None,
228 default=None,
229 )
229 )
230 coreconfigitem('convert', 'cvsps.mergefrom',
230 coreconfigitem('convert', 'cvsps.mergefrom',
231 default=None,
231 default=None,
232 )
232 )
233 coreconfigitem('convert', 'cvsps.mergeto',
233 coreconfigitem('convert', 'cvsps.mergeto',
234 default=None,
234 default=None,
235 )
235 )
236 coreconfigitem('convert', 'git.committeractions',
236 coreconfigitem('convert', 'git.committeractions',
237 default=lambda: ['messagedifferent'],
237 default=lambda: ['messagedifferent'],
238 )
238 )
239 coreconfigitem('convert', 'git.extrakeys',
239 coreconfigitem('convert', 'git.extrakeys',
240 default=list,
240 default=list,
241 )
241 )
242 coreconfigitem('convert', 'git.findcopiesharder',
242 coreconfigitem('convert', 'git.findcopiesharder',
243 default=False,
243 default=False,
244 )
244 )
245 coreconfigitem('convert', 'git.remoteprefix',
245 coreconfigitem('convert', 'git.remoteprefix',
246 default='remote',
246 default='remote',
247 )
247 )
248 coreconfigitem('convert', 'git.renamelimit',
248 coreconfigitem('convert', 'git.renamelimit',
249 default=400,
249 default=400,
250 )
250 )
251 coreconfigitem('convert', 'git.saverev',
251 coreconfigitem('convert', 'git.saverev',
252 default=True,
252 default=True,
253 )
253 )
254 coreconfigitem('convert', 'git.similarity',
254 coreconfigitem('convert', 'git.similarity',
255 default=50,
255 default=50,
256 )
256 )
257 coreconfigitem('convert', 'git.skipsubmodules',
257 coreconfigitem('convert', 'git.skipsubmodules',
258 default=False,
258 default=False,
259 )
259 )
260 coreconfigitem('convert', 'hg.clonebranches',
260 coreconfigitem('convert', 'hg.clonebranches',
261 default=False,
261 default=False,
262 )
262 )
263 coreconfigitem('convert', 'hg.ignoreerrors',
263 coreconfigitem('convert', 'hg.ignoreerrors',
264 default=False,
264 default=False,
265 )
265 )
266 coreconfigitem('convert', 'hg.revs',
266 coreconfigitem('convert', 'hg.revs',
267 default=None,
267 default=None,
268 )
268 )
269 coreconfigitem('convert', 'hg.saverev',
269 coreconfigitem('convert', 'hg.saverev',
270 default=False,
270 default=False,
271 )
271 )
272 coreconfigitem('convert', 'hg.sourcename',
272 coreconfigitem('convert', 'hg.sourcename',
273 default=None,
273 default=None,
274 )
274 )
275 coreconfigitem('convert', 'hg.startrev',
275 coreconfigitem('convert', 'hg.startrev',
276 default=None,
276 default=None,
277 )
277 )
278 coreconfigitem('convert', 'hg.tagsbranch',
278 coreconfigitem('convert', 'hg.tagsbranch',
279 default='default',
279 default='default',
280 )
280 )
281 coreconfigitem('convert', 'hg.usebranchnames',
281 coreconfigitem('convert', 'hg.usebranchnames',
282 default=True,
282 default=True,
283 )
283 )
284 coreconfigitem('convert', 'ignoreancestorcheck',
284 coreconfigitem('convert', 'ignoreancestorcheck',
285 default=False,
285 default=False,
286 )
286 )
287 coreconfigitem('convert', 'localtimezone',
287 coreconfigitem('convert', 'localtimezone',
288 default=False,
288 default=False,
289 )
289 )
290 coreconfigitem('convert', 'p4.encoding',
290 coreconfigitem('convert', 'p4.encoding',
291 default=dynamicdefault,
291 default=dynamicdefault,
292 )
292 )
293 coreconfigitem('convert', 'p4.startrev',
293 coreconfigitem('convert', 'p4.startrev',
294 default=0,
294 default=0,
295 )
295 )
296 coreconfigitem('convert', 'skiptags',
296 coreconfigitem('convert', 'skiptags',
297 default=False,
297 default=False,
298 )
298 )
299 coreconfigitem('convert', 'svn.debugsvnlog',
299 coreconfigitem('convert', 'svn.debugsvnlog',
300 default=True,
300 default=True,
301 )
301 )
302 coreconfigitem('convert', 'svn.trunk',
302 coreconfigitem('convert', 'svn.trunk',
303 default=None,
303 default=None,
304 )
304 )
305 coreconfigitem('convert', 'svn.tags',
305 coreconfigitem('convert', 'svn.tags',
306 default=None,
306 default=None,
307 )
307 )
308 coreconfigitem('convert', 'svn.branches',
308 coreconfigitem('convert', 'svn.branches',
309 default=None,
309 default=None,
310 )
310 )
311 coreconfigitem('convert', 'svn.startrev',
311 coreconfigitem('convert', 'svn.startrev',
312 default=0,
312 default=0,
313 )
313 )
314 coreconfigitem('debug', 'dirstate.delaywrite',
314 coreconfigitem('debug', 'dirstate.delaywrite',
315 default=0,
315 default=0,
316 )
316 )
317 coreconfigitem('defaults', '.*',
317 coreconfigitem('defaults', '.*',
318 default=None,
318 default=None,
319 generic=True,
319 generic=True,
320 )
320 )
321 coreconfigitem('devel', 'all-warnings',
321 coreconfigitem('devel', 'all-warnings',
322 default=False,
322 default=False,
323 )
323 )
324 coreconfigitem('devel', 'bundle2.debug',
324 coreconfigitem('devel', 'bundle2.debug',
325 default=False,
325 default=False,
326 )
326 )
327 coreconfigitem('devel', 'cache-vfs',
327 coreconfigitem('devel', 'cache-vfs',
328 default=None,
328 default=None,
329 )
329 )
330 coreconfigitem('devel', 'check-locks',
330 coreconfigitem('devel', 'check-locks',
331 default=False,
331 default=False,
332 )
332 )
333 coreconfigitem('devel', 'check-relroot',
333 coreconfigitem('devel', 'check-relroot',
334 default=False,
334 default=False,
335 )
335 )
336 coreconfigitem('devel', 'default-date',
336 coreconfigitem('devel', 'default-date',
337 default=None,
337 default=None,
338 )
338 )
339 coreconfigitem('devel', 'deprec-warn',
339 coreconfigitem('devel', 'deprec-warn',
340 default=False,
340 default=False,
341 )
341 )
342 coreconfigitem('devel', 'disableloaddefaultcerts',
342 coreconfigitem('devel', 'disableloaddefaultcerts',
343 default=False,
343 default=False,
344 )
344 )
345 coreconfigitem('devel', 'warn-empty-changegroup',
345 coreconfigitem('devel', 'warn-empty-changegroup',
346 default=False,
346 default=False,
347 )
347 )
348 coreconfigitem('devel', 'legacy.exchange',
348 coreconfigitem('devel', 'legacy.exchange',
349 default=list,
349 default=list,
350 )
350 )
351 coreconfigitem('devel', 'servercafile',
351 coreconfigitem('devel', 'servercafile',
352 default='',
352 default='',
353 )
353 )
354 coreconfigitem('devel', 'serverexactprotocol',
354 coreconfigitem('devel', 'serverexactprotocol',
355 default='',
355 default='',
356 )
356 )
357 coreconfigitem('devel', 'serverrequirecert',
357 coreconfigitem('devel', 'serverrequirecert',
358 default=False,
358 default=False,
359 )
359 )
360 coreconfigitem('devel', 'strip-obsmarkers',
360 coreconfigitem('devel', 'strip-obsmarkers',
361 default=True,
361 default=True,
362 )
362 )
363 coreconfigitem('devel', 'warn-config',
363 coreconfigitem('devel', 'warn-config',
364 default=None,
364 default=None,
365 )
365 )
366 coreconfigitem('devel', 'warn-config-default',
366 coreconfigitem('devel', 'warn-config-default',
367 default=None,
367 default=None,
368 )
368 )
369 coreconfigitem('devel', 'user.obsmarker',
369 coreconfigitem('devel', 'user.obsmarker',
370 default=None,
370 default=None,
371 )
371 )
372 coreconfigitem('devel', 'warn-config-unknown',
372 coreconfigitem('devel', 'warn-config-unknown',
373 default=None,
373 default=None,
374 )
374 )
375 coreconfigitem('devel', 'debug.extensions',
375 coreconfigitem('devel', 'debug.extensions',
376 default=False,
376 default=False,
377 )
377 )
378 coreconfigitem('devel', 'debug.peer-request',
378 coreconfigitem('devel', 'debug.peer-request',
379 default=False,
379 default=False,
380 )
380 )
381 coreconfigitem('diff', 'nodates',
381 coreconfigitem('diff', 'nodates',
382 default=False,
382 default=False,
383 )
383 )
384 coreconfigitem('diff', 'showfunc',
384 coreconfigitem('diff', 'showfunc',
385 default=False,
385 default=False,
386 )
386 )
387 coreconfigitem('diff', 'unified',
387 coreconfigitem('diff', 'unified',
388 default=None,
388 default=None,
389 )
389 )
390 coreconfigitem('diff', 'git',
390 coreconfigitem('diff', 'git',
391 default=False,
391 default=False,
392 )
392 )
393 coreconfigitem('diff', 'ignorews',
393 coreconfigitem('diff', 'ignorews',
394 default=False,
394 default=False,
395 )
395 )
396 coreconfigitem('diff', 'ignorewsamount',
396 coreconfigitem('diff', 'ignorewsamount',
397 default=False,
397 default=False,
398 )
398 )
399 coreconfigitem('diff', 'ignoreblanklines',
399 coreconfigitem('diff', 'ignoreblanklines',
400 default=False,
400 default=False,
401 )
401 )
402 coreconfigitem('diff', 'ignorewseol',
402 coreconfigitem('diff', 'ignorewseol',
403 default=False,
403 default=False,
404 )
404 )
405 coreconfigitem('diff', 'nobinary',
405 coreconfigitem('diff', 'nobinary',
406 default=False,
406 default=False,
407 )
407 )
408 coreconfigitem('diff', 'noprefix',
408 coreconfigitem('diff', 'noprefix',
409 default=False,
409 default=False,
410 )
410 )
411 coreconfigitem('diff', 'word-diff',
411 coreconfigitem('diff', 'word-diff',
412 default=False,
412 default=False,
413 )
413 )
414 coreconfigitem('email', 'bcc',
414 coreconfigitem('email', 'bcc',
415 default=None,
415 default=None,
416 )
416 )
417 coreconfigitem('email', 'cc',
417 coreconfigitem('email', 'cc',
418 default=None,
418 default=None,
419 )
419 )
420 coreconfigitem('email', 'charsets',
420 coreconfigitem('email', 'charsets',
421 default=list,
421 default=list,
422 )
422 )
423 coreconfigitem('email', 'from',
423 coreconfigitem('email', 'from',
424 default=None,
424 default=None,
425 )
425 )
426 coreconfigitem('email', 'method',
426 coreconfigitem('email', 'method',
427 default='smtp',
427 default='smtp',
428 )
428 )
429 coreconfigitem('email', 'reply-to',
429 coreconfigitem('email', 'reply-to',
430 default=None,
430 default=None,
431 )
431 )
432 coreconfigitem('email', 'to',
432 coreconfigitem('email', 'to',
433 default=None,
433 default=None,
434 )
434 )
435 coreconfigitem('experimental', 'archivemetatemplate',
435 coreconfigitem('experimental', 'archivemetatemplate',
436 default=dynamicdefault,
436 default=dynamicdefault,
437 )
437 )
438 coreconfigitem('experimental', 'bundle-phases',
438 coreconfigitem('experimental', 'bundle-phases',
439 default=False,
439 default=False,
440 )
440 )
441 coreconfigitem('experimental', 'bundle2-advertise',
441 coreconfigitem('experimental', 'bundle2-advertise',
442 default=True,
442 default=True,
443 )
443 )
444 coreconfigitem('experimental', 'bundle2-output-capture',
444 coreconfigitem('experimental', 'bundle2-output-capture',
445 default=False,
445 default=False,
446 )
446 )
447 coreconfigitem('experimental', 'bundle2.pushback',
447 coreconfigitem('experimental', 'bundle2.pushback',
448 default=False,
448 default=False,
449 )
449 )
450 coreconfigitem('experimental', 'bundle2.stream',
450 coreconfigitem('experimental', 'bundle2.stream',
451 default=False,
451 default=False,
452 )
452 )
453 coreconfigitem('experimental', 'bundle2lazylocking',
453 coreconfigitem('experimental', 'bundle2lazylocking',
454 default=False,
454 default=False,
455 )
455 )
456 coreconfigitem('experimental', 'bundlecomplevel',
456 coreconfigitem('experimental', 'bundlecomplevel',
457 default=None,
457 default=None,
458 )
458 )
459 coreconfigitem('experimental', 'bundlecomplevel.bzip2',
459 coreconfigitem('experimental', 'bundlecomplevel.bzip2',
460 default=None,
460 default=None,
461 )
461 )
462 coreconfigitem('experimental', 'bundlecomplevel.gzip',
462 coreconfigitem('experimental', 'bundlecomplevel.gzip',
463 default=None,
463 default=None,
464 )
464 )
465 coreconfigitem('experimental', 'bundlecomplevel.none',
465 coreconfigitem('experimental', 'bundlecomplevel.none',
466 default=None,
466 default=None,
467 )
467 )
468 coreconfigitem('experimental', 'bundlecomplevel.zstd',
468 coreconfigitem('experimental', 'bundlecomplevel.zstd',
469 default=None,
469 default=None,
470 )
470 )
471 coreconfigitem('experimental', 'changegroup3',
471 coreconfigitem('experimental', 'changegroup3',
472 default=False,
472 default=False,
473 )
473 )
474 coreconfigitem('experimental', 'clientcompressionengines',
474 coreconfigitem('experimental', 'clientcompressionengines',
475 default=list,
475 default=list,
476 )
476 )
477 coreconfigitem('experimental', 'copytrace',
477 coreconfigitem('experimental', 'copytrace',
478 default='on',
478 default='on',
479 )
479 )
480 coreconfigitem('experimental', 'copytrace.movecandidateslimit',
480 coreconfigitem('experimental', 'copytrace.movecandidateslimit',
481 default=100,
481 default=100,
482 )
482 )
483 coreconfigitem('experimental', 'copytrace.sourcecommitlimit',
483 coreconfigitem('experimental', 'copytrace.sourcecommitlimit',
484 default=100,
484 default=100,
485 )
485 )
486 coreconfigitem('experimental', 'crecordtest',
486 coreconfigitem('experimental', 'crecordtest',
487 default=None,
487 default=None,
488 )
488 )
489 coreconfigitem('experimental', 'directaccess',
489 coreconfigitem('experimental', 'directaccess',
490 default=False,
490 default=False,
491 )
491 )
492 coreconfigitem('experimental', 'directaccess.revnums',
492 coreconfigitem('experimental', 'directaccess.revnums',
493 default=False,
493 default=False,
494 )
494 )
495 coreconfigitem('experimental', 'editortmpinhg',
495 coreconfigitem('experimental', 'editortmpinhg',
496 default=False,
496 default=False,
497 )
497 )
498 coreconfigitem('experimental', 'evolution',
498 coreconfigitem('experimental', 'evolution',
499 default=list,
499 default=list,
500 )
500 )
501 coreconfigitem('experimental', 'evolution.allowdivergence',
501 coreconfigitem('experimental', 'evolution.allowdivergence',
502 default=False,
502 default=False,
503 alias=[('experimental', 'allowdivergence')]
503 alias=[('experimental', 'allowdivergence')]
504 )
504 )
505 coreconfigitem('experimental', 'evolution.allowunstable',
505 coreconfigitem('experimental', 'evolution.allowunstable',
506 default=None,
506 default=None,
507 )
507 )
508 coreconfigitem('experimental', 'evolution.createmarkers',
508 coreconfigitem('experimental', 'evolution.createmarkers',
509 default=None,
509 default=None,
510 )
510 )
511 coreconfigitem('experimental', 'evolution.effect-flags',
511 coreconfigitem('experimental', 'evolution.effect-flags',
512 default=True,
512 default=True,
513 alias=[('experimental', 'effect-flags')]
513 alias=[('experimental', 'effect-flags')]
514 )
514 )
515 coreconfigitem('experimental', 'evolution.exchange',
515 coreconfigitem('experimental', 'evolution.exchange',
516 default=None,
516 default=None,
517 )
517 )
518 coreconfigitem('experimental', 'evolution.bundle-obsmarker',
518 coreconfigitem('experimental', 'evolution.bundle-obsmarker',
519 default=False,
519 default=False,
520 )
520 )
521 coreconfigitem('experimental', 'evolution.report-instabilities',
521 coreconfigitem('experimental', 'evolution.report-instabilities',
522 default=True,
522 default=True,
523 )
523 )
524 coreconfigitem('experimental', 'evolution.track-operation',
524 coreconfigitem('experimental', 'evolution.track-operation',
525 default=True,
525 default=True,
526 )
526 )
527 coreconfigitem('experimental', 'maxdeltachainspan',
527 coreconfigitem('experimental', 'maxdeltachainspan',
528 default=-1,
528 default=-1,
529 )
529 )
530 coreconfigitem('experimental', 'mergetempdirprefix',
530 coreconfigitem('experimental', 'mergetempdirprefix',
531 default=None,
531 default=None,
532 )
532 )
533 coreconfigitem('experimental', 'mmapindexthreshold',
533 coreconfigitem('experimental', 'mmapindexthreshold',
534 default=None,
534 default=None,
535 )
535 )
536 coreconfigitem('experimental', 'nonnormalparanoidcheck',
536 coreconfigitem('experimental', 'nonnormalparanoidcheck',
537 default=False,
537 default=False,
538 )
538 )
539 coreconfigitem('experimental', 'exportableenviron',
539 coreconfigitem('experimental', 'exportableenviron',
540 default=list,
540 default=list,
541 )
541 )
542 coreconfigitem('experimental', 'extendedheader.index',
542 coreconfigitem('experimental', 'extendedheader.index',
543 default=None,
543 default=None,
544 )
544 )
545 coreconfigitem('experimental', 'extendedheader.similarity',
545 coreconfigitem('experimental', 'extendedheader.similarity',
546 default=False,
546 default=False,
547 )
547 )
548 coreconfigitem('experimental', 'format.compression',
548 coreconfigitem('experimental', 'format.compression',
549 default='zlib',
549 default='zlib',
550 )
550 )
551 coreconfigitem('experimental', 'graphshorten',
551 coreconfigitem('experimental', 'graphshorten',
552 default=False,
552 default=False,
553 )
553 )
554 coreconfigitem('experimental', 'graphstyle.parent',
554 coreconfigitem('experimental', 'graphstyle.parent',
555 default=dynamicdefault,
555 default=dynamicdefault,
556 )
556 )
557 coreconfigitem('experimental', 'graphstyle.missing',
557 coreconfigitem('experimental', 'graphstyle.missing',
558 default=dynamicdefault,
558 default=dynamicdefault,
559 )
559 )
560 coreconfigitem('experimental', 'graphstyle.grandparent',
560 coreconfigitem('experimental', 'graphstyle.grandparent',
561 default=dynamicdefault,
561 default=dynamicdefault,
562 )
562 )
563 coreconfigitem('experimental', 'hook-track-tags',
563 coreconfigitem('experimental', 'hook-track-tags',
564 default=False,
564 default=False,
565 )
565 )
566 coreconfigitem('experimental', 'httppeer.advertise-v2',
566 coreconfigitem('experimental', 'httppeer.advertise-v2',
567 default=False,
567 default=False,
568 )
568 )
569 coreconfigitem('experimental', 'httppostargs',
569 coreconfigitem('experimental', 'httppostargs',
570 default=False,
570 default=False,
571 )
571 )
572 coreconfigitem('experimental', 'mergedriver',
572 coreconfigitem('experimental', 'mergedriver',
573 default=None,
573 default=None,
574 )
574 )
575 coreconfigitem('experimental', 'nointerrupt', default=False)
575 coreconfigitem('experimental', 'nointerrupt', default=False)
576 coreconfigitem('experimental', 'nointerrupt-interactiveonly', default=True)
576 coreconfigitem('experimental', 'nointerrupt-interactiveonly', default=True)
577
577
578 coreconfigitem('experimental', 'obsmarkers-exchange-debug',
578 coreconfigitem('experimental', 'obsmarkers-exchange-debug',
579 default=False,
579 default=False,
580 )
580 )
581 coreconfigitem('experimental', 'remotenames',
581 coreconfigitem('experimental', 'remotenames',
582 default=False,
582 default=False,
583 )
583 )
584 coreconfigitem('experimental', 'removeemptydirs',
584 coreconfigitem('experimental', 'removeemptydirs',
585 default=True,
585 default=True,
586 )
586 )
587 coreconfigitem('experimental', 'revlogv2',
587 coreconfigitem('experimental', 'revlogv2',
588 default=None,
588 default=None,
589 )
589 )
590 coreconfigitem('experimental', 'single-head-per-branch',
590 coreconfigitem('experimental', 'single-head-per-branch',
591 default=False,
591 default=False,
592 )
592 )
593 coreconfigitem('experimental', 'sshserver.support-v2',
593 coreconfigitem('experimental', 'sshserver.support-v2',
594 default=False,
594 default=False,
595 )
595 )
596 coreconfigitem('experimental', 'spacemovesdown',
596 coreconfigitem('experimental', 'spacemovesdown',
597 default=False,
597 default=False,
598 )
598 )
599 coreconfigitem('experimental', 'sparse-read',
599 coreconfigitem('experimental', 'sparse-read',
600 default=False,
600 default=False,
601 )
601 )
602 coreconfigitem('experimental', 'sparse-read.density-threshold',
602 coreconfigitem('experimental', 'sparse-read.density-threshold',
603 default=0.50,
603 default=0.50,
604 )
604 )
605 coreconfigitem('experimental', 'sparse-read.min-gap-size',
605 coreconfigitem('experimental', 'sparse-read.min-gap-size',
606 default='65K',
606 default='65K',
607 )
607 )
608 coreconfigitem('experimental', 'treemanifest',
608 coreconfigitem('experimental', 'treemanifest',
609 default=False,
609 default=False,
610 )
610 )
611 coreconfigitem('experimental', 'update.atomic-file',
611 coreconfigitem('experimental', 'update.atomic-file',
612 default=False,
612 default=False,
613 )
613 )
614 coreconfigitem('experimental', 'sshpeer.advertise-v2',
614 coreconfigitem('experimental', 'sshpeer.advertise-v2',
615 default=False,
615 default=False,
616 )
616 )
617 coreconfigitem('experimental', 'web.apiserver',
617 coreconfigitem('experimental', 'web.apiserver',
618 default=False,
618 default=False,
619 )
619 )
620 coreconfigitem('experimental', 'web.api.http-v2',
620 coreconfigitem('experimental', 'web.api.http-v2',
621 default=False,
621 default=False,
622 )
622 )
623 coreconfigitem('experimental', 'web.api.debugreflect',
623 coreconfigitem('experimental', 'web.api.debugreflect',
624 default=False,
624 default=False,
625 )
625 )
626 coreconfigitem('experimental', 'worker.wdir-get-thread-safe',
626 coreconfigitem('experimental', 'worker.wdir-get-thread-safe',
627 default=False,
627 default=False,
628 )
628 )
629 coreconfigitem('experimental', 'xdiff',
629 coreconfigitem('experimental', 'xdiff',
630 default=False,
630 default=False,
631 )
631 )
632 coreconfigitem('extensions', '.*',
632 coreconfigitem('extensions', '.*',
633 default=None,
633 default=None,
634 generic=True,
634 generic=True,
635 )
635 )
636 coreconfigitem('extdata', '.*',
636 coreconfigitem('extdata', '.*',
637 default=None,
637 default=None,
638 generic=True,
638 generic=True,
639 )
639 )
640 coreconfigitem('format', 'chunkcachesize',
640 coreconfigitem('format', 'chunkcachesize',
641 default=None,
641 default=None,
642 )
642 )
643 coreconfigitem('format', 'dotencode',
643 coreconfigitem('format', 'dotencode',
644 default=True,
644 default=True,
645 )
645 )
646 coreconfigitem('format', 'generaldelta',
646 coreconfigitem('format', 'generaldelta',
647 default=False,
647 default=False,
648 )
648 )
649 coreconfigitem('format', 'manifestcachesize',
649 coreconfigitem('format', 'manifestcachesize',
650 default=None,
650 default=None,
651 )
651 )
652 coreconfigitem('format', 'maxchainlen',
652 coreconfigitem('format', 'maxchainlen',
653 default=None,
653 default=None,
654 )
654 )
655 coreconfigitem('format', 'obsstore-version',
655 coreconfigitem('format', 'obsstore-version',
656 default=None,
656 default=None,
657 )
657 )
658 coreconfigitem('format', 'sparse-revlog',
658 coreconfigitem('format', 'sparse-revlog',
659 default=False,
659 default=False,
660 )
660 )
661 coreconfigitem('format', 'usefncache',
661 coreconfigitem('format', 'usefncache',
662 default=True,
662 default=True,
663 )
663 )
664 coreconfigitem('format', 'usegeneraldelta',
664 coreconfigitem('format', 'usegeneraldelta',
665 default=True,
665 default=True,
666 )
666 )
667 coreconfigitem('format', 'usestore',
667 coreconfigitem('format', 'usestore',
668 default=True,
668 default=True,
669 )
669 )
670 coreconfigitem('fsmonitor', 'warn_when_unused',
670 coreconfigitem('fsmonitor', 'warn_when_unused',
671 default=True,
671 default=True,
672 )
672 )
673 coreconfigitem('fsmonitor', 'warn_update_file_count',
673 coreconfigitem('fsmonitor', 'warn_update_file_count',
674 default=50000,
674 default=50000,
675 )
675 )
676 coreconfigitem('hooks', '.*',
676 coreconfigitem('hooks', '.*',
677 default=dynamicdefault,
677 default=dynamicdefault,
678 generic=True,
678 generic=True,
679 )
679 )
680 coreconfigitem('hgweb-paths', '.*',
680 coreconfigitem('hgweb-paths', '.*',
681 default=list,
681 default=list,
682 generic=True,
682 generic=True,
683 )
683 )
684 coreconfigitem('hostfingerprints', '.*',
684 coreconfigitem('hostfingerprints', '.*',
685 default=list,
685 default=list,
686 generic=True,
686 generic=True,
687 )
687 )
688 coreconfigitem('hostsecurity', 'ciphers',
688 coreconfigitem('hostsecurity', 'ciphers',
689 default=None,
689 default=None,
690 )
690 )
691 coreconfigitem('hostsecurity', 'disabletls10warning',
691 coreconfigitem('hostsecurity', 'disabletls10warning',
692 default=False,
692 default=False,
693 )
693 )
694 coreconfigitem('hostsecurity', 'minimumprotocol',
694 coreconfigitem('hostsecurity', 'minimumprotocol',
695 default=dynamicdefault,
695 default=dynamicdefault,
696 )
696 )
697 coreconfigitem('hostsecurity', '.*:minimumprotocol$',
697 coreconfigitem('hostsecurity', '.*:minimumprotocol$',
698 default=dynamicdefault,
698 default=dynamicdefault,
699 generic=True,
699 generic=True,
700 )
700 )
701 coreconfigitem('hostsecurity', '.*:ciphers$',
701 coreconfigitem('hostsecurity', '.*:ciphers$',
702 default=dynamicdefault,
702 default=dynamicdefault,
703 generic=True,
703 generic=True,
704 )
704 )
705 coreconfigitem('hostsecurity', '.*:fingerprints$',
705 coreconfigitem('hostsecurity', '.*:fingerprints$',
706 default=list,
706 default=list,
707 generic=True,
707 generic=True,
708 )
708 )
709 coreconfigitem('hostsecurity', '.*:verifycertsfile$',
709 coreconfigitem('hostsecurity', '.*:verifycertsfile$',
710 default=None,
710 default=None,
711 generic=True,
711 generic=True,
712 )
712 )
713
713
714 coreconfigitem('http_proxy', 'always',
714 coreconfigitem('http_proxy', 'always',
715 default=False,
715 default=False,
716 )
716 )
717 coreconfigitem('http_proxy', 'host',
717 coreconfigitem('http_proxy', 'host',
718 default=None,
718 default=None,
719 )
719 )
720 coreconfigitem('http_proxy', 'no',
720 coreconfigitem('http_proxy', 'no',
721 default=list,
721 default=list,
722 )
722 )
723 coreconfigitem('http_proxy', 'passwd',
723 coreconfigitem('http_proxy', 'passwd',
724 default=None,
724 default=None,
725 )
725 )
726 coreconfigitem('http_proxy', 'user',
726 coreconfigitem('http_proxy', 'user',
727 default=None,
727 default=None,
728 )
728 )
729 coreconfigitem('logtoprocess', 'commandexception',
729 coreconfigitem('logtoprocess', 'commandexception',
730 default=None,
730 default=None,
731 )
731 )
732 coreconfigitem('logtoprocess', 'commandfinish',
732 coreconfigitem('logtoprocess', 'commandfinish',
733 default=None,
733 default=None,
734 )
734 )
735 coreconfigitem('logtoprocess', 'command',
735 coreconfigitem('logtoprocess', 'command',
736 default=None,
736 default=None,
737 )
737 )
738 coreconfigitem('logtoprocess', 'develwarn',
738 coreconfigitem('logtoprocess', 'develwarn',
739 default=None,
739 default=None,
740 )
740 )
741 coreconfigitem('logtoprocess', 'uiblocked',
741 coreconfigitem('logtoprocess', 'uiblocked',
742 default=None,
742 default=None,
743 )
743 )
744 coreconfigitem('merge', 'checkunknown',
744 coreconfigitem('merge', 'checkunknown',
745 default='abort',
745 default='abort',
746 )
746 )
747 coreconfigitem('merge', 'checkignored',
747 coreconfigitem('merge', 'checkignored',
748 default='abort',
748 default='abort',
749 )
749 )
750 coreconfigitem('experimental', 'merge.checkpathconflicts',
750 coreconfigitem('experimental', 'merge.checkpathconflicts',
751 default=False,
751 default=False,
752 )
752 )
753 coreconfigitem('merge', 'followcopies',
753 coreconfigitem('merge', 'followcopies',
754 default=True,
754 default=True,
755 )
755 )
756 coreconfigitem('merge', 'on-failure',
756 coreconfigitem('merge', 'on-failure',
757 default='continue',
757 default='continue',
758 )
758 )
759 coreconfigitem('merge', 'preferancestor',
759 coreconfigitem('merge', 'preferancestor',
760 default=lambda: ['*'],
760 default=lambda: ['*'],
761 )
761 )
762 coreconfigitem('merge-tools', '.*',
762 coreconfigitem('merge-tools', '.*',
763 default=None,
763 default=None,
764 generic=True,
764 generic=True,
765 )
765 )
766 coreconfigitem('merge-tools', br'.*\.args$',
766 coreconfigitem('merge-tools', br'.*\.args$',
767 default="$local $base $other",
767 default="$local $base $other",
768 generic=True,
768 generic=True,
769 priority=-1,
769 priority=-1,
770 )
770 )
771 coreconfigitem('merge-tools', br'.*\.binary$',
771 coreconfigitem('merge-tools', br'.*\.binary$',
772 default=False,
772 default=False,
773 generic=True,
773 generic=True,
774 priority=-1,
774 priority=-1,
775 )
775 )
776 coreconfigitem('merge-tools', br'.*\.check$',
776 coreconfigitem('merge-tools', br'.*\.check$',
777 default=list,
777 default=list,
778 generic=True,
778 generic=True,
779 priority=-1,
779 priority=-1,
780 )
780 )
781 coreconfigitem('merge-tools', br'.*\.checkchanged$',
781 coreconfigitem('merge-tools', br'.*\.checkchanged$',
782 default=False,
782 default=False,
783 generic=True,
783 generic=True,
784 priority=-1,
784 priority=-1,
785 )
785 )
786 coreconfigitem('merge-tools', br'.*\.executable$',
786 coreconfigitem('merge-tools', br'.*\.executable$',
787 default=dynamicdefault,
787 default=dynamicdefault,
788 generic=True,
788 generic=True,
789 priority=-1,
789 priority=-1,
790 )
790 )
791 coreconfigitem('merge-tools', br'.*\.fixeol$',
791 coreconfigitem('merge-tools', br'.*\.fixeol$',
792 default=False,
792 default=False,
793 generic=True,
793 generic=True,
794 priority=-1,
794 priority=-1,
795 )
795 )
796 coreconfigitem('merge-tools', br'.*\.gui$',
796 coreconfigitem('merge-tools', br'.*\.gui$',
797 default=False,
797 default=False,
798 generic=True,
798 generic=True,
799 priority=-1,
799 priority=-1,
800 )
800 )
801 coreconfigitem('merge-tools', br'.*\.mergemarkers$',
801 coreconfigitem('merge-tools', br'.*\.mergemarkers$',
802 default='basic',
802 default='basic',
803 generic=True,
803 generic=True,
804 priority=-1,
804 priority=-1,
805 )
805 )
806 coreconfigitem('merge-tools', br'.*\.mergemarkertemplate$',
806 coreconfigitem('merge-tools', br'.*\.mergemarkertemplate$',
807 default=dynamicdefault, # take from ui.mergemarkertemplate
807 default=dynamicdefault, # take from ui.mergemarkertemplate
808 generic=True,
808 generic=True,
809 priority=-1,
809 priority=-1,
810 )
810 )
811 coreconfigitem('merge-tools', br'.*\.priority$',
811 coreconfigitem('merge-tools', br'.*\.priority$',
812 default=0,
812 default=0,
813 generic=True,
813 generic=True,
814 priority=-1,
814 priority=-1,
815 )
815 )
816 coreconfigitem('merge-tools', br'.*\.premerge$',
816 coreconfigitem('merge-tools', br'.*\.premerge$',
817 default=dynamicdefault,
817 default=dynamicdefault,
818 generic=True,
818 generic=True,
819 priority=-1,
819 priority=-1,
820 )
820 )
821 coreconfigitem('merge-tools', br'.*\.symlink$',
821 coreconfigitem('merge-tools', br'.*\.symlink$',
822 default=False,
822 default=False,
823 generic=True,
823 generic=True,
824 priority=-1,
824 priority=-1,
825 )
825 )
826 coreconfigitem('pager', 'attend-.*',
826 coreconfigitem('pager', 'attend-.*',
827 default=dynamicdefault,
827 default=dynamicdefault,
828 generic=True,
828 generic=True,
829 )
829 )
830 coreconfigitem('pager', 'ignore',
830 coreconfigitem('pager', 'ignore',
831 default=list,
831 default=list,
832 )
832 )
833 coreconfigitem('pager', 'pager',
833 coreconfigitem('pager', 'pager',
834 default=dynamicdefault,
834 default=dynamicdefault,
835 )
835 )
836 coreconfigitem('patch', 'eol',
836 coreconfigitem('patch', 'eol',
837 default='strict',
837 default='strict',
838 )
838 )
839 coreconfigitem('patch', 'fuzz',
839 coreconfigitem('patch', 'fuzz',
840 default=2,
840 default=2,
841 )
841 )
842 coreconfigitem('paths', 'default',
842 coreconfigitem('paths', 'default',
843 default=None,
843 default=None,
844 )
844 )
845 coreconfigitem('paths', 'default-push',
845 coreconfigitem('paths', 'default-push',
846 default=None,
846 default=None,
847 )
847 )
848 coreconfigitem('paths', '.*',
848 coreconfigitem('paths', '.*',
849 default=None,
849 default=None,
850 generic=True,
850 generic=True,
851 )
851 )
852 coreconfigitem('phases', 'checksubrepos',
852 coreconfigitem('phases', 'checksubrepos',
853 default='follow',
853 default='follow',
854 )
854 )
855 coreconfigitem('phases', 'new-commit',
855 coreconfigitem('phases', 'new-commit',
856 default='draft',
856 default='draft',
857 )
857 )
858 coreconfigitem('phases', 'publish',
858 coreconfigitem('phases', 'publish',
859 default=True,
859 default=True,
860 )
860 )
861 coreconfigitem('profiling', 'enabled',
861 coreconfigitem('profiling', 'enabled',
862 default=False,
862 default=False,
863 )
863 )
864 coreconfigitem('profiling', 'format',
864 coreconfigitem('profiling', 'format',
865 default='text',
865 default='text',
866 )
866 )
867 coreconfigitem('profiling', 'freq',
867 coreconfigitem('profiling', 'freq',
868 default=1000,
868 default=1000,
869 )
869 )
870 coreconfigitem('profiling', 'limit',
870 coreconfigitem('profiling', 'limit',
871 default=30,
871 default=30,
872 )
872 )
873 coreconfigitem('profiling', 'nested',
873 coreconfigitem('profiling', 'nested',
874 default=0,
874 default=0,
875 )
875 )
876 coreconfigitem('profiling', 'output',
876 coreconfigitem('profiling', 'output',
877 default=None,
877 default=None,
878 )
878 )
879 coreconfigitem('profiling', 'showmax',
879 coreconfigitem('profiling', 'showmax',
880 default=0.999,
880 default=0.999,
881 )
881 )
882 coreconfigitem('profiling', 'showmin',
882 coreconfigitem('profiling', 'showmin',
883 default=dynamicdefault,
883 default=dynamicdefault,
884 )
884 )
885 coreconfigitem('profiling', 'sort',
885 coreconfigitem('profiling', 'sort',
886 default='inlinetime',
886 default='inlinetime',
887 )
887 )
888 coreconfigitem('profiling', 'statformat',
888 coreconfigitem('profiling', 'statformat',
889 default='hotpath',
889 default='hotpath',
890 )
890 )
891 coreconfigitem('profiling', 'time-track',
891 coreconfigitem('profiling', 'time-track',
892 default='cpu',
892 default='cpu',
893 )
893 )
894 coreconfigitem('profiling', 'type',
894 coreconfigitem('profiling', 'type',
895 default='stat',
895 default='stat',
896 )
896 )
897 coreconfigitem('progress', 'assume-tty',
897 coreconfigitem('progress', 'assume-tty',
898 default=False,
898 default=False,
899 )
899 )
900 coreconfigitem('progress', 'changedelay',
900 coreconfigitem('progress', 'changedelay',
901 default=1,
901 default=1,
902 )
902 )
903 coreconfigitem('progress', 'clear-complete',
903 coreconfigitem('progress', 'clear-complete',
904 default=True,
904 default=True,
905 )
905 )
906 coreconfigitem('progress', 'debug',
906 coreconfigitem('progress', 'debug',
907 default=False,
907 default=False,
908 )
908 )
909 coreconfigitem('progress', 'delay',
909 coreconfigitem('progress', 'delay',
910 default=3,
910 default=3,
911 )
911 )
912 coreconfigitem('progress', 'disable',
912 coreconfigitem('progress', 'disable',
913 default=False,
913 default=False,
914 )
914 )
915 coreconfigitem('progress', 'estimateinterval',
915 coreconfigitem('progress', 'estimateinterval',
916 default=60.0,
916 default=60.0,
917 )
917 )
918 coreconfigitem('progress', 'format',
918 coreconfigitem('progress', 'format',
919 default=lambda: ['topic', 'bar', 'number', 'estimate'],
919 default=lambda: ['topic', 'bar', 'number', 'estimate'],
920 )
920 )
921 coreconfigitem('progress', 'refresh',
921 coreconfigitem('progress', 'refresh',
922 default=0.1,
922 default=0.1,
923 )
923 )
924 coreconfigitem('progress', 'width',
924 coreconfigitem('progress', 'width',
925 default=dynamicdefault,
925 default=dynamicdefault,
926 )
926 )
927 coreconfigitem('push', 'pushvars.server',
927 coreconfigitem('push', 'pushvars.server',
928 default=False,
928 default=False,
929 )
929 )
930 coreconfigitem('revlog', 'optimize-delta-parent-choice',
930 coreconfigitem('storage', 'revlog.optimize-delta-parent-choice',
931 default=True,
931 default=True,
932 alias=[('format', 'aggressivemergedeltas')],
932 alias=[('format', 'aggressivemergedeltas')],
933 )
933 )
934 coreconfigitem('server', 'bookmarks-pushkey-compat',
934 coreconfigitem('server', 'bookmarks-pushkey-compat',
935 default=True,
935 default=True,
936 )
936 )
937 coreconfigitem('server', 'bundle1',
937 coreconfigitem('server', 'bundle1',
938 default=True,
938 default=True,
939 )
939 )
940 coreconfigitem('server', 'bundle1gd',
940 coreconfigitem('server', 'bundle1gd',
941 default=None,
941 default=None,
942 )
942 )
943 coreconfigitem('server', 'bundle1.pull',
943 coreconfigitem('server', 'bundle1.pull',
944 default=None,
944 default=None,
945 )
945 )
946 coreconfigitem('server', 'bundle1gd.pull',
946 coreconfigitem('server', 'bundle1gd.pull',
947 default=None,
947 default=None,
948 )
948 )
949 coreconfigitem('server', 'bundle1.push',
949 coreconfigitem('server', 'bundle1.push',
950 default=None,
950 default=None,
951 )
951 )
952 coreconfigitem('server', 'bundle1gd.push',
952 coreconfigitem('server', 'bundle1gd.push',
953 default=None,
953 default=None,
954 )
954 )
955 coreconfigitem('server', 'compressionengines',
955 coreconfigitem('server', 'compressionengines',
956 default=list,
956 default=list,
957 )
957 )
958 coreconfigitem('server', 'concurrent-push-mode',
958 coreconfigitem('server', 'concurrent-push-mode',
959 default='strict',
959 default='strict',
960 )
960 )
961 coreconfigitem('server', 'disablefullbundle',
961 coreconfigitem('server', 'disablefullbundle',
962 default=False,
962 default=False,
963 )
963 )
964 coreconfigitem('server', 'maxhttpheaderlen',
964 coreconfigitem('server', 'maxhttpheaderlen',
965 default=1024,
965 default=1024,
966 )
966 )
967 coreconfigitem('server', 'pullbundle',
967 coreconfigitem('server', 'pullbundle',
968 default=False,
968 default=False,
969 )
969 )
970 coreconfigitem('server', 'preferuncompressed',
970 coreconfigitem('server', 'preferuncompressed',
971 default=False,
971 default=False,
972 )
972 )
973 coreconfigitem('server', 'streamunbundle',
973 coreconfigitem('server', 'streamunbundle',
974 default=False,
974 default=False,
975 )
975 )
976 coreconfigitem('server', 'uncompressed',
976 coreconfigitem('server', 'uncompressed',
977 default=True,
977 default=True,
978 )
978 )
979 coreconfigitem('server', 'uncompressedallowsecret',
979 coreconfigitem('server', 'uncompressedallowsecret',
980 default=False,
980 default=False,
981 )
981 )
982 coreconfigitem('server', 'validate',
982 coreconfigitem('server', 'validate',
983 default=False,
983 default=False,
984 )
984 )
985 coreconfigitem('server', 'zliblevel',
985 coreconfigitem('server', 'zliblevel',
986 default=-1,
986 default=-1,
987 )
987 )
988 coreconfigitem('server', 'zstdlevel',
988 coreconfigitem('server', 'zstdlevel',
989 default=3,
989 default=3,
990 )
990 )
991 coreconfigitem('share', 'pool',
991 coreconfigitem('share', 'pool',
992 default=None,
992 default=None,
993 )
993 )
994 coreconfigitem('share', 'poolnaming',
994 coreconfigitem('share', 'poolnaming',
995 default='identity',
995 default='identity',
996 )
996 )
997 coreconfigitem('smtp', 'host',
997 coreconfigitem('smtp', 'host',
998 default=None,
998 default=None,
999 )
999 )
1000 coreconfigitem('smtp', 'local_hostname',
1000 coreconfigitem('smtp', 'local_hostname',
1001 default=None,
1001 default=None,
1002 )
1002 )
1003 coreconfigitem('smtp', 'password',
1003 coreconfigitem('smtp', 'password',
1004 default=None,
1004 default=None,
1005 )
1005 )
1006 coreconfigitem('smtp', 'port',
1006 coreconfigitem('smtp', 'port',
1007 default=dynamicdefault,
1007 default=dynamicdefault,
1008 )
1008 )
1009 coreconfigitem('smtp', 'tls',
1009 coreconfigitem('smtp', 'tls',
1010 default='none',
1010 default='none',
1011 )
1011 )
1012 coreconfigitem('smtp', 'username',
1012 coreconfigitem('smtp', 'username',
1013 default=None,
1013 default=None,
1014 )
1014 )
1015 coreconfigitem('sparse', 'missingwarning',
1015 coreconfigitem('sparse', 'missingwarning',
1016 default=True,
1016 default=True,
1017 )
1017 )
1018 coreconfigitem('subrepos', 'allowed',
1018 coreconfigitem('subrepos', 'allowed',
1019 default=dynamicdefault, # to make backporting simpler
1019 default=dynamicdefault, # to make backporting simpler
1020 )
1020 )
1021 coreconfigitem('subrepos', 'hg:allowed',
1021 coreconfigitem('subrepos', 'hg:allowed',
1022 default=dynamicdefault,
1022 default=dynamicdefault,
1023 )
1023 )
1024 coreconfigitem('subrepos', 'git:allowed',
1024 coreconfigitem('subrepos', 'git:allowed',
1025 default=dynamicdefault,
1025 default=dynamicdefault,
1026 )
1026 )
1027 coreconfigitem('subrepos', 'svn:allowed',
1027 coreconfigitem('subrepos', 'svn:allowed',
1028 default=dynamicdefault,
1028 default=dynamicdefault,
1029 )
1029 )
1030 coreconfigitem('templates', '.*',
1030 coreconfigitem('templates', '.*',
1031 default=None,
1031 default=None,
1032 generic=True,
1032 generic=True,
1033 )
1033 )
1034 coreconfigitem('trusted', 'groups',
1034 coreconfigitem('trusted', 'groups',
1035 default=list,
1035 default=list,
1036 )
1036 )
1037 coreconfigitem('trusted', 'users',
1037 coreconfigitem('trusted', 'users',
1038 default=list,
1038 default=list,
1039 )
1039 )
1040 coreconfigitem('ui', '_usedassubrepo',
1040 coreconfigitem('ui', '_usedassubrepo',
1041 default=False,
1041 default=False,
1042 )
1042 )
1043 coreconfigitem('ui', 'allowemptycommit',
1043 coreconfigitem('ui', 'allowemptycommit',
1044 default=False,
1044 default=False,
1045 )
1045 )
1046 coreconfigitem('ui', 'archivemeta',
1046 coreconfigitem('ui', 'archivemeta',
1047 default=True,
1047 default=True,
1048 )
1048 )
1049 coreconfigitem('ui', 'askusername',
1049 coreconfigitem('ui', 'askusername',
1050 default=False,
1050 default=False,
1051 )
1051 )
1052 coreconfigitem('ui', 'clonebundlefallback',
1052 coreconfigitem('ui', 'clonebundlefallback',
1053 default=False,
1053 default=False,
1054 )
1054 )
1055 coreconfigitem('ui', 'clonebundleprefers',
1055 coreconfigitem('ui', 'clonebundleprefers',
1056 default=list,
1056 default=list,
1057 )
1057 )
1058 coreconfigitem('ui', 'clonebundles',
1058 coreconfigitem('ui', 'clonebundles',
1059 default=True,
1059 default=True,
1060 )
1060 )
1061 coreconfigitem('ui', 'color',
1061 coreconfigitem('ui', 'color',
1062 default='auto',
1062 default='auto',
1063 )
1063 )
1064 coreconfigitem('ui', 'commitsubrepos',
1064 coreconfigitem('ui', 'commitsubrepos',
1065 default=False,
1065 default=False,
1066 )
1066 )
1067 coreconfigitem('ui', 'debug',
1067 coreconfigitem('ui', 'debug',
1068 default=False,
1068 default=False,
1069 )
1069 )
1070 coreconfigitem('ui', 'debugger',
1070 coreconfigitem('ui', 'debugger',
1071 default=None,
1071 default=None,
1072 )
1072 )
1073 coreconfigitem('ui', 'editor',
1073 coreconfigitem('ui', 'editor',
1074 default=dynamicdefault,
1074 default=dynamicdefault,
1075 )
1075 )
1076 coreconfigitem('ui', 'fallbackencoding',
1076 coreconfigitem('ui', 'fallbackencoding',
1077 default=None,
1077 default=None,
1078 )
1078 )
1079 coreconfigitem('ui', 'forcecwd',
1079 coreconfigitem('ui', 'forcecwd',
1080 default=None,
1080 default=None,
1081 )
1081 )
1082 coreconfigitem('ui', 'forcemerge',
1082 coreconfigitem('ui', 'forcemerge',
1083 default=None,
1083 default=None,
1084 )
1084 )
1085 coreconfigitem('ui', 'formatdebug',
1085 coreconfigitem('ui', 'formatdebug',
1086 default=False,
1086 default=False,
1087 )
1087 )
1088 coreconfigitem('ui', 'formatjson',
1088 coreconfigitem('ui', 'formatjson',
1089 default=False,
1089 default=False,
1090 )
1090 )
1091 coreconfigitem('ui', 'formatted',
1091 coreconfigitem('ui', 'formatted',
1092 default=None,
1092 default=None,
1093 )
1093 )
1094 coreconfigitem('ui', 'graphnodetemplate',
1094 coreconfigitem('ui', 'graphnodetemplate',
1095 default=None,
1095 default=None,
1096 )
1096 )
1097 coreconfigitem('ui', 'history-editing-backup',
1097 coreconfigitem('ui', 'history-editing-backup',
1098 default=True,
1098 default=True,
1099 )
1099 )
1100 coreconfigitem('ui', 'interactive',
1100 coreconfigitem('ui', 'interactive',
1101 default=None,
1101 default=None,
1102 )
1102 )
1103 coreconfigitem('ui', 'interface',
1103 coreconfigitem('ui', 'interface',
1104 default=None,
1104 default=None,
1105 )
1105 )
1106 coreconfigitem('ui', 'interface.chunkselector',
1106 coreconfigitem('ui', 'interface.chunkselector',
1107 default=None,
1107 default=None,
1108 )
1108 )
1109 coreconfigitem('ui', 'large-file-limit',
1109 coreconfigitem('ui', 'large-file-limit',
1110 default=10000000,
1110 default=10000000,
1111 )
1111 )
1112 coreconfigitem('ui', 'logblockedtimes',
1112 coreconfigitem('ui', 'logblockedtimes',
1113 default=False,
1113 default=False,
1114 )
1114 )
1115 coreconfigitem('ui', 'logtemplate',
1115 coreconfigitem('ui', 'logtemplate',
1116 default=None,
1116 default=None,
1117 )
1117 )
1118 coreconfigitem('ui', 'merge',
1118 coreconfigitem('ui', 'merge',
1119 default=None,
1119 default=None,
1120 )
1120 )
1121 coreconfigitem('ui', 'mergemarkers',
1121 coreconfigitem('ui', 'mergemarkers',
1122 default='basic',
1122 default='basic',
1123 )
1123 )
1124 coreconfigitem('ui', 'mergemarkertemplate',
1124 coreconfigitem('ui', 'mergemarkertemplate',
1125 default=('{node|short} '
1125 default=('{node|short} '
1126 '{ifeq(tags, "tip", "", '
1126 '{ifeq(tags, "tip", "", '
1127 'ifeq(tags, "", "", "{tags} "))}'
1127 'ifeq(tags, "", "", "{tags} "))}'
1128 '{if(bookmarks, "{bookmarks} ")}'
1128 '{if(bookmarks, "{bookmarks} ")}'
1129 '{ifeq(branch, "default", "", "{branch} ")}'
1129 '{ifeq(branch, "default", "", "{branch} ")}'
1130 '- {author|user}: {desc|firstline}')
1130 '- {author|user}: {desc|firstline}')
1131 )
1131 )
1132 coreconfigitem('ui', 'nontty',
1132 coreconfigitem('ui', 'nontty',
1133 default=False,
1133 default=False,
1134 )
1134 )
1135 coreconfigitem('ui', 'origbackuppath',
1135 coreconfigitem('ui', 'origbackuppath',
1136 default=None,
1136 default=None,
1137 )
1137 )
1138 coreconfigitem('ui', 'paginate',
1138 coreconfigitem('ui', 'paginate',
1139 default=True,
1139 default=True,
1140 )
1140 )
1141 coreconfigitem('ui', 'patch',
1141 coreconfigitem('ui', 'patch',
1142 default=None,
1142 default=None,
1143 )
1143 )
1144 coreconfigitem('ui', 'portablefilenames',
1144 coreconfigitem('ui', 'portablefilenames',
1145 default='warn',
1145 default='warn',
1146 )
1146 )
1147 coreconfigitem('ui', 'promptecho',
1147 coreconfigitem('ui', 'promptecho',
1148 default=False,
1148 default=False,
1149 )
1149 )
1150 coreconfigitem('ui', 'quiet',
1150 coreconfigitem('ui', 'quiet',
1151 default=False,
1151 default=False,
1152 )
1152 )
1153 coreconfigitem('ui', 'quietbookmarkmove',
1153 coreconfigitem('ui', 'quietbookmarkmove',
1154 default=False,
1154 default=False,
1155 )
1155 )
1156 coreconfigitem('ui', 'remotecmd',
1156 coreconfigitem('ui', 'remotecmd',
1157 default='hg',
1157 default='hg',
1158 )
1158 )
1159 coreconfigitem('ui', 'report_untrusted',
1159 coreconfigitem('ui', 'report_untrusted',
1160 default=True,
1160 default=True,
1161 )
1161 )
1162 coreconfigitem('ui', 'rollback',
1162 coreconfigitem('ui', 'rollback',
1163 default=True,
1163 default=True,
1164 )
1164 )
1165 coreconfigitem('ui', 'signal-safe-lock',
1165 coreconfigitem('ui', 'signal-safe-lock',
1166 default=True,
1166 default=True,
1167 )
1167 )
1168 coreconfigitem('ui', 'slash',
1168 coreconfigitem('ui', 'slash',
1169 default=False,
1169 default=False,
1170 )
1170 )
1171 coreconfigitem('ui', 'ssh',
1171 coreconfigitem('ui', 'ssh',
1172 default='ssh',
1172 default='ssh',
1173 )
1173 )
1174 coreconfigitem('ui', 'ssherrorhint',
1174 coreconfigitem('ui', 'ssherrorhint',
1175 default=None,
1175 default=None,
1176 )
1176 )
1177 coreconfigitem('ui', 'statuscopies',
1177 coreconfigitem('ui', 'statuscopies',
1178 default=False,
1178 default=False,
1179 )
1179 )
1180 coreconfigitem('ui', 'strict',
1180 coreconfigitem('ui', 'strict',
1181 default=False,
1181 default=False,
1182 )
1182 )
1183 coreconfigitem('ui', 'style',
1183 coreconfigitem('ui', 'style',
1184 default='',
1184 default='',
1185 )
1185 )
1186 coreconfigitem('ui', 'supportcontact',
1186 coreconfigitem('ui', 'supportcontact',
1187 default=None,
1187 default=None,
1188 )
1188 )
1189 coreconfigitem('ui', 'textwidth',
1189 coreconfigitem('ui', 'textwidth',
1190 default=78,
1190 default=78,
1191 )
1191 )
1192 coreconfigitem('ui', 'timeout',
1192 coreconfigitem('ui', 'timeout',
1193 default='600',
1193 default='600',
1194 )
1194 )
1195 coreconfigitem('ui', 'timeout.warn',
1195 coreconfigitem('ui', 'timeout.warn',
1196 default=0,
1196 default=0,
1197 )
1197 )
1198 coreconfigitem('ui', 'traceback',
1198 coreconfigitem('ui', 'traceback',
1199 default=False,
1199 default=False,
1200 )
1200 )
1201 coreconfigitem('ui', 'tweakdefaults',
1201 coreconfigitem('ui', 'tweakdefaults',
1202 default=False,
1202 default=False,
1203 )
1203 )
1204 coreconfigitem('ui', 'username',
1204 coreconfigitem('ui', 'username',
1205 alias=[('ui', 'user')]
1205 alias=[('ui', 'user')]
1206 )
1206 )
1207 coreconfigitem('ui', 'verbose',
1207 coreconfigitem('ui', 'verbose',
1208 default=False,
1208 default=False,
1209 )
1209 )
1210 coreconfigitem('verify', 'skipflags',
1210 coreconfigitem('verify', 'skipflags',
1211 default=None,
1211 default=None,
1212 )
1212 )
1213 coreconfigitem('web', 'allowbz2',
1213 coreconfigitem('web', 'allowbz2',
1214 default=False,
1214 default=False,
1215 )
1215 )
1216 coreconfigitem('web', 'allowgz',
1216 coreconfigitem('web', 'allowgz',
1217 default=False,
1217 default=False,
1218 )
1218 )
1219 coreconfigitem('web', 'allow-pull',
1219 coreconfigitem('web', 'allow-pull',
1220 alias=[('web', 'allowpull')],
1220 alias=[('web', 'allowpull')],
1221 default=True,
1221 default=True,
1222 )
1222 )
1223 coreconfigitem('web', 'allow-push',
1223 coreconfigitem('web', 'allow-push',
1224 alias=[('web', 'allow_push')],
1224 alias=[('web', 'allow_push')],
1225 default=list,
1225 default=list,
1226 )
1226 )
1227 coreconfigitem('web', 'allowzip',
1227 coreconfigitem('web', 'allowzip',
1228 default=False,
1228 default=False,
1229 )
1229 )
1230 coreconfigitem('web', 'archivesubrepos',
1230 coreconfigitem('web', 'archivesubrepos',
1231 default=False,
1231 default=False,
1232 )
1232 )
1233 coreconfigitem('web', 'cache',
1233 coreconfigitem('web', 'cache',
1234 default=True,
1234 default=True,
1235 )
1235 )
1236 coreconfigitem('web', 'contact',
1236 coreconfigitem('web', 'contact',
1237 default=None,
1237 default=None,
1238 )
1238 )
1239 coreconfigitem('web', 'deny_push',
1239 coreconfigitem('web', 'deny_push',
1240 default=list,
1240 default=list,
1241 )
1241 )
1242 coreconfigitem('web', 'guessmime',
1242 coreconfigitem('web', 'guessmime',
1243 default=False,
1243 default=False,
1244 )
1244 )
1245 coreconfigitem('web', 'hidden',
1245 coreconfigitem('web', 'hidden',
1246 default=False,
1246 default=False,
1247 )
1247 )
1248 coreconfigitem('web', 'labels',
1248 coreconfigitem('web', 'labels',
1249 default=list,
1249 default=list,
1250 )
1250 )
1251 coreconfigitem('web', 'logoimg',
1251 coreconfigitem('web', 'logoimg',
1252 default='hglogo.png',
1252 default='hglogo.png',
1253 )
1253 )
1254 coreconfigitem('web', 'logourl',
1254 coreconfigitem('web', 'logourl',
1255 default='https://mercurial-scm.org/',
1255 default='https://mercurial-scm.org/',
1256 )
1256 )
1257 coreconfigitem('web', 'accesslog',
1257 coreconfigitem('web', 'accesslog',
1258 default='-',
1258 default='-',
1259 )
1259 )
1260 coreconfigitem('web', 'address',
1260 coreconfigitem('web', 'address',
1261 default='',
1261 default='',
1262 )
1262 )
1263 coreconfigitem('web', 'allow-archive',
1263 coreconfigitem('web', 'allow-archive',
1264 alias=[('web', 'allow_archive')],
1264 alias=[('web', 'allow_archive')],
1265 default=list,
1265 default=list,
1266 )
1266 )
1267 coreconfigitem('web', 'allow_read',
1267 coreconfigitem('web', 'allow_read',
1268 default=list,
1268 default=list,
1269 )
1269 )
1270 coreconfigitem('web', 'baseurl',
1270 coreconfigitem('web', 'baseurl',
1271 default=None,
1271 default=None,
1272 )
1272 )
1273 coreconfigitem('web', 'cacerts',
1273 coreconfigitem('web', 'cacerts',
1274 default=None,
1274 default=None,
1275 )
1275 )
1276 coreconfigitem('web', 'certificate',
1276 coreconfigitem('web', 'certificate',
1277 default=None,
1277 default=None,
1278 )
1278 )
1279 coreconfigitem('web', 'collapse',
1279 coreconfigitem('web', 'collapse',
1280 default=False,
1280 default=False,
1281 )
1281 )
1282 coreconfigitem('web', 'csp',
1282 coreconfigitem('web', 'csp',
1283 default=None,
1283 default=None,
1284 )
1284 )
1285 coreconfigitem('web', 'deny_read',
1285 coreconfigitem('web', 'deny_read',
1286 default=list,
1286 default=list,
1287 )
1287 )
1288 coreconfigitem('web', 'descend',
1288 coreconfigitem('web', 'descend',
1289 default=True,
1289 default=True,
1290 )
1290 )
1291 coreconfigitem('web', 'description',
1291 coreconfigitem('web', 'description',
1292 default="",
1292 default="",
1293 )
1293 )
1294 coreconfigitem('web', 'encoding',
1294 coreconfigitem('web', 'encoding',
1295 default=lambda: encoding.encoding,
1295 default=lambda: encoding.encoding,
1296 )
1296 )
1297 coreconfigitem('web', 'errorlog',
1297 coreconfigitem('web', 'errorlog',
1298 default='-',
1298 default='-',
1299 )
1299 )
1300 coreconfigitem('web', 'ipv6',
1300 coreconfigitem('web', 'ipv6',
1301 default=False,
1301 default=False,
1302 )
1302 )
1303 coreconfigitem('web', 'maxchanges',
1303 coreconfigitem('web', 'maxchanges',
1304 default=10,
1304 default=10,
1305 )
1305 )
1306 coreconfigitem('web', 'maxfiles',
1306 coreconfigitem('web', 'maxfiles',
1307 default=10,
1307 default=10,
1308 )
1308 )
1309 coreconfigitem('web', 'maxshortchanges',
1309 coreconfigitem('web', 'maxshortchanges',
1310 default=60,
1310 default=60,
1311 )
1311 )
1312 coreconfigitem('web', 'motd',
1312 coreconfigitem('web', 'motd',
1313 default='',
1313 default='',
1314 )
1314 )
1315 coreconfigitem('web', 'name',
1315 coreconfigitem('web', 'name',
1316 default=dynamicdefault,
1316 default=dynamicdefault,
1317 )
1317 )
1318 coreconfigitem('web', 'port',
1318 coreconfigitem('web', 'port',
1319 default=8000,
1319 default=8000,
1320 )
1320 )
1321 coreconfigitem('web', 'prefix',
1321 coreconfigitem('web', 'prefix',
1322 default='',
1322 default='',
1323 )
1323 )
1324 coreconfigitem('web', 'push_ssl',
1324 coreconfigitem('web', 'push_ssl',
1325 default=True,
1325 default=True,
1326 )
1326 )
1327 coreconfigitem('web', 'refreshinterval',
1327 coreconfigitem('web', 'refreshinterval',
1328 default=20,
1328 default=20,
1329 )
1329 )
1330 coreconfigitem('web', 'server-header',
1330 coreconfigitem('web', 'server-header',
1331 default=None,
1331 default=None,
1332 )
1332 )
1333 coreconfigitem('web', 'staticurl',
1333 coreconfigitem('web', 'staticurl',
1334 default=None,
1334 default=None,
1335 )
1335 )
1336 coreconfigitem('web', 'stripes',
1336 coreconfigitem('web', 'stripes',
1337 default=1,
1337 default=1,
1338 )
1338 )
1339 coreconfigitem('web', 'style',
1339 coreconfigitem('web', 'style',
1340 default='paper',
1340 default='paper',
1341 )
1341 )
1342 coreconfigitem('web', 'templates',
1342 coreconfigitem('web', 'templates',
1343 default=None,
1343 default=None,
1344 )
1344 )
1345 coreconfigitem('web', 'view',
1345 coreconfigitem('web', 'view',
1346 default='served',
1346 default='served',
1347 )
1347 )
1348 coreconfigitem('worker', 'backgroundclose',
1348 coreconfigitem('worker', 'backgroundclose',
1349 default=dynamicdefault,
1349 default=dynamicdefault,
1350 )
1350 )
1351 # Windows defaults to a limit of 512 open files. A buffer of 128
1351 # Windows defaults to a limit of 512 open files. A buffer of 128
1352 # should give us enough headway.
1352 # should give us enough headway.
1353 coreconfigitem('worker', 'backgroundclosemaxqueue',
1353 coreconfigitem('worker', 'backgroundclosemaxqueue',
1354 default=384,
1354 default=384,
1355 )
1355 )
1356 coreconfigitem('worker', 'backgroundcloseminfilecount',
1356 coreconfigitem('worker', 'backgroundcloseminfilecount',
1357 default=2048,
1357 default=2048,
1358 )
1358 )
1359 coreconfigitem('worker', 'backgroundclosethreadcount',
1359 coreconfigitem('worker', 'backgroundclosethreadcount',
1360 default=4,
1360 default=4,
1361 )
1361 )
1362 coreconfigitem('worker', 'enabled',
1362 coreconfigitem('worker', 'enabled',
1363 default=True,
1363 default=True,
1364 )
1364 )
1365 coreconfigitem('worker', 'numcpus',
1365 coreconfigitem('worker', 'numcpus',
1366 default=None,
1366 default=None,
1367 )
1367 )
1368
1368
1369 # Rebase related configuration moved to core because other extension are doing
1369 # Rebase related configuration moved to core because other extension are doing
1370 # strange things. For example, shelve import the extensions to reuse some bit
1370 # strange things. For example, shelve import the extensions to reuse some bit
1371 # without formally loading it.
1371 # without formally loading it.
1372 coreconfigitem('commands', 'rebase.requiredest',
1372 coreconfigitem('commands', 'rebase.requiredest',
1373 default=False,
1373 default=False,
1374 )
1374 )
1375 coreconfigitem('experimental', 'rebaseskipobsolete',
1375 coreconfigitem('experimental', 'rebaseskipobsolete',
1376 default=True,
1376 default=True,
1377 )
1377 )
1378 coreconfigitem('rebase', 'singletransaction',
1378 coreconfigitem('rebase', 'singletransaction',
1379 default=False,
1379 default=False,
1380 )
1380 )
1381 coreconfigitem('rebase', 'experimental.inmemory',
1381 coreconfigitem('rebase', 'experimental.inmemory',
1382 default=False,
1382 default=False,
1383 )
1383 )
@@ -1,2691 +1,2691 b''
1 The Mercurial system uses a set of configuration files to control
1 The Mercurial system uses a set of configuration files to control
2 aspects of its behavior.
2 aspects of its behavior.
3
3
4 Troubleshooting
4 Troubleshooting
5 ===============
5 ===============
6
6
7 If you're having problems with your configuration,
7 If you're having problems with your configuration,
8 :hg:`config --debug` can help you understand what is introducing
8 :hg:`config --debug` can help you understand what is introducing
9 a setting into your environment.
9 a setting into your environment.
10
10
11 See :hg:`help config.syntax` and :hg:`help config.files`
11 See :hg:`help config.syntax` and :hg:`help config.files`
12 for information about how and where to override things.
12 for information about how and where to override things.
13
13
14 Structure
14 Structure
15 =========
15 =========
16
16
17 The configuration files use a simple ini-file format. A configuration
17 The configuration files use a simple ini-file format. A configuration
18 file consists of sections, led by a ``[section]`` header and followed
18 file consists of sections, led by a ``[section]`` header and followed
19 by ``name = value`` entries::
19 by ``name = value`` entries::
20
20
21 [ui]
21 [ui]
22 username = Firstname Lastname <firstname.lastname@example.net>
22 username = Firstname Lastname <firstname.lastname@example.net>
23 verbose = True
23 verbose = True
24
24
25 The above entries will be referred to as ``ui.username`` and
25 The above entries will be referred to as ``ui.username`` and
26 ``ui.verbose``, respectively. See :hg:`help config.syntax`.
26 ``ui.verbose``, respectively. See :hg:`help config.syntax`.
27
27
28 Files
28 Files
29 =====
29 =====
30
30
31 Mercurial reads configuration data from several files, if they exist.
31 Mercurial reads configuration data from several files, if they exist.
32 These files do not exist by default and you will have to create the
32 These files do not exist by default and you will have to create the
33 appropriate configuration files yourself:
33 appropriate configuration files yourself:
34
34
35 Local configuration is put into the per-repository ``<repo>/.hg/hgrc`` file.
35 Local configuration is put into the per-repository ``<repo>/.hg/hgrc`` file.
36
36
37 Global configuration like the username setting is typically put into:
37 Global configuration like the username setting is typically put into:
38
38
39 .. container:: windows
39 .. container:: windows
40
40
41 - ``%USERPROFILE%\mercurial.ini`` (on Windows)
41 - ``%USERPROFILE%\mercurial.ini`` (on Windows)
42
42
43 .. container:: unix.plan9
43 .. container:: unix.plan9
44
44
45 - ``$HOME/.hgrc`` (on Unix, Plan9)
45 - ``$HOME/.hgrc`` (on Unix, Plan9)
46
46
47 The names of these files depend on the system on which Mercurial is
47 The names of these files depend on the system on which Mercurial is
48 installed. ``*.rc`` files from a single directory are read in
48 installed. ``*.rc`` files from a single directory are read in
49 alphabetical order, later ones overriding earlier ones. Where multiple
49 alphabetical order, later ones overriding earlier ones. Where multiple
50 paths are given below, settings from earlier paths override later
50 paths are given below, settings from earlier paths override later
51 ones.
51 ones.
52
52
53 .. container:: verbose.unix
53 .. container:: verbose.unix
54
54
55 On Unix, the following files are consulted:
55 On Unix, the following files are consulted:
56
56
57 - ``<repo>/.hg/hgrc`` (per-repository)
57 - ``<repo>/.hg/hgrc`` (per-repository)
58 - ``$HOME/.hgrc`` (per-user)
58 - ``$HOME/.hgrc`` (per-user)
59 - ``${XDG_CONFIG_HOME:-$HOME/.config}/hg/hgrc`` (per-user)
59 - ``${XDG_CONFIG_HOME:-$HOME/.config}/hg/hgrc`` (per-user)
60 - ``<install-root>/etc/mercurial/hgrc`` (per-installation)
60 - ``<install-root>/etc/mercurial/hgrc`` (per-installation)
61 - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation)
61 - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation)
62 - ``/etc/mercurial/hgrc`` (per-system)
62 - ``/etc/mercurial/hgrc`` (per-system)
63 - ``/etc/mercurial/hgrc.d/*.rc`` (per-system)
63 - ``/etc/mercurial/hgrc.d/*.rc`` (per-system)
64 - ``<internal>/default.d/*.rc`` (defaults)
64 - ``<internal>/default.d/*.rc`` (defaults)
65
65
66 .. container:: verbose.windows
66 .. container:: verbose.windows
67
67
68 On Windows, the following files are consulted:
68 On Windows, the following files are consulted:
69
69
70 - ``<repo>/.hg/hgrc`` (per-repository)
70 - ``<repo>/.hg/hgrc`` (per-repository)
71 - ``%USERPROFILE%\.hgrc`` (per-user)
71 - ``%USERPROFILE%\.hgrc`` (per-user)
72 - ``%USERPROFILE%\Mercurial.ini`` (per-user)
72 - ``%USERPROFILE%\Mercurial.ini`` (per-user)
73 - ``%HOME%\.hgrc`` (per-user)
73 - ``%HOME%\.hgrc`` (per-user)
74 - ``%HOME%\Mercurial.ini`` (per-user)
74 - ``%HOME%\Mercurial.ini`` (per-user)
75 - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-installation)
75 - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-installation)
76 - ``<install-dir>\hgrc.d\*.rc`` (per-installation)
76 - ``<install-dir>\hgrc.d\*.rc`` (per-installation)
77 - ``<install-dir>\Mercurial.ini`` (per-installation)
77 - ``<install-dir>\Mercurial.ini`` (per-installation)
78 - ``<internal>/default.d/*.rc`` (defaults)
78 - ``<internal>/default.d/*.rc`` (defaults)
79
79
80 .. note::
80 .. note::
81
81
82 The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial``
82 The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial``
83 is used when running 32-bit Python on 64-bit Windows.
83 is used when running 32-bit Python on 64-bit Windows.
84
84
85 .. container:: windows
85 .. container:: windows
86
86
87 On Windows 9x, ``%HOME%`` is replaced by ``%APPDATA%``.
87 On Windows 9x, ``%HOME%`` is replaced by ``%APPDATA%``.
88
88
89 .. container:: verbose.plan9
89 .. container:: verbose.plan9
90
90
91 On Plan9, the following files are consulted:
91 On Plan9, the following files are consulted:
92
92
93 - ``<repo>/.hg/hgrc`` (per-repository)
93 - ``<repo>/.hg/hgrc`` (per-repository)
94 - ``$home/lib/hgrc`` (per-user)
94 - ``$home/lib/hgrc`` (per-user)
95 - ``<install-root>/lib/mercurial/hgrc`` (per-installation)
95 - ``<install-root>/lib/mercurial/hgrc`` (per-installation)
96 - ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation)
96 - ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation)
97 - ``/lib/mercurial/hgrc`` (per-system)
97 - ``/lib/mercurial/hgrc`` (per-system)
98 - ``/lib/mercurial/hgrc.d/*.rc`` (per-system)
98 - ``/lib/mercurial/hgrc.d/*.rc`` (per-system)
99 - ``<internal>/default.d/*.rc`` (defaults)
99 - ``<internal>/default.d/*.rc`` (defaults)
100
100
101 Per-repository configuration options only apply in a
101 Per-repository configuration options only apply in a
102 particular repository. This file is not version-controlled, and
102 particular repository. This file is not version-controlled, and
103 will not get transferred during a "clone" operation. Options in
103 will not get transferred during a "clone" operation. Options in
104 this file override options in all other configuration files.
104 this file override options in all other configuration files.
105
105
106 .. container:: unix.plan9
106 .. container:: unix.plan9
107
107
108 On Plan 9 and Unix, most of this file will be ignored if it doesn't
108 On Plan 9 and Unix, most of this file will be ignored if it doesn't
109 belong to a trusted user or to a trusted group. See
109 belong to a trusted user or to a trusted group. See
110 :hg:`help config.trusted` for more details.
110 :hg:`help config.trusted` for more details.
111
111
112 Per-user configuration file(s) are for the user running Mercurial. Options
112 Per-user configuration file(s) are for the user running Mercurial. Options
113 in these files apply to all Mercurial commands executed by this user in any
113 in these files apply to all Mercurial commands executed by this user in any
114 directory. Options in these files override per-system and per-installation
114 directory. Options in these files override per-system and per-installation
115 options.
115 options.
116
116
117 Per-installation configuration files are searched for in the
117 Per-installation configuration files are searched for in the
118 directory where Mercurial is installed. ``<install-root>`` is the
118 directory where Mercurial is installed. ``<install-root>`` is the
119 parent directory of the **hg** executable (or symlink) being run.
119 parent directory of the **hg** executable (or symlink) being run.
120
120
121 .. container:: unix.plan9
121 .. container:: unix.plan9
122
122
123 For example, if installed in ``/shared/tools/bin/hg``, Mercurial
123 For example, if installed in ``/shared/tools/bin/hg``, Mercurial
124 will look in ``/shared/tools/etc/mercurial/hgrc``. Options in these
124 will look in ``/shared/tools/etc/mercurial/hgrc``. Options in these
125 files apply to all Mercurial commands executed by any user in any
125 files apply to all Mercurial commands executed by any user in any
126 directory.
126 directory.
127
127
128 Per-installation configuration files are for the system on
128 Per-installation configuration files are for the system on
129 which Mercurial is running. Options in these files apply to all
129 which Mercurial is running. Options in these files apply to all
130 Mercurial commands executed by any user in any directory. Registry
130 Mercurial commands executed by any user in any directory. Registry
131 keys contain PATH-like strings, every part of which must reference
131 keys contain PATH-like strings, every part of which must reference
132 a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will
132 a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will
133 be read. Mercurial checks each of these locations in the specified
133 be read. Mercurial checks each of these locations in the specified
134 order until one or more configuration files are detected.
134 order until one or more configuration files are detected.
135
135
136 Per-system configuration files are for the system on which Mercurial
136 Per-system configuration files are for the system on which Mercurial
137 is running. Options in these files apply to all Mercurial commands
137 is running. Options in these files apply to all Mercurial commands
138 executed by any user in any directory. Options in these files
138 executed by any user in any directory. Options in these files
139 override per-installation options.
139 override per-installation options.
140
140
141 Mercurial comes with some default configuration. The default configuration
141 Mercurial comes with some default configuration. The default configuration
142 files are installed with Mercurial and will be overwritten on upgrades. Default
142 files are installed with Mercurial and will be overwritten on upgrades. Default
143 configuration files should never be edited by users or administrators but can
143 configuration files should never be edited by users or administrators but can
144 be overridden in other configuration files. So far the directory only contains
144 be overridden in other configuration files. So far the directory only contains
145 merge tool configuration but packagers can also put other default configuration
145 merge tool configuration but packagers can also put other default configuration
146 there.
146 there.
147
147
148 Syntax
148 Syntax
149 ======
149 ======
150
150
151 A configuration file consists of sections, led by a ``[section]`` header
151 A configuration file consists of sections, led by a ``[section]`` header
152 and followed by ``name = value`` entries (sometimes called
152 and followed by ``name = value`` entries (sometimes called
153 ``configuration keys``)::
153 ``configuration keys``)::
154
154
155 [spam]
155 [spam]
156 eggs=ham
156 eggs=ham
157 green=
157 green=
158 eggs
158 eggs
159
159
160 Each line contains one entry. If the lines that follow are indented,
160 Each line contains one entry. If the lines that follow are indented,
161 they are treated as continuations of that entry. Leading whitespace is
161 they are treated as continuations of that entry. Leading whitespace is
162 removed from values. Empty lines are skipped. Lines beginning with
162 removed from values. Empty lines are skipped. Lines beginning with
163 ``#`` or ``;`` are ignored and may be used to provide comments.
163 ``#`` or ``;`` are ignored and may be used to provide comments.
164
164
165 Configuration keys can be set multiple times, in which case Mercurial
165 Configuration keys can be set multiple times, in which case Mercurial
166 will use the value that was configured last. As an example::
166 will use the value that was configured last. As an example::
167
167
168 [spam]
168 [spam]
169 eggs=large
169 eggs=large
170 ham=serrano
170 ham=serrano
171 eggs=small
171 eggs=small
172
172
173 This would set the configuration key named ``eggs`` to ``small``.
173 This would set the configuration key named ``eggs`` to ``small``.
174
174
175 It is also possible to define a section multiple times. A section can
175 It is also possible to define a section multiple times. A section can
176 be redefined on the same and/or on different configuration files. For
176 be redefined on the same and/or on different configuration files. For
177 example::
177 example::
178
178
179 [foo]
179 [foo]
180 eggs=large
180 eggs=large
181 ham=serrano
181 ham=serrano
182 eggs=small
182 eggs=small
183
183
184 [bar]
184 [bar]
185 eggs=ham
185 eggs=ham
186 green=
186 green=
187 eggs
187 eggs
188
188
189 [foo]
189 [foo]
190 ham=prosciutto
190 ham=prosciutto
191 eggs=medium
191 eggs=medium
192 bread=toasted
192 bread=toasted
193
193
194 This would set the ``eggs``, ``ham``, and ``bread`` configuration keys
194 This would set the ``eggs``, ``ham``, and ``bread`` configuration keys
195 of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``,
195 of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``,
196 respectively. As you can see there only thing that matters is the last
196 respectively. As you can see there only thing that matters is the last
197 value that was set for each of the configuration keys.
197 value that was set for each of the configuration keys.
198
198
199 If a configuration key is set multiple times in different
199 If a configuration key is set multiple times in different
200 configuration files the final value will depend on the order in which
200 configuration files the final value will depend on the order in which
201 the different configuration files are read, with settings from earlier
201 the different configuration files are read, with settings from earlier
202 paths overriding later ones as described on the ``Files`` section
202 paths overriding later ones as described on the ``Files`` section
203 above.
203 above.
204
204
205 A line of the form ``%include file`` will include ``file`` into the
205 A line of the form ``%include file`` will include ``file`` into the
206 current configuration file. The inclusion is recursive, which means
206 current configuration file. The inclusion is recursive, which means
207 that included files can include other files. Filenames are relative to
207 that included files can include other files. Filenames are relative to
208 the configuration file in which the ``%include`` directive is found.
208 the configuration file in which the ``%include`` directive is found.
209 Environment variables and ``~user`` constructs are expanded in
209 Environment variables and ``~user`` constructs are expanded in
210 ``file``. This lets you do something like::
210 ``file``. This lets you do something like::
211
211
212 %include ~/.hgrc.d/$HOST.rc
212 %include ~/.hgrc.d/$HOST.rc
213
213
214 to include a different configuration file on each computer you use.
214 to include a different configuration file on each computer you use.
215
215
216 A line with ``%unset name`` will remove ``name`` from the current
216 A line with ``%unset name`` will remove ``name`` from the current
217 section, if it has been set previously.
217 section, if it has been set previously.
218
218
219 The values are either free-form text strings, lists of text strings,
219 The values are either free-form text strings, lists of text strings,
220 or Boolean values. Boolean values can be set to true using any of "1",
220 or Boolean values. Boolean values can be set to true using any of "1",
221 "yes", "true", or "on" and to false using "0", "no", "false", or "off"
221 "yes", "true", or "on" and to false using "0", "no", "false", or "off"
222 (all case insensitive).
222 (all case insensitive).
223
223
224 List values are separated by whitespace or comma, except when values are
224 List values are separated by whitespace or comma, except when values are
225 placed in double quotation marks::
225 placed in double quotation marks::
226
226
227 allow_read = "John Doe, PhD", brian, betty
227 allow_read = "John Doe, PhD", brian, betty
228
228
229 Quotation marks can be escaped by prefixing them with a backslash. Only
229 Quotation marks can be escaped by prefixing them with a backslash. Only
230 quotation marks at the beginning of a word is counted as a quotation
230 quotation marks at the beginning of a word is counted as a quotation
231 (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``).
231 (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``).
232
232
233 Sections
233 Sections
234 ========
234 ========
235
235
236 This section describes the different sections that may appear in a
236 This section describes the different sections that may appear in a
237 Mercurial configuration file, the purpose of each section, its possible
237 Mercurial configuration file, the purpose of each section, its possible
238 keys, and their possible values.
238 keys, and their possible values.
239
239
240 ``alias``
240 ``alias``
241 ---------
241 ---------
242
242
243 Defines command aliases.
243 Defines command aliases.
244
244
245 Aliases allow you to define your own commands in terms of other
245 Aliases allow you to define your own commands in terms of other
246 commands (or aliases), optionally including arguments. Positional
246 commands (or aliases), optionally including arguments. Positional
247 arguments in the form of ``$1``, ``$2``, etc. in the alias definition
247 arguments in the form of ``$1``, ``$2``, etc. in the alias definition
248 are expanded by Mercurial before execution. Positional arguments not
248 are expanded by Mercurial before execution. Positional arguments not
249 already used by ``$N`` in the definition are put at the end of the
249 already used by ``$N`` in the definition are put at the end of the
250 command to be executed.
250 command to be executed.
251
251
252 Alias definitions consist of lines of the form::
252 Alias definitions consist of lines of the form::
253
253
254 <alias> = <command> [<argument>]...
254 <alias> = <command> [<argument>]...
255
255
256 For example, this definition::
256 For example, this definition::
257
257
258 latest = log --limit 5
258 latest = log --limit 5
259
259
260 creates a new command ``latest`` that shows only the five most recent
260 creates a new command ``latest`` that shows only the five most recent
261 changesets. You can define subsequent aliases using earlier ones::
261 changesets. You can define subsequent aliases using earlier ones::
262
262
263 stable5 = latest -b stable
263 stable5 = latest -b stable
264
264
265 .. note::
265 .. note::
266
266
267 It is possible to create aliases with the same names as
267 It is possible to create aliases with the same names as
268 existing commands, which will then override the original
268 existing commands, which will then override the original
269 definitions. This is almost always a bad idea!
269 definitions. This is almost always a bad idea!
270
270
271 An alias can start with an exclamation point (``!``) to make it a
271 An alias can start with an exclamation point (``!``) to make it a
272 shell alias. A shell alias is executed with the shell and will let you
272 shell alias. A shell alias is executed with the shell and will let you
273 run arbitrary commands. As an example, ::
273 run arbitrary commands. As an example, ::
274
274
275 echo = !echo $@
275 echo = !echo $@
276
276
277 will let you do ``hg echo foo`` to have ``foo`` printed in your
277 will let you do ``hg echo foo`` to have ``foo`` printed in your
278 terminal. A better example might be::
278 terminal. A better example might be::
279
279
280 purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm -f
280 purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm -f
281
281
282 which will make ``hg purge`` delete all unknown files in the
282 which will make ``hg purge`` delete all unknown files in the
283 repository in the same manner as the purge extension.
283 repository in the same manner as the purge extension.
284
284
285 Positional arguments like ``$1``, ``$2``, etc. in the alias definition
285 Positional arguments like ``$1``, ``$2``, etc. in the alias definition
286 expand to the command arguments. Unmatched arguments are
286 expand to the command arguments. Unmatched arguments are
287 removed. ``$0`` expands to the alias name and ``$@`` expands to all
287 removed. ``$0`` expands to the alias name and ``$@`` expands to all
288 arguments separated by a space. ``"$@"`` (with quotes) expands to all
288 arguments separated by a space. ``"$@"`` (with quotes) expands to all
289 arguments quoted individually and separated by a space. These expansions
289 arguments quoted individually and separated by a space. These expansions
290 happen before the command is passed to the shell.
290 happen before the command is passed to the shell.
291
291
292 Shell aliases are executed in an environment where ``$HG`` expands to
292 Shell aliases are executed in an environment where ``$HG`` expands to
293 the path of the Mercurial that was used to execute the alias. This is
293 the path of the Mercurial that was used to execute the alias. This is
294 useful when you want to call further Mercurial commands in a shell
294 useful when you want to call further Mercurial commands in a shell
295 alias, as was done above for the purge alias. In addition,
295 alias, as was done above for the purge alias. In addition,
296 ``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg
296 ``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg
297 echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``.
297 echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``.
298
298
299 .. note::
299 .. note::
300
300
301 Some global configuration options such as ``-R`` are
301 Some global configuration options such as ``-R`` are
302 processed before shell aliases and will thus not be passed to
302 processed before shell aliases and will thus not be passed to
303 aliases.
303 aliases.
304
304
305
305
306 ``annotate``
306 ``annotate``
307 ------------
307 ------------
308
308
309 Settings used when displaying file annotations. All values are
309 Settings used when displaying file annotations. All values are
310 Booleans and default to False. See :hg:`help config.diff` for
310 Booleans and default to False. See :hg:`help config.diff` for
311 related options for the diff command.
311 related options for the diff command.
312
312
313 ``ignorews``
313 ``ignorews``
314 Ignore white space when comparing lines.
314 Ignore white space when comparing lines.
315
315
316 ``ignorewseol``
316 ``ignorewseol``
317 Ignore white space at the end of a line when comparing lines.
317 Ignore white space at the end of a line when comparing lines.
318
318
319 ``ignorewsamount``
319 ``ignorewsamount``
320 Ignore changes in the amount of white space.
320 Ignore changes in the amount of white space.
321
321
322 ``ignoreblanklines``
322 ``ignoreblanklines``
323 Ignore changes whose lines are all blank.
323 Ignore changes whose lines are all blank.
324
324
325
325
326 ``auth``
326 ``auth``
327 --------
327 --------
328
328
329 Authentication credentials and other authentication-like configuration
329 Authentication credentials and other authentication-like configuration
330 for HTTP connections. This section allows you to store usernames and
330 for HTTP connections. This section allows you to store usernames and
331 passwords for use when logging *into* HTTP servers. See
331 passwords for use when logging *into* HTTP servers. See
332 :hg:`help config.web` if you want to configure *who* can login to
332 :hg:`help config.web` if you want to configure *who* can login to
333 your HTTP server.
333 your HTTP server.
334
334
335 The following options apply to all hosts.
335 The following options apply to all hosts.
336
336
337 ``cookiefile``
337 ``cookiefile``
338 Path to a file containing HTTP cookie lines. Cookies matching a
338 Path to a file containing HTTP cookie lines. Cookies matching a
339 host will be sent automatically.
339 host will be sent automatically.
340
340
341 The file format uses the Mozilla cookies.txt format, which defines cookies
341 The file format uses the Mozilla cookies.txt format, which defines cookies
342 on their own lines. Each line contains 7 fields delimited by the tab
342 on their own lines. Each line contains 7 fields delimited by the tab
343 character (domain, is_domain_cookie, path, is_secure, expires, name,
343 character (domain, is_domain_cookie, path, is_secure, expires, name,
344 value). For more info, do an Internet search for "Netscape cookies.txt
344 value). For more info, do an Internet search for "Netscape cookies.txt
345 format."
345 format."
346
346
347 Note: the cookies parser does not handle port numbers on domains. You
347 Note: the cookies parser does not handle port numbers on domains. You
348 will need to remove ports from the domain for the cookie to be recognized.
348 will need to remove ports from the domain for the cookie to be recognized.
349 This could result in a cookie being disclosed to an unwanted server.
349 This could result in a cookie being disclosed to an unwanted server.
350
350
351 The cookies file is read-only.
351 The cookies file is read-only.
352
352
353 Other options in this section are grouped by name and have the following
353 Other options in this section are grouped by name and have the following
354 format::
354 format::
355
355
356 <name>.<argument> = <value>
356 <name>.<argument> = <value>
357
357
358 where ``<name>`` is used to group arguments into authentication
358 where ``<name>`` is used to group arguments into authentication
359 entries. Example::
359 entries. Example::
360
360
361 foo.prefix = hg.intevation.de/mercurial
361 foo.prefix = hg.intevation.de/mercurial
362 foo.username = foo
362 foo.username = foo
363 foo.password = bar
363 foo.password = bar
364 foo.schemes = http https
364 foo.schemes = http https
365
365
366 bar.prefix = secure.example.org
366 bar.prefix = secure.example.org
367 bar.key = path/to/file.key
367 bar.key = path/to/file.key
368 bar.cert = path/to/file.cert
368 bar.cert = path/to/file.cert
369 bar.schemes = https
369 bar.schemes = https
370
370
371 Supported arguments:
371 Supported arguments:
372
372
373 ``prefix``
373 ``prefix``
374 Either ``*`` or a URI prefix with or without the scheme part.
374 Either ``*`` or a URI prefix with or without the scheme part.
375 The authentication entry with the longest matching prefix is used
375 The authentication entry with the longest matching prefix is used
376 (where ``*`` matches everything and counts as a match of length
376 (where ``*`` matches everything and counts as a match of length
377 1). If the prefix doesn't include a scheme, the match is performed
377 1). If the prefix doesn't include a scheme, the match is performed
378 against the URI with its scheme stripped as well, and the schemes
378 against the URI with its scheme stripped as well, and the schemes
379 argument, q.v., is then subsequently consulted.
379 argument, q.v., is then subsequently consulted.
380
380
381 ``username``
381 ``username``
382 Optional. Username to authenticate with. If not given, and the
382 Optional. Username to authenticate with. If not given, and the
383 remote site requires basic or digest authentication, the user will
383 remote site requires basic or digest authentication, the user will
384 be prompted for it. Environment variables are expanded in the
384 be prompted for it. Environment variables are expanded in the
385 username letting you do ``foo.username = $USER``. If the URI
385 username letting you do ``foo.username = $USER``. If the URI
386 includes a username, only ``[auth]`` entries with a matching
386 includes a username, only ``[auth]`` entries with a matching
387 username or without a username will be considered.
387 username or without a username will be considered.
388
388
389 ``password``
389 ``password``
390 Optional. Password to authenticate with. If not given, and the
390 Optional. Password to authenticate with. If not given, and the
391 remote site requires basic or digest authentication, the user
391 remote site requires basic or digest authentication, the user
392 will be prompted for it.
392 will be prompted for it.
393
393
394 ``key``
394 ``key``
395 Optional. PEM encoded client certificate key file. Environment
395 Optional. PEM encoded client certificate key file. Environment
396 variables are expanded in the filename.
396 variables are expanded in the filename.
397
397
398 ``cert``
398 ``cert``
399 Optional. PEM encoded client certificate chain file. Environment
399 Optional. PEM encoded client certificate chain file. Environment
400 variables are expanded in the filename.
400 variables are expanded in the filename.
401
401
402 ``schemes``
402 ``schemes``
403 Optional. Space separated list of URI schemes to use this
403 Optional. Space separated list of URI schemes to use this
404 authentication entry with. Only used if the prefix doesn't include
404 authentication entry with. Only used if the prefix doesn't include
405 a scheme. Supported schemes are http and https. They will match
405 a scheme. Supported schemes are http and https. They will match
406 static-http and static-https respectively, as well.
406 static-http and static-https respectively, as well.
407 (default: https)
407 (default: https)
408
408
409 If no suitable authentication entry is found, the user is prompted
409 If no suitable authentication entry is found, the user is prompted
410 for credentials as usual if required by the remote.
410 for credentials as usual if required by the remote.
411
411
412 ``color``
412 ``color``
413 ---------
413 ---------
414
414
415 Configure the Mercurial color mode. For details about how to define your custom
415 Configure the Mercurial color mode. For details about how to define your custom
416 effect and style see :hg:`help color`.
416 effect and style see :hg:`help color`.
417
417
418 ``mode``
418 ``mode``
419 String: control the method used to output color. One of ``auto``, ``ansi``,
419 String: control the method used to output color. One of ``auto``, ``ansi``,
420 ``win32``, ``terminfo`` or ``debug``. In auto mode, Mercurial will
420 ``win32``, ``terminfo`` or ``debug``. In auto mode, Mercurial will
421 use ANSI mode by default (or win32 mode prior to Windows 10) if it detects a
421 use ANSI mode by default (or win32 mode prior to Windows 10) if it detects a
422 terminal. Any invalid value will disable color.
422 terminal. Any invalid value will disable color.
423
423
424 ``pagermode``
424 ``pagermode``
425 String: optional override of ``color.mode`` used with pager.
425 String: optional override of ``color.mode`` used with pager.
426
426
427 On some systems, terminfo mode may cause problems when using
427 On some systems, terminfo mode may cause problems when using
428 color with ``less -R`` as a pager program. less with the -R option
428 color with ``less -R`` as a pager program. less with the -R option
429 will only display ECMA-48 color codes, and terminfo mode may sometimes
429 will only display ECMA-48 color codes, and terminfo mode may sometimes
430 emit codes that less doesn't understand. You can work around this by
430 emit codes that less doesn't understand. You can work around this by
431 either using ansi mode (or auto mode), or by using less -r (which will
431 either using ansi mode (or auto mode), or by using less -r (which will
432 pass through all terminal control codes, not just color control
432 pass through all terminal control codes, not just color control
433 codes).
433 codes).
434
434
435 On some systems (such as MSYS in Windows), the terminal may support
435 On some systems (such as MSYS in Windows), the terminal may support
436 a different color mode than the pager program.
436 a different color mode than the pager program.
437
437
438 ``commands``
438 ``commands``
439 ------------
439 ------------
440
440
441 ``status.relative``
441 ``status.relative``
442 Make paths in :hg:`status` output relative to the current directory.
442 Make paths in :hg:`status` output relative to the current directory.
443 (default: False)
443 (default: False)
444
444
445 ``status.terse``
445 ``status.terse``
446 Default value for the --terse flag, which condenes status output.
446 Default value for the --terse flag, which condenes status output.
447 (default: empty)
447 (default: empty)
448
448
449 ``update.check``
449 ``update.check``
450 Determines what level of checking :hg:`update` will perform before moving
450 Determines what level of checking :hg:`update` will perform before moving
451 to a destination revision. Valid values are ``abort``, ``none``,
451 to a destination revision. Valid values are ``abort``, ``none``,
452 ``linear``, and ``noconflict``. ``abort`` always fails if the working
452 ``linear``, and ``noconflict``. ``abort`` always fails if the working
453 directory has uncommitted changes. ``none`` performs no checking, and may
453 directory has uncommitted changes. ``none`` performs no checking, and may
454 result in a merge with uncommitted changes. ``linear`` allows any update
454 result in a merge with uncommitted changes. ``linear`` allows any update
455 as long as it follows a straight line in the revision history, and may
455 as long as it follows a straight line in the revision history, and may
456 trigger a merge with uncommitted changes. ``noconflict`` will allow any
456 trigger a merge with uncommitted changes. ``noconflict`` will allow any
457 update which would not trigger a merge with uncommitted changes, if any
457 update which would not trigger a merge with uncommitted changes, if any
458 are present.
458 are present.
459 (default: ``linear``)
459 (default: ``linear``)
460
460
461 ``update.requiredest``
461 ``update.requiredest``
462 Require that the user pass a destination when running :hg:`update`.
462 Require that the user pass a destination when running :hg:`update`.
463 For example, :hg:`update .::` will be allowed, but a plain :hg:`update`
463 For example, :hg:`update .::` will be allowed, but a plain :hg:`update`
464 will be disallowed.
464 will be disallowed.
465 (default: False)
465 (default: False)
466
466
467 ``committemplate``
467 ``committemplate``
468 ------------------
468 ------------------
469
469
470 ``changeset``
470 ``changeset``
471 String: configuration in this section is used as the template to
471 String: configuration in this section is used as the template to
472 customize the text shown in the editor when committing.
472 customize the text shown in the editor when committing.
473
473
474 In addition to pre-defined template keywords, commit log specific one
474 In addition to pre-defined template keywords, commit log specific one
475 below can be used for customization:
475 below can be used for customization:
476
476
477 ``extramsg``
477 ``extramsg``
478 String: Extra message (typically 'Leave message empty to abort
478 String: Extra message (typically 'Leave message empty to abort
479 commit.'). This may be changed by some commands or extensions.
479 commit.'). This may be changed by some commands or extensions.
480
480
481 For example, the template configuration below shows as same text as
481 For example, the template configuration below shows as same text as
482 one shown by default::
482 one shown by default::
483
483
484 [committemplate]
484 [committemplate]
485 changeset = {desc}\n\n
485 changeset = {desc}\n\n
486 HG: Enter commit message. Lines beginning with 'HG:' are removed.
486 HG: Enter commit message. Lines beginning with 'HG:' are removed.
487 HG: {extramsg}
487 HG: {extramsg}
488 HG: --
488 HG: --
489 HG: user: {author}\n{ifeq(p2rev, "-1", "",
489 HG: user: {author}\n{ifeq(p2rev, "-1", "",
490 "HG: branch merge\n")
490 "HG: branch merge\n")
491 }HG: branch '{branch}'\n{if(activebookmark,
491 }HG: branch '{branch}'\n{if(activebookmark,
492 "HG: bookmark '{activebookmark}'\n") }{subrepos %
492 "HG: bookmark '{activebookmark}'\n") }{subrepos %
493 "HG: subrepo {subrepo}\n" }{file_adds %
493 "HG: subrepo {subrepo}\n" }{file_adds %
494 "HG: added {file}\n" }{file_mods %
494 "HG: added {file}\n" }{file_mods %
495 "HG: changed {file}\n" }{file_dels %
495 "HG: changed {file}\n" }{file_dels %
496 "HG: removed {file}\n" }{if(files, "",
496 "HG: removed {file}\n" }{if(files, "",
497 "HG: no files changed\n")}
497 "HG: no files changed\n")}
498
498
499 ``diff()``
499 ``diff()``
500 String: show the diff (see :hg:`help templates` for detail)
500 String: show the diff (see :hg:`help templates` for detail)
501
501
502 Sometimes it is helpful to show the diff of the changeset in the editor without
502 Sometimes it is helpful to show the diff of the changeset in the editor without
503 having to prefix 'HG: ' to each line so that highlighting works correctly. For
503 having to prefix 'HG: ' to each line so that highlighting works correctly. For
504 this, Mercurial provides a special string which will ignore everything below
504 this, Mercurial provides a special string which will ignore everything below
505 it::
505 it::
506
506
507 HG: ------------------------ >8 ------------------------
507 HG: ------------------------ >8 ------------------------
508
508
509 For example, the template configuration below will show the diff below the
509 For example, the template configuration below will show the diff below the
510 extra message::
510 extra message::
511
511
512 [committemplate]
512 [committemplate]
513 changeset = {desc}\n\n
513 changeset = {desc}\n\n
514 HG: Enter commit message. Lines beginning with 'HG:' are removed.
514 HG: Enter commit message. Lines beginning with 'HG:' are removed.
515 HG: {extramsg}
515 HG: {extramsg}
516 HG: ------------------------ >8 ------------------------
516 HG: ------------------------ >8 ------------------------
517 HG: Do not touch the line above.
517 HG: Do not touch the line above.
518 HG: Everything below will be removed.
518 HG: Everything below will be removed.
519 {diff()}
519 {diff()}
520
520
521 .. note::
521 .. note::
522
522
523 For some problematic encodings (see :hg:`help win32mbcs` for
523 For some problematic encodings (see :hg:`help win32mbcs` for
524 detail), this customization should be configured carefully, to
524 detail), this customization should be configured carefully, to
525 avoid showing broken characters.
525 avoid showing broken characters.
526
526
527 For example, if a multibyte character ending with backslash (0x5c) is
527 For example, if a multibyte character ending with backslash (0x5c) is
528 followed by the ASCII character 'n' in the customized template,
528 followed by the ASCII character 'n' in the customized template,
529 the sequence of backslash and 'n' is treated as line-feed unexpectedly
529 the sequence of backslash and 'n' is treated as line-feed unexpectedly
530 (and the multibyte character is broken, too).
530 (and the multibyte character is broken, too).
531
531
532 Customized template is used for commands below (``--edit`` may be
532 Customized template is used for commands below (``--edit`` may be
533 required):
533 required):
534
534
535 - :hg:`backout`
535 - :hg:`backout`
536 - :hg:`commit`
536 - :hg:`commit`
537 - :hg:`fetch` (for merge commit only)
537 - :hg:`fetch` (for merge commit only)
538 - :hg:`graft`
538 - :hg:`graft`
539 - :hg:`histedit`
539 - :hg:`histedit`
540 - :hg:`import`
540 - :hg:`import`
541 - :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh`
541 - :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh`
542 - :hg:`rebase`
542 - :hg:`rebase`
543 - :hg:`shelve`
543 - :hg:`shelve`
544 - :hg:`sign`
544 - :hg:`sign`
545 - :hg:`tag`
545 - :hg:`tag`
546 - :hg:`transplant`
546 - :hg:`transplant`
547
547
548 Configuring items below instead of ``changeset`` allows showing
548 Configuring items below instead of ``changeset`` allows showing
549 customized message only for specific actions, or showing different
549 customized message only for specific actions, or showing different
550 messages for each action.
550 messages for each action.
551
551
552 - ``changeset.backout`` for :hg:`backout`
552 - ``changeset.backout`` for :hg:`backout`
553 - ``changeset.commit.amend.merge`` for :hg:`commit --amend` on merges
553 - ``changeset.commit.amend.merge`` for :hg:`commit --amend` on merges
554 - ``changeset.commit.amend.normal`` for :hg:`commit --amend` on other
554 - ``changeset.commit.amend.normal`` for :hg:`commit --amend` on other
555 - ``changeset.commit.normal.merge`` for :hg:`commit` on merges
555 - ``changeset.commit.normal.merge`` for :hg:`commit` on merges
556 - ``changeset.commit.normal.normal`` for :hg:`commit` on other
556 - ``changeset.commit.normal.normal`` for :hg:`commit` on other
557 - ``changeset.fetch`` for :hg:`fetch` (impling merge commit)
557 - ``changeset.fetch`` for :hg:`fetch` (impling merge commit)
558 - ``changeset.gpg.sign`` for :hg:`sign`
558 - ``changeset.gpg.sign`` for :hg:`sign`
559 - ``changeset.graft`` for :hg:`graft`
559 - ``changeset.graft`` for :hg:`graft`
560 - ``changeset.histedit.edit`` for ``edit`` of :hg:`histedit`
560 - ``changeset.histedit.edit`` for ``edit`` of :hg:`histedit`
561 - ``changeset.histedit.fold`` for ``fold`` of :hg:`histedit`
561 - ``changeset.histedit.fold`` for ``fold`` of :hg:`histedit`
562 - ``changeset.histedit.mess`` for ``mess`` of :hg:`histedit`
562 - ``changeset.histedit.mess`` for ``mess`` of :hg:`histedit`
563 - ``changeset.histedit.pick`` for ``pick`` of :hg:`histedit`
563 - ``changeset.histedit.pick`` for ``pick`` of :hg:`histedit`
564 - ``changeset.import.bypass`` for :hg:`import --bypass`
564 - ``changeset.import.bypass`` for :hg:`import --bypass`
565 - ``changeset.import.normal.merge`` for :hg:`import` on merges
565 - ``changeset.import.normal.merge`` for :hg:`import` on merges
566 - ``changeset.import.normal.normal`` for :hg:`import` on other
566 - ``changeset.import.normal.normal`` for :hg:`import` on other
567 - ``changeset.mq.qnew`` for :hg:`qnew`
567 - ``changeset.mq.qnew`` for :hg:`qnew`
568 - ``changeset.mq.qfold`` for :hg:`qfold`
568 - ``changeset.mq.qfold`` for :hg:`qfold`
569 - ``changeset.mq.qrefresh`` for :hg:`qrefresh`
569 - ``changeset.mq.qrefresh`` for :hg:`qrefresh`
570 - ``changeset.rebase.collapse`` for :hg:`rebase --collapse`
570 - ``changeset.rebase.collapse`` for :hg:`rebase --collapse`
571 - ``changeset.rebase.merge`` for :hg:`rebase` on merges
571 - ``changeset.rebase.merge`` for :hg:`rebase` on merges
572 - ``changeset.rebase.normal`` for :hg:`rebase` on other
572 - ``changeset.rebase.normal`` for :hg:`rebase` on other
573 - ``changeset.shelve.shelve`` for :hg:`shelve`
573 - ``changeset.shelve.shelve`` for :hg:`shelve`
574 - ``changeset.tag.add`` for :hg:`tag` without ``--remove``
574 - ``changeset.tag.add`` for :hg:`tag` without ``--remove``
575 - ``changeset.tag.remove`` for :hg:`tag --remove`
575 - ``changeset.tag.remove`` for :hg:`tag --remove`
576 - ``changeset.transplant.merge`` for :hg:`transplant` on merges
576 - ``changeset.transplant.merge`` for :hg:`transplant` on merges
577 - ``changeset.transplant.normal`` for :hg:`transplant` on other
577 - ``changeset.transplant.normal`` for :hg:`transplant` on other
578
578
579 These dot-separated lists of names are treated as hierarchical ones.
579 These dot-separated lists of names are treated as hierarchical ones.
580 For example, ``changeset.tag.remove`` customizes the commit message
580 For example, ``changeset.tag.remove`` customizes the commit message
581 only for :hg:`tag --remove`, but ``changeset.tag`` customizes the
581 only for :hg:`tag --remove`, but ``changeset.tag`` customizes the
582 commit message for :hg:`tag` regardless of ``--remove`` option.
582 commit message for :hg:`tag` regardless of ``--remove`` option.
583
583
584 When the external editor is invoked for a commit, the corresponding
584 When the external editor is invoked for a commit, the corresponding
585 dot-separated list of names without the ``changeset.`` prefix
585 dot-separated list of names without the ``changeset.`` prefix
586 (e.g. ``commit.normal.normal``) is in the ``HGEDITFORM`` environment
586 (e.g. ``commit.normal.normal``) is in the ``HGEDITFORM`` environment
587 variable.
587 variable.
588
588
589 In this section, items other than ``changeset`` can be referred from
589 In this section, items other than ``changeset`` can be referred from
590 others. For example, the configuration to list committed files up
590 others. For example, the configuration to list committed files up
591 below can be referred as ``{listupfiles}``::
591 below can be referred as ``{listupfiles}``::
592
592
593 [committemplate]
593 [committemplate]
594 listupfiles = {file_adds %
594 listupfiles = {file_adds %
595 "HG: added {file}\n" }{file_mods %
595 "HG: added {file}\n" }{file_mods %
596 "HG: changed {file}\n" }{file_dels %
596 "HG: changed {file}\n" }{file_dels %
597 "HG: removed {file}\n" }{if(files, "",
597 "HG: removed {file}\n" }{if(files, "",
598 "HG: no files changed\n")}
598 "HG: no files changed\n")}
599
599
600 ``decode/encode``
600 ``decode/encode``
601 -----------------
601 -----------------
602
602
603 Filters for transforming files on checkout/checkin. This would
603 Filters for transforming files on checkout/checkin. This would
604 typically be used for newline processing or other
604 typically be used for newline processing or other
605 localization/canonicalization of files.
605 localization/canonicalization of files.
606
606
607 Filters consist of a filter pattern followed by a filter command.
607 Filters consist of a filter pattern followed by a filter command.
608 Filter patterns are globs by default, rooted at the repository root.
608 Filter patterns are globs by default, rooted at the repository root.
609 For example, to match any file ending in ``.txt`` in the root
609 For example, to match any file ending in ``.txt`` in the root
610 directory only, use the pattern ``*.txt``. To match any file ending
610 directory only, use the pattern ``*.txt``. To match any file ending
611 in ``.c`` anywhere in the repository, use the pattern ``**.c``.
611 in ``.c`` anywhere in the repository, use the pattern ``**.c``.
612 For each file only the first matching filter applies.
612 For each file only the first matching filter applies.
613
613
614 The filter command can start with a specifier, either ``pipe:`` or
614 The filter command can start with a specifier, either ``pipe:`` or
615 ``tempfile:``. If no specifier is given, ``pipe:`` is used by default.
615 ``tempfile:``. If no specifier is given, ``pipe:`` is used by default.
616
616
617 A ``pipe:`` command must accept data on stdin and return the transformed
617 A ``pipe:`` command must accept data on stdin and return the transformed
618 data on stdout.
618 data on stdout.
619
619
620 Pipe example::
620 Pipe example::
621
621
622 [encode]
622 [encode]
623 # uncompress gzip files on checkin to improve delta compression
623 # uncompress gzip files on checkin to improve delta compression
624 # note: not necessarily a good idea, just an example
624 # note: not necessarily a good idea, just an example
625 *.gz = pipe: gunzip
625 *.gz = pipe: gunzip
626
626
627 [decode]
627 [decode]
628 # recompress gzip files when writing them to the working dir (we
628 # recompress gzip files when writing them to the working dir (we
629 # can safely omit "pipe:", because it's the default)
629 # can safely omit "pipe:", because it's the default)
630 *.gz = gzip
630 *.gz = gzip
631
631
632 A ``tempfile:`` command is a template. The string ``INFILE`` is replaced
632 A ``tempfile:`` command is a template. The string ``INFILE`` is replaced
633 with the name of a temporary file that contains the data to be
633 with the name of a temporary file that contains the data to be
634 filtered by the command. The string ``OUTFILE`` is replaced with the name
634 filtered by the command. The string ``OUTFILE`` is replaced with the name
635 of an empty temporary file, where the filtered data must be written by
635 of an empty temporary file, where the filtered data must be written by
636 the command.
636 the command.
637
637
638 .. container:: windows
638 .. container:: windows
639
639
640 .. note::
640 .. note::
641
641
642 The tempfile mechanism is recommended for Windows systems,
642 The tempfile mechanism is recommended for Windows systems,
643 where the standard shell I/O redirection operators often have
643 where the standard shell I/O redirection operators often have
644 strange effects and may corrupt the contents of your files.
644 strange effects and may corrupt the contents of your files.
645
645
646 This filter mechanism is used internally by the ``eol`` extension to
646 This filter mechanism is used internally by the ``eol`` extension to
647 translate line ending characters between Windows (CRLF) and Unix (LF)
647 translate line ending characters between Windows (CRLF) and Unix (LF)
648 format. We suggest you use the ``eol`` extension for convenience.
648 format. We suggest you use the ``eol`` extension for convenience.
649
649
650
650
651 ``defaults``
651 ``defaults``
652 ------------
652 ------------
653
653
654 (defaults are deprecated. Don't use them. Use aliases instead.)
654 (defaults are deprecated. Don't use them. Use aliases instead.)
655
655
656 Use the ``[defaults]`` section to define command defaults, i.e. the
656 Use the ``[defaults]`` section to define command defaults, i.e. the
657 default options/arguments to pass to the specified commands.
657 default options/arguments to pass to the specified commands.
658
658
659 The following example makes :hg:`log` run in verbose mode, and
659 The following example makes :hg:`log` run in verbose mode, and
660 :hg:`status` show only the modified files, by default::
660 :hg:`status` show only the modified files, by default::
661
661
662 [defaults]
662 [defaults]
663 log = -v
663 log = -v
664 status = -m
664 status = -m
665
665
666 The actual commands, instead of their aliases, must be used when
666 The actual commands, instead of their aliases, must be used when
667 defining command defaults. The command defaults will also be applied
667 defining command defaults. The command defaults will also be applied
668 to the aliases of the commands defined.
668 to the aliases of the commands defined.
669
669
670
670
671 ``diff``
671 ``diff``
672 --------
672 --------
673
673
674 Settings used when displaying diffs. Everything except for ``unified``
674 Settings used when displaying diffs. Everything except for ``unified``
675 is a Boolean and defaults to False. See :hg:`help config.annotate`
675 is a Boolean and defaults to False. See :hg:`help config.annotate`
676 for related options for the annotate command.
676 for related options for the annotate command.
677
677
678 ``git``
678 ``git``
679 Use git extended diff format.
679 Use git extended diff format.
680
680
681 ``nobinary``
681 ``nobinary``
682 Omit git binary patches.
682 Omit git binary patches.
683
683
684 ``nodates``
684 ``nodates``
685 Don't include dates in diff headers.
685 Don't include dates in diff headers.
686
686
687 ``noprefix``
687 ``noprefix``
688 Omit 'a/' and 'b/' prefixes from filenames. Ignored in plain mode.
688 Omit 'a/' and 'b/' prefixes from filenames. Ignored in plain mode.
689
689
690 ``showfunc``
690 ``showfunc``
691 Show which function each change is in.
691 Show which function each change is in.
692
692
693 ``ignorews``
693 ``ignorews``
694 Ignore white space when comparing lines.
694 Ignore white space when comparing lines.
695
695
696 ``ignorewsamount``
696 ``ignorewsamount``
697 Ignore changes in the amount of white space.
697 Ignore changes in the amount of white space.
698
698
699 ``ignoreblanklines``
699 ``ignoreblanklines``
700 Ignore changes whose lines are all blank.
700 Ignore changes whose lines are all blank.
701
701
702 ``unified``
702 ``unified``
703 Number of lines of context to show.
703 Number of lines of context to show.
704
704
705 ``word-diff``
705 ``word-diff``
706 Highlight changed words.
706 Highlight changed words.
707
707
708 ``email``
708 ``email``
709 ---------
709 ---------
710
710
711 Settings for extensions that send email messages.
711 Settings for extensions that send email messages.
712
712
713 ``from``
713 ``from``
714 Optional. Email address to use in "From" header and SMTP envelope
714 Optional. Email address to use in "From" header and SMTP envelope
715 of outgoing messages.
715 of outgoing messages.
716
716
717 ``to``
717 ``to``
718 Optional. Comma-separated list of recipients' email addresses.
718 Optional. Comma-separated list of recipients' email addresses.
719
719
720 ``cc``
720 ``cc``
721 Optional. Comma-separated list of carbon copy recipients'
721 Optional. Comma-separated list of carbon copy recipients'
722 email addresses.
722 email addresses.
723
723
724 ``bcc``
724 ``bcc``
725 Optional. Comma-separated list of blind carbon copy recipients'
725 Optional. Comma-separated list of blind carbon copy recipients'
726 email addresses.
726 email addresses.
727
727
728 ``method``
728 ``method``
729 Optional. Method to use to send email messages. If value is ``smtp``
729 Optional. Method to use to send email messages. If value is ``smtp``
730 (default), use SMTP (see the ``[smtp]`` section for configuration).
730 (default), use SMTP (see the ``[smtp]`` section for configuration).
731 Otherwise, use as name of program to run that acts like sendmail
731 Otherwise, use as name of program to run that acts like sendmail
732 (takes ``-f`` option for sender, list of recipients on command line,
732 (takes ``-f`` option for sender, list of recipients on command line,
733 message on stdin). Normally, setting this to ``sendmail`` or
733 message on stdin). Normally, setting this to ``sendmail`` or
734 ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
734 ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
735
735
736 ``charsets``
736 ``charsets``
737 Optional. Comma-separated list of character sets considered
737 Optional. Comma-separated list of character sets considered
738 convenient for recipients. Addresses, headers, and parts not
738 convenient for recipients. Addresses, headers, and parts not
739 containing patches of outgoing messages will be encoded in the
739 containing patches of outgoing messages will be encoded in the
740 first character set to which conversion from local encoding
740 first character set to which conversion from local encoding
741 (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
741 (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
742 conversion fails, the text in question is sent as is.
742 conversion fails, the text in question is sent as is.
743 (default: '')
743 (default: '')
744
744
745 Order of outgoing email character sets:
745 Order of outgoing email character sets:
746
746
747 1. ``us-ascii``: always first, regardless of settings
747 1. ``us-ascii``: always first, regardless of settings
748 2. ``email.charsets``: in order given by user
748 2. ``email.charsets``: in order given by user
749 3. ``ui.fallbackencoding``: if not in email.charsets
749 3. ``ui.fallbackencoding``: if not in email.charsets
750 4. ``$HGENCODING``: if not in email.charsets
750 4. ``$HGENCODING``: if not in email.charsets
751 5. ``utf-8``: always last, regardless of settings
751 5. ``utf-8``: always last, regardless of settings
752
752
753 Email example::
753 Email example::
754
754
755 [email]
755 [email]
756 from = Joseph User <joe.user@example.com>
756 from = Joseph User <joe.user@example.com>
757 method = /usr/sbin/sendmail
757 method = /usr/sbin/sendmail
758 # charsets for western Europeans
758 # charsets for western Europeans
759 # us-ascii, utf-8 omitted, as they are tried first and last
759 # us-ascii, utf-8 omitted, as they are tried first and last
760 charsets = iso-8859-1, iso-8859-15, windows-1252
760 charsets = iso-8859-1, iso-8859-15, windows-1252
761
761
762
762
763 ``extensions``
763 ``extensions``
764 --------------
764 --------------
765
765
766 Mercurial has an extension mechanism for adding new features. To
766 Mercurial has an extension mechanism for adding new features. To
767 enable an extension, create an entry for it in this section.
767 enable an extension, create an entry for it in this section.
768
768
769 If you know that the extension is already in Python's search path,
769 If you know that the extension is already in Python's search path,
770 you can give the name of the module, followed by ``=``, with nothing
770 you can give the name of the module, followed by ``=``, with nothing
771 after the ``=``.
771 after the ``=``.
772
772
773 Otherwise, give a name that you choose, followed by ``=``, followed by
773 Otherwise, give a name that you choose, followed by ``=``, followed by
774 the path to the ``.py`` file (including the file name extension) that
774 the path to the ``.py`` file (including the file name extension) that
775 defines the extension.
775 defines the extension.
776
776
777 To explicitly disable an extension that is enabled in an hgrc of
777 To explicitly disable an extension that is enabled in an hgrc of
778 broader scope, prepend its path with ``!``, as in ``foo = !/ext/path``
778 broader scope, prepend its path with ``!``, as in ``foo = !/ext/path``
779 or ``foo = !`` when path is not supplied.
779 or ``foo = !`` when path is not supplied.
780
780
781 Example for ``~/.hgrc``::
781 Example for ``~/.hgrc``::
782
782
783 [extensions]
783 [extensions]
784 # (the churn extension will get loaded from Mercurial's path)
784 # (the churn extension will get loaded from Mercurial's path)
785 churn =
785 churn =
786 # (this extension will get loaded from the file specified)
786 # (this extension will get loaded from the file specified)
787 myfeature = ~/.hgext/myfeature.py
787 myfeature = ~/.hgext/myfeature.py
788
788
789
789
790 ``format``
790 ``format``
791 ----------
791 ----------
792
792
793 Configuration that controls the repository format. Newer format options are more
793 Configuration that controls the repository format. Newer format options are more
794 powerful but incompatible with some older versions of Mercurial. Format options
794 powerful but incompatible with some older versions of Mercurial. Format options
795 are considered at repository initialization only. You need to make a new clone
795 are considered at repository initialization only. You need to make a new clone
796 for config change to be taken into account.
796 for config change to be taken into account.
797
797
798 For more details about repository format and version compatibility, see
798 For more details about repository format and version compatibility, see
799 https://www.mercurial-scm.org/wiki/MissingRequirement
799 https://www.mercurial-scm.org/wiki/MissingRequirement
800
800
801 ``usegeneraldelta``
801 ``usegeneraldelta``
802 Enable or disable the "generaldelta" repository format which improves
802 Enable or disable the "generaldelta" repository format which improves
803 repository compression by allowing "revlog" to store delta against arbitrary
803 repository compression by allowing "revlog" to store delta against arbitrary
804 revision instead of the previous stored one. This provides significant
804 revision instead of the previous stored one. This provides significant
805 improvement for repositories with branches.
805 improvement for repositories with branches.
806
806
807 Repositories with this on-disk format require Mercurial version 1.9.
807 Repositories with this on-disk format require Mercurial version 1.9.
808
808
809 Enabled by default.
809 Enabled by default.
810
810
811 ``dotencode``
811 ``dotencode``
812 Enable or disable the "dotencode" repository format which enhances
812 Enable or disable the "dotencode" repository format which enhances
813 the "fncache" repository format (which has to be enabled to use
813 the "fncache" repository format (which has to be enabled to use
814 dotencode) to avoid issues with filenames starting with ._ on
814 dotencode) to avoid issues with filenames starting with ._ on
815 Mac OS X and spaces on Windows.
815 Mac OS X and spaces on Windows.
816
816
817 Repositories with this on-disk format require Mercurial version 1.7.
817 Repositories with this on-disk format require Mercurial version 1.7.
818
818
819 Enabled by default.
819 Enabled by default.
820
820
821 ``usefncache``
821 ``usefncache``
822 Enable or disable the "fncache" repository format which enhances
822 Enable or disable the "fncache" repository format which enhances
823 the "store" repository format (which has to be enabled to use
823 the "store" repository format (which has to be enabled to use
824 fncache) to allow longer filenames and avoids using Windows
824 fncache) to allow longer filenames and avoids using Windows
825 reserved names, e.g. "nul".
825 reserved names, e.g. "nul".
826
826
827 Repositories with this on-disk format require Mercurial version 1.1.
827 Repositories with this on-disk format require Mercurial version 1.1.
828
828
829 Enabled by default.
829 Enabled by default.
830
830
831 ``usestore``
831 ``usestore``
832 Enable or disable the "store" repository format which improves
832 Enable or disable the "store" repository format which improves
833 compatibility with systems that fold case or otherwise mangle
833 compatibility with systems that fold case or otherwise mangle
834 filenames. Disabling this option will allow you to store longer filenames
834 filenames. Disabling this option will allow you to store longer filenames
835 in some situations at the expense of compatibility.
835 in some situations at the expense of compatibility.
836
836
837 Repositories with this on-disk format require Mercurial version 0.9.4.
837 Repositories with this on-disk format require Mercurial version 0.9.4.
838
838
839 Enabled by default.
839 Enabled by default.
840
840
841 ``graph``
841 ``graph``
842 ---------
842 ---------
843
843
844 Web graph view configuration. This section let you change graph
844 Web graph view configuration. This section let you change graph
845 elements display properties by branches, for instance to make the
845 elements display properties by branches, for instance to make the
846 ``default`` branch stand out.
846 ``default`` branch stand out.
847
847
848 Each line has the following format::
848 Each line has the following format::
849
849
850 <branch>.<argument> = <value>
850 <branch>.<argument> = <value>
851
851
852 where ``<branch>`` is the name of the branch being
852 where ``<branch>`` is the name of the branch being
853 customized. Example::
853 customized. Example::
854
854
855 [graph]
855 [graph]
856 # 2px width
856 # 2px width
857 default.width = 2
857 default.width = 2
858 # red color
858 # red color
859 default.color = FF0000
859 default.color = FF0000
860
860
861 Supported arguments:
861 Supported arguments:
862
862
863 ``width``
863 ``width``
864 Set branch edges width in pixels.
864 Set branch edges width in pixels.
865
865
866 ``color``
866 ``color``
867 Set branch edges color in hexadecimal RGB notation.
867 Set branch edges color in hexadecimal RGB notation.
868
868
869 ``hooks``
869 ``hooks``
870 ---------
870 ---------
871
871
872 Commands or Python functions that get automatically executed by
872 Commands or Python functions that get automatically executed by
873 various actions such as starting or finishing a commit. Multiple
873 various actions such as starting or finishing a commit. Multiple
874 hooks can be run for the same action by appending a suffix to the
874 hooks can be run for the same action by appending a suffix to the
875 action. Overriding a site-wide hook can be done by changing its
875 action. Overriding a site-wide hook can be done by changing its
876 value or setting it to an empty string. Hooks can be prioritized
876 value or setting it to an empty string. Hooks can be prioritized
877 by adding a prefix of ``priority.`` to the hook name on a new line
877 by adding a prefix of ``priority.`` to the hook name on a new line
878 and setting the priority. The default priority is 0.
878 and setting the priority. The default priority is 0.
879
879
880 Example ``.hg/hgrc``::
880 Example ``.hg/hgrc``::
881
881
882 [hooks]
882 [hooks]
883 # update working directory after adding changesets
883 # update working directory after adding changesets
884 changegroup.update = hg update
884 changegroup.update = hg update
885 # do not use the site-wide hook
885 # do not use the site-wide hook
886 incoming =
886 incoming =
887 incoming.email = /my/email/hook
887 incoming.email = /my/email/hook
888 incoming.autobuild = /my/build/hook
888 incoming.autobuild = /my/build/hook
889 # force autobuild hook to run before other incoming hooks
889 # force autobuild hook to run before other incoming hooks
890 priority.incoming.autobuild = 1
890 priority.incoming.autobuild = 1
891
891
892 Most hooks are run with environment variables set that give useful
892 Most hooks are run with environment variables set that give useful
893 additional information. For each hook below, the environment variables
893 additional information. For each hook below, the environment variables
894 it is passed are listed with names in the form ``$HG_foo``. The
894 it is passed are listed with names in the form ``$HG_foo``. The
895 ``$HG_HOOKTYPE`` and ``$HG_HOOKNAME`` variables are set for all hooks.
895 ``$HG_HOOKTYPE`` and ``$HG_HOOKNAME`` variables are set for all hooks.
896 They contain the type of hook which triggered the run and the full name
896 They contain the type of hook which triggered the run and the full name
897 of the hook in the config, respectively. In the example above, this will
897 of the hook in the config, respectively. In the example above, this will
898 be ``$HG_HOOKTYPE=incoming`` and ``$HG_HOOKNAME=incoming.email``.
898 be ``$HG_HOOKTYPE=incoming`` and ``$HG_HOOKNAME=incoming.email``.
899
899
900 .. container:: windows
900 .. container:: windows
901
901
902 Some basic Unix syntax can be enabled for portability, including ``$VAR``
902 Some basic Unix syntax can be enabled for portability, including ``$VAR``
903 and ``${VAR}`` style variables. A ``~`` followed by ``\`` or ``/`` will
903 and ``${VAR}`` style variables. A ``~`` followed by ``\`` or ``/`` will
904 be expanded to ``%USERPROFILE%`` to simulate a subset of tilde expansion
904 be expanded to ``%USERPROFILE%`` to simulate a subset of tilde expansion
905 on Unix. To use a literal ``$`` or ``~``, it must be escaped with a back
905 on Unix. To use a literal ``$`` or ``~``, it must be escaped with a back
906 slash or inside of a strong quote. Strong quotes will be replaced by
906 slash or inside of a strong quote. Strong quotes will be replaced by
907 double quotes after processing.
907 double quotes after processing.
908
908
909 This feature is enabled by adding a prefix of ``tonative.`` to the hook
909 This feature is enabled by adding a prefix of ``tonative.`` to the hook
910 name on a new line, and setting it to ``True``. For example::
910 name on a new line, and setting it to ``True``. For example::
911
911
912 [hooks]
912 [hooks]
913 incoming.autobuild = /my/build/hook
913 incoming.autobuild = /my/build/hook
914 # enable translation to cmd.exe syntax for autobuild hook
914 # enable translation to cmd.exe syntax for autobuild hook
915 tonative.incoming.autobuild = True
915 tonative.incoming.autobuild = True
916
916
917 ``changegroup``
917 ``changegroup``
918 Run after a changegroup has been added via push, pull or unbundle. The ID of
918 Run after a changegroup has been added via push, pull or unbundle. The ID of
919 the first new changeset is in ``$HG_NODE`` and last is in ``$HG_NODE_LAST``.
919 the first new changeset is in ``$HG_NODE`` and last is in ``$HG_NODE_LAST``.
920 The URL from which changes came is in ``$HG_URL``.
920 The URL from which changes came is in ``$HG_URL``.
921
921
922 ``commit``
922 ``commit``
923 Run after a changeset has been created in the local repository. The ID
923 Run after a changeset has been created in the local repository. The ID
924 of the newly created changeset is in ``$HG_NODE``. Parent changeset
924 of the newly created changeset is in ``$HG_NODE``. Parent changeset
925 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
925 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
926
926
927 ``incoming``
927 ``incoming``
928 Run after a changeset has been pulled, pushed, or unbundled into
928 Run after a changeset has been pulled, pushed, or unbundled into
929 the local repository. The ID of the newly arrived changeset is in
929 the local repository. The ID of the newly arrived changeset is in
930 ``$HG_NODE``. The URL that was source of the changes is in ``$HG_URL``.
930 ``$HG_NODE``. The URL that was source of the changes is in ``$HG_URL``.
931
931
932 ``outgoing``
932 ``outgoing``
933 Run after sending changes from the local repository to another. The ID of
933 Run after sending changes from the local repository to another. The ID of
934 first changeset sent is in ``$HG_NODE``. The source of operation is in
934 first changeset sent is in ``$HG_NODE``. The source of operation is in
935 ``$HG_SOURCE``. Also see :hg:`help config.hooks.preoutgoing`.
935 ``$HG_SOURCE``. Also see :hg:`help config.hooks.preoutgoing`.
936
936
937 ``post-<command>``
937 ``post-<command>``
938 Run after successful invocations of the associated command. The
938 Run after successful invocations of the associated command. The
939 contents of the command line are passed as ``$HG_ARGS`` and the result
939 contents of the command line are passed as ``$HG_ARGS`` and the result
940 code in ``$HG_RESULT``. Parsed command line arguments are passed as
940 code in ``$HG_RESULT``. Parsed command line arguments are passed as
941 ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of
941 ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of
942 the python data internally passed to <command>. ``$HG_OPTS`` is a
942 the python data internally passed to <command>. ``$HG_OPTS`` is a
943 dictionary of options (with unspecified options set to their defaults).
943 dictionary of options (with unspecified options set to their defaults).
944 ``$HG_PATS`` is a list of arguments. Hook failure is ignored.
944 ``$HG_PATS`` is a list of arguments. Hook failure is ignored.
945
945
946 ``fail-<command>``
946 ``fail-<command>``
947 Run after a failed invocation of an associated command. The contents
947 Run after a failed invocation of an associated command. The contents
948 of the command line are passed as ``$HG_ARGS``. Parsed command line
948 of the command line are passed as ``$HG_ARGS``. Parsed command line
949 arguments are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain
949 arguments are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain
950 string representations of the python data internally passed to
950 string representations of the python data internally passed to
951 <command>. ``$HG_OPTS`` is a dictionary of options (with unspecified
951 <command>. ``$HG_OPTS`` is a dictionary of options (with unspecified
952 options set to their defaults). ``$HG_PATS`` is a list of arguments.
952 options set to their defaults). ``$HG_PATS`` is a list of arguments.
953 Hook failure is ignored.
953 Hook failure is ignored.
954
954
955 ``pre-<command>``
955 ``pre-<command>``
956 Run before executing the associated command. The contents of the
956 Run before executing the associated command. The contents of the
957 command line are passed as ``$HG_ARGS``. Parsed command line arguments
957 command line are passed as ``$HG_ARGS``. Parsed command line arguments
958 are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string
958 are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string
959 representations of the data internally passed to <command>. ``$HG_OPTS``
959 representations of the data internally passed to <command>. ``$HG_OPTS``
960 is a dictionary of options (with unspecified options set to their
960 is a dictionary of options (with unspecified options set to their
961 defaults). ``$HG_PATS`` is a list of arguments. If the hook returns
961 defaults). ``$HG_PATS`` is a list of arguments. If the hook returns
962 failure, the command doesn't execute and Mercurial returns the failure
962 failure, the command doesn't execute and Mercurial returns the failure
963 code.
963 code.
964
964
965 ``prechangegroup``
965 ``prechangegroup``
966 Run before a changegroup is added via push, pull or unbundle. Exit
966 Run before a changegroup is added via push, pull or unbundle. Exit
967 status 0 allows the changegroup to proceed. A non-zero status will
967 status 0 allows the changegroup to proceed. A non-zero status will
968 cause the push, pull or unbundle to fail. The URL from which changes
968 cause the push, pull or unbundle to fail. The URL from which changes
969 will come is in ``$HG_URL``.
969 will come is in ``$HG_URL``.
970
970
971 ``precommit``
971 ``precommit``
972 Run before starting a local commit. Exit status 0 allows the
972 Run before starting a local commit. Exit status 0 allows the
973 commit to proceed. A non-zero status will cause the commit to fail.
973 commit to proceed. A non-zero status will cause the commit to fail.
974 Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
974 Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
975
975
976 ``prelistkeys``
976 ``prelistkeys``
977 Run before listing pushkeys (like bookmarks) in the
977 Run before listing pushkeys (like bookmarks) in the
978 repository. A non-zero status will cause failure. The key namespace is
978 repository. A non-zero status will cause failure. The key namespace is
979 in ``$HG_NAMESPACE``.
979 in ``$HG_NAMESPACE``.
980
980
981 ``preoutgoing``
981 ``preoutgoing``
982 Run before collecting changes to send from the local repository to
982 Run before collecting changes to send from the local repository to
983 another. A non-zero status will cause failure. This lets you prevent
983 another. A non-zero status will cause failure. This lets you prevent
984 pull over HTTP or SSH. It can also prevent propagating commits (via
984 pull over HTTP or SSH. It can also prevent propagating commits (via
985 local pull, push (outbound) or bundle commands), but not completely,
985 local pull, push (outbound) or bundle commands), but not completely,
986 since you can just copy files instead. The source of operation is in
986 since you can just copy files instead. The source of operation is in
987 ``$HG_SOURCE``. If "serve", the operation is happening on behalf of a remote
987 ``$HG_SOURCE``. If "serve", the operation is happening on behalf of a remote
988 SSH or HTTP repository. If "push", "pull" or "bundle", the operation
988 SSH or HTTP repository. If "push", "pull" or "bundle", the operation
989 is happening on behalf of a repository on same system.
989 is happening on behalf of a repository on same system.
990
990
991 ``prepushkey``
991 ``prepushkey``
992 Run before a pushkey (like a bookmark) is added to the
992 Run before a pushkey (like a bookmark) is added to the
993 repository. A non-zero status will cause the key to be rejected. The
993 repository. A non-zero status will cause the key to be rejected. The
994 key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``,
994 key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``,
995 the old value (if any) is in ``$HG_OLD``, and the new value is in
995 the old value (if any) is in ``$HG_OLD``, and the new value is in
996 ``$HG_NEW``.
996 ``$HG_NEW``.
997
997
998 ``pretag``
998 ``pretag``
999 Run before creating a tag. Exit status 0 allows the tag to be
999 Run before creating a tag. Exit status 0 allows the tag to be
1000 created. A non-zero status will cause the tag to fail. The ID of the
1000 created. A non-zero status will cause the tag to fail. The ID of the
1001 changeset to tag is in ``$HG_NODE``. The name of tag is in ``$HG_TAG``. The
1001 changeset to tag is in ``$HG_NODE``. The name of tag is in ``$HG_TAG``. The
1002 tag is local if ``$HG_LOCAL=1``, or in the repository if ``$HG_LOCAL=0``.
1002 tag is local if ``$HG_LOCAL=1``, or in the repository if ``$HG_LOCAL=0``.
1003
1003
1004 ``pretxnopen``
1004 ``pretxnopen``
1005 Run before any new repository transaction is open. The reason for the
1005 Run before any new repository transaction is open. The reason for the
1006 transaction will be in ``$HG_TXNNAME``, and a unique identifier for the
1006 transaction will be in ``$HG_TXNNAME``, and a unique identifier for the
1007 transaction will be in ``HG_TXNID``. A non-zero status will prevent the
1007 transaction will be in ``HG_TXNID``. A non-zero status will prevent the
1008 transaction from being opened.
1008 transaction from being opened.
1009
1009
1010 ``pretxnclose``
1010 ``pretxnclose``
1011 Run right before the transaction is actually finalized. Any repository change
1011 Run right before the transaction is actually finalized. Any repository change
1012 will be visible to the hook program. This lets you validate the transaction
1012 will be visible to the hook program. This lets you validate the transaction
1013 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1013 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1014 status will cause the transaction to be rolled back. The reason for the
1014 status will cause the transaction to be rolled back. The reason for the
1015 transaction opening will be in ``$HG_TXNNAME``, and a unique identifier for
1015 transaction opening will be in ``$HG_TXNNAME``, and a unique identifier for
1016 the transaction will be in ``HG_TXNID``. The rest of the available data will
1016 the transaction will be in ``HG_TXNID``. The rest of the available data will
1017 vary according the transaction type. New changesets will add ``$HG_NODE``
1017 vary according the transaction type. New changesets will add ``$HG_NODE``
1018 (the ID of the first added changeset), ``$HG_NODE_LAST`` (the ID of the last
1018 (the ID of the first added changeset), ``$HG_NODE_LAST`` (the ID of the last
1019 added changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables. Bookmark and
1019 added changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables. Bookmark and
1020 phase changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1``
1020 phase changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1``
1021 respectively, etc.
1021 respectively, etc.
1022
1022
1023 ``pretxnclose-bookmark``
1023 ``pretxnclose-bookmark``
1024 Run right before a bookmark change is actually finalized. Any repository
1024 Run right before a bookmark change is actually finalized. Any repository
1025 change will be visible to the hook program. This lets you validate the
1025 change will be visible to the hook program. This lets you validate the
1026 transaction content or change it. Exit status 0 allows the commit to
1026 transaction content or change it. Exit status 0 allows the commit to
1027 proceed. A non-zero status will cause the transaction to be rolled back.
1027 proceed. A non-zero status will cause the transaction to be rolled back.
1028 The name of the bookmark will be available in ``$HG_BOOKMARK``, the new
1028 The name of the bookmark will be available in ``$HG_BOOKMARK``, the new
1029 bookmark location will be available in ``$HG_NODE`` while the previous
1029 bookmark location will be available in ``$HG_NODE`` while the previous
1030 location will be available in ``$HG_OLDNODE``. In case of a bookmark
1030 location will be available in ``$HG_OLDNODE``. In case of a bookmark
1031 creation ``$HG_OLDNODE`` will be empty. In case of deletion ``$HG_NODE``
1031 creation ``$HG_OLDNODE`` will be empty. In case of deletion ``$HG_NODE``
1032 will be empty.
1032 will be empty.
1033 In addition, the reason for the transaction opening will be in
1033 In addition, the reason for the transaction opening will be in
1034 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1034 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1035 ``HG_TXNID``.
1035 ``HG_TXNID``.
1036
1036
1037 ``pretxnclose-phase``
1037 ``pretxnclose-phase``
1038 Run right before a phase change is actually finalized. Any repository change
1038 Run right before a phase change is actually finalized. Any repository change
1039 will be visible to the hook program. This lets you validate the transaction
1039 will be visible to the hook program. This lets you validate the transaction
1040 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1040 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1041 status will cause the transaction to be rolled back. The hook is called
1041 status will cause the transaction to be rolled back. The hook is called
1042 multiple times, once for each revision affected by a phase change.
1042 multiple times, once for each revision affected by a phase change.
1043 The affected node is available in ``$HG_NODE``, the phase in ``$HG_PHASE``
1043 The affected node is available in ``$HG_NODE``, the phase in ``$HG_PHASE``
1044 while the previous ``$HG_OLDPHASE``. In case of new node, ``$HG_OLDPHASE``
1044 while the previous ``$HG_OLDPHASE``. In case of new node, ``$HG_OLDPHASE``
1045 will be empty. In addition, the reason for the transaction opening will be in
1045 will be empty. In addition, the reason for the transaction opening will be in
1046 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1046 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1047 ``HG_TXNID``. The hook is also run for newly added revisions. In this case
1047 ``HG_TXNID``. The hook is also run for newly added revisions. In this case
1048 the ``$HG_OLDPHASE`` entry will be empty.
1048 the ``$HG_OLDPHASE`` entry will be empty.
1049
1049
1050 ``txnclose``
1050 ``txnclose``
1051 Run after any repository transaction has been committed. At this
1051 Run after any repository transaction has been committed. At this
1052 point, the transaction can no longer be rolled back. The hook will run
1052 point, the transaction can no longer be rolled back. The hook will run
1053 after the lock is released. See :hg:`help config.hooks.pretxnclose` for
1053 after the lock is released. See :hg:`help config.hooks.pretxnclose` for
1054 details about available variables.
1054 details about available variables.
1055
1055
1056 ``txnclose-bookmark``
1056 ``txnclose-bookmark``
1057 Run after any bookmark change has been committed. At this point, the
1057 Run after any bookmark change has been committed. At this point, the
1058 transaction can no longer be rolled back. The hook will run after the lock
1058 transaction can no longer be rolled back. The hook will run after the lock
1059 is released. See :hg:`help config.hooks.pretxnclose-bookmark` for details
1059 is released. See :hg:`help config.hooks.pretxnclose-bookmark` for details
1060 about available variables.
1060 about available variables.
1061
1061
1062 ``txnclose-phase``
1062 ``txnclose-phase``
1063 Run after any phase change has been committed. At this point, the
1063 Run after any phase change has been committed. At this point, the
1064 transaction can no longer be rolled back. The hook will run after the lock
1064 transaction can no longer be rolled back. The hook will run after the lock
1065 is released. See :hg:`help config.hooks.pretxnclose-phase` for details about
1065 is released. See :hg:`help config.hooks.pretxnclose-phase` for details about
1066 available variables.
1066 available variables.
1067
1067
1068 ``txnabort``
1068 ``txnabort``
1069 Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose`
1069 Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose`
1070 for details about available variables.
1070 for details about available variables.
1071
1071
1072 ``pretxnchangegroup``
1072 ``pretxnchangegroup``
1073 Run after a changegroup has been added via push, pull or unbundle, but before
1073 Run after a changegroup has been added via push, pull or unbundle, but before
1074 the transaction has been committed. The changegroup is visible to the hook
1074 the transaction has been committed. The changegroup is visible to the hook
1075 program. This allows validation of incoming changes before accepting them.
1075 program. This allows validation of incoming changes before accepting them.
1076 The ID of the first new changeset is in ``$HG_NODE`` and last is in
1076 The ID of the first new changeset is in ``$HG_NODE`` and last is in
1077 ``$HG_NODE_LAST``. Exit status 0 allows the transaction to commit. A non-zero
1077 ``$HG_NODE_LAST``. Exit status 0 allows the transaction to commit. A non-zero
1078 status will cause the transaction to be rolled back, and the push, pull or
1078 status will cause the transaction to be rolled back, and the push, pull or
1079 unbundle will fail. The URL that was the source of changes is in ``$HG_URL``.
1079 unbundle will fail. The URL that was the source of changes is in ``$HG_URL``.
1080
1080
1081 ``pretxncommit``
1081 ``pretxncommit``
1082 Run after a changeset has been created, but before the transaction is
1082 Run after a changeset has been created, but before the transaction is
1083 committed. The changeset is visible to the hook program. This allows
1083 committed. The changeset is visible to the hook program. This allows
1084 validation of the commit message and changes. Exit status 0 allows the
1084 validation of the commit message and changes. Exit status 0 allows the
1085 commit to proceed. A non-zero status will cause the transaction to
1085 commit to proceed. A non-zero status will cause the transaction to
1086 be rolled back. The ID of the new changeset is in ``$HG_NODE``. The parent
1086 be rolled back. The ID of the new changeset is in ``$HG_NODE``. The parent
1087 changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1087 changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1088
1088
1089 ``preupdate``
1089 ``preupdate``
1090 Run before updating the working directory. Exit status 0 allows
1090 Run before updating the working directory. Exit status 0 allows
1091 the update to proceed. A non-zero status will prevent the update.
1091 the update to proceed. A non-zero status will prevent the update.
1092 The changeset ID of first new parent is in ``$HG_PARENT1``. If updating to a
1092 The changeset ID of first new parent is in ``$HG_PARENT1``. If updating to a
1093 merge, the ID of second new parent is in ``$HG_PARENT2``.
1093 merge, the ID of second new parent is in ``$HG_PARENT2``.
1094
1094
1095 ``listkeys``
1095 ``listkeys``
1096 Run after listing pushkeys (like bookmarks) in the repository. The
1096 Run after listing pushkeys (like bookmarks) in the repository. The
1097 key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a
1097 key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a
1098 dictionary containing the keys and values.
1098 dictionary containing the keys and values.
1099
1099
1100 ``pushkey``
1100 ``pushkey``
1101 Run after a pushkey (like a bookmark) is added to the
1101 Run after a pushkey (like a bookmark) is added to the
1102 repository. The key namespace is in ``$HG_NAMESPACE``, the key is in
1102 repository. The key namespace is in ``$HG_NAMESPACE``, the key is in
1103 ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new
1103 ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new
1104 value is in ``$HG_NEW``.
1104 value is in ``$HG_NEW``.
1105
1105
1106 ``tag``
1106 ``tag``
1107 Run after a tag is created. The ID of the tagged changeset is in ``$HG_NODE``.
1107 Run after a tag is created. The ID of the tagged changeset is in ``$HG_NODE``.
1108 The name of tag is in ``$HG_TAG``. The tag is local if ``$HG_LOCAL=1``, or in
1108 The name of tag is in ``$HG_TAG``. The tag is local if ``$HG_LOCAL=1``, or in
1109 the repository if ``$HG_LOCAL=0``.
1109 the repository if ``$HG_LOCAL=0``.
1110
1110
1111 ``update``
1111 ``update``
1112 Run after updating the working directory. The changeset ID of first
1112 Run after updating the working directory. The changeset ID of first
1113 new parent is in ``$HG_PARENT1``. If updating to a merge, the ID of second new
1113 new parent is in ``$HG_PARENT1``. If updating to a merge, the ID of second new
1114 parent is in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
1114 parent is in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
1115 update failed (e.g. because conflicts were not resolved), ``$HG_ERROR=1``.
1115 update failed (e.g. because conflicts were not resolved), ``$HG_ERROR=1``.
1116
1116
1117 .. note::
1117 .. note::
1118
1118
1119 It is generally better to use standard hooks rather than the
1119 It is generally better to use standard hooks rather than the
1120 generic pre- and post- command hooks, as they are guaranteed to be
1120 generic pre- and post- command hooks, as they are guaranteed to be
1121 called in the appropriate contexts for influencing transactions.
1121 called in the appropriate contexts for influencing transactions.
1122 Also, hooks like "commit" will be called in all contexts that
1122 Also, hooks like "commit" will be called in all contexts that
1123 generate a commit (e.g. tag) and not just the commit command.
1123 generate a commit (e.g. tag) and not just the commit command.
1124
1124
1125 .. note::
1125 .. note::
1126
1126
1127 Environment variables with empty values may not be passed to
1127 Environment variables with empty values may not be passed to
1128 hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
1128 hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
1129 will have an empty value under Unix-like platforms for non-merge
1129 will have an empty value under Unix-like platforms for non-merge
1130 changesets, while it will not be available at all under Windows.
1130 changesets, while it will not be available at all under Windows.
1131
1131
1132 The syntax for Python hooks is as follows::
1132 The syntax for Python hooks is as follows::
1133
1133
1134 hookname = python:modulename.submodule.callable
1134 hookname = python:modulename.submodule.callable
1135 hookname = python:/path/to/python/module.py:callable
1135 hookname = python:/path/to/python/module.py:callable
1136
1136
1137 Python hooks are run within the Mercurial process. Each hook is
1137 Python hooks are run within the Mercurial process. Each hook is
1138 called with at least three keyword arguments: a ui object (keyword
1138 called with at least three keyword arguments: a ui object (keyword
1139 ``ui``), a repository object (keyword ``repo``), and a ``hooktype``
1139 ``ui``), a repository object (keyword ``repo``), and a ``hooktype``
1140 keyword that tells what kind of hook is used. Arguments listed as
1140 keyword that tells what kind of hook is used. Arguments listed as
1141 environment variables above are passed as keyword arguments, with no
1141 environment variables above are passed as keyword arguments, with no
1142 ``HG_`` prefix, and names in lower case.
1142 ``HG_`` prefix, and names in lower case.
1143
1143
1144 If a Python hook returns a "true" value or raises an exception, this
1144 If a Python hook returns a "true" value or raises an exception, this
1145 is treated as a failure.
1145 is treated as a failure.
1146
1146
1147
1147
1148 ``hostfingerprints``
1148 ``hostfingerprints``
1149 --------------------
1149 --------------------
1150
1150
1151 (Deprecated. Use ``[hostsecurity]``'s ``fingerprints`` options instead.)
1151 (Deprecated. Use ``[hostsecurity]``'s ``fingerprints`` options instead.)
1152
1152
1153 Fingerprints of the certificates of known HTTPS servers.
1153 Fingerprints of the certificates of known HTTPS servers.
1154
1154
1155 A HTTPS connection to a server with a fingerprint configured here will
1155 A HTTPS connection to a server with a fingerprint configured here will
1156 only succeed if the servers certificate matches the fingerprint.
1156 only succeed if the servers certificate matches the fingerprint.
1157 This is very similar to how ssh known hosts works.
1157 This is very similar to how ssh known hosts works.
1158
1158
1159 The fingerprint is the SHA-1 hash value of the DER encoded certificate.
1159 The fingerprint is the SHA-1 hash value of the DER encoded certificate.
1160 Multiple values can be specified (separated by spaces or commas). This can
1160 Multiple values can be specified (separated by spaces or commas). This can
1161 be used to define both old and new fingerprints while a host transitions
1161 be used to define both old and new fingerprints while a host transitions
1162 to a new certificate.
1162 to a new certificate.
1163
1163
1164 The CA chain and web.cacerts is not used for servers with a fingerprint.
1164 The CA chain and web.cacerts is not used for servers with a fingerprint.
1165
1165
1166 For example::
1166 For example::
1167
1167
1168 [hostfingerprints]
1168 [hostfingerprints]
1169 hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1169 hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1170 hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1170 hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1171
1171
1172 ``hostsecurity``
1172 ``hostsecurity``
1173 ----------------
1173 ----------------
1174
1174
1175 Used to specify global and per-host security settings for connecting to
1175 Used to specify global and per-host security settings for connecting to
1176 other machines.
1176 other machines.
1177
1177
1178 The following options control default behavior for all hosts.
1178 The following options control default behavior for all hosts.
1179
1179
1180 ``ciphers``
1180 ``ciphers``
1181 Defines the cryptographic ciphers to use for connections.
1181 Defines the cryptographic ciphers to use for connections.
1182
1182
1183 Value must be a valid OpenSSL Cipher List Format as documented at
1183 Value must be a valid OpenSSL Cipher List Format as documented at
1184 https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT.
1184 https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT.
1185
1185
1186 This setting is for advanced users only. Setting to incorrect values
1186 This setting is for advanced users only. Setting to incorrect values
1187 can significantly lower connection security or decrease performance.
1187 can significantly lower connection security or decrease performance.
1188 You have been warned.
1188 You have been warned.
1189
1189
1190 This option requires Python 2.7.
1190 This option requires Python 2.7.
1191
1191
1192 ``minimumprotocol``
1192 ``minimumprotocol``
1193 Defines the minimum channel encryption protocol to use.
1193 Defines the minimum channel encryption protocol to use.
1194
1194
1195 By default, the highest version of TLS supported by both client and server
1195 By default, the highest version of TLS supported by both client and server
1196 is used.
1196 is used.
1197
1197
1198 Allowed values are: ``tls1.0``, ``tls1.1``, ``tls1.2``.
1198 Allowed values are: ``tls1.0``, ``tls1.1``, ``tls1.2``.
1199
1199
1200 When running on an old Python version, only ``tls1.0`` is allowed since
1200 When running on an old Python version, only ``tls1.0`` is allowed since
1201 old versions of Python only support up to TLS 1.0.
1201 old versions of Python only support up to TLS 1.0.
1202
1202
1203 When running a Python that supports modern TLS versions, the default is
1203 When running a Python that supports modern TLS versions, the default is
1204 ``tls1.1``. ``tls1.0`` can still be used to allow TLS 1.0. However, this
1204 ``tls1.1``. ``tls1.0`` can still be used to allow TLS 1.0. However, this
1205 weakens security and should only be used as a feature of last resort if
1205 weakens security and should only be used as a feature of last resort if
1206 a server does not support TLS 1.1+.
1206 a server does not support TLS 1.1+.
1207
1207
1208 Options in the ``[hostsecurity]`` section can have the form
1208 Options in the ``[hostsecurity]`` section can have the form
1209 ``hostname``:``setting``. This allows multiple settings to be defined on a
1209 ``hostname``:``setting``. This allows multiple settings to be defined on a
1210 per-host basis.
1210 per-host basis.
1211
1211
1212 The following per-host settings can be defined.
1212 The following per-host settings can be defined.
1213
1213
1214 ``ciphers``
1214 ``ciphers``
1215 This behaves like ``ciphers`` as described above except it only applies
1215 This behaves like ``ciphers`` as described above except it only applies
1216 to the host on which it is defined.
1216 to the host on which it is defined.
1217
1217
1218 ``fingerprints``
1218 ``fingerprints``
1219 A list of hashes of the DER encoded peer/remote certificate. Values have
1219 A list of hashes of the DER encoded peer/remote certificate. Values have
1220 the form ``algorithm``:``fingerprint``. e.g.
1220 the form ``algorithm``:``fingerprint``. e.g.
1221 ``sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2``.
1221 ``sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2``.
1222 In addition, colons (``:``) can appear in the fingerprint part.
1222 In addition, colons (``:``) can appear in the fingerprint part.
1223
1223
1224 The following algorithms/prefixes are supported: ``sha1``, ``sha256``,
1224 The following algorithms/prefixes are supported: ``sha1``, ``sha256``,
1225 ``sha512``.
1225 ``sha512``.
1226
1226
1227 Use of ``sha256`` or ``sha512`` is preferred.
1227 Use of ``sha256`` or ``sha512`` is preferred.
1228
1228
1229 If a fingerprint is specified, the CA chain is not validated for this
1229 If a fingerprint is specified, the CA chain is not validated for this
1230 host and Mercurial will require the remote certificate to match one
1230 host and Mercurial will require the remote certificate to match one
1231 of the fingerprints specified. This means if the server updates its
1231 of the fingerprints specified. This means if the server updates its
1232 certificate, Mercurial will abort until a new fingerprint is defined.
1232 certificate, Mercurial will abort until a new fingerprint is defined.
1233 This can provide stronger security than traditional CA-based validation
1233 This can provide stronger security than traditional CA-based validation
1234 at the expense of convenience.
1234 at the expense of convenience.
1235
1235
1236 This option takes precedence over ``verifycertsfile``.
1236 This option takes precedence over ``verifycertsfile``.
1237
1237
1238 ``minimumprotocol``
1238 ``minimumprotocol``
1239 This behaves like ``minimumprotocol`` as described above except it
1239 This behaves like ``minimumprotocol`` as described above except it
1240 only applies to the host on which it is defined.
1240 only applies to the host on which it is defined.
1241
1241
1242 ``verifycertsfile``
1242 ``verifycertsfile``
1243 Path to file a containing a list of PEM encoded certificates used to
1243 Path to file a containing a list of PEM encoded certificates used to
1244 verify the server certificate. Environment variables and ``~user``
1244 verify the server certificate. Environment variables and ``~user``
1245 constructs are expanded in the filename.
1245 constructs are expanded in the filename.
1246
1246
1247 The server certificate or the certificate's certificate authority (CA)
1247 The server certificate or the certificate's certificate authority (CA)
1248 must match a certificate from this file or certificate verification
1248 must match a certificate from this file or certificate verification
1249 will fail and connections to the server will be refused.
1249 will fail and connections to the server will be refused.
1250
1250
1251 If defined, only certificates provided by this file will be used:
1251 If defined, only certificates provided by this file will be used:
1252 ``web.cacerts`` and any system/default certificates will not be
1252 ``web.cacerts`` and any system/default certificates will not be
1253 used.
1253 used.
1254
1254
1255 This option has no effect if the per-host ``fingerprints`` option
1255 This option has no effect if the per-host ``fingerprints`` option
1256 is set.
1256 is set.
1257
1257
1258 The format of the file is as follows::
1258 The format of the file is as follows::
1259
1259
1260 -----BEGIN CERTIFICATE-----
1260 -----BEGIN CERTIFICATE-----
1261 ... (certificate in base64 PEM encoding) ...
1261 ... (certificate in base64 PEM encoding) ...
1262 -----END CERTIFICATE-----
1262 -----END CERTIFICATE-----
1263 -----BEGIN CERTIFICATE-----
1263 -----BEGIN CERTIFICATE-----
1264 ... (certificate in base64 PEM encoding) ...
1264 ... (certificate in base64 PEM encoding) ...
1265 -----END CERTIFICATE-----
1265 -----END CERTIFICATE-----
1266
1266
1267 For example::
1267 For example::
1268
1268
1269 [hostsecurity]
1269 [hostsecurity]
1270 hg.example.com:fingerprints = sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
1270 hg.example.com:fingerprints = sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
1271 hg2.example.com:fingerprints = sha1:914f1aff87249c09b6859b88b1906d30756491ca, sha1:fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1271 hg2.example.com:fingerprints = sha1:914f1aff87249c09b6859b88b1906d30756491ca, sha1:fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1272 hg3.example.com:fingerprints = sha256:9a:b0:dc:e2:75:ad:8a:b7:84:58:e5:1f:07:32:f1:87:e6:bd:24:22:af:b7:ce:8e:9c:b4:10:cf:b9:f4:0e:d2
1272 hg3.example.com:fingerprints = sha256:9a:b0:dc:e2:75:ad:8a:b7:84:58:e5:1f:07:32:f1:87:e6:bd:24:22:af:b7:ce:8e:9c:b4:10:cf:b9:f4:0e:d2
1273 foo.example.com:verifycertsfile = /etc/ssl/trusted-ca-certs.pem
1273 foo.example.com:verifycertsfile = /etc/ssl/trusted-ca-certs.pem
1274
1274
1275 To change the default minimum protocol version to TLS 1.2 but to allow TLS 1.1
1275 To change the default minimum protocol version to TLS 1.2 but to allow TLS 1.1
1276 when connecting to ``hg.example.com``::
1276 when connecting to ``hg.example.com``::
1277
1277
1278 [hostsecurity]
1278 [hostsecurity]
1279 minimumprotocol = tls1.2
1279 minimumprotocol = tls1.2
1280 hg.example.com:minimumprotocol = tls1.1
1280 hg.example.com:minimumprotocol = tls1.1
1281
1281
1282 ``http_proxy``
1282 ``http_proxy``
1283 --------------
1283 --------------
1284
1284
1285 Used to access web-based Mercurial repositories through a HTTP
1285 Used to access web-based Mercurial repositories through a HTTP
1286 proxy.
1286 proxy.
1287
1287
1288 ``host``
1288 ``host``
1289 Host name and (optional) port of the proxy server, for example
1289 Host name and (optional) port of the proxy server, for example
1290 "myproxy:8000".
1290 "myproxy:8000".
1291
1291
1292 ``no``
1292 ``no``
1293 Optional. Comma-separated list of host names that should bypass
1293 Optional. Comma-separated list of host names that should bypass
1294 the proxy.
1294 the proxy.
1295
1295
1296 ``passwd``
1296 ``passwd``
1297 Optional. Password to authenticate with at the proxy server.
1297 Optional. Password to authenticate with at the proxy server.
1298
1298
1299 ``user``
1299 ``user``
1300 Optional. User name to authenticate with at the proxy server.
1300 Optional. User name to authenticate with at the proxy server.
1301
1301
1302 ``always``
1302 ``always``
1303 Optional. Always use the proxy, even for localhost and any entries
1303 Optional. Always use the proxy, even for localhost and any entries
1304 in ``http_proxy.no``. (default: False)
1304 in ``http_proxy.no``. (default: False)
1305
1305
1306 ``merge``
1306 ``merge``
1307 ---------
1307 ---------
1308
1308
1309 This section specifies behavior during merges and updates.
1309 This section specifies behavior during merges and updates.
1310
1310
1311 ``checkignored``
1311 ``checkignored``
1312 Controls behavior when an ignored file on disk has the same name as a tracked
1312 Controls behavior when an ignored file on disk has the same name as a tracked
1313 file in the changeset being merged or updated to, and has different
1313 file in the changeset being merged or updated to, and has different
1314 contents. Options are ``abort``, ``warn`` and ``ignore``. With ``abort``,
1314 contents. Options are ``abort``, ``warn`` and ``ignore``. With ``abort``,
1315 abort on such files. With ``warn``, warn on such files and back them up as
1315 abort on such files. With ``warn``, warn on such files and back them up as
1316 ``.orig``. With ``ignore``, don't print a warning and back them up as
1316 ``.orig``. With ``ignore``, don't print a warning and back them up as
1317 ``.orig``. (default: ``abort``)
1317 ``.orig``. (default: ``abort``)
1318
1318
1319 ``checkunknown``
1319 ``checkunknown``
1320 Controls behavior when an unknown file that isn't ignored has the same name
1320 Controls behavior when an unknown file that isn't ignored has the same name
1321 as a tracked file in the changeset being merged or updated to, and has
1321 as a tracked file in the changeset being merged or updated to, and has
1322 different contents. Similar to ``merge.checkignored``, except for files that
1322 different contents. Similar to ``merge.checkignored``, except for files that
1323 are not ignored. (default: ``abort``)
1323 are not ignored. (default: ``abort``)
1324
1324
1325 ``on-failure``
1325 ``on-failure``
1326 When set to ``continue`` (the default), the merge process attempts to
1326 When set to ``continue`` (the default), the merge process attempts to
1327 merge all unresolved files using the merge chosen tool, regardless of
1327 merge all unresolved files using the merge chosen tool, regardless of
1328 whether previous file merge attempts during the process succeeded or not.
1328 whether previous file merge attempts during the process succeeded or not.
1329 Setting this to ``prompt`` will prompt after any merge failure continue
1329 Setting this to ``prompt`` will prompt after any merge failure continue
1330 or halt the merge process. Setting this to ``halt`` will automatically
1330 or halt the merge process. Setting this to ``halt`` will automatically
1331 halt the merge process on any merge tool failure. The merge process
1331 halt the merge process on any merge tool failure. The merge process
1332 can be restarted by using the ``resolve`` command. When a merge is
1332 can be restarted by using the ``resolve`` command. When a merge is
1333 halted, the repository is left in a normal ``unresolved`` merge state.
1333 halted, the repository is left in a normal ``unresolved`` merge state.
1334 (default: ``continue``)
1334 (default: ``continue``)
1335
1335
1336 ``merge-patterns``
1336 ``merge-patterns``
1337 ------------------
1337 ------------------
1338
1338
1339 This section specifies merge tools to associate with particular file
1339 This section specifies merge tools to associate with particular file
1340 patterns. Tools matched here will take precedence over the default
1340 patterns. Tools matched here will take precedence over the default
1341 merge tool. Patterns are globs by default, rooted at the repository
1341 merge tool. Patterns are globs by default, rooted at the repository
1342 root.
1342 root.
1343
1343
1344 Example::
1344 Example::
1345
1345
1346 [merge-patterns]
1346 [merge-patterns]
1347 **.c = kdiff3
1347 **.c = kdiff3
1348 **.jpg = myimgmerge
1348 **.jpg = myimgmerge
1349
1349
1350 ``merge-tools``
1350 ``merge-tools``
1351 ---------------
1351 ---------------
1352
1352
1353 This section configures external merge tools to use for file-level
1353 This section configures external merge tools to use for file-level
1354 merges. This section has likely been preconfigured at install time.
1354 merges. This section has likely been preconfigured at install time.
1355 Use :hg:`config merge-tools` to check the existing configuration.
1355 Use :hg:`config merge-tools` to check the existing configuration.
1356 Also see :hg:`help merge-tools` for more details.
1356 Also see :hg:`help merge-tools` for more details.
1357
1357
1358 Example ``~/.hgrc``::
1358 Example ``~/.hgrc``::
1359
1359
1360 [merge-tools]
1360 [merge-tools]
1361 # Override stock tool location
1361 # Override stock tool location
1362 kdiff3.executable = ~/bin/kdiff3
1362 kdiff3.executable = ~/bin/kdiff3
1363 # Specify command line
1363 # Specify command line
1364 kdiff3.args = $base $local $other -o $output
1364 kdiff3.args = $base $local $other -o $output
1365 # Give higher priority
1365 # Give higher priority
1366 kdiff3.priority = 1
1366 kdiff3.priority = 1
1367
1367
1368 # Changing the priority of preconfigured tool
1368 # Changing the priority of preconfigured tool
1369 meld.priority = 0
1369 meld.priority = 0
1370
1370
1371 # Disable a preconfigured tool
1371 # Disable a preconfigured tool
1372 vimdiff.disabled = yes
1372 vimdiff.disabled = yes
1373
1373
1374 # Define new tool
1374 # Define new tool
1375 myHtmlTool.args = -m $local $other $base $output
1375 myHtmlTool.args = -m $local $other $base $output
1376 myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
1376 myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
1377 myHtmlTool.priority = 1
1377 myHtmlTool.priority = 1
1378
1378
1379 Supported arguments:
1379 Supported arguments:
1380
1380
1381 ``priority``
1381 ``priority``
1382 The priority in which to evaluate this tool.
1382 The priority in which to evaluate this tool.
1383 (default: 0)
1383 (default: 0)
1384
1384
1385 ``executable``
1385 ``executable``
1386 Either just the name of the executable or its pathname.
1386 Either just the name of the executable or its pathname.
1387
1387
1388 .. container:: windows
1388 .. container:: windows
1389
1389
1390 On Windows, the path can use environment variables with ${ProgramFiles}
1390 On Windows, the path can use environment variables with ${ProgramFiles}
1391 syntax.
1391 syntax.
1392
1392
1393 (default: the tool name)
1393 (default: the tool name)
1394
1394
1395 ``args``
1395 ``args``
1396 The arguments to pass to the tool executable. You can refer to the
1396 The arguments to pass to the tool executable. You can refer to the
1397 files being merged as well as the output file through these
1397 files being merged as well as the output file through these
1398 variables: ``$base``, ``$local``, ``$other``, ``$output``.
1398 variables: ``$base``, ``$local``, ``$other``, ``$output``.
1399
1399
1400 The meaning of ``$local`` and ``$other`` can vary depending on which action is
1400 The meaning of ``$local`` and ``$other`` can vary depending on which action is
1401 being performed. During an update or merge, ``$local`` represents the original
1401 being performed. During an update or merge, ``$local`` represents the original
1402 state of the file, while ``$other`` represents the commit you are updating to or
1402 state of the file, while ``$other`` represents the commit you are updating to or
1403 the commit you are merging with. During a rebase, ``$local`` represents the
1403 the commit you are merging with. During a rebase, ``$local`` represents the
1404 destination of the rebase, and ``$other`` represents the commit being rebased.
1404 destination of the rebase, and ``$other`` represents the commit being rebased.
1405
1405
1406 Some operations define custom labels to assist with identifying the revisions,
1406 Some operations define custom labels to assist with identifying the revisions,
1407 accessible via ``$labellocal``, ``$labelother``, and ``$labelbase``. If custom
1407 accessible via ``$labellocal``, ``$labelother``, and ``$labelbase``. If custom
1408 labels are not available, these will be ``local``, ``other``, and ``base``,
1408 labels are not available, these will be ``local``, ``other``, and ``base``,
1409 respectively.
1409 respectively.
1410 (default: ``$local $base $other``)
1410 (default: ``$local $base $other``)
1411
1411
1412 ``premerge``
1412 ``premerge``
1413 Attempt to run internal non-interactive 3-way merge tool before
1413 Attempt to run internal non-interactive 3-way merge tool before
1414 launching external tool. Options are ``true``, ``false``, ``keep`` or
1414 launching external tool. Options are ``true``, ``false``, ``keep`` or
1415 ``keep-merge3``. The ``keep`` option will leave markers in the file if the
1415 ``keep-merge3``. The ``keep`` option will leave markers in the file if the
1416 premerge fails. The ``keep-merge3`` will do the same but include information
1416 premerge fails. The ``keep-merge3`` will do the same but include information
1417 about the base of the merge in the marker (see internal :merge3 in
1417 about the base of the merge in the marker (see internal :merge3 in
1418 :hg:`help merge-tools`).
1418 :hg:`help merge-tools`).
1419 (default: True)
1419 (default: True)
1420
1420
1421 ``binary``
1421 ``binary``
1422 This tool can merge binary files. (default: False, unless tool
1422 This tool can merge binary files. (default: False, unless tool
1423 was selected by file pattern match)
1423 was selected by file pattern match)
1424
1424
1425 ``symlink``
1425 ``symlink``
1426 This tool can merge symlinks. (default: False)
1426 This tool can merge symlinks. (default: False)
1427
1427
1428 ``check``
1428 ``check``
1429 A list of merge success-checking options:
1429 A list of merge success-checking options:
1430
1430
1431 ``changed``
1431 ``changed``
1432 Ask whether merge was successful when the merged file shows no changes.
1432 Ask whether merge was successful when the merged file shows no changes.
1433 ``conflicts``
1433 ``conflicts``
1434 Check whether there are conflicts even though the tool reported success.
1434 Check whether there are conflicts even though the tool reported success.
1435 ``prompt``
1435 ``prompt``
1436 Always prompt for merge success, regardless of success reported by tool.
1436 Always prompt for merge success, regardless of success reported by tool.
1437
1437
1438 ``fixeol``
1438 ``fixeol``
1439 Attempt to fix up EOL changes caused by the merge tool.
1439 Attempt to fix up EOL changes caused by the merge tool.
1440 (default: False)
1440 (default: False)
1441
1441
1442 ``gui``
1442 ``gui``
1443 This tool requires a graphical interface to run. (default: False)
1443 This tool requires a graphical interface to run. (default: False)
1444
1444
1445 ``mergemarkers``
1445 ``mergemarkers``
1446 Controls whether the labels passed via ``$labellocal``, ``$labelother``, and
1446 Controls whether the labels passed via ``$labellocal``, ``$labelother``, and
1447 ``$labelbase`` are ``detailed`` (respecting ``mergemarkertemplate``) or
1447 ``$labelbase`` are ``detailed`` (respecting ``mergemarkertemplate``) or
1448 ``basic``. If ``premerge`` is ``keep`` or ``keep-merge3``, the conflict
1448 ``basic``. If ``premerge`` is ``keep`` or ``keep-merge3``, the conflict
1449 markers generated during premerge will be ``detailed`` if either this option or
1449 markers generated during premerge will be ``detailed`` if either this option or
1450 the corresponding option in the ``[ui]`` section is ``detailed``.
1450 the corresponding option in the ``[ui]`` section is ``detailed``.
1451 (default: ``basic``)
1451 (default: ``basic``)
1452
1452
1453 ``mergemarkertemplate``
1453 ``mergemarkertemplate``
1454 This setting can be used to override ``mergemarkertemplate`` from the ``[ui]``
1454 This setting can be used to override ``mergemarkertemplate`` from the ``[ui]``
1455 section on a per-tool basis; this applies to the ``$label``-prefixed variables
1455 section on a per-tool basis; this applies to the ``$label``-prefixed variables
1456 and to the conflict markers that are generated if ``premerge`` is ``keep` or
1456 and to the conflict markers that are generated if ``premerge`` is ``keep` or
1457 ``keep-merge3``. See the corresponding variable in ``[ui]`` for more
1457 ``keep-merge3``. See the corresponding variable in ``[ui]`` for more
1458 information.
1458 information.
1459
1459
1460 .. container:: windows
1460 .. container:: windows
1461
1461
1462 ``regkey``
1462 ``regkey``
1463 Windows registry key which describes install location of this
1463 Windows registry key which describes install location of this
1464 tool. Mercurial will search for this key first under
1464 tool. Mercurial will search for this key first under
1465 ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
1465 ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
1466 (default: None)
1466 (default: None)
1467
1467
1468 ``regkeyalt``
1468 ``regkeyalt``
1469 An alternate Windows registry key to try if the first key is not
1469 An alternate Windows registry key to try if the first key is not
1470 found. The alternate key uses the same ``regname`` and ``regappend``
1470 found. The alternate key uses the same ``regname`` and ``regappend``
1471 semantics of the primary key. The most common use for this key
1471 semantics of the primary key. The most common use for this key
1472 is to search for 32bit applications on 64bit operating systems.
1472 is to search for 32bit applications on 64bit operating systems.
1473 (default: None)
1473 (default: None)
1474
1474
1475 ``regname``
1475 ``regname``
1476 Name of value to read from specified registry key.
1476 Name of value to read from specified registry key.
1477 (default: the unnamed (default) value)
1477 (default: the unnamed (default) value)
1478
1478
1479 ``regappend``
1479 ``regappend``
1480 String to append to the value read from the registry, typically
1480 String to append to the value read from the registry, typically
1481 the executable name of the tool.
1481 the executable name of the tool.
1482 (default: None)
1482 (default: None)
1483
1483
1484 ``pager``
1484 ``pager``
1485 ---------
1485 ---------
1486
1486
1487 Setting used to control when to paginate and with what external tool. See
1487 Setting used to control when to paginate and with what external tool. See
1488 :hg:`help pager` for details.
1488 :hg:`help pager` for details.
1489
1489
1490 ``pager``
1490 ``pager``
1491 Define the external tool used as pager.
1491 Define the external tool used as pager.
1492
1492
1493 If no pager is set, Mercurial uses the environment variable $PAGER.
1493 If no pager is set, Mercurial uses the environment variable $PAGER.
1494 If neither pager.pager, nor $PAGER is set, a default pager will be
1494 If neither pager.pager, nor $PAGER is set, a default pager will be
1495 used, typically `less` on Unix and `more` on Windows. Example::
1495 used, typically `less` on Unix and `more` on Windows. Example::
1496
1496
1497 [pager]
1497 [pager]
1498 pager = less -FRX
1498 pager = less -FRX
1499
1499
1500 ``ignore``
1500 ``ignore``
1501 List of commands to disable the pager for. Example::
1501 List of commands to disable the pager for. Example::
1502
1502
1503 [pager]
1503 [pager]
1504 ignore = version, help, update
1504 ignore = version, help, update
1505
1505
1506 ``patch``
1506 ``patch``
1507 ---------
1507 ---------
1508
1508
1509 Settings used when applying patches, for instance through the 'import'
1509 Settings used when applying patches, for instance through the 'import'
1510 command or with Mercurial Queues extension.
1510 command or with Mercurial Queues extension.
1511
1511
1512 ``eol``
1512 ``eol``
1513 When set to 'strict' patch content and patched files end of lines
1513 When set to 'strict' patch content and patched files end of lines
1514 are preserved. When set to ``lf`` or ``crlf``, both files end of
1514 are preserved. When set to ``lf`` or ``crlf``, both files end of
1515 lines are ignored when patching and the result line endings are
1515 lines are ignored when patching and the result line endings are
1516 normalized to either LF (Unix) or CRLF (Windows). When set to
1516 normalized to either LF (Unix) or CRLF (Windows). When set to
1517 ``auto``, end of lines are again ignored while patching but line
1517 ``auto``, end of lines are again ignored while patching but line
1518 endings in patched files are normalized to their original setting
1518 endings in patched files are normalized to their original setting
1519 on a per-file basis. If target file does not exist or has no end
1519 on a per-file basis. If target file does not exist or has no end
1520 of line, patch line endings are preserved.
1520 of line, patch line endings are preserved.
1521 (default: strict)
1521 (default: strict)
1522
1522
1523 ``fuzz``
1523 ``fuzz``
1524 The number of lines of 'fuzz' to allow when applying patches. This
1524 The number of lines of 'fuzz' to allow when applying patches. This
1525 controls how much context the patcher is allowed to ignore when
1525 controls how much context the patcher is allowed to ignore when
1526 trying to apply a patch.
1526 trying to apply a patch.
1527 (default: 2)
1527 (default: 2)
1528
1528
1529 ``paths``
1529 ``paths``
1530 ---------
1530 ---------
1531
1531
1532 Assigns symbolic names and behavior to repositories.
1532 Assigns symbolic names and behavior to repositories.
1533
1533
1534 Options are symbolic names defining the URL or directory that is the
1534 Options are symbolic names defining the URL or directory that is the
1535 location of the repository. Example::
1535 location of the repository. Example::
1536
1536
1537 [paths]
1537 [paths]
1538 my_server = https://example.com/my_repo
1538 my_server = https://example.com/my_repo
1539 local_path = /home/me/repo
1539 local_path = /home/me/repo
1540
1540
1541 These symbolic names can be used from the command line. To pull
1541 These symbolic names can be used from the command line. To pull
1542 from ``my_server``: :hg:`pull my_server`. To push to ``local_path``:
1542 from ``my_server``: :hg:`pull my_server`. To push to ``local_path``:
1543 :hg:`push local_path`.
1543 :hg:`push local_path`.
1544
1544
1545 Options containing colons (``:``) denote sub-options that can influence
1545 Options containing colons (``:``) denote sub-options that can influence
1546 behavior for that specific path. Example::
1546 behavior for that specific path. Example::
1547
1547
1548 [paths]
1548 [paths]
1549 my_server = https://example.com/my_path
1549 my_server = https://example.com/my_path
1550 my_server:pushurl = ssh://example.com/my_path
1550 my_server:pushurl = ssh://example.com/my_path
1551
1551
1552 The following sub-options can be defined:
1552 The following sub-options can be defined:
1553
1553
1554 ``pushurl``
1554 ``pushurl``
1555 The URL to use for push operations. If not defined, the location
1555 The URL to use for push operations. If not defined, the location
1556 defined by the path's main entry is used.
1556 defined by the path's main entry is used.
1557
1557
1558 ``pushrev``
1558 ``pushrev``
1559 A revset defining which revisions to push by default.
1559 A revset defining which revisions to push by default.
1560
1560
1561 When :hg:`push` is executed without a ``-r`` argument, the revset
1561 When :hg:`push` is executed without a ``-r`` argument, the revset
1562 defined by this sub-option is evaluated to determine what to push.
1562 defined by this sub-option is evaluated to determine what to push.
1563
1563
1564 For example, a value of ``.`` will push the working directory's
1564 For example, a value of ``.`` will push the working directory's
1565 revision by default.
1565 revision by default.
1566
1566
1567 Revsets specifying bookmarks will not result in the bookmark being
1567 Revsets specifying bookmarks will not result in the bookmark being
1568 pushed.
1568 pushed.
1569
1569
1570 The following special named paths exist:
1570 The following special named paths exist:
1571
1571
1572 ``default``
1572 ``default``
1573 The URL or directory to use when no source or remote is specified.
1573 The URL or directory to use when no source or remote is specified.
1574
1574
1575 :hg:`clone` will automatically define this path to the location the
1575 :hg:`clone` will automatically define this path to the location the
1576 repository was cloned from.
1576 repository was cloned from.
1577
1577
1578 ``default-push``
1578 ``default-push``
1579 (deprecated) The URL or directory for the default :hg:`push` location.
1579 (deprecated) The URL or directory for the default :hg:`push` location.
1580 ``default:pushurl`` should be used instead.
1580 ``default:pushurl`` should be used instead.
1581
1581
1582 ``phases``
1582 ``phases``
1583 ----------
1583 ----------
1584
1584
1585 Specifies default handling of phases. See :hg:`help phases` for more
1585 Specifies default handling of phases. See :hg:`help phases` for more
1586 information about working with phases.
1586 information about working with phases.
1587
1587
1588 ``publish``
1588 ``publish``
1589 Controls draft phase behavior when working as a server. When true,
1589 Controls draft phase behavior when working as a server. When true,
1590 pushed changesets are set to public in both client and server and
1590 pushed changesets are set to public in both client and server and
1591 pulled or cloned changesets are set to public in the client.
1591 pulled or cloned changesets are set to public in the client.
1592 (default: True)
1592 (default: True)
1593
1593
1594 ``new-commit``
1594 ``new-commit``
1595 Phase of newly-created commits.
1595 Phase of newly-created commits.
1596 (default: draft)
1596 (default: draft)
1597
1597
1598 ``checksubrepos``
1598 ``checksubrepos``
1599 Check the phase of the current revision of each subrepository. Allowed
1599 Check the phase of the current revision of each subrepository. Allowed
1600 values are "ignore", "follow" and "abort". For settings other than
1600 values are "ignore", "follow" and "abort". For settings other than
1601 "ignore", the phase of the current revision of each subrepository is
1601 "ignore", the phase of the current revision of each subrepository is
1602 checked before committing the parent repository. If any of those phases is
1602 checked before committing the parent repository. If any of those phases is
1603 greater than the phase of the parent repository (e.g. if a subrepo is in a
1603 greater than the phase of the parent repository (e.g. if a subrepo is in a
1604 "secret" phase while the parent repo is in "draft" phase), the commit is
1604 "secret" phase while the parent repo is in "draft" phase), the commit is
1605 either aborted (if checksubrepos is set to "abort") or the higher phase is
1605 either aborted (if checksubrepos is set to "abort") or the higher phase is
1606 used for the parent repository commit (if set to "follow").
1606 used for the parent repository commit (if set to "follow").
1607 (default: follow)
1607 (default: follow)
1608
1608
1609
1609
1610 ``profiling``
1610 ``profiling``
1611 -------------
1611 -------------
1612
1612
1613 Specifies profiling type, format, and file output. Two profilers are
1613 Specifies profiling type, format, and file output. Two profilers are
1614 supported: an instrumenting profiler (named ``ls``), and a sampling
1614 supported: an instrumenting profiler (named ``ls``), and a sampling
1615 profiler (named ``stat``).
1615 profiler (named ``stat``).
1616
1616
1617 In this section description, 'profiling data' stands for the raw data
1617 In this section description, 'profiling data' stands for the raw data
1618 collected during profiling, while 'profiling report' stands for a
1618 collected during profiling, while 'profiling report' stands for a
1619 statistical text report generated from the profiling data.
1619 statistical text report generated from the profiling data.
1620
1620
1621 ``enabled``
1621 ``enabled``
1622 Enable the profiler.
1622 Enable the profiler.
1623 (default: false)
1623 (default: false)
1624
1624
1625 This is equivalent to passing ``--profile`` on the command line.
1625 This is equivalent to passing ``--profile`` on the command line.
1626
1626
1627 ``type``
1627 ``type``
1628 The type of profiler to use.
1628 The type of profiler to use.
1629 (default: stat)
1629 (default: stat)
1630
1630
1631 ``ls``
1631 ``ls``
1632 Use Python's built-in instrumenting profiler. This profiler
1632 Use Python's built-in instrumenting profiler. This profiler
1633 works on all platforms, but each line number it reports is the
1633 works on all platforms, but each line number it reports is the
1634 first line of a function. This restriction makes it difficult to
1634 first line of a function. This restriction makes it difficult to
1635 identify the expensive parts of a non-trivial function.
1635 identify the expensive parts of a non-trivial function.
1636 ``stat``
1636 ``stat``
1637 Use a statistical profiler, statprof. This profiler is most
1637 Use a statistical profiler, statprof. This profiler is most
1638 useful for profiling commands that run for longer than about 0.1
1638 useful for profiling commands that run for longer than about 0.1
1639 seconds.
1639 seconds.
1640
1640
1641 ``format``
1641 ``format``
1642 Profiling format. Specific to the ``ls`` instrumenting profiler.
1642 Profiling format. Specific to the ``ls`` instrumenting profiler.
1643 (default: text)
1643 (default: text)
1644
1644
1645 ``text``
1645 ``text``
1646 Generate a profiling report. When saving to a file, it should be
1646 Generate a profiling report. When saving to a file, it should be
1647 noted that only the report is saved, and the profiling data is
1647 noted that only the report is saved, and the profiling data is
1648 not kept.
1648 not kept.
1649 ``kcachegrind``
1649 ``kcachegrind``
1650 Format profiling data for kcachegrind use: when saving to a
1650 Format profiling data for kcachegrind use: when saving to a
1651 file, the generated file can directly be loaded into
1651 file, the generated file can directly be loaded into
1652 kcachegrind.
1652 kcachegrind.
1653
1653
1654 ``statformat``
1654 ``statformat``
1655 Profiling format for the ``stat`` profiler.
1655 Profiling format for the ``stat`` profiler.
1656 (default: hotpath)
1656 (default: hotpath)
1657
1657
1658 ``hotpath``
1658 ``hotpath``
1659 Show a tree-based display containing the hot path of execution (where
1659 Show a tree-based display containing the hot path of execution (where
1660 most time was spent).
1660 most time was spent).
1661 ``bymethod``
1661 ``bymethod``
1662 Show a table of methods ordered by how frequently they are active.
1662 Show a table of methods ordered by how frequently they are active.
1663 ``byline``
1663 ``byline``
1664 Show a table of lines in files ordered by how frequently they are active.
1664 Show a table of lines in files ordered by how frequently they are active.
1665 ``json``
1665 ``json``
1666 Render profiling data as JSON.
1666 Render profiling data as JSON.
1667
1667
1668 ``frequency``
1668 ``frequency``
1669 Sampling frequency. Specific to the ``stat`` sampling profiler.
1669 Sampling frequency. Specific to the ``stat`` sampling profiler.
1670 (default: 1000)
1670 (default: 1000)
1671
1671
1672 ``output``
1672 ``output``
1673 File path where profiling data or report should be saved. If the
1673 File path where profiling data or report should be saved. If the
1674 file exists, it is replaced. (default: None, data is printed on
1674 file exists, it is replaced. (default: None, data is printed on
1675 stderr)
1675 stderr)
1676
1676
1677 ``sort``
1677 ``sort``
1678 Sort field. Specific to the ``ls`` instrumenting profiler.
1678 Sort field. Specific to the ``ls`` instrumenting profiler.
1679 One of ``callcount``, ``reccallcount``, ``totaltime`` and
1679 One of ``callcount``, ``reccallcount``, ``totaltime`` and
1680 ``inlinetime``.
1680 ``inlinetime``.
1681 (default: inlinetime)
1681 (default: inlinetime)
1682
1682
1683 ``time-track``
1683 ``time-track``
1684 Control if the stat profiler track ``cpu`` or ``real`` time.
1684 Control if the stat profiler track ``cpu`` or ``real`` time.
1685 (default: ``cpu``)
1685 (default: ``cpu``)
1686
1686
1687 ``limit``
1687 ``limit``
1688 Number of lines to show. Specific to the ``ls`` instrumenting profiler.
1688 Number of lines to show. Specific to the ``ls`` instrumenting profiler.
1689 (default: 30)
1689 (default: 30)
1690
1690
1691 ``nested``
1691 ``nested``
1692 Show at most this number of lines of drill-down info after each main entry.
1692 Show at most this number of lines of drill-down info after each main entry.
1693 This can help explain the difference between Total and Inline.
1693 This can help explain the difference between Total and Inline.
1694 Specific to the ``ls`` instrumenting profiler.
1694 Specific to the ``ls`` instrumenting profiler.
1695 (default: 0)
1695 (default: 0)
1696
1696
1697 ``showmin``
1697 ``showmin``
1698 Minimum fraction of samples an entry must have for it to be displayed.
1698 Minimum fraction of samples an entry must have for it to be displayed.
1699 Can be specified as a float between ``0.0`` and ``1.0`` or can have a
1699 Can be specified as a float between ``0.0`` and ``1.0`` or can have a
1700 ``%`` afterwards to allow values up to ``100``. e.g. ``5%``.
1700 ``%`` afterwards to allow values up to ``100``. e.g. ``5%``.
1701
1701
1702 Only used by the ``stat`` profiler.
1702 Only used by the ``stat`` profiler.
1703
1703
1704 For the ``hotpath`` format, default is ``0.05``.
1704 For the ``hotpath`` format, default is ``0.05``.
1705 For the ``chrome`` format, default is ``0.005``.
1705 For the ``chrome`` format, default is ``0.005``.
1706
1706
1707 The option is unused on other formats.
1707 The option is unused on other formats.
1708
1708
1709 ``showmax``
1709 ``showmax``
1710 Maximum fraction of samples an entry can have before it is ignored in
1710 Maximum fraction of samples an entry can have before it is ignored in
1711 display. Values format is the same as ``showmin``.
1711 display. Values format is the same as ``showmin``.
1712
1712
1713 Only used by the ``stat`` profiler.
1713 Only used by the ``stat`` profiler.
1714
1714
1715 For the ``chrome`` format, default is ``0.999``.
1715 For the ``chrome`` format, default is ``0.999``.
1716
1716
1717 The option is unused on other formats.
1717 The option is unused on other formats.
1718
1718
1719 ``progress``
1719 ``progress``
1720 ------------
1720 ------------
1721
1721
1722 Mercurial commands can draw progress bars that are as informative as
1722 Mercurial commands can draw progress bars that are as informative as
1723 possible. Some progress bars only offer indeterminate information, while others
1723 possible. Some progress bars only offer indeterminate information, while others
1724 have a definite end point.
1724 have a definite end point.
1725
1725
1726 ``delay``
1726 ``delay``
1727 Number of seconds (float) before showing the progress bar. (default: 3)
1727 Number of seconds (float) before showing the progress bar. (default: 3)
1728
1728
1729 ``changedelay``
1729 ``changedelay``
1730 Minimum delay before showing a new topic. When set to less than 3 * refresh,
1730 Minimum delay before showing a new topic. When set to less than 3 * refresh,
1731 that value will be used instead. (default: 1)
1731 that value will be used instead. (default: 1)
1732
1732
1733 ``estimateinterval``
1733 ``estimateinterval``
1734 Maximum sampling interval in seconds for speed and estimated time
1734 Maximum sampling interval in seconds for speed and estimated time
1735 calculation. (default: 60)
1735 calculation. (default: 60)
1736
1736
1737 ``refresh``
1737 ``refresh``
1738 Time in seconds between refreshes of the progress bar. (default: 0.1)
1738 Time in seconds between refreshes of the progress bar. (default: 0.1)
1739
1739
1740 ``format``
1740 ``format``
1741 Format of the progress bar.
1741 Format of the progress bar.
1742
1742
1743 Valid entries for the format field are ``topic``, ``bar``, ``number``,
1743 Valid entries for the format field are ``topic``, ``bar``, ``number``,
1744 ``unit``, ``estimate``, ``speed``, and ``item``. ``item`` defaults to the
1744 ``unit``, ``estimate``, ``speed``, and ``item``. ``item`` defaults to the
1745 last 20 characters of the item, but this can be changed by adding either
1745 last 20 characters of the item, but this can be changed by adding either
1746 ``-<num>`` which would take the last num characters, or ``+<num>`` for the
1746 ``-<num>`` which would take the last num characters, or ``+<num>`` for the
1747 first num characters.
1747 first num characters.
1748
1748
1749 (default: topic bar number estimate)
1749 (default: topic bar number estimate)
1750
1750
1751 ``width``
1751 ``width``
1752 If set, the maximum width of the progress information (that is, min(width,
1752 If set, the maximum width of the progress information (that is, min(width,
1753 term width) will be used).
1753 term width) will be used).
1754
1754
1755 ``clear-complete``
1755 ``clear-complete``
1756 Clear the progress bar after it's done. (default: True)
1756 Clear the progress bar after it's done. (default: True)
1757
1757
1758 ``disable``
1758 ``disable``
1759 If true, don't show a progress bar.
1759 If true, don't show a progress bar.
1760
1760
1761 ``assume-tty``
1761 ``assume-tty``
1762 If true, ALWAYS show a progress bar, unless disable is given.
1762 If true, ALWAYS show a progress bar, unless disable is given.
1763
1763
1764 ``rebase``
1764 ``rebase``
1765 ----------
1765 ----------
1766
1766
1767 ``evolution.allowdivergence``
1767 ``evolution.allowdivergence``
1768 Default to False, when True allow creating divergence when performing
1768 Default to False, when True allow creating divergence when performing
1769 rebase of obsolete changesets.
1769 rebase of obsolete changesets.
1770
1770
1771 ``revsetalias``
1771 ``revsetalias``
1772 ---------------
1772 ---------------
1773
1773
1774 Alias definitions for revsets. See :hg:`help revsets` for details.
1774 Alias definitions for revsets. See :hg:`help revsets` for details.
1775
1775
1776 ``revlog``
1776 ``storage``
1777 ----------
1777 ----------
1778
1778
1779 Control the strategy Mercurial uses internally to store history. Options in this
1779 Control the strategy Mercurial uses internally to store history. Options in this
1780 category impact performance and repository size.
1780 category impact performance and repository size.
1781
1781
1782 ``optimize-delta-parent-choice``
1782 ``revlog.optimize-delta-parent-choice``
1783 When storing a merge revision, both parents will be equally considered as
1783 When storing a merge revision, both parents will be equally considered as
1784 a possible delta base. This results in better delta selection and improved
1784 a possible delta base. This results in better delta selection and improved
1785 revlog compression. This option is enabled by default.
1785 revlog compression. This option is enabled by default.
1786
1786
1787 Turning this option off can result in large increase of repository size for
1787 Turning this option off can result in large increase of repository size for
1788 repository with many merges.
1788 repository with many merges.
1789
1789
1790 ``server``
1790 ``server``
1791 ----------
1791 ----------
1792
1792
1793 Controls generic server settings.
1793 Controls generic server settings.
1794
1794
1795 ``bookmarks-pushkey-compat``
1795 ``bookmarks-pushkey-compat``
1796 Trigger pushkey hook when being pushed bookmark updates. This config exist
1796 Trigger pushkey hook when being pushed bookmark updates. This config exist
1797 for compatibility purpose (default to True)
1797 for compatibility purpose (default to True)
1798
1798
1799 If you use ``pushkey`` and ``pre-pushkey`` hooks to control bookmark
1799 If you use ``pushkey`` and ``pre-pushkey`` hooks to control bookmark
1800 movement we recommend you migrate them to ``txnclose-bookmark`` and
1800 movement we recommend you migrate them to ``txnclose-bookmark`` and
1801 ``pretxnclose-bookmark``.
1801 ``pretxnclose-bookmark``.
1802
1802
1803 ``compressionengines``
1803 ``compressionengines``
1804 List of compression engines and their relative priority to advertise
1804 List of compression engines and their relative priority to advertise
1805 to clients.
1805 to clients.
1806
1806
1807 The order of compression engines determines their priority, the first
1807 The order of compression engines determines their priority, the first
1808 having the highest priority. If a compression engine is not listed
1808 having the highest priority. If a compression engine is not listed
1809 here, it won't be advertised to clients.
1809 here, it won't be advertised to clients.
1810
1810
1811 If not set (the default), built-in defaults are used. Run
1811 If not set (the default), built-in defaults are used. Run
1812 :hg:`debuginstall` to list available compression engines and their
1812 :hg:`debuginstall` to list available compression engines and their
1813 default wire protocol priority.
1813 default wire protocol priority.
1814
1814
1815 Older Mercurial clients only support zlib compression and this setting
1815 Older Mercurial clients only support zlib compression and this setting
1816 has no effect for legacy clients.
1816 has no effect for legacy clients.
1817
1817
1818 ``uncompressed``
1818 ``uncompressed``
1819 Whether to allow clients to clone a repository using the
1819 Whether to allow clients to clone a repository using the
1820 uncompressed streaming protocol. This transfers about 40% more
1820 uncompressed streaming protocol. This transfers about 40% more
1821 data than a regular clone, but uses less memory and CPU on both
1821 data than a regular clone, but uses less memory and CPU on both
1822 server and client. Over a LAN (100 Mbps or better) or a very fast
1822 server and client. Over a LAN (100 Mbps or better) or a very fast
1823 WAN, an uncompressed streaming clone is a lot faster (~10x) than a
1823 WAN, an uncompressed streaming clone is a lot faster (~10x) than a
1824 regular clone. Over most WAN connections (anything slower than
1824 regular clone. Over most WAN connections (anything slower than
1825 about 6 Mbps), uncompressed streaming is slower, because of the
1825 about 6 Mbps), uncompressed streaming is slower, because of the
1826 extra data transfer overhead. This mode will also temporarily hold
1826 extra data transfer overhead. This mode will also temporarily hold
1827 the write lock while determining what data to transfer.
1827 the write lock while determining what data to transfer.
1828 (default: True)
1828 (default: True)
1829
1829
1830 ``uncompressedallowsecret``
1830 ``uncompressedallowsecret``
1831 Whether to allow stream clones when the repository contains secret
1831 Whether to allow stream clones when the repository contains secret
1832 changesets. (default: False)
1832 changesets. (default: False)
1833
1833
1834 ``preferuncompressed``
1834 ``preferuncompressed``
1835 When set, clients will try to use the uncompressed streaming
1835 When set, clients will try to use the uncompressed streaming
1836 protocol. (default: False)
1836 protocol. (default: False)
1837
1837
1838 ``disablefullbundle``
1838 ``disablefullbundle``
1839 When set, servers will refuse attempts to do pull-based clones.
1839 When set, servers will refuse attempts to do pull-based clones.
1840 If this option is set, ``preferuncompressed`` and/or clone bundles
1840 If this option is set, ``preferuncompressed`` and/or clone bundles
1841 are highly recommended. Partial clones will still be allowed.
1841 are highly recommended. Partial clones will still be allowed.
1842 (default: False)
1842 (default: False)
1843
1843
1844 ``streamunbundle``
1844 ``streamunbundle``
1845 When set, servers will apply data sent from the client directly,
1845 When set, servers will apply data sent from the client directly,
1846 otherwise it will be written to a temporary file first. This option
1846 otherwise it will be written to a temporary file first. This option
1847 effectively prevents concurrent pushes.
1847 effectively prevents concurrent pushes.
1848
1848
1849 ``pullbundle``
1849 ``pullbundle``
1850 When set, the server will check pullbundle.manifest for bundles
1850 When set, the server will check pullbundle.manifest for bundles
1851 covering the requested heads and common nodes. The first matching
1851 covering the requested heads and common nodes. The first matching
1852 entry will be streamed to the client.
1852 entry will be streamed to the client.
1853
1853
1854 For HTTP transport, the stream will still use zlib compression
1854 For HTTP transport, the stream will still use zlib compression
1855 for older clients.
1855 for older clients.
1856
1856
1857 ``concurrent-push-mode``
1857 ``concurrent-push-mode``
1858 Level of allowed race condition between two pushing clients.
1858 Level of allowed race condition between two pushing clients.
1859
1859
1860 - 'strict': push is abort if another client touched the repository
1860 - 'strict': push is abort if another client touched the repository
1861 while the push was preparing. (default)
1861 while the push was preparing. (default)
1862 - 'check-related': push is only aborted if it affects head that got also
1862 - 'check-related': push is only aborted if it affects head that got also
1863 affected while the push was preparing.
1863 affected while the push was preparing.
1864
1864
1865 This requires compatible client (version 4.3 and later). Old client will
1865 This requires compatible client (version 4.3 and later). Old client will
1866 use 'strict'.
1866 use 'strict'.
1867
1867
1868 ``validate``
1868 ``validate``
1869 Whether to validate the completeness of pushed changesets by
1869 Whether to validate the completeness of pushed changesets by
1870 checking that all new file revisions specified in manifests are
1870 checking that all new file revisions specified in manifests are
1871 present. (default: False)
1871 present. (default: False)
1872
1872
1873 ``maxhttpheaderlen``
1873 ``maxhttpheaderlen``
1874 Instruct HTTP clients not to send request headers longer than this
1874 Instruct HTTP clients not to send request headers longer than this
1875 many bytes. (default: 1024)
1875 many bytes. (default: 1024)
1876
1876
1877 ``bundle1``
1877 ``bundle1``
1878 Whether to allow clients to push and pull using the legacy bundle1
1878 Whether to allow clients to push and pull using the legacy bundle1
1879 exchange format. (default: True)
1879 exchange format. (default: True)
1880
1880
1881 ``bundle1gd``
1881 ``bundle1gd``
1882 Like ``bundle1`` but only used if the repository is using the
1882 Like ``bundle1`` but only used if the repository is using the
1883 *generaldelta* storage format. (default: True)
1883 *generaldelta* storage format. (default: True)
1884
1884
1885 ``bundle1.push``
1885 ``bundle1.push``
1886 Whether to allow clients to push using the legacy bundle1 exchange
1886 Whether to allow clients to push using the legacy bundle1 exchange
1887 format. (default: True)
1887 format. (default: True)
1888
1888
1889 ``bundle1gd.push``
1889 ``bundle1gd.push``
1890 Like ``bundle1.push`` but only used if the repository is using the
1890 Like ``bundle1.push`` but only used if the repository is using the
1891 *generaldelta* storage format. (default: True)
1891 *generaldelta* storage format. (default: True)
1892
1892
1893 ``bundle1.pull``
1893 ``bundle1.pull``
1894 Whether to allow clients to pull using the legacy bundle1 exchange
1894 Whether to allow clients to pull using the legacy bundle1 exchange
1895 format. (default: True)
1895 format. (default: True)
1896
1896
1897 ``bundle1gd.pull``
1897 ``bundle1gd.pull``
1898 Like ``bundle1.pull`` but only used if the repository is using the
1898 Like ``bundle1.pull`` but only used if the repository is using the
1899 *generaldelta* storage format. (default: True)
1899 *generaldelta* storage format. (default: True)
1900
1900
1901 Large repositories using the *generaldelta* storage format should
1901 Large repositories using the *generaldelta* storage format should
1902 consider setting this option because converting *generaldelta*
1902 consider setting this option because converting *generaldelta*
1903 repositories to the exchange format required by the bundle1 data
1903 repositories to the exchange format required by the bundle1 data
1904 format can consume a lot of CPU.
1904 format can consume a lot of CPU.
1905
1905
1906 ``zliblevel``
1906 ``zliblevel``
1907 Integer between ``-1`` and ``9`` that controls the zlib compression level
1907 Integer between ``-1`` and ``9`` that controls the zlib compression level
1908 for wire protocol commands that send zlib compressed output (notably the
1908 for wire protocol commands that send zlib compressed output (notably the
1909 commands that send repository history data).
1909 commands that send repository history data).
1910
1910
1911 The default (``-1``) uses the default zlib compression level, which is
1911 The default (``-1``) uses the default zlib compression level, which is
1912 likely equivalent to ``6``. ``0`` means no compression. ``9`` means
1912 likely equivalent to ``6``. ``0`` means no compression. ``9`` means
1913 maximum compression.
1913 maximum compression.
1914
1914
1915 Setting this option allows server operators to make trade-offs between
1915 Setting this option allows server operators to make trade-offs between
1916 bandwidth and CPU used. Lowering the compression lowers CPU utilization
1916 bandwidth and CPU used. Lowering the compression lowers CPU utilization
1917 but sends more bytes to clients.
1917 but sends more bytes to clients.
1918
1918
1919 This option only impacts the HTTP server.
1919 This option only impacts the HTTP server.
1920
1920
1921 ``zstdlevel``
1921 ``zstdlevel``
1922 Integer between ``1`` and ``22`` that controls the zstd compression level
1922 Integer between ``1`` and ``22`` that controls the zstd compression level
1923 for wire protocol commands. ``1`` is the minimal amount of compression and
1923 for wire protocol commands. ``1`` is the minimal amount of compression and
1924 ``22`` is the highest amount of compression.
1924 ``22`` is the highest amount of compression.
1925
1925
1926 The default (``3``) should be significantly faster than zlib while likely
1926 The default (``3``) should be significantly faster than zlib while likely
1927 delivering better compression ratios.
1927 delivering better compression ratios.
1928
1928
1929 This option only impacts the HTTP server.
1929 This option only impacts the HTTP server.
1930
1930
1931 See also ``server.zliblevel``.
1931 See also ``server.zliblevel``.
1932
1932
1933 ``smtp``
1933 ``smtp``
1934 --------
1934 --------
1935
1935
1936 Configuration for extensions that need to send email messages.
1936 Configuration for extensions that need to send email messages.
1937
1937
1938 ``host``
1938 ``host``
1939 Host name of mail server, e.g. "mail.example.com".
1939 Host name of mail server, e.g. "mail.example.com".
1940
1940
1941 ``port``
1941 ``port``
1942 Optional. Port to connect to on mail server. (default: 465 if
1942 Optional. Port to connect to on mail server. (default: 465 if
1943 ``tls`` is smtps; 25 otherwise)
1943 ``tls`` is smtps; 25 otherwise)
1944
1944
1945 ``tls``
1945 ``tls``
1946 Optional. Method to enable TLS when connecting to mail server: starttls,
1946 Optional. Method to enable TLS when connecting to mail server: starttls,
1947 smtps or none. (default: none)
1947 smtps or none. (default: none)
1948
1948
1949 ``username``
1949 ``username``
1950 Optional. User name for authenticating with the SMTP server.
1950 Optional. User name for authenticating with the SMTP server.
1951 (default: None)
1951 (default: None)
1952
1952
1953 ``password``
1953 ``password``
1954 Optional. Password for authenticating with the SMTP server. If not
1954 Optional. Password for authenticating with the SMTP server. If not
1955 specified, interactive sessions will prompt the user for a
1955 specified, interactive sessions will prompt the user for a
1956 password; non-interactive sessions will fail. (default: None)
1956 password; non-interactive sessions will fail. (default: None)
1957
1957
1958 ``local_hostname``
1958 ``local_hostname``
1959 Optional. The hostname that the sender can use to identify
1959 Optional. The hostname that the sender can use to identify
1960 itself to the MTA.
1960 itself to the MTA.
1961
1961
1962
1962
1963 ``subpaths``
1963 ``subpaths``
1964 ------------
1964 ------------
1965
1965
1966 Subrepository source URLs can go stale if a remote server changes name
1966 Subrepository source URLs can go stale if a remote server changes name
1967 or becomes temporarily unavailable. This section lets you define
1967 or becomes temporarily unavailable. This section lets you define
1968 rewrite rules of the form::
1968 rewrite rules of the form::
1969
1969
1970 <pattern> = <replacement>
1970 <pattern> = <replacement>
1971
1971
1972 where ``pattern`` is a regular expression matching a subrepository
1972 where ``pattern`` is a regular expression matching a subrepository
1973 source URL and ``replacement`` is the replacement string used to
1973 source URL and ``replacement`` is the replacement string used to
1974 rewrite it. Groups can be matched in ``pattern`` and referenced in
1974 rewrite it. Groups can be matched in ``pattern`` and referenced in
1975 ``replacements``. For instance::
1975 ``replacements``. For instance::
1976
1976
1977 http://server/(.*)-hg/ = http://hg.server/\1/
1977 http://server/(.*)-hg/ = http://hg.server/\1/
1978
1978
1979 rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``.
1979 rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``.
1980
1980
1981 Relative subrepository paths are first made absolute, and the
1981 Relative subrepository paths are first made absolute, and the
1982 rewrite rules are then applied on the full (absolute) path. If ``pattern``
1982 rewrite rules are then applied on the full (absolute) path. If ``pattern``
1983 doesn't match the full path, an attempt is made to apply it on the
1983 doesn't match the full path, an attempt is made to apply it on the
1984 relative path alone. The rules are applied in definition order.
1984 relative path alone. The rules are applied in definition order.
1985
1985
1986 ``subrepos``
1986 ``subrepos``
1987 ------------
1987 ------------
1988
1988
1989 This section contains options that control the behavior of the
1989 This section contains options that control the behavior of the
1990 subrepositories feature. See also :hg:`help subrepos`.
1990 subrepositories feature. See also :hg:`help subrepos`.
1991
1991
1992 Security note: auditing in Mercurial is known to be insufficient to
1992 Security note: auditing in Mercurial is known to be insufficient to
1993 prevent clone-time code execution with carefully constructed Git
1993 prevent clone-time code execution with carefully constructed Git
1994 subrepos. It is unknown if a similar detect is present in Subversion
1994 subrepos. It is unknown if a similar detect is present in Subversion
1995 subrepos. Both Git and Subversion subrepos are disabled by default
1995 subrepos. Both Git and Subversion subrepos are disabled by default
1996 out of security concerns. These subrepo types can be enabled using
1996 out of security concerns. These subrepo types can be enabled using
1997 the respective options below.
1997 the respective options below.
1998
1998
1999 ``allowed``
1999 ``allowed``
2000 Whether subrepositories are allowed in the working directory.
2000 Whether subrepositories are allowed in the working directory.
2001
2001
2002 When false, commands involving subrepositories (like :hg:`update`)
2002 When false, commands involving subrepositories (like :hg:`update`)
2003 will fail for all subrepository types.
2003 will fail for all subrepository types.
2004 (default: true)
2004 (default: true)
2005
2005
2006 ``hg:allowed``
2006 ``hg:allowed``
2007 Whether Mercurial subrepositories are allowed in the working
2007 Whether Mercurial subrepositories are allowed in the working
2008 directory. This option only has an effect if ``subrepos.allowed``
2008 directory. This option only has an effect if ``subrepos.allowed``
2009 is true.
2009 is true.
2010 (default: true)
2010 (default: true)
2011
2011
2012 ``git:allowed``
2012 ``git:allowed``
2013 Whether Git subrepositories are allowed in the working directory.
2013 Whether Git subrepositories are allowed in the working directory.
2014 This option only has an effect if ``subrepos.allowed`` is true.
2014 This option only has an effect if ``subrepos.allowed`` is true.
2015
2015
2016 See the security note above before enabling Git subrepos.
2016 See the security note above before enabling Git subrepos.
2017 (default: false)
2017 (default: false)
2018
2018
2019 ``svn:allowed``
2019 ``svn:allowed``
2020 Whether Subversion subrepositories are allowed in the working
2020 Whether Subversion subrepositories are allowed in the working
2021 directory. This option only has an effect if ``subrepos.allowed``
2021 directory. This option only has an effect if ``subrepos.allowed``
2022 is true.
2022 is true.
2023
2023
2024 See the security note above before enabling Subversion subrepos.
2024 See the security note above before enabling Subversion subrepos.
2025 (default: false)
2025 (default: false)
2026
2026
2027 ``templatealias``
2027 ``templatealias``
2028 -----------------
2028 -----------------
2029
2029
2030 Alias definitions for templates. See :hg:`help templates` for details.
2030 Alias definitions for templates. See :hg:`help templates` for details.
2031
2031
2032 ``templates``
2032 ``templates``
2033 -------------
2033 -------------
2034
2034
2035 Use the ``[templates]`` section to define template strings.
2035 Use the ``[templates]`` section to define template strings.
2036 See :hg:`help templates` for details.
2036 See :hg:`help templates` for details.
2037
2037
2038 ``trusted``
2038 ``trusted``
2039 -----------
2039 -----------
2040
2040
2041 Mercurial will not use the settings in the
2041 Mercurial will not use the settings in the
2042 ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
2042 ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
2043 user or to a trusted group, as various hgrc features allow arbitrary
2043 user or to a trusted group, as various hgrc features allow arbitrary
2044 commands to be run. This issue is often encountered when configuring
2044 commands to be run. This issue is often encountered when configuring
2045 hooks or extensions for shared repositories or servers. However,
2045 hooks or extensions for shared repositories or servers. However,
2046 the web interface will use some safe settings from the ``[web]``
2046 the web interface will use some safe settings from the ``[web]``
2047 section.
2047 section.
2048
2048
2049 This section specifies what users and groups are trusted. The
2049 This section specifies what users and groups are trusted. The
2050 current user is always trusted. To trust everybody, list a user or a
2050 current user is always trusted. To trust everybody, list a user or a
2051 group with name ``*``. These settings must be placed in an
2051 group with name ``*``. These settings must be placed in an
2052 *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the
2052 *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the
2053 user or service running Mercurial.
2053 user or service running Mercurial.
2054
2054
2055 ``users``
2055 ``users``
2056 Comma-separated list of trusted users.
2056 Comma-separated list of trusted users.
2057
2057
2058 ``groups``
2058 ``groups``
2059 Comma-separated list of trusted groups.
2059 Comma-separated list of trusted groups.
2060
2060
2061
2061
2062 ``ui``
2062 ``ui``
2063 ------
2063 ------
2064
2064
2065 User interface controls.
2065 User interface controls.
2066
2066
2067 ``archivemeta``
2067 ``archivemeta``
2068 Whether to include the .hg_archival.txt file containing meta data
2068 Whether to include the .hg_archival.txt file containing meta data
2069 (hashes for the repository base and for tip) in archives created
2069 (hashes for the repository base and for tip) in archives created
2070 by the :hg:`archive` command or downloaded via hgweb.
2070 by the :hg:`archive` command or downloaded via hgweb.
2071 (default: True)
2071 (default: True)
2072
2072
2073 ``askusername``
2073 ``askusername``
2074 Whether to prompt for a username when committing. If True, and
2074 Whether to prompt for a username when committing. If True, and
2075 neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
2075 neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
2076 be prompted to enter a username. If no username is entered, the
2076 be prompted to enter a username. If no username is entered, the
2077 default ``USER@HOST`` is used instead.
2077 default ``USER@HOST`` is used instead.
2078 (default: False)
2078 (default: False)
2079
2079
2080 ``clonebundles``
2080 ``clonebundles``
2081 Whether the "clone bundles" feature is enabled.
2081 Whether the "clone bundles" feature is enabled.
2082
2082
2083 When enabled, :hg:`clone` may download and apply a server-advertised
2083 When enabled, :hg:`clone` may download and apply a server-advertised
2084 bundle file from a URL instead of using the normal exchange mechanism.
2084 bundle file from a URL instead of using the normal exchange mechanism.
2085
2085
2086 This can likely result in faster and more reliable clones.
2086 This can likely result in faster and more reliable clones.
2087
2087
2088 (default: True)
2088 (default: True)
2089
2089
2090 ``clonebundlefallback``
2090 ``clonebundlefallback``
2091 Whether failure to apply an advertised "clone bundle" from a server
2091 Whether failure to apply an advertised "clone bundle" from a server
2092 should result in fallback to a regular clone.
2092 should result in fallback to a regular clone.
2093
2093
2094 This is disabled by default because servers advertising "clone
2094 This is disabled by default because servers advertising "clone
2095 bundles" often do so to reduce server load. If advertised bundles
2095 bundles" often do so to reduce server load. If advertised bundles
2096 start mass failing and clients automatically fall back to a regular
2096 start mass failing and clients automatically fall back to a regular
2097 clone, this would add significant and unexpected load to the server
2097 clone, this would add significant and unexpected load to the server
2098 since the server is expecting clone operations to be offloaded to
2098 since the server is expecting clone operations to be offloaded to
2099 pre-generated bundles. Failing fast (the default behavior) ensures
2099 pre-generated bundles. Failing fast (the default behavior) ensures
2100 clients don't overwhelm the server when "clone bundle" application
2100 clients don't overwhelm the server when "clone bundle" application
2101 fails.
2101 fails.
2102
2102
2103 (default: False)
2103 (default: False)
2104
2104
2105 ``clonebundleprefers``
2105 ``clonebundleprefers``
2106 Defines preferences for which "clone bundles" to use.
2106 Defines preferences for which "clone bundles" to use.
2107
2107
2108 Servers advertising "clone bundles" may advertise multiple available
2108 Servers advertising "clone bundles" may advertise multiple available
2109 bundles. Each bundle may have different attributes, such as the bundle
2109 bundles. Each bundle may have different attributes, such as the bundle
2110 type and compression format. This option is used to prefer a particular
2110 type and compression format. This option is used to prefer a particular
2111 bundle over another.
2111 bundle over another.
2112
2112
2113 The following keys are defined by Mercurial:
2113 The following keys are defined by Mercurial:
2114
2114
2115 BUNDLESPEC
2115 BUNDLESPEC
2116 A bundle type specifier. These are strings passed to :hg:`bundle -t`.
2116 A bundle type specifier. These are strings passed to :hg:`bundle -t`.
2117 e.g. ``gzip-v2`` or ``bzip2-v1``.
2117 e.g. ``gzip-v2`` or ``bzip2-v1``.
2118
2118
2119 COMPRESSION
2119 COMPRESSION
2120 The compression format of the bundle. e.g. ``gzip`` and ``bzip2``.
2120 The compression format of the bundle. e.g. ``gzip`` and ``bzip2``.
2121
2121
2122 Server operators may define custom keys.
2122 Server operators may define custom keys.
2123
2123
2124 Example values: ``COMPRESSION=bzip2``,
2124 Example values: ``COMPRESSION=bzip2``,
2125 ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``.
2125 ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``.
2126
2126
2127 By default, the first bundle advertised by the server is used.
2127 By default, the first bundle advertised by the server is used.
2128
2128
2129 ``color``
2129 ``color``
2130 When to colorize output. Possible value are Boolean ("yes" or "no"), or
2130 When to colorize output. Possible value are Boolean ("yes" or "no"), or
2131 "debug", or "always". (default: "yes"). "yes" will use color whenever it
2131 "debug", or "always". (default: "yes"). "yes" will use color whenever it
2132 seems possible. See :hg:`help color` for details.
2132 seems possible. See :hg:`help color` for details.
2133
2133
2134 ``commitsubrepos``
2134 ``commitsubrepos``
2135 Whether to commit modified subrepositories when committing the
2135 Whether to commit modified subrepositories when committing the
2136 parent repository. If False and one subrepository has uncommitted
2136 parent repository. If False and one subrepository has uncommitted
2137 changes, abort the commit.
2137 changes, abort the commit.
2138 (default: False)
2138 (default: False)
2139
2139
2140 ``debug``
2140 ``debug``
2141 Print debugging information. (default: False)
2141 Print debugging information. (default: False)
2142
2142
2143 ``editor``
2143 ``editor``
2144 The editor to use during a commit. (default: ``$EDITOR`` or ``vi``)
2144 The editor to use during a commit. (default: ``$EDITOR`` or ``vi``)
2145
2145
2146 ``fallbackencoding``
2146 ``fallbackencoding``
2147 Encoding to try if it's not possible to decode the changelog using
2147 Encoding to try if it's not possible to decode the changelog using
2148 UTF-8. (default: ISO-8859-1)
2148 UTF-8. (default: ISO-8859-1)
2149
2149
2150 ``graphnodetemplate``
2150 ``graphnodetemplate``
2151 The template used to print changeset nodes in an ASCII revision graph.
2151 The template used to print changeset nodes in an ASCII revision graph.
2152 (default: ``{graphnode}``)
2152 (default: ``{graphnode}``)
2153
2153
2154 ``ignore``
2154 ``ignore``
2155 A file to read per-user ignore patterns from. This file should be
2155 A file to read per-user ignore patterns from. This file should be
2156 in the same format as a repository-wide .hgignore file. Filenames
2156 in the same format as a repository-wide .hgignore file. Filenames
2157 are relative to the repository root. This option supports hook syntax,
2157 are relative to the repository root. This option supports hook syntax,
2158 so if you want to specify multiple ignore files, you can do so by
2158 so if you want to specify multiple ignore files, you can do so by
2159 setting something like ``ignore.other = ~/.hgignore2``. For details
2159 setting something like ``ignore.other = ~/.hgignore2``. For details
2160 of the ignore file format, see the ``hgignore(5)`` man page.
2160 of the ignore file format, see the ``hgignore(5)`` man page.
2161
2161
2162 ``interactive``
2162 ``interactive``
2163 Allow to prompt the user. (default: True)
2163 Allow to prompt the user. (default: True)
2164
2164
2165 ``interface``
2165 ``interface``
2166 Select the default interface for interactive features (default: text).
2166 Select the default interface for interactive features (default: text).
2167 Possible values are 'text' and 'curses'.
2167 Possible values are 'text' and 'curses'.
2168
2168
2169 ``interface.chunkselector``
2169 ``interface.chunkselector``
2170 Select the interface for change recording (e.g. :hg:`commit -i`).
2170 Select the interface for change recording (e.g. :hg:`commit -i`).
2171 Possible values are 'text' and 'curses'.
2171 Possible values are 'text' and 'curses'.
2172 This config overrides the interface specified by ui.interface.
2172 This config overrides the interface specified by ui.interface.
2173
2173
2174 ``large-file-limit``
2174 ``large-file-limit``
2175 Largest file size that gives no memory use warning.
2175 Largest file size that gives no memory use warning.
2176 Possible values are integers or 0 to disable the check.
2176 Possible values are integers or 0 to disable the check.
2177 (default: 10000000)
2177 (default: 10000000)
2178
2178
2179 ``logtemplate``
2179 ``logtemplate``
2180 Template string for commands that print changesets.
2180 Template string for commands that print changesets.
2181
2181
2182 ``merge``
2182 ``merge``
2183 The conflict resolution program to use during a manual merge.
2183 The conflict resolution program to use during a manual merge.
2184 For more information on merge tools see :hg:`help merge-tools`.
2184 For more information on merge tools see :hg:`help merge-tools`.
2185 For configuring merge tools see the ``[merge-tools]`` section.
2185 For configuring merge tools see the ``[merge-tools]`` section.
2186
2186
2187 ``mergemarkers``
2187 ``mergemarkers``
2188 Sets the merge conflict marker label styling. The ``detailed``
2188 Sets the merge conflict marker label styling. The ``detailed``
2189 style uses the ``mergemarkertemplate`` setting to style the labels.
2189 style uses the ``mergemarkertemplate`` setting to style the labels.
2190 The ``basic`` style just uses 'local' and 'other' as the marker label.
2190 The ``basic`` style just uses 'local' and 'other' as the marker label.
2191 One of ``basic`` or ``detailed``.
2191 One of ``basic`` or ``detailed``.
2192 (default: ``basic``)
2192 (default: ``basic``)
2193
2193
2194 ``mergemarkertemplate``
2194 ``mergemarkertemplate``
2195 The template used to print the commit description next to each conflict
2195 The template used to print the commit description next to each conflict
2196 marker during merge conflicts. See :hg:`help templates` for the template
2196 marker during merge conflicts. See :hg:`help templates` for the template
2197 format.
2197 format.
2198
2198
2199 Defaults to showing the hash, tags, branches, bookmarks, author, and
2199 Defaults to showing the hash, tags, branches, bookmarks, author, and
2200 the first line of the commit description.
2200 the first line of the commit description.
2201
2201
2202 If you use non-ASCII characters in names for tags, branches, bookmarks,
2202 If you use non-ASCII characters in names for tags, branches, bookmarks,
2203 authors, and/or commit descriptions, you must pay attention to encodings of
2203 authors, and/or commit descriptions, you must pay attention to encodings of
2204 managed files. At template expansion, non-ASCII characters use the encoding
2204 managed files. At template expansion, non-ASCII characters use the encoding
2205 specified by the ``--encoding`` global option, ``HGENCODING`` or other
2205 specified by the ``--encoding`` global option, ``HGENCODING`` or other
2206 environment variables that govern your locale. If the encoding of the merge
2206 environment variables that govern your locale. If the encoding of the merge
2207 markers is different from the encoding of the merged files,
2207 markers is different from the encoding of the merged files,
2208 serious problems may occur.
2208 serious problems may occur.
2209
2209
2210 Can be overridden per-merge-tool, see the ``[merge-tools]`` section.
2210 Can be overridden per-merge-tool, see the ``[merge-tools]`` section.
2211
2211
2212 ``origbackuppath``
2212 ``origbackuppath``
2213 The path to a directory used to store generated .orig files. If the path is
2213 The path to a directory used to store generated .orig files. If the path is
2214 not a directory, one will be created. If set, files stored in this
2214 not a directory, one will be created. If set, files stored in this
2215 directory have the same name as the original file and do not have a .orig
2215 directory have the same name as the original file and do not have a .orig
2216 suffix.
2216 suffix.
2217
2217
2218 ``paginate``
2218 ``paginate``
2219 Control the pagination of command output (default: True). See :hg:`help pager`
2219 Control the pagination of command output (default: True). See :hg:`help pager`
2220 for details.
2220 for details.
2221
2221
2222 ``patch``
2222 ``patch``
2223 An optional external tool that ``hg import`` and some extensions
2223 An optional external tool that ``hg import`` and some extensions
2224 will use for applying patches. By default Mercurial uses an
2224 will use for applying patches. By default Mercurial uses an
2225 internal patch utility. The external tool must work as the common
2225 internal patch utility. The external tool must work as the common
2226 Unix ``patch`` program. In particular, it must accept a ``-p``
2226 Unix ``patch`` program. In particular, it must accept a ``-p``
2227 argument to strip patch headers, a ``-d`` argument to specify the
2227 argument to strip patch headers, a ``-d`` argument to specify the
2228 current directory, a file name to patch, and a patch file to take
2228 current directory, a file name to patch, and a patch file to take
2229 from stdin.
2229 from stdin.
2230
2230
2231 It is possible to specify a patch tool together with extra
2231 It is possible to specify a patch tool together with extra
2232 arguments. For example, setting this option to ``patch --merge``
2232 arguments. For example, setting this option to ``patch --merge``
2233 will use the ``patch`` program with its 2-way merge option.
2233 will use the ``patch`` program with its 2-way merge option.
2234
2234
2235 ``portablefilenames``
2235 ``portablefilenames``
2236 Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``.
2236 Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``.
2237 (default: ``warn``)
2237 (default: ``warn``)
2238
2238
2239 ``warn``
2239 ``warn``
2240 Print a warning message on POSIX platforms, if a file with a non-portable
2240 Print a warning message on POSIX platforms, if a file with a non-portable
2241 filename is added (e.g. a file with a name that can't be created on
2241 filename is added (e.g. a file with a name that can't be created on
2242 Windows because it contains reserved parts like ``AUX``, reserved
2242 Windows because it contains reserved parts like ``AUX``, reserved
2243 characters like ``:``, or would cause a case collision with an existing
2243 characters like ``:``, or would cause a case collision with an existing
2244 file).
2244 file).
2245
2245
2246 ``ignore``
2246 ``ignore``
2247 Don't print a warning.
2247 Don't print a warning.
2248
2248
2249 ``abort``
2249 ``abort``
2250 The command is aborted.
2250 The command is aborted.
2251
2251
2252 ``true``
2252 ``true``
2253 Alias for ``warn``.
2253 Alias for ``warn``.
2254
2254
2255 ``false``
2255 ``false``
2256 Alias for ``ignore``.
2256 Alias for ``ignore``.
2257
2257
2258 .. container:: windows
2258 .. container:: windows
2259
2259
2260 On Windows, this configuration option is ignored and the command aborted.
2260 On Windows, this configuration option is ignored and the command aborted.
2261
2261
2262 ``quiet``
2262 ``quiet``
2263 Reduce the amount of output printed.
2263 Reduce the amount of output printed.
2264 (default: False)
2264 (default: False)
2265
2265
2266 ``remotecmd``
2266 ``remotecmd``
2267 Remote command to use for clone/push/pull operations.
2267 Remote command to use for clone/push/pull operations.
2268 (default: ``hg``)
2268 (default: ``hg``)
2269
2269
2270 ``report_untrusted``
2270 ``report_untrusted``
2271 Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
2271 Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
2272 trusted user or group.
2272 trusted user or group.
2273 (default: True)
2273 (default: True)
2274
2274
2275 ``slash``
2275 ``slash``
2276 (Deprecated. Use ``slashpath`` template filter instead.)
2276 (Deprecated. Use ``slashpath`` template filter instead.)
2277
2277
2278 Display paths using a slash (``/``) as the path separator. This
2278 Display paths using a slash (``/``) as the path separator. This
2279 only makes a difference on systems where the default path
2279 only makes a difference on systems where the default path
2280 separator is not the slash character (e.g. Windows uses the
2280 separator is not the slash character (e.g. Windows uses the
2281 backslash character (``\``)).
2281 backslash character (``\``)).
2282 (default: False)
2282 (default: False)
2283
2283
2284 ``statuscopies``
2284 ``statuscopies``
2285 Display copies in the status command.
2285 Display copies in the status command.
2286
2286
2287 ``ssh``
2287 ``ssh``
2288 Command to use for SSH connections. (default: ``ssh``)
2288 Command to use for SSH connections. (default: ``ssh``)
2289
2289
2290 ``ssherrorhint``
2290 ``ssherrorhint``
2291 A hint shown to the user in the case of SSH error (e.g.
2291 A hint shown to the user in the case of SSH error (e.g.
2292 ``Please see http://company/internalwiki/ssh.html``)
2292 ``Please see http://company/internalwiki/ssh.html``)
2293
2293
2294 ``strict``
2294 ``strict``
2295 Require exact command names, instead of allowing unambiguous
2295 Require exact command names, instead of allowing unambiguous
2296 abbreviations. (default: False)
2296 abbreviations. (default: False)
2297
2297
2298 ``style``
2298 ``style``
2299 Name of style to use for command output.
2299 Name of style to use for command output.
2300
2300
2301 ``supportcontact``
2301 ``supportcontact``
2302 A URL where users should report a Mercurial traceback. Use this if you are a
2302 A URL where users should report a Mercurial traceback. Use this if you are a
2303 large organisation with its own Mercurial deployment process and crash
2303 large organisation with its own Mercurial deployment process and crash
2304 reports should be addressed to your internal support.
2304 reports should be addressed to your internal support.
2305
2305
2306 ``textwidth``
2306 ``textwidth``
2307 Maximum width of help text. A longer line generated by ``hg help`` or
2307 Maximum width of help text. A longer line generated by ``hg help`` or
2308 ``hg subcommand --help`` will be broken after white space to get this
2308 ``hg subcommand --help`` will be broken after white space to get this
2309 width or the terminal width, whichever comes first.
2309 width or the terminal width, whichever comes first.
2310 A non-positive value will disable this and the terminal width will be
2310 A non-positive value will disable this and the terminal width will be
2311 used. (default: 78)
2311 used. (default: 78)
2312
2312
2313 ``timeout``
2313 ``timeout``
2314 The timeout used when a lock is held (in seconds), a negative value
2314 The timeout used when a lock is held (in seconds), a negative value
2315 means no timeout. (default: 600)
2315 means no timeout. (default: 600)
2316
2316
2317 ``timeout.warn``
2317 ``timeout.warn``
2318 Time (in seconds) before a warning is printed about held lock. A negative
2318 Time (in seconds) before a warning is printed about held lock. A negative
2319 value means no warning. (default: 0)
2319 value means no warning. (default: 0)
2320
2320
2321 ``traceback``
2321 ``traceback``
2322 Mercurial always prints a traceback when an unknown exception
2322 Mercurial always prints a traceback when an unknown exception
2323 occurs. Setting this to True will make Mercurial print a traceback
2323 occurs. Setting this to True will make Mercurial print a traceback
2324 on all exceptions, even those recognized by Mercurial (such as
2324 on all exceptions, even those recognized by Mercurial (such as
2325 IOError or MemoryError). (default: False)
2325 IOError or MemoryError). (default: False)
2326
2326
2327 ``tweakdefaults``
2327 ``tweakdefaults``
2328
2328
2329 By default Mercurial's behavior changes very little from release
2329 By default Mercurial's behavior changes very little from release
2330 to release, but over time the recommended config settings
2330 to release, but over time the recommended config settings
2331 shift. Enable this config to opt in to get automatic tweaks to
2331 shift. Enable this config to opt in to get automatic tweaks to
2332 Mercurial's behavior over time. This config setting will have no
2332 Mercurial's behavior over time. This config setting will have no
2333 effet if ``HGPLAIN` is set or ``HGPLAINEXCEPT`` is set and does
2333 effet if ``HGPLAIN` is set or ``HGPLAINEXCEPT`` is set and does
2334 not include ``tweakdefaults``. (default: False)
2334 not include ``tweakdefaults``. (default: False)
2335
2335
2336 ``username``
2336 ``username``
2337 The committer of a changeset created when running "commit".
2337 The committer of a changeset created when running "commit".
2338 Typically a person's name and email address, e.g. ``Fred Widget
2338 Typically a person's name and email address, e.g. ``Fred Widget
2339 <fred@example.com>``. Environment variables in the
2339 <fred@example.com>``. Environment variables in the
2340 username are expanded.
2340 username are expanded.
2341
2341
2342 (default: ``$EMAIL`` or ``username@hostname``. If the username in
2342 (default: ``$EMAIL`` or ``username@hostname``. If the username in
2343 hgrc is empty, e.g. if the system admin set ``username =`` in the
2343 hgrc is empty, e.g. if the system admin set ``username =`` in the
2344 system hgrc, it has to be specified manually or in a different
2344 system hgrc, it has to be specified manually or in a different
2345 hgrc file)
2345 hgrc file)
2346
2346
2347 ``verbose``
2347 ``verbose``
2348 Increase the amount of output printed. (default: False)
2348 Increase the amount of output printed. (default: False)
2349
2349
2350
2350
2351 ``web``
2351 ``web``
2352 -------
2352 -------
2353
2353
2354 Web interface configuration. The settings in this section apply to
2354 Web interface configuration. The settings in this section apply to
2355 both the builtin webserver (started by :hg:`serve`) and the script you
2355 both the builtin webserver (started by :hg:`serve`) and the script you
2356 run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI
2356 run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI
2357 and WSGI).
2357 and WSGI).
2358
2358
2359 The Mercurial webserver does no authentication (it does not prompt for
2359 The Mercurial webserver does no authentication (it does not prompt for
2360 usernames and passwords to validate *who* users are), but it does do
2360 usernames and passwords to validate *who* users are), but it does do
2361 authorization (it grants or denies access for *authenticated users*
2361 authorization (it grants or denies access for *authenticated users*
2362 based on settings in this section). You must either configure your
2362 based on settings in this section). You must either configure your
2363 webserver to do authentication for you, or disable the authorization
2363 webserver to do authentication for you, or disable the authorization
2364 checks.
2364 checks.
2365
2365
2366 For a quick setup in a trusted environment, e.g., a private LAN, where
2366 For a quick setup in a trusted environment, e.g., a private LAN, where
2367 you want it to accept pushes from anybody, you can use the following
2367 you want it to accept pushes from anybody, you can use the following
2368 command line::
2368 command line::
2369
2369
2370 $ hg --config web.allow-push=* --config web.push_ssl=False serve
2370 $ hg --config web.allow-push=* --config web.push_ssl=False serve
2371
2371
2372 Note that this will allow anybody to push anything to the server and
2372 Note that this will allow anybody to push anything to the server and
2373 that this should not be used for public servers.
2373 that this should not be used for public servers.
2374
2374
2375 The full set of options is:
2375 The full set of options is:
2376
2376
2377 ``accesslog``
2377 ``accesslog``
2378 Where to output the access log. (default: stdout)
2378 Where to output the access log. (default: stdout)
2379
2379
2380 ``address``
2380 ``address``
2381 Interface address to bind to. (default: all)
2381 Interface address to bind to. (default: all)
2382
2382
2383 ``allow-archive``
2383 ``allow-archive``
2384 List of archive format (bz2, gz, zip) allowed for downloading.
2384 List of archive format (bz2, gz, zip) allowed for downloading.
2385 (default: empty)
2385 (default: empty)
2386
2386
2387 ``allowbz2``
2387 ``allowbz2``
2388 (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
2388 (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
2389 revisions.
2389 revisions.
2390 (default: False)
2390 (default: False)
2391
2391
2392 ``allowgz``
2392 ``allowgz``
2393 (DEPRECATED) Whether to allow .tar.gz downloading of repository
2393 (DEPRECATED) Whether to allow .tar.gz downloading of repository
2394 revisions.
2394 revisions.
2395 (default: False)
2395 (default: False)
2396
2396
2397 ``allow-pull``
2397 ``allow-pull``
2398 Whether to allow pulling from the repository. (default: True)
2398 Whether to allow pulling from the repository. (default: True)
2399
2399
2400 ``allow-push``
2400 ``allow-push``
2401 Whether to allow pushing to the repository. If empty or not set,
2401 Whether to allow pushing to the repository. If empty or not set,
2402 pushing is not allowed. If the special value ``*``, any remote
2402 pushing is not allowed. If the special value ``*``, any remote
2403 user can push, including unauthenticated users. Otherwise, the
2403 user can push, including unauthenticated users. Otherwise, the
2404 remote user must have been authenticated, and the authenticated
2404 remote user must have been authenticated, and the authenticated
2405 user name must be present in this list. The contents of the
2405 user name must be present in this list. The contents of the
2406 allow-push list are examined after the deny_push list.
2406 allow-push list are examined after the deny_push list.
2407
2407
2408 ``allow_read``
2408 ``allow_read``
2409 If the user has not already been denied repository access due to
2409 If the user has not already been denied repository access due to
2410 the contents of deny_read, this list determines whether to grant
2410 the contents of deny_read, this list determines whether to grant
2411 repository access to the user. If this list is not empty, and the
2411 repository access to the user. If this list is not empty, and the
2412 user is unauthenticated or not present in the list, then access is
2412 user is unauthenticated or not present in the list, then access is
2413 denied for the user. If the list is empty or not set, then access
2413 denied for the user. If the list is empty or not set, then access
2414 is permitted to all users by default. Setting allow_read to the
2414 is permitted to all users by default. Setting allow_read to the
2415 special value ``*`` is equivalent to it not being set (i.e. access
2415 special value ``*`` is equivalent to it not being set (i.e. access
2416 is permitted to all users). The contents of the allow_read list are
2416 is permitted to all users). The contents of the allow_read list are
2417 examined after the deny_read list.
2417 examined after the deny_read list.
2418
2418
2419 ``allowzip``
2419 ``allowzip``
2420 (DEPRECATED) Whether to allow .zip downloading of repository
2420 (DEPRECATED) Whether to allow .zip downloading of repository
2421 revisions. This feature creates temporary files.
2421 revisions. This feature creates temporary files.
2422 (default: False)
2422 (default: False)
2423
2423
2424 ``archivesubrepos``
2424 ``archivesubrepos``
2425 Whether to recurse into subrepositories when archiving.
2425 Whether to recurse into subrepositories when archiving.
2426 (default: False)
2426 (default: False)
2427
2427
2428 ``baseurl``
2428 ``baseurl``
2429 Base URL to use when publishing URLs in other locations, so
2429 Base URL to use when publishing URLs in other locations, so
2430 third-party tools like email notification hooks can construct
2430 third-party tools like email notification hooks can construct
2431 URLs. Example: ``http://hgserver/repos/``.
2431 URLs. Example: ``http://hgserver/repos/``.
2432
2432
2433 ``cacerts``
2433 ``cacerts``
2434 Path to file containing a list of PEM encoded certificate
2434 Path to file containing a list of PEM encoded certificate
2435 authority certificates. Environment variables and ``~user``
2435 authority certificates. Environment variables and ``~user``
2436 constructs are expanded in the filename. If specified on the
2436 constructs are expanded in the filename. If specified on the
2437 client, then it will verify the identity of remote HTTPS servers
2437 client, then it will verify the identity of remote HTTPS servers
2438 with these certificates.
2438 with these certificates.
2439
2439
2440 To disable SSL verification temporarily, specify ``--insecure`` from
2440 To disable SSL verification temporarily, specify ``--insecure`` from
2441 command line.
2441 command line.
2442
2442
2443 You can use OpenSSL's CA certificate file if your platform has
2443 You can use OpenSSL's CA certificate file if your platform has
2444 one. On most Linux systems this will be
2444 one. On most Linux systems this will be
2445 ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to
2445 ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to
2446 generate this file manually. The form must be as follows::
2446 generate this file manually. The form must be as follows::
2447
2447
2448 -----BEGIN CERTIFICATE-----
2448 -----BEGIN CERTIFICATE-----
2449 ... (certificate in base64 PEM encoding) ...
2449 ... (certificate in base64 PEM encoding) ...
2450 -----END CERTIFICATE-----
2450 -----END CERTIFICATE-----
2451 -----BEGIN CERTIFICATE-----
2451 -----BEGIN CERTIFICATE-----
2452 ... (certificate in base64 PEM encoding) ...
2452 ... (certificate in base64 PEM encoding) ...
2453 -----END CERTIFICATE-----
2453 -----END CERTIFICATE-----
2454
2454
2455 ``cache``
2455 ``cache``
2456 Whether to support caching in hgweb. (default: True)
2456 Whether to support caching in hgweb. (default: True)
2457
2457
2458 ``certificate``
2458 ``certificate``
2459 Certificate to use when running :hg:`serve`.
2459 Certificate to use when running :hg:`serve`.
2460
2460
2461 ``collapse``
2461 ``collapse``
2462 With ``descend`` enabled, repositories in subdirectories are shown at
2462 With ``descend`` enabled, repositories in subdirectories are shown at
2463 a single level alongside repositories in the current path. With
2463 a single level alongside repositories in the current path. With
2464 ``collapse`` also enabled, repositories residing at a deeper level than
2464 ``collapse`` also enabled, repositories residing at a deeper level than
2465 the current path are grouped behind navigable directory entries that
2465 the current path are grouped behind navigable directory entries that
2466 lead to the locations of these repositories. In effect, this setting
2466 lead to the locations of these repositories. In effect, this setting
2467 collapses each collection of repositories found within a subdirectory
2467 collapses each collection of repositories found within a subdirectory
2468 into a single entry for that subdirectory. (default: False)
2468 into a single entry for that subdirectory. (default: False)
2469
2469
2470 ``comparisoncontext``
2470 ``comparisoncontext``
2471 Number of lines of context to show in side-by-side file comparison. If
2471 Number of lines of context to show in side-by-side file comparison. If
2472 negative or the value ``full``, whole files are shown. (default: 5)
2472 negative or the value ``full``, whole files are shown. (default: 5)
2473
2473
2474 This setting can be overridden by a ``context`` request parameter to the
2474 This setting can be overridden by a ``context`` request parameter to the
2475 ``comparison`` command, taking the same values.
2475 ``comparison`` command, taking the same values.
2476
2476
2477 ``contact``
2477 ``contact``
2478 Name or email address of the person in charge of the repository.
2478 Name or email address of the person in charge of the repository.
2479 (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty)
2479 (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty)
2480
2480
2481 ``csp``
2481 ``csp``
2482 Send a ``Content-Security-Policy`` HTTP header with this value.
2482 Send a ``Content-Security-Policy`` HTTP header with this value.
2483
2483
2484 The value may contain a special string ``%nonce%``, which will be replaced
2484 The value may contain a special string ``%nonce%``, which will be replaced
2485 by a randomly-generated one-time use value. If the value contains
2485 by a randomly-generated one-time use value. If the value contains
2486 ``%nonce%``, ``web.cache`` will be disabled, as caching undermines the
2486 ``%nonce%``, ``web.cache`` will be disabled, as caching undermines the
2487 one-time property of the nonce. This nonce will also be inserted into
2487 one-time property of the nonce. This nonce will also be inserted into
2488 ``<script>`` elements containing inline JavaScript.
2488 ``<script>`` elements containing inline JavaScript.
2489
2489
2490 Note: lots of HTML content sent by the server is derived from repository
2490 Note: lots of HTML content sent by the server is derived from repository
2491 data. Please consider the potential for malicious repository data to
2491 data. Please consider the potential for malicious repository data to
2492 "inject" itself into generated HTML content as part of your security
2492 "inject" itself into generated HTML content as part of your security
2493 threat model.
2493 threat model.
2494
2494
2495 ``deny_push``
2495 ``deny_push``
2496 Whether to deny pushing to the repository. If empty or not set,
2496 Whether to deny pushing to the repository. If empty or not set,
2497 push is not denied. If the special value ``*``, all remote users are
2497 push is not denied. If the special value ``*``, all remote users are
2498 denied push. Otherwise, unauthenticated users are all denied, and
2498 denied push. Otherwise, unauthenticated users are all denied, and
2499 any authenticated user name present in this list is also denied. The
2499 any authenticated user name present in this list is also denied. The
2500 contents of the deny_push list are examined before the allow-push list.
2500 contents of the deny_push list are examined before the allow-push list.
2501
2501
2502 ``deny_read``
2502 ``deny_read``
2503 Whether to deny reading/viewing of the repository. If this list is
2503 Whether to deny reading/viewing of the repository. If this list is
2504 not empty, unauthenticated users are all denied, and any
2504 not empty, unauthenticated users are all denied, and any
2505 authenticated user name present in this list is also denied access to
2505 authenticated user name present in this list is also denied access to
2506 the repository. If set to the special value ``*``, all remote users
2506 the repository. If set to the special value ``*``, all remote users
2507 are denied access (rarely needed ;). If deny_read is empty or not set,
2507 are denied access (rarely needed ;). If deny_read is empty or not set,
2508 the determination of repository access depends on the presence and
2508 the determination of repository access depends on the presence and
2509 content of the allow_read list (see description). If both
2509 content of the allow_read list (see description). If both
2510 deny_read and allow_read are empty or not set, then access is
2510 deny_read and allow_read are empty or not set, then access is
2511 permitted to all users by default. If the repository is being
2511 permitted to all users by default. If the repository is being
2512 served via hgwebdir, denied users will not be able to see it in
2512 served via hgwebdir, denied users will not be able to see it in
2513 the list of repositories. The contents of the deny_read list have
2513 the list of repositories. The contents of the deny_read list have
2514 priority over (are examined before) the contents of the allow_read
2514 priority over (are examined before) the contents of the allow_read
2515 list.
2515 list.
2516
2516
2517 ``descend``
2517 ``descend``
2518 hgwebdir indexes will not descend into subdirectories. Only repositories
2518 hgwebdir indexes will not descend into subdirectories. Only repositories
2519 directly in the current path will be shown (other repositories are still
2519 directly in the current path will be shown (other repositories are still
2520 available from the index corresponding to their containing path).
2520 available from the index corresponding to their containing path).
2521
2521
2522 ``description``
2522 ``description``
2523 Textual description of the repository's purpose or contents.
2523 Textual description of the repository's purpose or contents.
2524 (default: "unknown")
2524 (default: "unknown")
2525
2525
2526 ``encoding``
2526 ``encoding``
2527 Character encoding name. (default: the current locale charset)
2527 Character encoding name. (default: the current locale charset)
2528 Example: "UTF-8".
2528 Example: "UTF-8".
2529
2529
2530 ``errorlog``
2530 ``errorlog``
2531 Where to output the error log. (default: stderr)
2531 Where to output the error log. (default: stderr)
2532
2532
2533 ``guessmime``
2533 ``guessmime``
2534 Control MIME types for raw download of file content.
2534 Control MIME types for raw download of file content.
2535 Set to True to let hgweb guess the content type from the file
2535 Set to True to let hgweb guess the content type from the file
2536 extension. This will serve HTML files as ``text/html`` and might
2536 extension. This will serve HTML files as ``text/html`` and might
2537 allow cross-site scripting attacks when serving untrusted
2537 allow cross-site scripting attacks when serving untrusted
2538 repositories. (default: False)
2538 repositories. (default: False)
2539
2539
2540 ``hidden``
2540 ``hidden``
2541 Whether to hide the repository in the hgwebdir index.
2541 Whether to hide the repository in the hgwebdir index.
2542 (default: False)
2542 (default: False)
2543
2543
2544 ``ipv6``
2544 ``ipv6``
2545 Whether to use IPv6. (default: False)
2545 Whether to use IPv6. (default: False)
2546
2546
2547 ``labels``
2547 ``labels``
2548 List of string *labels* associated with the repository.
2548 List of string *labels* associated with the repository.
2549
2549
2550 Labels are exposed as a template keyword and can be used to customize
2550 Labels are exposed as a template keyword and can be used to customize
2551 output. e.g. the ``index`` template can group or filter repositories
2551 output. e.g. the ``index`` template can group or filter repositories
2552 by labels and the ``summary`` template can display additional content
2552 by labels and the ``summary`` template can display additional content
2553 if a specific label is present.
2553 if a specific label is present.
2554
2554
2555 ``logoimg``
2555 ``logoimg``
2556 File name of the logo image that some templates display on each page.
2556 File name of the logo image that some templates display on each page.
2557 The file name is relative to ``staticurl``. That is, the full path to
2557 The file name is relative to ``staticurl``. That is, the full path to
2558 the logo image is "staticurl/logoimg".
2558 the logo image is "staticurl/logoimg".
2559 If unset, ``hglogo.png`` will be used.
2559 If unset, ``hglogo.png`` will be used.
2560
2560
2561 ``logourl``
2561 ``logourl``
2562 Base URL to use for logos. If unset, ``https://mercurial-scm.org/``
2562 Base URL to use for logos. If unset, ``https://mercurial-scm.org/``
2563 will be used.
2563 will be used.
2564
2564
2565 ``maxchanges``
2565 ``maxchanges``
2566 Maximum number of changes to list on the changelog. (default: 10)
2566 Maximum number of changes to list on the changelog. (default: 10)
2567
2567
2568 ``maxfiles``
2568 ``maxfiles``
2569 Maximum number of files to list per changeset. (default: 10)
2569 Maximum number of files to list per changeset. (default: 10)
2570
2570
2571 ``maxshortchanges``
2571 ``maxshortchanges``
2572 Maximum number of changes to list on the shortlog, graph or filelog
2572 Maximum number of changes to list on the shortlog, graph or filelog
2573 pages. (default: 60)
2573 pages. (default: 60)
2574
2574
2575 ``name``
2575 ``name``
2576 Repository name to use in the web interface.
2576 Repository name to use in the web interface.
2577 (default: current working directory)
2577 (default: current working directory)
2578
2578
2579 ``port``
2579 ``port``
2580 Port to listen on. (default: 8000)
2580 Port to listen on. (default: 8000)
2581
2581
2582 ``prefix``
2582 ``prefix``
2583 Prefix path to serve from. (default: '' (server root))
2583 Prefix path to serve from. (default: '' (server root))
2584
2584
2585 ``push_ssl``
2585 ``push_ssl``
2586 Whether to require that inbound pushes be transported over SSL to
2586 Whether to require that inbound pushes be transported over SSL to
2587 prevent password sniffing. (default: True)
2587 prevent password sniffing. (default: True)
2588
2588
2589 ``refreshinterval``
2589 ``refreshinterval``
2590 How frequently directory listings re-scan the filesystem for new
2590 How frequently directory listings re-scan the filesystem for new
2591 repositories, in seconds. This is relevant when wildcards are used
2591 repositories, in seconds. This is relevant when wildcards are used
2592 to define paths. Depending on how much filesystem traversal is
2592 to define paths. Depending on how much filesystem traversal is
2593 required, refreshing may negatively impact performance.
2593 required, refreshing may negatively impact performance.
2594
2594
2595 Values less than or equal to 0 always refresh.
2595 Values less than or equal to 0 always refresh.
2596 (default: 20)
2596 (default: 20)
2597
2597
2598 ``server-header``
2598 ``server-header``
2599 Value for HTTP ``Server`` response header.
2599 Value for HTTP ``Server`` response header.
2600
2600
2601 ``staticurl``
2601 ``staticurl``
2602 Base URL to use for static files. If unset, static files (e.g. the
2602 Base URL to use for static files. If unset, static files (e.g. the
2603 hgicon.png favicon) will be served by the CGI script itself. Use
2603 hgicon.png favicon) will be served by the CGI script itself. Use
2604 this setting to serve them directly with the HTTP server.
2604 this setting to serve them directly with the HTTP server.
2605 Example: ``http://hgserver/static/``.
2605 Example: ``http://hgserver/static/``.
2606
2606
2607 ``stripes``
2607 ``stripes``
2608 How many lines a "zebra stripe" should span in multi-line output.
2608 How many lines a "zebra stripe" should span in multi-line output.
2609 Set to 0 to disable. (default: 1)
2609 Set to 0 to disable. (default: 1)
2610
2610
2611 ``style``
2611 ``style``
2612 Which template map style to use. The available options are the names of
2612 Which template map style to use. The available options are the names of
2613 subdirectories in the HTML templates path. (default: ``paper``)
2613 subdirectories in the HTML templates path. (default: ``paper``)
2614 Example: ``monoblue``.
2614 Example: ``monoblue``.
2615
2615
2616 ``templates``
2616 ``templates``
2617 Where to find the HTML templates. The default path to the HTML templates
2617 Where to find the HTML templates. The default path to the HTML templates
2618 can be obtained from ``hg debuginstall``.
2618 can be obtained from ``hg debuginstall``.
2619
2619
2620 ``websub``
2620 ``websub``
2621 ----------
2621 ----------
2622
2622
2623 Web substitution filter definition. You can use this section to
2623 Web substitution filter definition. You can use this section to
2624 define a set of regular expression substitution patterns which
2624 define a set of regular expression substitution patterns which
2625 let you automatically modify the hgweb server output.
2625 let you automatically modify the hgweb server output.
2626
2626
2627 The default hgweb templates only apply these substitution patterns
2627 The default hgweb templates only apply these substitution patterns
2628 on the revision description fields. You can apply them anywhere
2628 on the revision description fields. You can apply them anywhere
2629 you want when you create your own templates by adding calls to the
2629 you want when you create your own templates by adding calls to the
2630 "websub" filter (usually after calling the "escape" filter).
2630 "websub" filter (usually after calling the "escape" filter).
2631
2631
2632 This can be used, for example, to convert issue references to links
2632 This can be used, for example, to convert issue references to links
2633 to your issue tracker, or to convert "markdown-like" syntax into
2633 to your issue tracker, or to convert "markdown-like" syntax into
2634 HTML (see the examples below).
2634 HTML (see the examples below).
2635
2635
2636 Each entry in this section names a substitution filter.
2636 Each entry in this section names a substitution filter.
2637 The value of each entry defines the substitution expression itself.
2637 The value of each entry defines the substitution expression itself.
2638 The websub expressions follow the old interhg extension syntax,
2638 The websub expressions follow the old interhg extension syntax,
2639 which in turn imitates the Unix sed replacement syntax::
2639 which in turn imitates the Unix sed replacement syntax::
2640
2640
2641 patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i]
2641 patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i]
2642
2642
2643 You can use any separator other than "/". The final "i" is optional
2643 You can use any separator other than "/". The final "i" is optional
2644 and indicates that the search must be case insensitive.
2644 and indicates that the search must be case insensitive.
2645
2645
2646 Examples::
2646 Examples::
2647
2647
2648 [websub]
2648 [websub]
2649 issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i
2649 issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i
2650 italic = s/\b_(\S+)_\b/<i>\1<\/i>/
2650 italic = s/\b_(\S+)_\b/<i>\1<\/i>/
2651 bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/
2651 bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/
2652
2652
2653 ``worker``
2653 ``worker``
2654 ----------
2654 ----------
2655
2655
2656 Parallel master/worker configuration. We currently perform working
2656 Parallel master/worker configuration. We currently perform working
2657 directory updates in parallel on Unix-like systems, which greatly
2657 directory updates in parallel on Unix-like systems, which greatly
2658 helps performance.
2658 helps performance.
2659
2659
2660 ``enabled``
2660 ``enabled``
2661 Whether to enable workers code to be used.
2661 Whether to enable workers code to be used.
2662 (default: true)
2662 (default: true)
2663
2663
2664 ``numcpus``
2664 ``numcpus``
2665 Number of CPUs to use for parallel operations. A zero or
2665 Number of CPUs to use for parallel operations. A zero or
2666 negative value is treated as ``use the default``.
2666 negative value is treated as ``use the default``.
2667 (default: 4 or the number of CPUs on the system, whichever is larger)
2667 (default: 4 or the number of CPUs on the system, whichever is larger)
2668
2668
2669 ``backgroundclose``
2669 ``backgroundclose``
2670 Whether to enable closing file handles on background threads during certain
2670 Whether to enable closing file handles on background threads during certain
2671 operations. Some platforms aren't very efficient at closing file
2671 operations. Some platforms aren't very efficient at closing file
2672 handles that have been written or appended to. By performing file closing
2672 handles that have been written or appended to. By performing file closing
2673 on background threads, file write rate can increase substantially.
2673 on background threads, file write rate can increase substantially.
2674 (default: true on Windows, false elsewhere)
2674 (default: true on Windows, false elsewhere)
2675
2675
2676 ``backgroundcloseminfilecount``
2676 ``backgroundcloseminfilecount``
2677 Minimum number of files required to trigger background file closing.
2677 Minimum number of files required to trigger background file closing.
2678 Operations not writing this many files won't start background close
2678 Operations not writing this many files won't start background close
2679 threads.
2679 threads.
2680 (default: 2048)
2680 (default: 2048)
2681
2681
2682 ``backgroundclosemaxqueue``
2682 ``backgroundclosemaxqueue``
2683 The maximum number of opened file handles waiting to be closed in the
2683 The maximum number of opened file handles waiting to be closed in the
2684 background. This option only has an effect if ``backgroundclose`` is
2684 background. This option only has an effect if ``backgroundclose`` is
2685 enabled.
2685 enabled.
2686 (default: 384)
2686 (default: 384)
2687
2687
2688 ``backgroundclosethreadcount``
2688 ``backgroundclosethreadcount``
2689 Number of threads to process background file closes. Only relevant if
2689 Number of threads to process background file closes. Only relevant if
2690 ``backgroundclose`` is enabled.
2690 ``backgroundclose`` is enabled.
2691 (default: 4)
2691 (default: 4)
@@ -1,2395 +1,2395 b''
1 # localrepo.py - read/write repository class for mercurial
1 # localrepo.py - read/write repository class for mercurial
2 #
2 #
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
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 errno
10 import errno
11 import hashlib
11 import hashlib
12 import os
12 import os
13 import random
13 import random
14 import sys
14 import sys
15 import time
15 import time
16 import weakref
16 import weakref
17
17
18 from .i18n import _
18 from .i18n import _
19 from .node import (
19 from .node import (
20 hex,
20 hex,
21 nullid,
21 nullid,
22 short,
22 short,
23 )
23 )
24 from . import (
24 from . import (
25 bookmarks,
25 bookmarks,
26 branchmap,
26 branchmap,
27 bundle2,
27 bundle2,
28 changegroup,
28 changegroup,
29 changelog,
29 changelog,
30 color,
30 color,
31 context,
31 context,
32 dirstate,
32 dirstate,
33 dirstateguard,
33 dirstateguard,
34 discovery,
34 discovery,
35 encoding,
35 encoding,
36 error,
36 error,
37 exchange,
37 exchange,
38 extensions,
38 extensions,
39 filelog,
39 filelog,
40 hook,
40 hook,
41 lock as lockmod,
41 lock as lockmod,
42 manifest,
42 manifest,
43 match as matchmod,
43 match as matchmod,
44 merge as mergemod,
44 merge as mergemod,
45 mergeutil,
45 mergeutil,
46 namespaces,
46 namespaces,
47 narrowspec,
47 narrowspec,
48 obsolete,
48 obsolete,
49 pathutil,
49 pathutil,
50 phases,
50 phases,
51 pushkey,
51 pushkey,
52 pycompat,
52 pycompat,
53 repository,
53 repository,
54 repoview,
54 repoview,
55 revset,
55 revset,
56 revsetlang,
56 revsetlang,
57 scmutil,
57 scmutil,
58 sparse,
58 sparse,
59 store,
59 store,
60 subrepoutil,
60 subrepoutil,
61 tags as tagsmod,
61 tags as tagsmod,
62 transaction,
62 transaction,
63 txnutil,
63 txnutil,
64 util,
64 util,
65 vfs as vfsmod,
65 vfs as vfsmod,
66 )
66 )
67 from .utils import (
67 from .utils import (
68 interfaceutil,
68 interfaceutil,
69 procutil,
69 procutil,
70 stringutil,
70 stringutil,
71 )
71 )
72
72
73 release = lockmod.release
73 release = lockmod.release
74 urlerr = util.urlerr
74 urlerr = util.urlerr
75 urlreq = util.urlreq
75 urlreq = util.urlreq
76
76
77 # set of (path, vfs-location) tuples. vfs-location is:
77 # set of (path, vfs-location) tuples. vfs-location is:
78 # - 'plain for vfs relative paths
78 # - 'plain for vfs relative paths
79 # - '' for svfs relative paths
79 # - '' for svfs relative paths
80 _cachedfiles = set()
80 _cachedfiles = set()
81
81
82 class _basefilecache(scmutil.filecache):
82 class _basefilecache(scmutil.filecache):
83 """All filecache usage on repo are done for logic that should be unfiltered
83 """All filecache usage on repo are done for logic that should be unfiltered
84 """
84 """
85 def __get__(self, repo, type=None):
85 def __get__(self, repo, type=None):
86 if repo is None:
86 if repo is None:
87 return self
87 return self
88 return super(_basefilecache, self).__get__(repo.unfiltered(), type)
88 return super(_basefilecache, self).__get__(repo.unfiltered(), type)
89 def __set__(self, repo, value):
89 def __set__(self, repo, value):
90 return super(_basefilecache, self).__set__(repo.unfiltered(), value)
90 return super(_basefilecache, self).__set__(repo.unfiltered(), value)
91 def __delete__(self, repo):
91 def __delete__(self, repo):
92 return super(_basefilecache, self).__delete__(repo.unfiltered())
92 return super(_basefilecache, self).__delete__(repo.unfiltered())
93
93
94 class repofilecache(_basefilecache):
94 class repofilecache(_basefilecache):
95 """filecache for files in .hg but outside of .hg/store"""
95 """filecache for files in .hg but outside of .hg/store"""
96 def __init__(self, *paths):
96 def __init__(self, *paths):
97 super(repofilecache, self).__init__(*paths)
97 super(repofilecache, self).__init__(*paths)
98 for path in paths:
98 for path in paths:
99 _cachedfiles.add((path, 'plain'))
99 _cachedfiles.add((path, 'plain'))
100
100
101 def join(self, obj, fname):
101 def join(self, obj, fname):
102 return obj.vfs.join(fname)
102 return obj.vfs.join(fname)
103
103
104 class storecache(_basefilecache):
104 class storecache(_basefilecache):
105 """filecache for files in the store"""
105 """filecache for files in the store"""
106 def __init__(self, *paths):
106 def __init__(self, *paths):
107 super(storecache, self).__init__(*paths)
107 super(storecache, self).__init__(*paths)
108 for path in paths:
108 for path in paths:
109 _cachedfiles.add((path, ''))
109 _cachedfiles.add((path, ''))
110
110
111 def join(self, obj, fname):
111 def join(self, obj, fname):
112 return obj.sjoin(fname)
112 return obj.sjoin(fname)
113
113
114 def isfilecached(repo, name):
114 def isfilecached(repo, name):
115 """check if a repo has already cached "name" filecache-ed property
115 """check if a repo has already cached "name" filecache-ed property
116
116
117 This returns (cachedobj-or-None, iscached) tuple.
117 This returns (cachedobj-or-None, iscached) tuple.
118 """
118 """
119 cacheentry = repo.unfiltered()._filecache.get(name, None)
119 cacheentry = repo.unfiltered()._filecache.get(name, None)
120 if not cacheentry:
120 if not cacheentry:
121 return None, False
121 return None, False
122 return cacheentry.obj, True
122 return cacheentry.obj, True
123
123
124 class unfilteredpropertycache(util.propertycache):
124 class unfilteredpropertycache(util.propertycache):
125 """propertycache that apply to unfiltered repo only"""
125 """propertycache that apply to unfiltered repo only"""
126
126
127 def __get__(self, repo, type=None):
127 def __get__(self, repo, type=None):
128 unfi = repo.unfiltered()
128 unfi = repo.unfiltered()
129 if unfi is repo:
129 if unfi is repo:
130 return super(unfilteredpropertycache, self).__get__(unfi)
130 return super(unfilteredpropertycache, self).__get__(unfi)
131 return getattr(unfi, self.name)
131 return getattr(unfi, self.name)
132
132
133 class filteredpropertycache(util.propertycache):
133 class filteredpropertycache(util.propertycache):
134 """propertycache that must take filtering in account"""
134 """propertycache that must take filtering in account"""
135
135
136 def cachevalue(self, obj, value):
136 def cachevalue(self, obj, value):
137 object.__setattr__(obj, self.name, value)
137 object.__setattr__(obj, self.name, value)
138
138
139
139
140 def hasunfilteredcache(repo, name):
140 def hasunfilteredcache(repo, name):
141 """check if a repo has an unfilteredpropertycache value for <name>"""
141 """check if a repo has an unfilteredpropertycache value for <name>"""
142 return name in vars(repo.unfiltered())
142 return name in vars(repo.unfiltered())
143
143
144 def unfilteredmethod(orig):
144 def unfilteredmethod(orig):
145 """decorate method that always need to be run on unfiltered version"""
145 """decorate method that always need to be run on unfiltered version"""
146 def wrapper(repo, *args, **kwargs):
146 def wrapper(repo, *args, **kwargs):
147 return orig(repo.unfiltered(), *args, **kwargs)
147 return orig(repo.unfiltered(), *args, **kwargs)
148 return wrapper
148 return wrapper
149
149
150 moderncaps = {'lookup', 'branchmap', 'pushkey', 'known', 'getbundle',
150 moderncaps = {'lookup', 'branchmap', 'pushkey', 'known', 'getbundle',
151 'unbundle'}
151 'unbundle'}
152 legacycaps = moderncaps.union({'changegroupsubset'})
152 legacycaps = moderncaps.union({'changegroupsubset'})
153
153
154 @interfaceutil.implementer(repository.ipeercommandexecutor)
154 @interfaceutil.implementer(repository.ipeercommandexecutor)
155 class localcommandexecutor(object):
155 class localcommandexecutor(object):
156 def __init__(self, peer):
156 def __init__(self, peer):
157 self._peer = peer
157 self._peer = peer
158 self._sent = False
158 self._sent = False
159 self._closed = False
159 self._closed = False
160
160
161 def __enter__(self):
161 def __enter__(self):
162 return self
162 return self
163
163
164 def __exit__(self, exctype, excvalue, exctb):
164 def __exit__(self, exctype, excvalue, exctb):
165 self.close()
165 self.close()
166
166
167 def callcommand(self, command, args):
167 def callcommand(self, command, args):
168 if self._sent:
168 if self._sent:
169 raise error.ProgrammingError('callcommand() cannot be used after '
169 raise error.ProgrammingError('callcommand() cannot be used after '
170 'sendcommands()')
170 'sendcommands()')
171
171
172 if self._closed:
172 if self._closed:
173 raise error.ProgrammingError('callcommand() cannot be used after '
173 raise error.ProgrammingError('callcommand() cannot be used after '
174 'close()')
174 'close()')
175
175
176 # We don't need to support anything fancy. Just call the named
176 # We don't need to support anything fancy. Just call the named
177 # method on the peer and return a resolved future.
177 # method on the peer and return a resolved future.
178 fn = getattr(self._peer, pycompat.sysstr(command))
178 fn = getattr(self._peer, pycompat.sysstr(command))
179
179
180 f = pycompat.futures.Future()
180 f = pycompat.futures.Future()
181
181
182 try:
182 try:
183 result = fn(**pycompat.strkwargs(args))
183 result = fn(**pycompat.strkwargs(args))
184 except Exception:
184 except Exception:
185 pycompat.future_set_exception_info(f, sys.exc_info()[1:])
185 pycompat.future_set_exception_info(f, sys.exc_info()[1:])
186 else:
186 else:
187 f.set_result(result)
187 f.set_result(result)
188
188
189 return f
189 return f
190
190
191 def sendcommands(self):
191 def sendcommands(self):
192 self._sent = True
192 self._sent = True
193
193
194 def close(self):
194 def close(self):
195 self._closed = True
195 self._closed = True
196
196
197 @interfaceutil.implementer(repository.ipeercommands)
197 @interfaceutil.implementer(repository.ipeercommands)
198 class localpeer(repository.peer):
198 class localpeer(repository.peer):
199 '''peer for a local repo; reflects only the most recent API'''
199 '''peer for a local repo; reflects only the most recent API'''
200
200
201 def __init__(self, repo, caps=None):
201 def __init__(self, repo, caps=None):
202 super(localpeer, self).__init__()
202 super(localpeer, self).__init__()
203
203
204 if caps is None:
204 if caps is None:
205 caps = moderncaps.copy()
205 caps = moderncaps.copy()
206 self._repo = repo.filtered('served')
206 self._repo = repo.filtered('served')
207 self.ui = repo.ui
207 self.ui = repo.ui
208 self._caps = repo._restrictcapabilities(caps)
208 self._caps = repo._restrictcapabilities(caps)
209
209
210 # Begin of _basepeer interface.
210 # Begin of _basepeer interface.
211
211
212 def url(self):
212 def url(self):
213 return self._repo.url()
213 return self._repo.url()
214
214
215 def local(self):
215 def local(self):
216 return self._repo
216 return self._repo
217
217
218 def peer(self):
218 def peer(self):
219 return self
219 return self
220
220
221 def canpush(self):
221 def canpush(self):
222 return True
222 return True
223
223
224 def close(self):
224 def close(self):
225 self._repo.close()
225 self._repo.close()
226
226
227 # End of _basepeer interface.
227 # End of _basepeer interface.
228
228
229 # Begin of _basewirecommands interface.
229 # Begin of _basewirecommands interface.
230
230
231 def branchmap(self):
231 def branchmap(self):
232 return self._repo.branchmap()
232 return self._repo.branchmap()
233
233
234 def capabilities(self):
234 def capabilities(self):
235 return self._caps
235 return self._caps
236
236
237 def clonebundles(self):
237 def clonebundles(self):
238 return self._repo.tryread('clonebundles.manifest')
238 return self._repo.tryread('clonebundles.manifest')
239
239
240 def debugwireargs(self, one, two, three=None, four=None, five=None):
240 def debugwireargs(self, one, two, three=None, four=None, five=None):
241 """Used to test argument passing over the wire"""
241 """Used to test argument passing over the wire"""
242 return "%s %s %s %s %s" % (one, two, pycompat.bytestr(three),
242 return "%s %s %s %s %s" % (one, two, pycompat.bytestr(three),
243 pycompat.bytestr(four),
243 pycompat.bytestr(four),
244 pycompat.bytestr(five))
244 pycompat.bytestr(five))
245
245
246 def getbundle(self, source, heads=None, common=None, bundlecaps=None,
246 def getbundle(self, source, heads=None, common=None, bundlecaps=None,
247 **kwargs):
247 **kwargs):
248 chunks = exchange.getbundlechunks(self._repo, source, heads=heads,
248 chunks = exchange.getbundlechunks(self._repo, source, heads=heads,
249 common=common, bundlecaps=bundlecaps,
249 common=common, bundlecaps=bundlecaps,
250 **kwargs)[1]
250 **kwargs)[1]
251 cb = util.chunkbuffer(chunks)
251 cb = util.chunkbuffer(chunks)
252
252
253 if exchange.bundle2requested(bundlecaps):
253 if exchange.bundle2requested(bundlecaps):
254 # When requesting a bundle2, getbundle returns a stream to make the
254 # When requesting a bundle2, getbundle returns a stream to make the
255 # wire level function happier. We need to build a proper object
255 # wire level function happier. We need to build a proper object
256 # from it in local peer.
256 # from it in local peer.
257 return bundle2.getunbundler(self.ui, cb)
257 return bundle2.getunbundler(self.ui, cb)
258 else:
258 else:
259 return changegroup.getunbundler('01', cb, None)
259 return changegroup.getunbundler('01', cb, None)
260
260
261 def heads(self):
261 def heads(self):
262 return self._repo.heads()
262 return self._repo.heads()
263
263
264 def known(self, nodes):
264 def known(self, nodes):
265 return self._repo.known(nodes)
265 return self._repo.known(nodes)
266
266
267 def listkeys(self, namespace):
267 def listkeys(self, namespace):
268 return self._repo.listkeys(namespace)
268 return self._repo.listkeys(namespace)
269
269
270 def lookup(self, key):
270 def lookup(self, key):
271 return self._repo.lookup(key)
271 return self._repo.lookup(key)
272
272
273 def pushkey(self, namespace, key, old, new):
273 def pushkey(self, namespace, key, old, new):
274 return self._repo.pushkey(namespace, key, old, new)
274 return self._repo.pushkey(namespace, key, old, new)
275
275
276 def stream_out(self):
276 def stream_out(self):
277 raise error.Abort(_('cannot perform stream clone against local '
277 raise error.Abort(_('cannot perform stream clone against local '
278 'peer'))
278 'peer'))
279
279
280 def unbundle(self, bundle, heads, url):
280 def unbundle(self, bundle, heads, url):
281 """apply a bundle on a repo
281 """apply a bundle on a repo
282
282
283 This function handles the repo locking itself."""
283 This function handles the repo locking itself."""
284 try:
284 try:
285 try:
285 try:
286 bundle = exchange.readbundle(self.ui, bundle, None)
286 bundle = exchange.readbundle(self.ui, bundle, None)
287 ret = exchange.unbundle(self._repo, bundle, heads, 'push', url)
287 ret = exchange.unbundle(self._repo, bundle, heads, 'push', url)
288 if util.safehasattr(ret, 'getchunks'):
288 if util.safehasattr(ret, 'getchunks'):
289 # This is a bundle20 object, turn it into an unbundler.
289 # This is a bundle20 object, turn it into an unbundler.
290 # This little dance should be dropped eventually when the
290 # This little dance should be dropped eventually when the
291 # API is finally improved.
291 # API is finally improved.
292 stream = util.chunkbuffer(ret.getchunks())
292 stream = util.chunkbuffer(ret.getchunks())
293 ret = bundle2.getunbundler(self.ui, stream)
293 ret = bundle2.getunbundler(self.ui, stream)
294 return ret
294 return ret
295 except Exception as exc:
295 except Exception as exc:
296 # If the exception contains output salvaged from a bundle2
296 # If the exception contains output salvaged from a bundle2
297 # reply, we need to make sure it is printed before continuing
297 # reply, we need to make sure it is printed before continuing
298 # to fail. So we build a bundle2 with such output and consume
298 # to fail. So we build a bundle2 with such output and consume
299 # it directly.
299 # it directly.
300 #
300 #
301 # This is not very elegant but allows a "simple" solution for
301 # This is not very elegant but allows a "simple" solution for
302 # issue4594
302 # issue4594
303 output = getattr(exc, '_bundle2salvagedoutput', ())
303 output = getattr(exc, '_bundle2salvagedoutput', ())
304 if output:
304 if output:
305 bundler = bundle2.bundle20(self._repo.ui)
305 bundler = bundle2.bundle20(self._repo.ui)
306 for out in output:
306 for out in output:
307 bundler.addpart(out)
307 bundler.addpart(out)
308 stream = util.chunkbuffer(bundler.getchunks())
308 stream = util.chunkbuffer(bundler.getchunks())
309 b = bundle2.getunbundler(self.ui, stream)
309 b = bundle2.getunbundler(self.ui, stream)
310 bundle2.processbundle(self._repo, b)
310 bundle2.processbundle(self._repo, b)
311 raise
311 raise
312 except error.PushRaced as exc:
312 except error.PushRaced as exc:
313 raise error.ResponseError(_('push failed:'),
313 raise error.ResponseError(_('push failed:'),
314 stringutil.forcebytestr(exc))
314 stringutil.forcebytestr(exc))
315
315
316 # End of _basewirecommands interface.
316 # End of _basewirecommands interface.
317
317
318 # Begin of peer interface.
318 # Begin of peer interface.
319
319
320 def commandexecutor(self):
320 def commandexecutor(self):
321 return localcommandexecutor(self)
321 return localcommandexecutor(self)
322
322
323 # End of peer interface.
323 # End of peer interface.
324
324
325 @interfaceutil.implementer(repository.ipeerlegacycommands)
325 @interfaceutil.implementer(repository.ipeerlegacycommands)
326 class locallegacypeer(localpeer):
326 class locallegacypeer(localpeer):
327 '''peer extension which implements legacy methods too; used for tests with
327 '''peer extension which implements legacy methods too; used for tests with
328 restricted capabilities'''
328 restricted capabilities'''
329
329
330 def __init__(self, repo):
330 def __init__(self, repo):
331 super(locallegacypeer, self).__init__(repo, caps=legacycaps)
331 super(locallegacypeer, self).__init__(repo, caps=legacycaps)
332
332
333 # Begin of baselegacywirecommands interface.
333 # Begin of baselegacywirecommands interface.
334
334
335 def between(self, pairs):
335 def between(self, pairs):
336 return self._repo.between(pairs)
336 return self._repo.between(pairs)
337
337
338 def branches(self, nodes):
338 def branches(self, nodes):
339 return self._repo.branches(nodes)
339 return self._repo.branches(nodes)
340
340
341 def changegroup(self, nodes, source):
341 def changegroup(self, nodes, source):
342 outgoing = discovery.outgoing(self._repo, missingroots=nodes,
342 outgoing = discovery.outgoing(self._repo, missingroots=nodes,
343 missingheads=self._repo.heads())
343 missingheads=self._repo.heads())
344 return changegroup.makechangegroup(self._repo, outgoing, '01', source)
344 return changegroup.makechangegroup(self._repo, outgoing, '01', source)
345
345
346 def changegroupsubset(self, bases, heads, source):
346 def changegroupsubset(self, bases, heads, source):
347 outgoing = discovery.outgoing(self._repo, missingroots=bases,
347 outgoing = discovery.outgoing(self._repo, missingroots=bases,
348 missingheads=heads)
348 missingheads=heads)
349 return changegroup.makechangegroup(self._repo, outgoing, '01', source)
349 return changegroup.makechangegroup(self._repo, outgoing, '01', source)
350
350
351 # End of baselegacywirecommands interface.
351 # End of baselegacywirecommands interface.
352
352
353 # Increment the sub-version when the revlog v2 format changes to lock out old
353 # Increment the sub-version when the revlog v2 format changes to lock out old
354 # clients.
354 # clients.
355 REVLOGV2_REQUIREMENT = 'exp-revlogv2.0'
355 REVLOGV2_REQUIREMENT = 'exp-revlogv2.0'
356
356
357 # A repository with the sparserevlog feature will have delta chains that
357 # A repository with the sparserevlog feature will have delta chains that
358 # can spread over a larger span. Sparse reading cuts these large spans into
358 # can spread over a larger span. Sparse reading cuts these large spans into
359 # pieces, so that each piece isn't too big.
359 # pieces, so that each piece isn't too big.
360 # Without the sparserevlog capability, reading from the repository could use
360 # Without the sparserevlog capability, reading from the repository could use
361 # huge amounts of memory, because the whole span would be read at once,
361 # huge amounts of memory, because the whole span would be read at once,
362 # including all the intermediate revisions that aren't pertinent for the chain.
362 # including all the intermediate revisions that aren't pertinent for the chain.
363 # This is why once a repository has enabled sparse-read, it becomes required.
363 # This is why once a repository has enabled sparse-read, it becomes required.
364 SPARSEREVLOG_REQUIREMENT = 'sparserevlog'
364 SPARSEREVLOG_REQUIREMENT = 'sparserevlog'
365
365
366 # Functions receiving (ui, features) that extensions can register to impact
366 # Functions receiving (ui, features) that extensions can register to impact
367 # the ability to load repositories with custom requirements. Only
367 # the ability to load repositories with custom requirements. Only
368 # functions defined in loaded extensions are called.
368 # functions defined in loaded extensions are called.
369 #
369 #
370 # The function receives a set of requirement strings that the repository
370 # The function receives a set of requirement strings that the repository
371 # is capable of opening. Functions will typically add elements to the
371 # is capable of opening. Functions will typically add elements to the
372 # set to reflect that the extension knows how to handle that requirements.
372 # set to reflect that the extension knows how to handle that requirements.
373 featuresetupfuncs = set()
373 featuresetupfuncs = set()
374
374
375 @interfaceutil.implementer(repository.completelocalrepository)
375 @interfaceutil.implementer(repository.completelocalrepository)
376 class localrepository(object):
376 class localrepository(object):
377
377
378 # obsolete experimental requirements:
378 # obsolete experimental requirements:
379 # - manifestv2: An experimental new manifest format that allowed
379 # - manifestv2: An experimental new manifest format that allowed
380 # for stem compression of long paths. Experiment ended up not
380 # for stem compression of long paths. Experiment ended up not
381 # being successful (repository sizes went up due to worse delta
381 # being successful (repository sizes went up due to worse delta
382 # chains), and the code was deleted in 4.6.
382 # chains), and the code was deleted in 4.6.
383 supportedformats = {
383 supportedformats = {
384 'revlogv1',
384 'revlogv1',
385 'generaldelta',
385 'generaldelta',
386 'treemanifest',
386 'treemanifest',
387 REVLOGV2_REQUIREMENT,
387 REVLOGV2_REQUIREMENT,
388 SPARSEREVLOG_REQUIREMENT,
388 SPARSEREVLOG_REQUIREMENT,
389 }
389 }
390 _basesupported = supportedformats | {
390 _basesupported = supportedformats | {
391 'store',
391 'store',
392 'fncache',
392 'fncache',
393 'shared',
393 'shared',
394 'relshared',
394 'relshared',
395 'dotencode',
395 'dotencode',
396 'exp-sparse',
396 'exp-sparse',
397 }
397 }
398 openerreqs = {
398 openerreqs = {
399 'revlogv1',
399 'revlogv1',
400 'generaldelta',
400 'generaldelta',
401 'treemanifest',
401 'treemanifest',
402 }
402 }
403
403
404 # list of prefix for file which can be written without 'wlock'
404 # list of prefix for file which can be written without 'wlock'
405 # Extensions should extend this list when needed
405 # Extensions should extend this list when needed
406 _wlockfreeprefix = {
406 _wlockfreeprefix = {
407 # We migh consider requiring 'wlock' for the next
407 # We migh consider requiring 'wlock' for the next
408 # two, but pretty much all the existing code assume
408 # two, but pretty much all the existing code assume
409 # wlock is not needed so we keep them excluded for
409 # wlock is not needed so we keep them excluded for
410 # now.
410 # now.
411 'hgrc',
411 'hgrc',
412 'requires',
412 'requires',
413 # XXX cache is a complicatged business someone
413 # XXX cache is a complicatged business someone
414 # should investigate this in depth at some point
414 # should investigate this in depth at some point
415 'cache/',
415 'cache/',
416 # XXX shouldn't be dirstate covered by the wlock?
416 # XXX shouldn't be dirstate covered by the wlock?
417 'dirstate',
417 'dirstate',
418 # XXX bisect was still a bit too messy at the time
418 # XXX bisect was still a bit too messy at the time
419 # this changeset was introduced. Someone should fix
419 # this changeset was introduced. Someone should fix
420 # the remainig bit and drop this line
420 # the remainig bit and drop this line
421 'bisect.state',
421 'bisect.state',
422 }
422 }
423
423
424 def __init__(self, baseui, path, create=False, intents=None):
424 def __init__(self, baseui, path, create=False, intents=None):
425 self.requirements = set()
425 self.requirements = set()
426 self.filtername = None
426 self.filtername = None
427 # wvfs: rooted at the repository root, used to access the working copy
427 # wvfs: rooted at the repository root, used to access the working copy
428 self.wvfs = vfsmod.vfs(path, expandpath=True, realpath=True)
428 self.wvfs = vfsmod.vfs(path, expandpath=True, realpath=True)
429 # vfs: rooted at .hg, used to access repo files outside of .hg/store
429 # vfs: rooted at .hg, used to access repo files outside of .hg/store
430 self.vfs = None
430 self.vfs = None
431 # svfs: usually rooted at .hg/store, used to access repository history
431 # svfs: usually rooted at .hg/store, used to access repository history
432 # If this is a shared repository, this vfs may point to another
432 # If this is a shared repository, this vfs may point to another
433 # repository's .hg/store directory.
433 # repository's .hg/store directory.
434 self.svfs = None
434 self.svfs = None
435 self.root = self.wvfs.base
435 self.root = self.wvfs.base
436 self.path = self.wvfs.join(".hg")
436 self.path = self.wvfs.join(".hg")
437 self.origroot = path
437 self.origroot = path
438 # This is only used by context.workingctx.match in order to
438 # This is only used by context.workingctx.match in order to
439 # detect files in subrepos.
439 # detect files in subrepos.
440 self.auditor = pathutil.pathauditor(
440 self.auditor = pathutil.pathauditor(
441 self.root, callback=self._checknested)
441 self.root, callback=self._checknested)
442 # This is only used by context.basectx.match in order to detect
442 # This is only used by context.basectx.match in order to detect
443 # files in subrepos.
443 # files in subrepos.
444 self.nofsauditor = pathutil.pathauditor(
444 self.nofsauditor = pathutil.pathauditor(
445 self.root, callback=self._checknested, realfs=False, cached=True)
445 self.root, callback=self._checknested, realfs=False, cached=True)
446 self.baseui = baseui
446 self.baseui = baseui
447 self.ui = baseui.copy()
447 self.ui = baseui.copy()
448 self.ui.copy = baseui.copy # prevent copying repo configuration
448 self.ui.copy = baseui.copy # prevent copying repo configuration
449 self.vfs = vfsmod.vfs(self.path, cacheaudited=True)
449 self.vfs = vfsmod.vfs(self.path, cacheaudited=True)
450 if (self.ui.configbool('devel', 'all-warnings') or
450 if (self.ui.configbool('devel', 'all-warnings') or
451 self.ui.configbool('devel', 'check-locks')):
451 self.ui.configbool('devel', 'check-locks')):
452 self.vfs.audit = self._getvfsward(self.vfs.audit)
452 self.vfs.audit = self._getvfsward(self.vfs.audit)
453 # A list of callback to shape the phase if no data were found.
453 # A list of callback to shape the phase if no data were found.
454 # Callback are in the form: func(repo, roots) --> processed root.
454 # Callback are in the form: func(repo, roots) --> processed root.
455 # This list it to be filled by extension during repo setup
455 # This list it to be filled by extension during repo setup
456 self._phasedefaults = []
456 self._phasedefaults = []
457 try:
457 try:
458 self.ui.readconfig(self.vfs.join("hgrc"), self.root)
458 self.ui.readconfig(self.vfs.join("hgrc"), self.root)
459 self._loadextensions()
459 self._loadextensions()
460 except IOError:
460 except IOError:
461 pass
461 pass
462
462
463 if featuresetupfuncs:
463 if featuresetupfuncs:
464 self.supported = set(self._basesupported) # use private copy
464 self.supported = set(self._basesupported) # use private copy
465 extmods = set(m.__name__ for n, m
465 extmods = set(m.__name__ for n, m
466 in extensions.extensions(self.ui))
466 in extensions.extensions(self.ui))
467 for setupfunc in featuresetupfuncs:
467 for setupfunc in featuresetupfuncs:
468 if setupfunc.__module__ in extmods:
468 if setupfunc.__module__ in extmods:
469 setupfunc(self.ui, self.supported)
469 setupfunc(self.ui, self.supported)
470 else:
470 else:
471 self.supported = self._basesupported
471 self.supported = self._basesupported
472 color.setup(self.ui)
472 color.setup(self.ui)
473
473
474 # Add compression engines.
474 # Add compression engines.
475 for name in util.compengines:
475 for name in util.compengines:
476 engine = util.compengines[name]
476 engine = util.compengines[name]
477 if engine.revlogheader():
477 if engine.revlogheader():
478 self.supported.add('exp-compression-%s' % name)
478 self.supported.add('exp-compression-%s' % name)
479
479
480 if not self.vfs.isdir():
480 if not self.vfs.isdir():
481 if create:
481 if create:
482 self.requirements = newreporequirements(self)
482 self.requirements = newreporequirements(self)
483
483
484 if not self.wvfs.exists():
484 if not self.wvfs.exists():
485 self.wvfs.makedirs()
485 self.wvfs.makedirs()
486 self.vfs.makedir(notindexed=True)
486 self.vfs.makedir(notindexed=True)
487
487
488 if 'store' in self.requirements:
488 if 'store' in self.requirements:
489 self.vfs.mkdir("store")
489 self.vfs.mkdir("store")
490
490
491 # create an invalid changelog
491 # create an invalid changelog
492 self.vfs.append(
492 self.vfs.append(
493 "00changelog.i",
493 "00changelog.i",
494 '\0\0\0\2' # represents revlogv2
494 '\0\0\0\2' # represents revlogv2
495 ' dummy changelog to prevent using the old repo layout'
495 ' dummy changelog to prevent using the old repo layout'
496 )
496 )
497 else:
497 else:
498 raise error.RepoError(_("repository %s not found") % path)
498 raise error.RepoError(_("repository %s not found") % path)
499 elif create:
499 elif create:
500 raise error.RepoError(_("repository %s already exists") % path)
500 raise error.RepoError(_("repository %s already exists") % path)
501 else:
501 else:
502 try:
502 try:
503 self.requirements = scmutil.readrequires(
503 self.requirements = scmutil.readrequires(
504 self.vfs, self.supported)
504 self.vfs, self.supported)
505 except IOError as inst:
505 except IOError as inst:
506 if inst.errno != errno.ENOENT:
506 if inst.errno != errno.ENOENT:
507 raise
507 raise
508
508
509 cachepath = self.vfs.join('cache')
509 cachepath = self.vfs.join('cache')
510 self.sharedpath = self.path
510 self.sharedpath = self.path
511 try:
511 try:
512 sharedpath = self.vfs.read("sharedpath").rstrip('\n')
512 sharedpath = self.vfs.read("sharedpath").rstrip('\n')
513 if 'relshared' in self.requirements:
513 if 'relshared' in self.requirements:
514 sharedpath = self.vfs.join(sharedpath)
514 sharedpath = self.vfs.join(sharedpath)
515 vfs = vfsmod.vfs(sharedpath, realpath=True)
515 vfs = vfsmod.vfs(sharedpath, realpath=True)
516 cachepath = vfs.join('cache')
516 cachepath = vfs.join('cache')
517 s = vfs.base
517 s = vfs.base
518 if not vfs.exists():
518 if not vfs.exists():
519 raise error.RepoError(
519 raise error.RepoError(
520 _('.hg/sharedpath points to nonexistent directory %s') % s)
520 _('.hg/sharedpath points to nonexistent directory %s') % s)
521 self.sharedpath = s
521 self.sharedpath = s
522 except IOError as inst:
522 except IOError as inst:
523 if inst.errno != errno.ENOENT:
523 if inst.errno != errno.ENOENT:
524 raise
524 raise
525
525
526 if 'exp-sparse' in self.requirements and not sparse.enabled:
526 if 'exp-sparse' in self.requirements and not sparse.enabled:
527 raise error.RepoError(_('repository is using sparse feature but '
527 raise error.RepoError(_('repository is using sparse feature but '
528 'sparse is not enabled; enable the '
528 'sparse is not enabled; enable the '
529 '"sparse" extensions to access'))
529 '"sparse" extensions to access'))
530
530
531 self.store = store.store(
531 self.store = store.store(
532 self.requirements, self.sharedpath,
532 self.requirements, self.sharedpath,
533 lambda base: vfsmod.vfs(base, cacheaudited=True))
533 lambda base: vfsmod.vfs(base, cacheaudited=True))
534 self.spath = self.store.path
534 self.spath = self.store.path
535 self.svfs = self.store.vfs
535 self.svfs = self.store.vfs
536 self.sjoin = self.store.join
536 self.sjoin = self.store.join
537 self.vfs.createmode = self.store.createmode
537 self.vfs.createmode = self.store.createmode
538 self.cachevfs = vfsmod.vfs(cachepath, cacheaudited=True)
538 self.cachevfs = vfsmod.vfs(cachepath, cacheaudited=True)
539 self.cachevfs.createmode = self.store.createmode
539 self.cachevfs.createmode = self.store.createmode
540 if (self.ui.configbool('devel', 'all-warnings') or
540 if (self.ui.configbool('devel', 'all-warnings') or
541 self.ui.configbool('devel', 'check-locks')):
541 self.ui.configbool('devel', 'check-locks')):
542 if util.safehasattr(self.svfs, 'vfs'): # this is filtervfs
542 if util.safehasattr(self.svfs, 'vfs'): # this is filtervfs
543 self.svfs.vfs.audit = self._getsvfsward(self.svfs.vfs.audit)
543 self.svfs.vfs.audit = self._getsvfsward(self.svfs.vfs.audit)
544 else: # standard vfs
544 else: # standard vfs
545 self.svfs.audit = self._getsvfsward(self.svfs.audit)
545 self.svfs.audit = self._getsvfsward(self.svfs.audit)
546 self._applyopenerreqs()
546 self._applyopenerreqs()
547 if create:
547 if create:
548 self._writerequirements()
548 self._writerequirements()
549
549
550 self._dirstatevalidatewarned = False
550 self._dirstatevalidatewarned = False
551
551
552 self._branchcaches = {}
552 self._branchcaches = {}
553 self._revbranchcache = None
553 self._revbranchcache = None
554 self._filterpats = {}
554 self._filterpats = {}
555 self._datafilters = {}
555 self._datafilters = {}
556 self._transref = self._lockref = self._wlockref = None
556 self._transref = self._lockref = self._wlockref = None
557
557
558 # A cache for various files under .hg/ that tracks file changes,
558 # A cache for various files under .hg/ that tracks file changes,
559 # (used by the filecache decorator)
559 # (used by the filecache decorator)
560 #
560 #
561 # Maps a property name to its util.filecacheentry
561 # Maps a property name to its util.filecacheentry
562 self._filecache = {}
562 self._filecache = {}
563
563
564 # hold sets of revision to be filtered
564 # hold sets of revision to be filtered
565 # should be cleared when something might have changed the filter value:
565 # should be cleared when something might have changed the filter value:
566 # - new changesets,
566 # - new changesets,
567 # - phase change,
567 # - phase change,
568 # - new obsolescence marker,
568 # - new obsolescence marker,
569 # - working directory parent change,
569 # - working directory parent change,
570 # - bookmark changes
570 # - bookmark changes
571 self.filteredrevcache = {}
571 self.filteredrevcache = {}
572
572
573 # post-dirstate-status hooks
573 # post-dirstate-status hooks
574 self._postdsstatus = []
574 self._postdsstatus = []
575
575
576 # generic mapping between names and nodes
576 # generic mapping between names and nodes
577 self.names = namespaces.namespaces()
577 self.names = namespaces.namespaces()
578
578
579 # Key to signature value.
579 # Key to signature value.
580 self._sparsesignaturecache = {}
580 self._sparsesignaturecache = {}
581 # Signature to cached matcher instance.
581 # Signature to cached matcher instance.
582 self._sparsematchercache = {}
582 self._sparsematchercache = {}
583
583
584 def _getvfsward(self, origfunc):
584 def _getvfsward(self, origfunc):
585 """build a ward for self.vfs"""
585 """build a ward for self.vfs"""
586 rref = weakref.ref(self)
586 rref = weakref.ref(self)
587 def checkvfs(path, mode=None):
587 def checkvfs(path, mode=None):
588 ret = origfunc(path, mode=mode)
588 ret = origfunc(path, mode=mode)
589 repo = rref()
589 repo = rref()
590 if (repo is None
590 if (repo is None
591 or not util.safehasattr(repo, '_wlockref')
591 or not util.safehasattr(repo, '_wlockref')
592 or not util.safehasattr(repo, '_lockref')):
592 or not util.safehasattr(repo, '_lockref')):
593 return
593 return
594 if mode in (None, 'r', 'rb'):
594 if mode in (None, 'r', 'rb'):
595 return
595 return
596 if path.startswith(repo.path):
596 if path.startswith(repo.path):
597 # truncate name relative to the repository (.hg)
597 # truncate name relative to the repository (.hg)
598 path = path[len(repo.path) + 1:]
598 path = path[len(repo.path) + 1:]
599 if path.startswith('cache/'):
599 if path.startswith('cache/'):
600 msg = 'accessing cache with vfs instead of cachevfs: "%s"'
600 msg = 'accessing cache with vfs instead of cachevfs: "%s"'
601 repo.ui.develwarn(msg % path, stacklevel=2, config="cache-vfs")
601 repo.ui.develwarn(msg % path, stacklevel=2, config="cache-vfs")
602 if path.startswith('journal.'):
602 if path.startswith('journal.'):
603 # journal is covered by 'lock'
603 # journal is covered by 'lock'
604 if repo._currentlock(repo._lockref) is None:
604 if repo._currentlock(repo._lockref) is None:
605 repo.ui.develwarn('write with no lock: "%s"' % path,
605 repo.ui.develwarn('write with no lock: "%s"' % path,
606 stacklevel=2, config='check-locks')
606 stacklevel=2, config='check-locks')
607 elif repo._currentlock(repo._wlockref) is None:
607 elif repo._currentlock(repo._wlockref) is None:
608 # rest of vfs files are covered by 'wlock'
608 # rest of vfs files are covered by 'wlock'
609 #
609 #
610 # exclude special files
610 # exclude special files
611 for prefix in self._wlockfreeprefix:
611 for prefix in self._wlockfreeprefix:
612 if path.startswith(prefix):
612 if path.startswith(prefix):
613 return
613 return
614 repo.ui.develwarn('write with no wlock: "%s"' % path,
614 repo.ui.develwarn('write with no wlock: "%s"' % path,
615 stacklevel=2, config='check-locks')
615 stacklevel=2, config='check-locks')
616 return ret
616 return ret
617 return checkvfs
617 return checkvfs
618
618
619 def _getsvfsward(self, origfunc):
619 def _getsvfsward(self, origfunc):
620 """build a ward for self.svfs"""
620 """build a ward for self.svfs"""
621 rref = weakref.ref(self)
621 rref = weakref.ref(self)
622 def checksvfs(path, mode=None):
622 def checksvfs(path, mode=None):
623 ret = origfunc(path, mode=mode)
623 ret = origfunc(path, mode=mode)
624 repo = rref()
624 repo = rref()
625 if repo is None or not util.safehasattr(repo, '_lockref'):
625 if repo is None or not util.safehasattr(repo, '_lockref'):
626 return
626 return
627 if mode in (None, 'r', 'rb'):
627 if mode in (None, 'r', 'rb'):
628 return
628 return
629 if path.startswith(repo.sharedpath):
629 if path.startswith(repo.sharedpath):
630 # truncate name relative to the repository (.hg)
630 # truncate name relative to the repository (.hg)
631 path = path[len(repo.sharedpath) + 1:]
631 path = path[len(repo.sharedpath) + 1:]
632 if repo._currentlock(repo._lockref) is None:
632 if repo._currentlock(repo._lockref) is None:
633 repo.ui.develwarn('write with no lock: "%s"' % path,
633 repo.ui.develwarn('write with no lock: "%s"' % path,
634 stacklevel=3)
634 stacklevel=3)
635 return ret
635 return ret
636 return checksvfs
636 return checksvfs
637
637
638 def close(self):
638 def close(self):
639 self._writecaches()
639 self._writecaches()
640
640
641 def _loadextensions(self):
641 def _loadextensions(self):
642 extensions.loadall(self.ui)
642 extensions.loadall(self.ui)
643
643
644 def _writecaches(self):
644 def _writecaches(self):
645 if self._revbranchcache:
645 if self._revbranchcache:
646 self._revbranchcache.write()
646 self._revbranchcache.write()
647
647
648 def _restrictcapabilities(self, caps):
648 def _restrictcapabilities(self, caps):
649 if self.ui.configbool('experimental', 'bundle2-advertise'):
649 if self.ui.configbool('experimental', 'bundle2-advertise'):
650 caps = set(caps)
650 caps = set(caps)
651 capsblob = bundle2.encodecaps(bundle2.getrepocaps(self,
651 capsblob = bundle2.encodecaps(bundle2.getrepocaps(self,
652 role='client'))
652 role='client'))
653 caps.add('bundle2=' + urlreq.quote(capsblob))
653 caps.add('bundle2=' + urlreq.quote(capsblob))
654 return caps
654 return caps
655
655
656 def _applyopenerreqs(self):
656 def _applyopenerreqs(self):
657 self.svfs.options = dict((r, 1) for r in self.requirements
657 self.svfs.options = dict((r, 1) for r in self.requirements
658 if r in self.openerreqs)
658 if r in self.openerreqs)
659 # experimental config: format.chunkcachesize
659 # experimental config: format.chunkcachesize
660 chunkcachesize = self.ui.configint('format', 'chunkcachesize')
660 chunkcachesize = self.ui.configint('format', 'chunkcachesize')
661 if chunkcachesize is not None:
661 if chunkcachesize is not None:
662 self.svfs.options['chunkcachesize'] = chunkcachesize
662 self.svfs.options['chunkcachesize'] = chunkcachesize
663 # experimental config: format.maxchainlen
663 # experimental config: format.maxchainlen
664 maxchainlen = self.ui.configint('format', 'maxchainlen')
664 maxchainlen = self.ui.configint('format', 'maxchainlen')
665 if maxchainlen is not None:
665 if maxchainlen is not None:
666 self.svfs.options['maxchainlen'] = maxchainlen
666 self.svfs.options['maxchainlen'] = maxchainlen
667 # experimental config: format.manifestcachesize
667 # experimental config: format.manifestcachesize
668 manifestcachesize = self.ui.configint('format', 'manifestcachesize')
668 manifestcachesize = self.ui.configint('format', 'manifestcachesize')
669 if manifestcachesize is not None:
669 if manifestcachesize is not None:
670 self.svfs.options['manifestcachesize'] = manifestcachesize
670 self.svfs.options['manifestcachesize'] = manifestcachesize
671 deltabothparents = self.ui.configbool('revlog',
671 deltabothparents = self.ui.configbool('storage',
672 'optimize-delta-parent-choice')
672 'revlog.optimize-delta-parent-choice')
673 self.svfs.options['deltabothparents'] = deltabothparents
673 self.svfs.options['deltabothparents'] = deltabothparents
674 self.svfs.options['lazydeltabase'] = not scmutil.gddeltaconfig(self.ui)
674 self.svfs.options['lazydeltabase'] = not scmutil.gddeltaconfig(self.ui)
675 chainspan = self.ui.configbytes('experimental', 'maxdeltachainspan')
675 chainspan = self.ui.configbytes('experimental', 'maxdeltachainspan')
676 if 0 <= chainspan:
676 if 0 <= chainspan:
677 self.svfs.options['maxdeltachainspan'] = chainspan
677 self.svfs.options['maxdeltachainspan'] = chainspan
678 mmapindexthreshold = self.ui.configbytes('experimental',
678 mmapindexthreshold = self.ui.configbytes('experimental',
679 'mmapindexthreshold')
679 'mmapindexthreshold')
680 if mmapindexthreshold is not None:
680 if mmapindexthreshold is not None:
681 self.svfs.options['mmapindexthreshold'] = mmapindexthreshold
681 self.svfs.options['mmapindexthreshold'] = mmapindexthreshold
682 withsparseread = self.ui.configbool('experimental', 'sparse-read')
682 withsparseread = self.ui.configbool('experimental', 'sparse-read')
683 srdensitythres = float(self.ui.config('experimental',
683 srdensitythres = float(self.ui.config('experimental',
684 'sparse-read.density-threshold'))
684 'sparse-read.density-threshold'))
685 srmingapsize = self.ui.configbytes('experimental',
685 srmingapsize = self.ui.configbytes('experimental',
686 'sparse-read.min-gap-size')
686 'sparse-read.min-gap-size')
687 self.svfs.options['with-sparse-read'] = withsparseread
687 self.svfs.options['with-sparse-read'] = withsparseread
688 self.svfs.options['sparse-read-density-threshold'] = srdensitythres
688 self.svfs.options['sparse-read-density-threshold'] = srdensitythres
689 self.svfs.options['sparse-read-min-gap-size'] = srmingapsize
689 self.svfs.options['sparse-read-min-gap-size'] = srmingapsize
690 sparserevlog = SPARSEREVLOG_REQUIREMENT in self.requirements
690 sparserevlog = SPARSEREVLOG_REQUIREMENT in self.requirements
691 self.svfs.options['sparse-revlog'] = sparserevlog
691 self.svfs.options['sparse-revlog'] = sparserevlog
692
692
693 for r in self.requirements:
693 for r in self.requirements:
694 if r.startswith('exp-compression-'):
694 if r.startswith('exp-compression-'):
695 self.svfs.options['compengine'] = r[len('exp-compression-'):]
695 self.svfs.options['compengine'] = r[len('exp-compression-'):]
696
696
697 # TODO move "revlogv2" to openerreqs once finalized.
697 # TODO move "revlogv2" to openerreqs once finalized.
698 if REVLOGV2_REQUIREMENT in self.requirements:
698 if REVLOGV2_REQUIREMENT in self.requirements:
699 self.svfs.options['revlogv2'] = True
699 self.svfs.options['revlogv2'] = True
700
700
701 def _writerequirements(self):
701 def _writerequirements(self):
702 scmutil.writerequires(self.vfs, self.requirements)
702 scmutil.writerequires(self.vfs, self.requirements)
703
703
704 def _checknested(self, path):
704 def _checknested(self, path):
705 """Determine if path is a legal nested repository."""
705 """Determine if path is a legal nested repository."""
706 if not path.startswith(self.root):
706 if not path.startswith(self.root):
707 return False
707 return False
708 subpath = path[len(self.root) + 1:]
708 subpath = path[len(self.root) + 1:]
709 normsubpath = util.pconvert(subpath)
709 normsubpath = util.pconvert(subpath)
710
710
711 # XXX: Checking against the current working copy is wrong in
711 # XXX: Checking against the current working copy is wrong in
712 # the sense that it can reject things like
712 # the sense that it can reject things like
713 #
713 #
714 # $ hg cat -r 10 sub/x.txt
714 # $ hg cat -r 10 sub/x.txt
715 #
715 #
716 # if sub/ is no longer a subrepository in the working copy
716 # if sub/ is no longer a subrepository in the working copy
717 # parent revision.
717 # parent revision.
718 #
718 #
719 # However, it can of course also allow things that would have
719 # However, it can of course also allow things that would have
720 # been rejected before, such as the above cat command if sub/
720 # been rejected before, such as the above cat command if sub/
721 # is a subrepository now, but was a normal directory before.
721 # is a subrepository now, but was a normal directory before.
722 # The old path auditor would have rejected by mistake since it
722 # The old path auditor would have rejected by mistake since it
723 # panics when it sees sub/.hg/.
723 # panics when it sees sub/.hg/.
724 #
724 #
725 # All in all, checking against the working copy seems sensible
725 # All in all, checking against the working copy seems sensible
726 # since we want to prevent access to nested repositories on
726 # since we want to prevent access to nested repositories on
727 # the filesystem *now*.
727 # the filesystem *now*.
728 ctx = self[None]
728 ctx = self[None]
729 parts = util.splitpath(subpath)
729 parts = util.splitpath(subpath)
730 while parts:
730 while parts:
731 prefix = '/'.join(parts)
731 prefix = '/'.join(parts)
732 if prefix in ctx.substate:
732 if prefix in ctx.substate:
733 if prefix == normsubpath:
733 if prefix == normsubpath:
734 return True
734 return True
735 else:
735 else:
736 sub = ctx.sub(prefix)
736 sub = ctx.sub(prefix)
737 return sub.checknested(subpath[len(prefix) + 1:])
737 return sub.checknested(subpath[len(prefix) + 1:])
738 else:
738 else:
739 parts.pop()
739 parts.pop()
740 return False
740 return False
741
741
742 def peer(self):
742 def peer(self):
743 return localpeer(self) # not cached to avoid reference cycle
743 return localpeer(self) # not cached to avoid reference cycle
744
744
745 def unfiltered(self):
745 def unfiltered(self):
746 """Return unfiltered version of the repository
746 """Return unfiltered version of the repository
747
747
748 Intended to be overwritten by filtered repo."""
748 Intended to be overwritten by filtered repo."""
749 return self
749 return self
750
750
751 def filtered(self, name, visibilityexceptions=None):
751 def filtered(self, name, visibilityexceptions=None):
752 """Return a filtered version of a repository"""
752 """Return a filtered version of a repository"""
753 cls = repoview.newtype(self.unfiltered().__class__)
753 cls = repoview.newtype(self.unfiltered().__class__)
754 return cls(self, name, visibilityexceptions)
754 return cls(self, name, visibilityexceptions)
755
755
756 @repofilecache('bookmarks', 'bookmarks.current')
756 @repofilecache('bookmarks', 'bookmarks.current')
757 def _bookmarks(self):
757 def _bookmarks(self):
758 return bookmarks.bmstore(self)
758 return bookmarks.bmstore(self)
759
759
760 @property
760 @property
761 def _activebookmark(self):
761 def _activebookmark(self):
762 return self._bookmarks.active
762 return self._bookmarks.active
763
763
764 # _phasesets depend on changelog. what we need is to call
764 # _phasesets depend on changelog. what we need is to call
765 # _phasecache.invalidate() if '00changelog.i' was changed, but it
765 # _phasecache.invalidate() if '00changelog.i' was changed, but it
766 # can't be easily expressed in filecache mechanism.
766 # can't be easily expressed in filecache mechanism.
767 @storecache('phaseroots', '00changelog.i')
767 @storecache('phaseroots', '00changelog.i')
768 def _phasecache(self):
768 def _phasecache(self):
769 return phases.phasecache(self, self._phasedefaults)
769 return phases.phasecache(self, self._phasedefaults)
770
770
771 @storecache('obsstore')
771 @storecache('obsstore')
772 def obsstore(self):
772 def obsstore(self):
773 return obsolete.makestore(self.ui, self)
773 return obsolete.makestore(self.ui, self)
774
774
775 @storecache('00changelog.i')
775 @storecache('00changelog.i')
776 def changelog(self):
776 def changelog(self):
777 return changelog.changelog(self.svfs,
777 return changelog.changelog(self.svfs,
778 trypending=txnutil.mayhavepending(self.root))
778 trypending=txnutil.mayhavepending(self.root))
779
779
780 def _constructmanifest(self):
780 def _constructmanifest(self):
781 # This is a temporary function while we migrate from manifest to
781 # This is a temporary function while we migrate from manifest to
782 # manifestlog. It allows bundlerepo and unionrepo to intercept the
782 # manifestlog. It allows bundlerepo and unionrepo to intercept the
783 # manifest creation.
783 # manifest creation.
784 return manifest.manifestrevlog(self.svfs)
784 return manifest.manifestrevlog(self.svfs)
785
785
786 @storecache('00manifest.i')
786 @storecache('00manifest.i')
787 def manifestlog(self):
787 def manifestlog(self):
788 return manifest.manifestlog(self.svfs, self)
788 return manifest.manifestlog(self.svfs, self)
789
789
790 @repofilecache('dirstate')
790 @repofilecache('dirstate')
791 def dirstate(self):
791 def dirstate(self):
792 return self._makedirstate()
792 return self._makedirstate()
793
793
794 def _makedirstate(self):
794 def _makedirstate(self):
795 """Extension point for wrapping the dirstate per-repo."""
795 """Extension point for wrapping the dirstate per-repo."""
796 sparsematchfn = lambda: sparse.matcher(self)
796 sparsematchfn = lambda: sparse.matcher(self)
797
797
798 return dirstate.dirstate(self.vfs, self.ui, self.root,
798 return dirstate.dirstate(self.vfs, self.ui, self.root,
799 self._dirstatevalidate, sparsematchfn)
799 self._dirstatevalidate, sparsematchfn)
800
800
801 def _dirstatevalidate(self, node):
801 def _dirstatevalidate(self, node):
802 try:
802 try:
803 self.changelog.rev(node)
803 self.changelog.rev(node)
804 return node
804 return node
805 except error.LookupError:
805 except error.LookupError:
806 if not self._dirstatevalidatewarned:
806 if not self._dirstatevalidatewarned:
807 self._dirstatevalidatewarned = True
807 self._dirstatevalidatewarned = True
808 self.ui.warn(_("warning: ignoring unknown"
808 self.ui.warn(_("warning: ignoring unknown"
809 " working parent %s!\n") % short(node))
809 " working parent %s!\n") % short(node))
810 return nullid
810 return nullid
811
811
812 @repofilecache(narrowspec.FILENAME)
812 @repofilecache(narrowspec.FILENAME)
813 def narrowpats(self):
813 def narrowpats(self):
814 """matcher patterns for this repository's narrowspec
814 """matcher patterns for this repository's narrowspec
815
815
816 A tuple of (includes, excludes).
816 A tuple of (includes, excludes).
817 """
817 """
818 source = self
818 source = self
819 if self.shared():
819 if self.shared():
820 from . import hg
820 from . import hg
821 source = hg.sharedreposource(self)
821 source = hg.sharedreposource(self)
822 return narrowspec.load(source)
822 return narrowspec.load(source)
823
823
824 @repofilecache(narrowspec.FILENAME)
824 @repofilecache(narrowspec.FILENAME)
825 def _narrowmatch(self):
825 def _narrowmatch(self):
826 if changegroup.NARROW_REQUIREMENT not in self.requirements:
826 if changegroup.NARROW_REQUIREMENT not in self.requirements:
827 return matchmod.always(self.root, '')
827 return matchmod.always(self.root, '')
828 include, exclude = self.narrowpats
828 include, exclude = self.narrowpats
829 return narrowspec.match(self.root, include=include, exclude=exclude)
829 return narrowspec.match(self.root, include=include, exclude=exclude)
830
830
831 # TODO(martinvonz): make this property-like instead?
831 # TODO(martinvonz): make this property-like instead?
832 def narrowmatch(self):
832 def narrowmatch(self):
833 return self._narrowmatch
833 return self._narrowmatch
834
834
835 def setnarrowpats(self, newincludes, newexcludes):
835 def setnarrowpats(self, newincludes, newexcludes):
836 target = self
836 target = self
837 if self.shared():
837 if self.shared():
838 from . import hg
838 from . import hg
839 target = hg.sharedreposource(self)
839 target = hg.sharedreposource(self)
840 narrowspec.save(target, newincludes, newexcludes)
840 narrowspec.save(target, newincludes, newexcludes)
841 self.invalidate(clearfilecache=True)
841 self.invalidate(clearfilecache=True)
842
842
843 def __getitem__(self, changeid):
843 def __getitem__(self, changeid):
844 if changeid is None:
844 if changeid is None:
845 return context.workingctx(self)
845 return context.workingctx(self)
846 if isinstance(changeid, context.basectx):
846 if isinstance(changeid, context.basectx):
847 return changeid
847 return changeid
848 if isinstance(changeid, slice):
848 if isinstance(changeid, slice):
849 # wdirrev isn't contiguous so the slice shouldn't include it
849 # wdirrev isn't contiguous so the slice shouldn't include it
850 return [context.changectx(self, i)
850 return [context.changectx(self, i)
851 for i in xrange(*changeid.indices(len(self)))
851 for i in xrange(*changeid.indices(len(self)))
852 if i not in self.changelog.filteredrevs]
852 if i not in self.changelog.filteredrevs]
853 try:
853 try:
854 return context.changectx(self, changeid)
854 return context.changectx(self, changeid)
855 except error.WdirUnsupported:
855 except error.WdirUnsupported:
856 return context.workingctx(self)
856 return context.workingctx(self)
857
857
858 def __contains__(self, changeid):
858 def __contains__(self, changeid):
859 """True if the given changeid exists
859 """True if the given changeid exists
860
860
861 error.LookupError is raised if an ambiguous node specified.
861 error.LookupError is raised if an ambiguous node specified.
862 """
862 """
863 try:
863 try:
864 self[changeid]
864 self[changeid]
865 return True
865 return True
866 except error.RepoLookupError:
866 except error.RepoLookupError:
867 return False
867 return False
868
868
869 def __nonzero__(self):
869 def __nonzero__(self):
870 return True
870 return True
871
871
872 __bool__ = __nonzero__
872 __bool__ = __nonzero__
873
873
874 def __len__(self):
874 def __len__(self):
875 # no need to pay the cost of repoview.changelog
875 # no need to pay the cost of repoview.changelog
876 unfi = self.unfiltered()
876 unfi = self.unfiltered()
877 return len(unfi.changelog)
877 return len(unfi.changelog)
878
878
879 def __iter__(self):
879 def __iter__(self):
880 return iter(self.changelog)
880 return iter(self.changelog)
881
881
882 def revs(self, expr, *args):
882 def revs(self, expr, *args):
883 '''Find revisions matching a revset.
883 '''Find revisions matching a revset.
884
884
885 The revset is specified as a string ``expr`` that may contain
885 The revset is specified as a string ``expr`` that may contain
886 %-formatting to escape certain types. See ``revsetlang.formatspec``.
886 %-formatting to escape certain types. See ``revsetlang.formatspec``.
887
887
888 Revset aliases from the configuration are not expanded. To expand
888 Revset aliases from the configuration are not expanded. To expand
889 user aliases, consider calling ``scmutil.revrange()`` or
889 user aliases, consider calling ``scmutil.revrange()`` or
890 ``repo.anyrevs([expr], user=True)``.
890 ``repo.anyrevs([expr], user=True)``.
891
891
892 Returns a revset.abstractsmartset, which is a list-like interface
892 Returns a revset.abstractsmartset, which is a list-like interface
893 that contains integer revisions.
893 that contains integer revisions.
894 '''
894 '''
895 expr = revsetlang.formatspec(expr, *args)
895 expr = revsetlang.formatspec(expr, *args)
896 m = revset.match(None, expr)
896 m = revset.match(None, expr)
897 return m(self)
897 return m(self)
898
898
899 def set(self, expr, *args):
899 def set(self, expr, *args):
900 '''Find revisions matching a revset and emit changectx instances.
900 '''Find revisions matching a revset and emit changectx instances.
901
901
902 This is a convenience wrapper around ``revs()`` that iterates the
902 This is a convenience wrapper around ``revs()`` that iterates the
903 result and is a generator of changectx instances.
903 result and is a generator of changectx instances.
904
904
905 Revset aliases from the configuration are not expanded. To expand
905 Revset aliases from the configuration are not expanded. To expand
906 user aliases, consider calling ``scmutil.revrange()``.
906 user aliases, consider calling ``scmutil.revrange()``.
907 '''
907 '''
908 for r in self.revs(expr, *args):
908 for r in self.revs(expr, *args):
909 yield self[r]
909 yield self[r]
910
910
911 def anyrevs(self, specs, user=False, localalias=None):
911 def anyrevs(self, specs, user=False, localalias=None):
912 '''Find revisions matching one of the given revsets.
912 '''Find revisions matching one of the given revsets.
913
913
914 Revset aliases from the configuration are not expanded by default. To
914 Revset aliases from the configuration are not expanded by default. To
915 expand user aliases, specify ``user=True``. To provide some local
915 expand user aliases, specify ``user=True``. To provide some local
916 definitions overriding user aliases, set ``localalias`` to
916 definitions overriding user aliases, set ``localalias`` to
917 ``{name: definitionstring}``.
917 ``{name: definitionstring}``.
918 '''
918 '''
919 if user:
919 if user:
920 m = revset.matchany(self.ui, specs,
920 m = revset.matchany(self.ui, specs,
921 lookup=revset.lookupfn(self),
921 lookup=revset.lookupfn(self),
922 localalias=localalias)
922 localalias=localalias)
923 else:
923 else:
924 m = revset.matchany(None, specs, localalias=localalias)
924 m = revset.matchany(None, specs, localalias=localalias)
925 return m(self)
925 return m(self)
926
926
927 def url(self):
927 def url(self):
928 return 'file:' + self.root
928 return 'file:' + self.root
929
929
930 def hook(self, name, throw=False, **args):
930 def hook(self, name, throw=False, **args):
931 """Call a hook, passing this repo instance.
931 """Call a hook, passing this repo instance.
932
932
933 This a convenience method to aid invoking hooks. Extensions likely
933 This a convenience method to aid invoking hooks. Extensions likely
934 won't call this unless they have registered a custom hook or are
934 won't call this unless they have registered a custom hook or are
935 replacing code that is expected to call a hook.
935 replacing code that is expected to call a hook.
936 """
936 """
937 return hook.hook(self.ui, self, name, throw, **args)
937 return hook.hook(self.ui, self, name, throw, **args)
938
938
939 @filteredpropertycache
939 @filteredpropertycache
940 def _tagscache(self):
940 def _tagscache(self):
941 '''Returns a tagscache object that contains various tags related
941 '''Returns a tagscache object that contains various tags related
942 caches.'''
942 caches.'''
943
943
944 # This simplifies its cache management by having one decorated
944 # This simplifies its cache management by having one decorated
945 # function (this one) and the rest simply fetch things from it.
945 # function (this one) and the rest simply fetch things from it.
946 class tagscache(object):
946 class tagscache(object):
947 def __init__(self):
947 def __init__(self):
948 # These two define the set of tags for this repository. tags
948 # These two define the set of tags for this repository. tags
949 # maps tag name to node; tagtypes maps tag name to 'global' or
949 # maps tag name to node; tagtypes maps tag name to 'global' or
950 # 'local'. (Global tags are defined by .hgtags across all
950 # 'local'. (Global tags are defined by .hgtags across all
951 # heads, and local tags are defined in .hg/localtags.)
951 # heads, and local tags are defined in .hg/localtags.)
952 # They constitute the in-memory cache of tags.
952 # They constitute the in-memory cache of tags.
953 self.tags = self.tagtypes = None
953 self.tags = self.tagtypes = None
954
954
955 self.nodetagscache = self.tagslist = None
955 self.nodetagscache = self.tagslist = None
956
956
957 cache = tagscache()
957 cache = tagscache()
958 cache.tags, cache.tagtypes = self._findtags()
958 cache.tags, cache.tagtypes = self._findtags()
959
959
960 return cache
960 return cache
961
961
962 def tags(self):
962 def tags(self):
963 '''return a mapping of tag to node'''
963 '''return a mapping of tag to node'''
964 t = {}
964 t = {}
965 if self.changelog.filteredrevs:
965 if self.changelog.filteredrevs:
966 tags, tt = self._findtags()
966 tags, tt = self._findtags()
967 else:
967 else:
968 tags = self._tagscache.tags
968 tags = self._tagscache.tags
969 for k, v in tags.iteritems():
969 for k, v in tags.iteritems():
970 try:
970 try:
971 # ignore tags to unknown nodes
971 # ignore tags to unknown nodes
972 self.changelog.rev(v)
972 self.changelog.rev(v)
973 t[k] = v
973 t[k] = v
974 except (error.LookupError, ValueError):
974 except (error.LookupError, ValueError):
975 pass
975 pass
976 return t
976 return t
977
977
978 def _findtags(self):
978 def _findtags(self):
979 '''Do the hard work of finding tags. Return a pair of dicts
979 '''Do the hard work of finding tags. Return a pair of dicts
980 (tags, tagtypes) where tags maps tag name to node, and tagtypes
980 (tags, tagtypes) where tags maps tag name to node, and tagtypes
981 maps tag name to a string like \'global\' or \'local\'.
981 maps tag name to a string like \'global\' or \'local\'.
982 Subclasses or extensions are free to add their own tags, but
982 Subclasses or extensions are free to add their own tags, but
983 should be aware that the returned dicts will be retained for the
983 should be aware that the returned dicts will be retained for the
984 duration of the localrepo object.'''
984 duration of the localrepo object.'''
985
985
986 # XXX what tagtype should subclasses/extensions use? Currently
986 # XXX what tagtype should subclasses/extensions use? Currently
987 # mq and bookmarks add tags, but do not set the tagtype at all.
987 # mq and bookmarks add tags, but do not set the tagtype at all.
988 # Should each extension invent its own tag type? Should there
988 # Should each extension invent its own tag type? Should there
989 # be one tagtype for all such "virtual" tags? Or is the status
989 # be one tagtype for all such "virtual" tags? Or is the status
990 # quo fine?
990 # quo fine?
991
991
992
992
993 # map tag name to (node, hist)
993 # map tag name to (node, hist)
994 alltags = tagsmod.findglobaltags(self.ui, self)
994 alltags = tagsmod.findglobaltags(self.ui, self)
995 # map tag name to tag type
995 # map tag name to tag type
996 tagtypes = dict((tag, 'global') for tag in alltags)
996 tagtypes = dict((tag, 'global') for tag in alltags)
997
997
998 tagsmod.readlocaltags(self.ui, self, alltags, tagtypes)
998 tagsmod.readlocaltags(self.ui, self, alltags, tagtypes)
999
999
1000 # Build the return dicts. Have to re-encode tag names because
1000 # Build the return dicts. Have to re-encode tag names because
1001 # the tags module always uses UTF-8 (in order not to lose info
1001 # the tags module always uses UTF-8 (in order not to lose info
1002 # writing to the cache), but the rest of Mercurial wants them in
1002 # writing to the cache), but the rest of Mercurial wants them in
1003 # local encoding.
1003 # local encoding.
1004 tags = {}
1004 tags = {}
1005 for (name, (node, hist)) in alltags.iteritems():
1005 for (name, (node, hist)) in alltags.iteritems():
1006 if node != nullid:
1006 if node != nullid:
1007 tags[encoding.tolocal(name)] = node
1007 tags[encoding.tolocal(name)] = node
1008 tags['tip'] = self.changelog.tip()
1008 tags['tip'] = self.changelog.tip()
1009 tagtypes = dict([(encoding.tolocal(name), value)
1009 tagtypes = dict([(encoding.tolocal(name), value)
1010 for (name, value) in tagtypes.iteritems()])
1010 for (name, value) in tagtypes.iteritems()])
1011 return (tags, tagtypes)
1011 return (tags, tagtypes)
1012
1012
1013 def tagtype(self, tagname):
1013 def tagtype(self, tagname):
1014 '''
1014 '''
1015 return the type of the given tag. result can be:
1015 return the type of the given tag. result can be:
1016
1016
1017 'local' : a local tag
1017 'local' : a local tag
1018 'global' : a global tag
1018 'global' : a global tag
1019 None : tag does not exist
1019 None : tag does not exist
1020 '''
1020 '''
1021
1021
1022 return self._tagscache.tagtypes.get(tagname)
1022 return self._tagscache.tagtypes.get(tagname)
1023
1023
1024 def tagslist(self):
1024 def tagslist(self):
1025 '''return a list of tags ordered by revision'''
1025 '''return a list of tags ordered by revision'''
1026 if not self._tagscache.tagslist:
1026 if not self._tagscache.tagslist:
1027 l = []
1027 l = []
1028 for t, n in self.tags().iteritems():
1028 for t, n in self.tags().iteritems():
1029 l.append((self.changelog.rev(n), t, n))
1029 l.append((self.changelog.rev(n), t, n))
1030 self._tagscache.tagslist = [(t, n) for r, t, n in sorted(l)]
1030 self._tagscache.tagslist = [(t, n) for r, t, n in sorted(l)]
1031
1031
1032 return self._tagscache.tagslist
1032 return self._tagscache.tagslist
1033
1033
1034 def nodetags(self, node):
1034 def nodetags(self, node):
1035 '''return the tags associated with a node'''
1035 '''return the tags associated with a node'''
1036 if not self._tagscache.nodetagscache:
1036 if not self._tagscache.nodetagscache:
1037 nodetagscache = {}
1037 nodetagscache = {}
1038 for t, n in self._tagscache.tags.iteritems():
1038 for t, n in self._tagscache.tags.iteritems():
1039 nodetagscache.setdefault(n, []).append(t)
1039 nodetagscache.setdefault(n, []).append(t)
1040 for tags in nodetagscache.itervalues():
1040 for tags in nodetagscache.itervalues():
1041 tags.sort()
1041 tags.sort()
1042 self._tagscache.nodetagscache = nodetagscache
1042 self._tagscache.nodetagscache = nodetagscache
1043 return self._tagscache.nodetagscache.get(node, [])
1043 return self._tagscache.nodetagscache.get(node, [])
1044
1044
1045 def nodebookmarks(self, node):
1045 def nodebookmarks(self, node):
1046 """return the list of bookmarks pointing to the specified node"""
1046 """return the list of bookmarks pointing to the specified node"""
1047 return self._bookmarks.names(node)
1047 return self._bookmarks.names(node)
1048
1048
1049 def branchmap(self):
1049 def branchmap(self):
1050 '''returns a dictionary {branch: [branchheads]} with branchheads
1050 '''returns a dictionary {branch: [branchheads]} with branchheads
1051 ordered by increasing revision number'''
1051 ordered by increasing revision number'''
1052 branchmap.updatecache(self)
1052 branchmap.updatecache(self)
1053 return self._branchcaches[self.filtername]
1053 return self._branchcaches[self.filtername]
1054
1054
1055 @unfilteredmethod
1055 @unfilteredmethod
1056 def revbranchcache(self):
1056 def revbranchcache(self):
1057 if not self._revbranchcache:
1057 if not self._revbranchcache:
1058 self._revbranchcache = branchmap.revbranchcache(self.unfiltered())
1058 self._revbranchcache = branchmap.revbranchcache(self.unfiltered())
1059 return self._revbranchcache
1059 return self._revbranchcache
1060
1060
1061 def branchtip(self, branch, ignoremissing=False):
1061 def branchtip(self, branch, ignoremissing=False):
1062 '''return the tip node for a given branch
1062 '''return the tip node for a given branch
1063
1063
1064 If ignoremissing is True, then this method will not raise an error.
1064 If ignoremissing is True, then this method will not raise an error.
1065 This is helpful for callers that only expect None for a missing branch
1065 This is helpful for callers that only expect None for a missing branch
1066 (e.g. namespace).
1066 (e.g. namespace).
1067
1067
1068 '''
1068 '''
1069 try:
1069 try:
1070 return self.branchmap().branchtip(branch)
1070 return self.branchmap().branchtip(branch)
1071 except KeyError:
1071 except KeyError:
1072 if not ignoremissing:
1072 if not ignoremissing:
1073 raise error.RepoLookupError(_("unknown branch '%s'") % branch)
1073 raise error.RepoLookupError(_("unknown branch '%s'") % branch)
1074 else:
1074 else:
1075 pass
1075 pass
1076
1076
1077 def lookup(self, key):
1077 def lookup(self, key):
1078 return scmutil.revsymbol(self, key).node()
1078 return scmutil.revsymbol(self, key).node()
1079
1079
1080 def lookupbranch(self, key):
1080 def lookupbranch(self, key):
1081 if key in self.branchmap():
1081 if key in self.branchmap():
1082 return key
1082 return key
1083
1083
1084 return scmutil.revsymbol(self, key).branch()
1084 return scmutil.revsymbol(self, key).branch()
1085
1085
1086 def known(self, nodes):
1086 def known(self, nodes):
1087 cl = self.changelog
1087 cl = self.changelog
1088 nm = cl.nodemap
1088 nm = cl.nodemap
1089 filtered = cl.filteredrevs
1089 filtered = cl.filteredrevs
1090 result = []
1090 result = []
1091 for n in nodes:
1091 for n in nodes:
1092 r = nm.get(n)
1092 r = nm.get(n)
1093 resp = not (r is None or r in filtered)
1093 resp = not (r is None or r in filtered)
1094 result.append(resp)
1094 result.append(resp)
1095 return result
1095 return result
1096
1096
1097 def local(self):
1097 def local(self):
1098 return self
1098 return self
1099
1099
1100 def publishing(self):
1100 def publishing(self):
1101 # it's safe (and desirable) to trust the publish flag unconditionally
1101 # it's safe (and desirable) to trust the publish flag unconditionally
1102 # so that we don't finalize changes shared between users via ssh or nfs
1102 # so that we don't finalize changes shared between users via ssh or nfs
1103 return self.ui.configbool('phases', 'publish', untrusted=True)
1103 return self.ui.configbool('phases', 'publish', untrusted=True)
1104
1104
1105 def cancopy(self):
1105 def cancopy(self):
1106 # so statichttprepo's override of local() works
1106 # so statichttprepo's override of local() works
1107 if not self.local():
1107 if not self.local():
1108 return False
1108 return False
1109 if not self.publishing():
1109 if not self.publishing():
1110 return True
1110 return True
1111 # if publishing we can't copy if there is filtered content
1111 # if publishing we can't copy if there is filtered content
1112 return not self.filtered('visible').changelog.filteredrevs
1112 return not self.filtered('visible').changelog.filteredrevs
1113
1113
1114 def shared(self):
1114 def shared(self):
1115 '''the type of shared repository (None if not shared)'''
1115 '''the type of shared repository (None if not shared)'''
1116 if self.sharedpath != self.path:
1116 if self.sharedpath != self.path:
1117 return 'store'
1117 return 'store'
1118 return None
1118 return None
1119
1119
1120 def wjoin(self, f, *insidef):
1120 def wjoin(self, f, *insidef):
1121 return self.vfs.reljoin(self.root, f, *insidef)
1121 return self.vfs.reljoin(self.root, f, *insidef)
1122
1122
1123 def file(self, f):
1123 def file(self, f):
1124 if f[0] == '/':
1124 if f[0] == '/':
1125 f = f[1:]
1125 f = f[1:]
1126 return filelog.filelog(self.svfs, f)
1126 return filelog.filelog(self.svfs, f)
1127
1127
1128 def setparents(self, p1, p2=nullid):
1128 def setparents(self, p1, p2=nullid):
1129 with self.dirstate.parentchange():
1129 with self.dirstate.parentchange():
1130 copies = self.dirstate.setparents(p1, p2)
1130 copies = self.dirstate.setparents(p1, p2)
1131 pctx = self[p1]
1131 pctx = self[p1]
1132 if copies:
1132 if copies:
1133 # Adjust copy records, the dirstate cannot do it, it
1133 # Adjust copy records, the dirstate cannot do it, it
1134 # requires access to parents manifests. Preserve them
1134 # requires access to parents manifests. Preserve them
1135 # only for entries added to first parent.
1135 # only for entries added to first parent.
1136 for f in copies:
1136 for f in copies:
1137 if f not in pctx and copies[f] in pctx:
1137 if f not in pctx and copies[f] in pctx:
1138 self.dirstate.copy(copies[f], f)
1138 self.dirstate.copy(copies[f], f)
1139 if p2 == nullid:
1139 if p2 == nullid:
1140 for f, s in sorted(self.dirstate.copies().items()):
1140 for f, s in sorted(self.dirstate.copies().items()):
1141 if f not in pctx and s not in pctx:
1141 if f not in pctx and s not in pctx:
1142 self.dirstate.copy(None, f)
1142 self.dirstate.copy(None, f)
1143
1143
1144 def filectx(self, path, changeid=None, fileid=None, changectx=None):
1144 def filectx(self, path, changeid=None, fileid=None, changectx=None):
1145 """changeid can be a changeset revision, node, or tag.
1145 """changeid can be a changeset revision, node, or tag.
1146 fileid can be a file revision or node."""
1146 fileid can be a file revision or node."""
1147 return context.filectx(self, path, changeid, fileid,
1147 return context.filectx(self, path, changeid, fileid,
1148 changectx=changectx)
1148 changectx=changectx)
1149
1149
1150 def getcwd(self):
1150 def getcwd(self):
1151 return self.dirstate.getcwd()
1151 return self.dirstate.getcwd()
1152
1152
1153 def pathto(self, f, cwd=None):
1153 def pathto(self, f, cwd=None):
1154 return self.dirstate.pathto(f, cwd)
1154 return self.dirstate.pathto(f, cwd)
1155
1155
1156 def _loadfilter(self, filter):
1156 def _loadfilter(self, filter):
1157 if filter not in self._filterpats:
1157 if filter not in self._filterpats:
1158 l = []
1158 l = []
1159 for pat, cmd in self.ui.configitems(filter):
1159 for pat, cmd in self.ui.configitems(filter):
1160 if cmd == '!':
1160 if cmd == '!':
1161 continue
1161 continue
1162 mf = matchmod.match(self.root, '', [pat])
1162 mf = matchmod.match(self.root, '', [pat])
1163 fn = None
1163 fn = None
1164 params = cmd
1164 params = cmd
1165 for name, filterfn in self._datafilters.iteritems():
1165 for name, filterfn in self._datafilters.iteritems():
1166 if cmd.startswith(name):
1166 if cmd.startswith(name):
1167 fn = filterfn
1167 fn = filterfn
1168 params = cmd[len(name):].lstrip()
1168 params = cmd[len(name):].lstrip()
1169 break
1169 break
1170 if not fn:
1170 if not fn:
1171 fn = lambda s, c, **kwargs: procutil.filter(s, c)
1171 fn = lambda s, c, **kwargs: procutil.filter(s, c)
1172 # Wrap old filters not supporting keyword arguments
1172 # Wrap old filters not supporting keyword arguments
1173 if not pycompat.getargspec(fn)[2]:
1173 if not pycompat.getargspec(fn)[2]:
1174 oldfn = fn
1174 oldfn = fn
1175 fn = lambda s, c, **kwargs: oldfn(s, c)
1175 fn = lambda s, c, **kwargs: oldfn(s, c)
1176 l.append((mf, fn, params))
1176 l.append((mf, fn, params))
1177 self._filterpats[filter] = l
1177 self._filterpats[filter] = l
1178 return self._filterpats[filter]
1178 return self._filterpats[filter]
1179
1179
1180 def _filter(self, filterpats, filename, data):
1180 def _filter(self, filterpats, filename, data):
1181 for mf, fn, cmd in filterpats:
1181 for mf, fn, cmd in filterpats:
1182 if mf(filename):
1182 if mf(filename):
1183 self.ui.debug("filtering %s through %s\n" % (filename, cmd))
1183 self.ui.debug("filtering %s through %s\n" % (filename, cmd))
1184 data = fn(data, cmd, ui=self.ui, repo=self, filename=filename)
1184 data = fn(data, cmd, ui=self.ui, repo=self, filename=filename)
1185 break
1185 break
1186
1186
1187 return data
1187 return data
1188
1188
1189 @unfilteredpropertycache
1189 @unfilteredpropertycache
1190 def _encodefilterpats(self):
1190 def _encodefilterpats(self):
1191 return self._loadfilter('encode')
1191 return self._loadfilter('encode')
1192
1192
1193 @unfilteredpropertycache
1193 @unfilteredpropertycache
1194 def _decodefilterpats(self):
1194 def _decodefilterpats(self):
1195 return self._loadfilter('decode')
1195 return self._loadfilter('decode')
1196
1196
1197 def adddatafilter(self, name, filter):
1197 def adddatafilter(self, name, filter):
1198 self._datafilters[name] = filter
1198 self._datafilters[name] = filter
1199
1199
1200 def wread(self, filename):
1200 def wread(self, filename):
1201 if self.wvfs.islink(filename):
1201 if self.wvfs.islink(filename):
1202 data = self.wvfs.readlink(filename)
1202 data = self.wvfs.readlink(filename)
1203 else:
1203 else:
1204 data = self.wvfs.read(filename)
1204 data = self.wvfs.read(filename)
1205 return self._filter(self._encodefilterpats, filename, data)
1205 return self._filter(self._encodefilterpats, filename, data)
1206
1206
1207 def wwrite(self, filename, data, flags, backgroundclose=False, **kwargs):
1207 def wwrite(self, filename, data, flags, backgroundclose=False, **kwargs):
1208 """write ``data`` into ``filename`` in the working directory
1208 """write ``data`` into ``filename`` in the working directory
1209
1209
1210 This returns length of written (maybe decoded) data.
1210 This returns length of written (maybe decoded) data.
1211 """
1211 """
1212 data = self._filter(self._decodefilterpats, filename, data)
1212 data = self._filter(self._decodefilterpats, filename, data)
1213 if 'l' in flags:
1213 if 'l' in flags:
1214 self.wvfs.symlink(data, filename)
1214 self.wvfs.symlink(data, filename)
1215 else:
1215 else:
1216 self.wvfs.write(filename, data, backgroundclose=backgroundclose,
1216 self.wvfs.write(filename, data, backgroundclose=backgroundclose,
1217 **kwargs)
1217 **kwargs)
1218 if 'x' in flags:
1218 if 'x' in flags:
1219 self.wvfs.setflags(filename, False, True)
1219 self.wvfs.setflags(filename, False, True)
1220 else:
1220 else:
1221 self.wvfs.setflags(filename, False, False)
1221 self.wvfs.setflags(filename, False, False)
1222 return len(data)
1222 return len(data)
1223
1223
1224 def wwritedata(self, filename, data):
1224 def wwritedata(self, filename, data):
1225 return self._filter(self._decodefilterpats, filename, data)
1225 return self._filter(self._decodefilterpats, filename, data)
1226
1226
1227 def currenttransaction(self):
1227 def currenttransaction(self):
1228 """return the current transaction or None if non exists"""
1228 """return the current transaction or None if non exists"""
1229 if self._transref:
1229 if self._transref:
1230 tr = self._transref()
1230 tr = self._transref()
1231 else:
1231 else:
1232 tr = None
1232 tr = None
1233
1233
1234 if tr and tr.running():
1234 if tr and tr.running():
1235 return tr
1235 return tr
1236 return None
1236 return None
1237
1237
1238 def transaction(self, desc, report=None):
1238 def transaction(self, desc, report=None):
1239 if (self.ui.configbool('devel', 'all-warnings')
1239 if (self.ui.configbool('devel', 'all-warnings')
1240 or self.ui.configbool('devel', 'check-locks')):
1240 or self.ui.configbool('devel', 'check-locks')):
1241 if self._currentlock(self._lockref) is None:
1241 if self._currentlock(self._lockref) is None:
1242 raise error.ProgrammingError('transaction requires locking')
1242 raise error.ProgrammingError('transaction requires locking')
1243 tr = self.currenttransaction()
1243 tr = self.currenttransaction()
1244 if tr is not None:
1244 if tr is not None:
1245 return tr.nest(name=desc)
1245 return tr.nest(name=desc)
1246
1246
1247 # abort here if the journal already exists
1247 # abort here if the journal already exists
1248 if self.svfs.exists("journal"):
1248 if self.svfs.exists("journal"):
1249 raise error.RepoError(
1249 raise error.RepoError(
1250 _("abandoned transaction found"),
1250 _("abandoned transaction found"),
1251 hint=_("run 'hg recover' to clean up transaction"))
1251 hint=_("run 'hg recover' to clean up transaction"))
1252
1252
1253 idbase = "%.40f#%f" % (random.random(), time.time())
1253 idbase = "%.40f#%f" % (random.random(), time.time())
1254 ha = hex(hashlib.sha1(idbase).digest())
1254 ha = hex(hashlib.sha1(idbase).digest())
1255 txnid = 'TXN:' + ha
1255 txnid = 'TXN:' + ha
1256 self.hook('pretxnopen', throw=True, txnname=desc, txnid=txnid)
1256 self.hook('pretxnopen', throw=True, txnname=desc, txnid=txnid)
1257
1257
1258 self._writejournal(desc)
1258 self._writejournal(desc)
1259 renames = [(vfs, x, undoname(x)) for vfs, x in self._journalfiles()]
1259 renames = [(vfs, x, undoname(x)) for vfs, x in self._journalfiles()]
1260 if report:
1260 if report:
1261 rp = report
1261 rp = report
1262 else:
1262 else:
1263 rp = self.ui.warn
1263 rp = self.ui.warn
1264 vfsmap = {'plain': self.vfs} # root of .hg/
1264 vfsmap = {'plain': self.vfs} # root of .hg/
1265 # we must avoid cyclic reference between repo and transaction.
1265 # we must avoid cyclic reference between repo and transaction.
1266 reporef = weakref.ref(self)
1266 reporef = weakref.ref(self)
1267 # Code to track tag movement
1267 # Code to track tag movement
1268 #
1268 #
1269 # Since tags are all handled as file content, it is actually quite hard
1269 # Since tags are all handled as file content, it is actually quite hard
1270 # to track these movement from a code perspective. So we fallback to a
1270 # to track these movement from a code perspective. So we fallback to a
1271 # tracking at the repository level. One could envision to track changes
1271 # tracking at the repository level. One could envision to track changes
1272 # to the '.hgtags' file through changegroup apply but that fails to
1272 # to the '.hgtags' file through changegroup apply but that fails to
1273 # cope with case where transaction expose new heads without changegroup
1273 # cope with case where transaction expose new heads without changegroup
1274 # being involved (eg: phase movement).
1274 # being involved (eg: phase movement).
1275 #
1275 #
1276 # For now, We gate the feature behind a flag since this likely comes
1276 # For now, We gate the feature behind a flag since this likely comes
1277 # with performance impacts. The current code run more often than needed
1277 # with performance impacts. The current code run more often than needed
1278 # and do not use caches as much as it could. The current focus is on
1278 # and do not use caches as much as it could. The current focus is on
1279 # the behavior of the feature so we disable it by default. The flag
1279 # the behavior of the feature so we disable it by default. The flag
1280 # will be removed when we are happy with the performance impact.
1280 # will be removed when we are happy with the performance impact.
1281 #
1281 #
1282 # Once this feature is no longer experimental move the following
1282 # Once this feature is no longer experimental move the following
1283 # documentation to the appropriate help section:
1283 # documentation to the appropriate help section:
1284 #
1284 #
1285 # The ``HG_TAG_MOVED`` variable will be set if the transaction touched
1285 # The ``HG_TAG_MOVED`` variable will be set if the transaction touched
1286 # tags (new or changed or deleted tags). In addition the details of
1286 # tags (new or changed or deleted tags). In addition the details of
1287 # these changes are made available in a file at:
1287 # these changes are made available in a file at:
1288 # ``REPOROOT/.hg/changes/tags.changes``.
1288 # ``REPOROOT/.hg/changes/tags.changes``.
1289 # Make sure you check for HG_TAG_MOVED before reading that file as it
1289 # Make sure you check for HG_TAG_MOVED before reading that file as it
1290 # might exist from a previous transaction even if no tag were touched
1290 # might exist from a previous transaction even if no tag were touched
1291 # in this one. Changes are recorded in a line base format::
1291 # in this one. Changes are recorded in a line base format::
1292 #
1292 #
1293 # <action> <hex-node> <tag-name>\n
1293 # <action> <hex-node> <tag-name>\n
1294 #
1294 #
1295 # Actions are defined as follow:
1295 # Actions are defined as follow:
1296 # "-R": tag is removed,
1296 # "-R": tag is removed,
1297 # "+A": tag is added,
1297 # "+A": tag is added,
1298 # "-M": tag is moved (old value),
1298 # "-M": tag is moved (old value),
1299 # "+M": tag is moved (new value),
1299 # "+M": tag is moved (new value),
1300 tracktags = lambda x: None
1300 tracktags = lambda x: None
1301 # experimental config: experimental.hook-track-tags
1301 # experimental config: experimental.hook-track-tags
1302 shouldtracktags = self.ui.configbool('experimental', 'hook-track-tags')
1302 shouldtracktags = self.ui.configbool('experimental', 'hook-track-tags')
1303 if desc != 'strip' and shouldtracktags:
1303 if desc != 'strip' and shouldtracktags:
1304 oldheads = self.changelog.headrevs()
1304 oldheads = self.changelog.headrevs()
1305 def tracktags(tr2):
1305 def tracktags(tr2):
1306 repo = reporef()
1306 repo = reporef()
1307 oldfnodes = tagsmod.fnoderevs(repo.ui, repo, oldheads)
1307 oldfnodes = tagsmod.fnoderevs(repo.ui, repo, oldheads)
1308 newheads = repo.changelog.headrevs()
1308 newheads = repo.changelog.headrevs()
1309 newfnodes = tagsmod.fnoderevs(repo.ui, repo, newheads)
1309 newfnodes = tagsmod.fnoderevs(repo.ui, repo, newheads)
1310 # notes: we compare lists here.
1310 # notes: we compare lists here.
1311 # As we do it only once buiding set would not be cheaper
1311 # As we do it only once buiding set would not be cheaper
1312 changes = tagsmod.difftags(repo.ui, repo, oldfnodes, newfnodes)
1312 changes = tagsmod.difftags(repo.ui, repo, oldfnodes, newfnodes)
1313 if changes:
1313 if changes:
1314 tr2.hookargs['tag_moved'] = '1'
1314 tr2.hookargs['tag_moved'] = '1'
1315 with repo.vfs('changes/tags.changes', 'w',
1315 with repo.vfs('changes/tags.changes', 'w',
1316 atomictemp=True) as changesfile:
1316 atomictemp=True) as changesfile:
1317 # note: we do not register the file to the transaction
1317 # note: we do not register the file to the transaction
1318 # because we needs it to still exist on the transaction
1318 # because we needs it to still exist on the transaction
1319 # is close (for txnclose hooks)
1319 # is close (for txnclose hooks)
1320 tagsmod.writediff(changesfile, changes)
1320 tagsmod.writediff(changesfile, changes)
1321 def validate(tr2):
1321 def validate(tr2):
1322 """will run pre-closing hooks"""
1322 """will run pre-closing hooks"""
1323 # XXX the transaction API is a bit lacking here so we take a hacky
1323 # XXX the transaction API is a bit lacking here so we take a hacky
1324 # path for now
1324 # path for now
1325 #
1325 #
1326 # We cannot add this as a "pending" hooks since the 'tr.hookargs'
1326 # We cannot add this as a "pending" hooks since the 'tr.hookargs'
1327 # dict is copied before these run. In addition we needs the data
1327 # dict is copied before these run. In addition we needs the data
1328 # available to in memory hooks too.
1328 # available to in memory hooks too.
1329 #
1329 #
1330 # Moreover, we also need to make sure this runs before txnclose
1330 # Moreover, we also need to make sure this runs before txnclose
1331 # hooks and there is no "pending" mechanism that would execute
1331 # hooks and there is no "pending" mechanism that would execute
1332 # logic only if hooks are about to run.
1332 # logic only if hooks are about to run.
1333 #
1333 #
1334 # Fixing this limitation of the transaction is also needed to track
1334 # Fixing this limitation of the transaction is also needed to track
1335 # other families of changes (bookmarks, phases, obsolescence).
1335 # other families of changes (bookmarks, phases, obsolescence).
1336 #
1336 #
1337 # This will have to be fixed before we remove the experimental
1337 # This will have to be fixed before we remove the experimental
1338 # gating.
1338 # gating.
1339 tracktags(tr2)
1339 tracktags(tr2)
1340 repo = reporef()
1340 repo = reporef()
1341 if repo.ui.configbool('experimental', 'single-head-per-branch'):
1341 if repo.ui.configbool('experimental', 'single-head-per-branch'):
1342 scmutil.enforcesinglehead(repo, tr2, desc)
1342 scmutil.enforcesinglehead(repo, tr2, desc)
1343 if hook.hashook(repo.ui, 'pretxnclose-bookmark'):
1343 if hook.hashook(repo.ui, 'pretxnclose-bookmark'):
1344 for name, (old, new) in sorted(tr.changes['bookmarks'].items()):
1344 for name, (old, new) in sorted(tr.changes['bookmarks'].items()):
1345 args = tr.hookargs.copy()
1345 args = tr.hookargs.copy()
1346 args.update(bookmarks.preparehookargs(name, old, new))
1346 args.update(bookmarks.preparehookargs(name, old, new))
1347 repo.hook('pretxnclose-bookmark', throw=True,
1347 repo.hook('pretxnclose-bookmark', throw=True,
1348 txnname=desc,
1348 txnname=desc,
1349 **pycompat.strkwargs(args))
1349 **pycompat.strkwargs(args))
1350 if hook.hashook(repo.ui, 'pretxnclose-phase'):
1350 if hook.hashook(repo.ui, 'pretxnclose-phase'):
1351 cl = repo.unfiltered().changelog
1351 cl = repo.unfiltered().changelog
1352 for rev, (old, new) in tr.changes['phases'].items():
1352 for rev, (old, new) in tr.changes['phases'].items():
1353 args = tr.hookargs.copy()
1353 args = tr.hookargs.copy()
1354 node = hex(cl.node(rev))
1354 node = hex(cl.node(rev))
1355 args.update(phases.preparehookargs(node, old, new))
1355 args.update(phases.preparehookargs(node, old, new))
1356 repo.hook('pretxnclose-phase', throw=True, txnname=desc,
1356 repo.hook('pretxnclose-phase', throw=True, txnname=desc,
1357 **pycompat.strkwargs(args))
1357 **pycompat.strkwargs(args))
1358
1358
1359 repo.hook('pretxnclose', throw=True,
1359 repo.hook('pretxnclose', throw=True,
1360 txnname=desc, **pycompat.strkwargs(tr.hookargs))
1360 txnname=desc, **pycompat.strkwargs(tr.hookargs))
1361 def releasefn(tr, success):
1361 def releasefn(tr, success):
1362 repo = reporef()
1362 repo = reporef()
1363 if success:
1363 if success:
1364 # this should be explicitly invoked here, because
1364 # this should be explicitly invoked here, because
1365 # in-memory changes aren't written out at closing
1365 # in-memory changes aren't written out at closing
1366 # transaction, if tr.addfilegenerator (via
1366 # transaction, if tr.addfilegenerator (via
1367 # dirstate.write or so) isn't invoked while
1367 # dirstate.write or so) isn't invoked while
1368 # transaction running
1368 # transaction running
1369 repo.dirstate.write(None)
1369 repo.dirstate.write(None)
1370 else:
1370 else:
1371 # discard all changes (including ones already written
1371 # discard all changes (including ones already written
1372 # out) in this transaction
1372 # out) in this transaction
1373 repo.dirstate.restorebackup(None, 'journal.dirstate')
1373 repo.dirstate.restorebackup(None, 'journal.dirstate')
1374
1374
1375 repo.invalidate(clearfilecache=True)
1375 repo.invalidate(clearfilecache=True)
1376
1376
1377 tr = transaction.transaction(rp, self.svfs, vfsmap,
1377 tr = transaction.transaction(rp, self.svfs, vfsmap,
1378 "journal",
1378 "journal",
1379 "undo",
1379 "undo",
1380 aftertrans(renames),
1380 aftertrans(renames),
1381 self.store.createmode,
1381 self.store.createmode,
1382 validator=validate,
1382 validator=validate,
1383 releasefn=releasefn,
1383 releasefn=releasefn,
1384 checkambigfiles=_cachedfiles,
1384 checkambigfiles=_cachedfiles,
1385 name=desc)
1385 name=desc)
1386 tr.changes['revs'] = xrange(0, 0)
1386 tr.changes['revs'] = xrange(0, 0)
1387 tr.changes['obsmarkers'] = set()
1387 tr.changes['obsmarkers'] = set()
1388 tr.changes['phases'] = {}
1388 tr.changes['phases'] = {}
1389 tr.changes['bookmarks'] = {}
1389 tr.changes['bookmarks'] = {}
1390
1390
1391 tr.hookargs['txnid'] = txnid
1391 tr.hookargs['txnid'] = txnid
1392 # note: writing the fncache only during finalize mean that the file is
1392 # note: writing the fncache only during finalize mean that the file is
1393 # outdated when running hooks. As fncache is used for streaming clone,
1393 # outdated when running hooks. As fncache is used for streaming clone,
1394 # this is not expected to break anything that happen during the hooks.
1394 # this is not expected to break anything that happen during the hooks.
1395 tr.addfinalize('flush-fncache', self.store.write)
1395 tr.addfinalize('flush-fncache', self.store.write)
1396 def txnclosehook(tr2):
1396 def txnclosehook(tr2):
1397 """To be run if transaction is successful, will schedule a hook run
1397 """To be run if transaction is successful, will schedule a hook run
1398 """
1398 """
1399 # Don't reference tr2 in hook() so we don't hold a reference.
1399 # Don't reference tr2 in hook() so we don't hold a reference.
1400 # This reduces memory consumption when there are multiple
1400 # This reduces memory consumption when there are multiple
1401 # transactions per lock. This can likely go away if issue5045
1401 # transactions per lock. This can likely go away if issue5045
1402 # fixes the function accumulation.
1402 # fixes the function accumulation.
1403 hookargs = tr2.hookargs
1403 hookargs = tr2.hookargs
1404
1404
1405 def hookfunc():
1405 def hookfunc():
1406 repo = reporef()
1406 repo = reporef()
1407 if hook.hashook(repo.ui, 'txnclose-bookmark'):
1407 if hook.hashook(repo.ui, 'txnclose-bookmark'):
1408 bmchanges = sorted(tr.changes['bookmarks'].items())
1408 bmchanges = sorted(tr.changes['bookmarks'].items())
1409 for name, (old, new) in bmchanges:
1409 for name, (old, new) in bmchanges:
1410 args = tr.hookargs.copy()
1410 args = tr.hookargs.copy()
1411 args.update(bookmarks.preparehookargs(name, old, new))
1411 args.update(bookmarks.preparehookargs(name, old, new))
1412 repo.hook('txnclose-bookmark', throw=False,
1412 repo.hook('txnclose-bookmark', throw=False,
1413 txnname=desc, **pycompat.strkwargs(args))
1413 txnname=desc, **pycompat.strkwargs(args))
1414
1414
1415 if hook.hashook(repo.ui, 'txnclose-phase'):
1415 if hook.hashook(repo.ui, 'txnclose-phase'):
1416 cl = repo.unfiltered().changelog
1416 cl = repo.unfiltered().changelog
1417 phasemv = sorted(tr.changes['phases'].items())
1417 phasemv = sorted(tr.changes['phases'].items())
1418 for rev, (old, new) in phasemv:
1418 for rev, (old, new) in phasemv:
1419 args = tr.hookargs.copy()
1419 args = tr.hookargs.copy()
1420 node = hex(cl.node(rev))
1420 node = hex(cl.node(rev))
1421 args.update(phases.preparehookargs(node, old, new))
1421 args.update(phases.preparehookargs(node, old, new))
1422 repo.hook('txnclose-phase', throw=False, txnname=desc,
1422 repo.hook('txnclose-phase', throw=False, txnname=desc,
1423 **pycompat.strkwargs(args))
1423 **pycompat.strkwargs(args))
1424
1424
1425 repo.hook('txnclose', throw=False, txnname=desc,
1425 repo.hook('txnclose', throw=False, txnname=desc,
1426 **pycompat.strkwargs(hookargs))
1426 **pycompat.strkwargs(hookargs))
1427 reporef()._afterlock(hookfunc)
1427 reporef()._afterlock(hookfunc)
1428 tr.addfinalize('txnclose-hook', txnclosehook)
1428 tr.addfinalize('txnclose-hook', txnclosehook)
1429 # Include a leading "-" to make it happen before the transaction summary
1429 # Include a leading "-" to make it happen before the transaction summary
1430 # reports registered via scmutil.registersummarycallback() whose names
1430 # reports registered via scmutil.registersummarycallback() whose names
1431 # are 00-txnreport etc. That way, the caches will be warm when the
1431 # are 00-txnreport etc. That way, the caches will be warm when the
1432 # callbacks run.
1432 # callbacks run.
1433 tr.addpostclose('-warm-cache', self._buildcacheupdater(tr))
1433 tr.addpostclose('-warm-cache', self._buildcacheupdater(tr))
1434 def txnaborthook(tr2):
1434 def txnaborthook(tr2):
1435 """To be run if transaction is aborted
1435 """To be run if transaction is aborted
1436 """
1436 """
1437 reporef().hook('txnabort', throw=False, txnname=desc,
1437 reporef().hook('txnabort', throw=False, txnname=desc,
1438 **pycompat.strkwargs(tr2.hookargs))
1438 **pycompat.strkwargs(tr2.hookargs))
1439 tr.addabort('txnabort-hook', txnaborthook)
1439 tr.addabort('txnabort-hook', txnaborthook)
1440 # avoid eager cache invalidation. in-memory data should be identical
1440 # avoid eager cache invalidation. in-memory data should be identical
1441 # to stored data if transaction has no error.
1441 # to stored data if transaction has no error.
1442 tr.addpostclose('refresh-filecachestats', self._refreshfilecachestats)
1442 tr.addpostclose('refresh-filecachestats', self._refreshfilecachestats)
1443 self._transref = weakref.ref(tr)
1443 self._transref = weakref.ref(tr)
1444 scmutil.registersummarycallback(self, tr, desc)
1444 scmutil.registersummarycallback(self, tr, desc)
1445 return tr
1445 return tr
1446
1446
1447 def _journalfiles(self):
1447 def _journalfiles(self):
1448 return ((self.svfs, 'journal'),
1448 return ((self.svfs, 'journal'),
1449 (self.vfs, 'journal.dirstate'),
1449 (self.vfs, 'journal.dirstate'),
1450 (self.vfs, 'journal.branch'),
1450 (self.vfs, 'journal.branch'),
1451 (self.vfs, 'journal.desc'),
1451 (self.vfs, 'journal.desc'),
1452 (self.vfs, 'journal.bookmarks'),
1452 (self.vfs, 'journal.bookmarks'),
1453 (self.svfs, 'journal.phaseroots'))
1453 (self.svfs, 'journal.phaseroots'))
1454
1454
1455 def undofiles(self):
1455 def undofiles(self):
1456 return [(vfs, undoname(x)) for vfs, x in self._journalfiles()]
1456 return [(vfs, undoname(x)) for vfs, x in self._journalfiles()]
1457
1457
1458 @unfilteredmethod
1458 @unfilteredmethod
1459 def _writejournal(self, desc):
1459 def _writejournal(self, desc):
1460 self.dirstate.savebackup(None, 'journal.dirstate')
1460 self.dirstate.savebackup(None, 'journal.dirstate')
1461 self.vfs.write("journal.branch",
1461 self.vfs.write("journal.branch",
1462 encoding.fromlocal(self.dirstate.branch()))
1462 encoding.fromlocal(self.dirstate.branch()))
1463 self.vfs.write("journal.desc",
1463 self.vfs.write("journal.desc",
1464 "%d\n%s\n" % (len(self), desc))
1464 "%d\n%s\n" % (len(self), desc))
1465 self.vfs.write("journal.bookmarks",
1465 self.vfs.write("journal.bookmarks",
1466 self.vfs.tryread("bookmarks"))
1466 self.vfs.tryread("bookmarks"))
1467 self.svfs.write("journal.phaseroots",
1467 self.svfs.write("journal.phaseroots",
1468 self.svfs.tryread("phaseroots"))
1468 self.svfs.tryread("phaseroots"))
1469
1469
1470 def recover(self):
1470 def recover(self):
1471 with self.lock():
1471 with self.lock():
1472 if self.svfs.exists("journal"):
1472 if self.svfs.exists("journal"):
1473 self.ui.status(_("rolling back interrupted transaction\n"))
1473 self.ui.status(_("rolling back interrupted transaction\n"))
1474 vfsmap = {'': self.svfs,
1474 vfsmap = {'': self.svfs,
1475 'plain': self.vfs,}
1475 'plain': self.vfs,}
1476 transaction.rollback(self.svfs, vfsmap, "journal",
1476 transaction.rollback(self.svfs, vfsmap, "journal",
1477 self.ui.warn,
1477 self.ui.warn,
1478 checkambigfiles=_cachedfiles)
1478 checkambigfiles=_cachedfiles)
1479 self.invalidate()
1479 self.invalidate()
1480 return True
1480 return True
1481 else:
1481 else:
1482 self.ui.warn(_("no interrupted transaction available\n"))
1482 self.ui.warn(_("no interrupted transaction available\n"))
1483 return False
1483 return False
1484
1484
1485 def rollback(self, dryrun=False, force=False):
1485 def rollback(self, dryrun=False, force=False):
1486 wlock = lock = dsguard = None
1486 wlock = lock = dsguard = None
1487 try:
1487 try:
1488 wlock = self.wlock()
1488 wlock = self.wlock()
1489 lock = self.lock()
1489 lock = self.lock()
1490 if self.svfs.exists("undo"):
1490 if self.svfs.exists("undo"):
1491 dsguard = dirstateguard.dirstateguard(self, 'rollback')
1491 dsguard = dirstateguard.dirstateguard(self, 'rollback')
1492
1492
1493 return self._rollback(dryrun, force, dsguard)
1493 return self._rollback(dryrun, force, dsguard)
1494 else:
1494 else:
1495 self.ui.warn(_("no rollback information available\n"))
1495 self.ui.warn(_("no rollback information available\n"))
1496 return 1
1496 return 1
1497 finally:
1497 finally:
1498 release(dsguard, lock, wlock)
1498 release(dsguard, lock, wlock)
1499
1499
1500 @unfilteredmethod # Until we get smarter cache management
1500 @unfilteredmethod # Until we get smarter cache management
1501 def _rollback(self, dryrun, force, dsguard):
1501 def _rollback(self, dryrun, force, dsguard):
1502 ui = self.ui
1502 ui = self.ui
1503 try:
1503 try:
1504 args = self.vfs.read('undo.desc').splitlines()
1504 args = self.vfs.read('undo.desc').splitlines()
1505 (oldlen, desc, detail) = (int(args[0]), args[1], None)
1505 (oldlen, desc, detail) = (int(args[0]), args[1], None)
1506 if len(args) >= 3:
1506 if len(args) >= 3:
1507 detail = args[2]
1507 detail = args[2]
1508 oldtip = oldlen - 1
1508 oldtip = oldlen - 1
1509
1509
1510 if detail and ui.verbose:
1510 if detail and ui.verbose:
1511 msg = (_('repository tip rolled back to revision %d'
1511 msg = (_('repository tip rolled back to revision %d'
1512 ' (undo %s: %s)\n')
1512 ' (undo %s: %s)\n')
1513 % (oldtip, desc, detail))
1513 % (oldtip, desc, detail))
1514 else:
1514 else:
1515 msg = (_('repository tip rolled back to revision %d'
1515 msg = (_('repository tip rolled back to revision %d'
1516 ' (undo %s)\n')
1516 ' (undo %s)\n')
1517 % (oldtip, desc))
1517 % (oldtip, desc))
1518 except IOError:
1518 except IOError:
1519 msg = _('rolling back unknown transaction\n')
1519 msg = _('rolling back unknown transaction\n')
1520 desc = None
1520 desc = None
1521
1521
1522 if not force and self['.'] != self['tip'] and desc == 'commit':
1522 if not force and self['.'] != self['tip'] and desc == 'commit':
1523 raise error.Abort(
1523 raise error.Abort(
1524 _('rollback of last commit while not checked out '
1524 _('rollback of last commit while not checked out '
1525 'may lose data'), hint=_('use -f to force'))
1525 'may lose data'), hint=_('use -f to force'))
1526
1526
1527 ui.status(msg)
1527 ui.status(msg)
1528 if dryrun:
1528 if dryrun:
1529 return 0
1529 return 0
1530
1530
1531 parents = self.dirstate.parents()
1531 parents = self.dirstate.parents()
1532 self.destroying()
1532 self.destroying()
1533 vfsmap = {'plain': self.vfs, '': self.svfs}
1533 vfsmap = {'plain': self.vfs, '': self.svfs}
1534 transaction.rollback(self.svfs, vfsmap, 'undo', ui.warn,
1534 transaction.rollback(self.svfs, vfsmap, 'undo', ui.warn,
1535 checkambigfiles=_cachedfiles)
1535 checkambigfiles=_cachedfiles)
1536 if self.vfs.exists('undo.bookmarks'):
1536 if self.vfs.exists('undo.bookmarks'):
1537 self.vfs.rename('undo.bookmarks', 'bookmarks', checkambig=True)
1537 self.vfs.rename('undo.bookmarks', 'bookmarks', checkambig=True)
1538 if self.svfs.exists('undo.phaseroots'):
1538 if self.svfs.exists('undo.phaseroots'):
1539 self.svfs.rename('undo.phaseroots', 'phaseroots', checkambig=True)
1539 self.svfs.rename('undo.phaseroots', 'phaseroots', checkambig=True)
1540 self.invalidate()
1540 self.invalidate()
1541
1541
1542 parentgone = (parents[0] not in self.changelog.nodemap or
1542 parentgone = (parents[0] not in self.changelog.nodemap or
1543 parents[1] not in self.changelog.nodemap)
1543 parents[1] not in self.changelog.nodemap)
1544 if parentgone:
1544 if parentgone:
1545 # prevent dirstateguard from overwriting already restored one
1545 # prevent dirstateguard from overwriting already restored one
1546 dsguard.close()
1546 dsguard.close()
1547
1547
1548 self.dirstate.restorebackup(None, 'undo.dirstate')
1548 self.dirstate.restorebackup(None, 'undo.dirstate')
1549 try:
1549 try:
1550 branch = self.vfs.read('undo.branch')
1550 branch = self.vfs.read('undo.branch')
1551 self.dirstate.setbranch(encoding.tolocal(branch))
1551 self.dirstate.setbranch(encoding.tolocal(branch))
1552 except IOError:
1552 except IOError:
1553 ui.warn(_('named branch could not be reset: '
1553 ui.warn(_('named branch could not be reset: '
1554 'current branch is still \'%s\'\n')
1554 'current branch is still \'%s\'\n')
1555 % self.dirstate.branch())
1555 % self.dirstate.branch())
1556
1556
1557 parents = tuple([p.rev() for p in self[None].parents()])
1557 parents = tuple([p.rev() for p in self[None].parents()])
1558 if len(parents) > 1:
1558 if len(parents) > 1:
1559 ui.status(_('working directory now based on '
1559 ui.status(_('working directory now based on '
1560 'revisions %d and %d\n') % parents)
1560 'revisions %d and %d\n') % parents)
1561 else:
1561 else:
1562 ui.status(_('working directory now based on '
1562 ui.status(_('working directory now based on '
1563 'revision %d\n') % parents)
1563 'revision %d\n') % parents)
1564 mergemod.mergestate.clean(self, self['.'].node())
1564 mergemod.mergestate.clean(self, self['.'].node())
1565
1565
1566 # TODO: if we know which new heads may result from this rollback, pass
1566 # TODO: if we know which new heads may result from this rollback, pass
1567 # them to destroy(), which will prevent the branchhead cache from being
1567 # them to destroy(), which will prevent the branchhead cache from being
1568 # invalidated.
1568 # invalidated.
1569 self.destroyed()
1569 self.destroyed()
1570 return 0
1570 return 0
1571
1571
1572 def _buildcacheupdater(self, newtransaction):
1572 def _buildcacheupdater(self, newtransaction):
1573 """called during transaction to build the callback updating cache
1573 """called during transaction to build the callback updating cache
1574
1574
1575 Lives on the repository to help extension who might want to augment
1575 Lives on the repository to help extension who might want to augment
1576 this logic. For this purpose, the created transaction is passed to the
1576 this logic. For this purpose, the created transaction is passed to the
1577 method.
1577 method.
1578 """
1578 """
1579 # we must avoid cyclic reference between repo and transaction.
1579 # we must avoid cyclic reference between repo and transaction.
1580 reporef = weakref.ref(self)
1580 reporef = weakref.ref(self)
1581 def updater(tr):
1581 def updater(tr):
1582 repo = reporef()
1582 repo = reporef()
1583 repo.updatecaches(tr)
1583 repo.updatecaches(tr)
1584 return updater
1584 return updater
1585
1585
1586 @unfilteredmethod
1586 @unfilteredmethod
1587 def updatecaches(self, tr=None, full=False):
1587 def updatecaches(self, tr=None, full=False):
1588 """warm appropriate caches
1588 """warm appropriate caches
1589
1589
1590 If this function is called after a transaction closed. The transaction
1590 If this function is called after a transaction closed. The transaction
1591 will be available in the 'tr' argument. This can be used to selectively
1591 will be available in the 'tr' argument. This can be used to selectively
1592 update caches relevant to the changes in that transaction.
1592 update caches relevant to the changes in that transaction.
1593
1593
1594 If 'full' is set, make sure all caches the function knows about have
1594 If 'full' is set, make sure all caches the function knows about have
1595 up-to-date data. Even the ones usually loaded more lazily.
1595 up-to-date data. Even the ones usually loaded more lazily.
1596 """
1596 """
1597 if tr is not None and tr.hookargs.get('source') == 'strip':
1597 if tr is not None and tr.hookargs.get('source') == 'strip':
1598 # During strip, many caches are invalid but
1598 # During strip, many caches are invalid but
1599 # later call to `destroyed` will refresh them.
1599 # later call to `destroyed` will refresh them.
1600 return
1600 return
1601
1601
1602 if tr is None or tr.changes['revs']:
1602 if tr is None or tr.changes['revs']:
1603 # updating the unfiltered branchmap should refresh all the others,
1603 # updating the unfiltered branchmap should refresh all the others,
1604 self.ui.debug('updating the branch cache\n')
1604 self.ui.debug('updating the branch cache\n')
1605 branchmap.updatecache(self.filtered('served'))
1605 branchmap.updatecache(self.filtered('served'))
1606
1606
1607 if full:
1607 if full:
1608 rbc = self.revbranchcache()
1608 rbc = self.revbranchcache()
1609 for r in self.changelog:
1609 for r in self.changelog:
1610 rbc.branchinfo(r)
1610 rbc.branchinfo(r)
1611 rbc.write()
1611 rbc.write()
1612
1612
1613 def invalidatecaches(self):
1613 def invalidatecaches(self):
1614
1614
1615 if '_tagscache' in vars(self):
1615 if '_tagscache' in vars(self):
1616 # can't use delattr on proxy
1616 # can't use delattr on proxy
1617 del self.__dict__['_tagscache']
1617 del self.__dict__['_tagscache']
1618
1618
1619 self.unfiltered()._branchcaches.clear()
1619 self.unfiltered()._branchcaches.clear()
1620 self.invalidatevolatilesets()
1620 self.invalidatevolatilesets()
1621 self._sparsesignaturecache.clear()
1621 self._sparsesignaturecache.clear()
1622
1622
1623 def invalidatevolatilesets(self):
1623 def invalidatevolatilesets(self):
1624 self.filteredrevcache.clear()
1624 self.filteredrevcache.clear()
1625 obsolete.clearobscaches(self)
1625 obsolete.clearobscaches(self)
1626
1626
1627 def invalidatedirstate(self):
1627 def invalidatedirstate(self):
1628 '''Invalidates the dirstate, causing the next call to dirstate
1628 '''Invalidates the dirstate, causing the next call to dirstate
1629 to check if it was modified since the last time it was read,
1629 to check if it was modified since the last time it was read,
1630 rereading it if it has.
1630 rereading it if it has.
1631
1631
1632 This is different to dirstate.invalidate() that it doesn't always
1632 This is different to dirstate.invalidate() that it doesn't always
1633 rereads the dirstate. Use dirstate.invalidate() if you want to
1633 rereads the dirstate. Use dirstate.invalidate() if you want to
1634 explicitly read the dirstate again (i.e. restoring it to a previous
1634 explicitly read the dirstate again (i.e. restoring it to a previous
1635 known good state).'''
1635 known good state).'''
1636 if hasunfilteredcache(self, 'dirstate'):
1636 if hasunfilteredcache(self, 'dirstate'):
1637 for k in self.dirstate._filecache:
1637 for k in self.dirstate._filecache:
1638 try:
1638 try:
1639 delattr(self.dirstate, k)
1639 delattr(self.dirstate, k)
1640 except AttributeError:
1640 except AttributeError:
1641 pass
1641 pass
1642 delattr(self.unfiltered(), 'dirstate')
1642 delattr(self.unfiltered(), 'dirstate')
1643
1643
1644 def invalidate(self, clearfilecache=False):
1644 def invalidate(self, clearfilecache=False):
1645 '''Invalidates both store and non-store parts other than dirstate
1645 '''Invalidates both store and non-store parts other than dirstate
1646
1646
1647 If a transaction is running, invalidation of store is omitted,
1647 If a transaction is running, invalidation of store is omitted,
1648 because discarding in-memory changes might cause inconsistency
1648 because discarding in-memory changes might cause inconsistency
1649 (e.g. incomplete fncache causes unintentional failure, but
1649 (e.g. incomplete fncache causes unintentional failure, but
1650 redundant one doesn't).
1650 redundant one doesn't).
1651 '''
1651 '''
1652 unfiltered = self.unfiltered() # all file caches are stored unfiltered
1652 unfiltered = self.unfiltered() # all file caches are stored unfiltered
1653 for k in list(self._filecache.keys()):
1653 for k in list(self._filecache.keys()):
1654 # dirstate is invalidated separately in invalidatedirstate()
1654 # dirstate is invalidated separately in invalidatedirstate()
1655 if k == 'dirstate':
1655 if k == 'dirstate':
1656 continue
1656 continue
1657 if (k == 'changelog' and
1657 if (k == 'changelog' and
1658 self.currenttransaction() and
1658 self.currenttransaction() and
1659 self.changelog._delayed):
1659 self.changelog._delayed):
1660 # The changelog object may store unwritten revisions. We don't
1660 # The changelog object may store unwritten revisions. We don't
1661 # want to lose them.
1661 # want to lose them.
1662 # TODO: Solve the problem instead of working around it.
1662 # TODO: Solve the problem instead of working around it.
1663 continue
1663 continue
1664
1664
1665 if clearfilecache:
1665 if clearfilecache:
1666 del self._filecache[k]
1666 del self._filecache[k]
1667 try:
1667 try:
1668 delattr(unfiltered, k)
1668 delattr(unfiltered, k)
1669 except AttributeError:
1669 except AttributeError:
1670 pass
1670 pass
1671 self.invalidatecaches()
1671 self.invalidatecaches()
1672 if not self.currenttransaction():
1672 if not self.currenttransaction():
1673 # TODO: Changing contents of store outside transaction
1673 # TODO: Changing contents of store outside transaction
1674 # causes inconsistency. We should make in-memory store
1674 # causes inconsistency. We should make in-memory store
1675 # changes detectable, and abort if changed.
1675 # changes detectable, and abort if changed.
1676 self.store.invalidatecaches()
1676 self.store.invalidatecaches()
1677
1677
1678 def invalidateall(self):
1678 def invalidateall(self):
1679 '''Fully invalidates both store and non-store parts, causing the
1679 '''Fully invalidates both store and non-store parts, causing the
1680 subsequent operation to reread any outside changes.'''
1680 subsequent operation to reread any outside changes.'''
1681 # extension should hook this to invalidate its caches
1681 # extension should hook this to invalidate its caches
1682 self.invalidate()
1682 self.invalidate()
1683 self.invalidatedirstate()
1683 self.invalidatedirstate()
1684
1684
1685 @unfilteredmethod
1685 @unfilteredmethod
1686 def _refreshfilecachestats(self, tr):
1686 def _refreshfilecachestats(self, tr):
1687 """Reload stats of cached files so that they are flagged as valid"""
1687 """Reload stats of cached files so that they are flagged as valid"""
1688 for k, ce in self._filecache.items():
1688 for k, ce in self._filecache.items():
1689 k = pycompat.sysstr(k)
1689 k = pycompat.sysstr(k)
1690 if k == r'dirstate' or k not in self.__dict__:
1690 if k == r'dirstate' or k not in self.__dict__:
1691 continue
1691 continue
1692 ce.refresh()
1692 ce.refresh()
1693
1693
1694 def _lock(self, vfs, lockname, wait, releasefn, acquirefn, desc,
1694 def _lock(self, vfs, lockname, wait, releasefn, acquirefn, desc,
1695 inheritchecker=None, parentenvvar=None):
1695 inheritchecker=None, parentenvvar=None):
1696 parentlock = None
1696 parentlock = None
1697 # the contents of parentenvvar are used by the underlying lock to
1697 # the contents of parentenvvar are used by the underlying lock to
1698 # determine whether it can be inherited
1698 # determine whether it can be inherited
1699 if parentenvvar is not None:
1699 if parentenvvar is not None:
1700 parentlock = encoding.environ.get(parentenvvar)
1700 parentlock = encoding.environ.get(parentenvvar)
1701
1701
1702 timeout = 0
1702 timeout = 0
1703 warntimeout = 0
1703 warntimeout = 0
1704 if wait:
1704 if wait:
1705 timeout = self.ui.configint("ui", "timeout")
1705 timeout = self.ui.configint("ui", "timeout")
1706 warntimeout = self.ui.configint("ui", "timeout.warn")
1706 warntimeout = self.ui.configint("ui", "timeout.warn")
1707 # internal config: ui.signal-safe-lock
1707 # internal config: ui.signal-safe-lock
1708 signalsafe = self.ui.configbool('ui', 'signal-safe-lock')
1708 signalsafe = self.ui.configbool('ui', 'signal-safe-lock')
1709
1709
1710 l = lockmod.trylock(self.ui, vfs, lockname, timeout, warntimeout,
1710 l = lockmod.trylock(self.ui, vfs, lockname, timeout, warntimeout,
1711 releasefn=releasefn,
1711 releasefn=releasefn,
1712 acquirefn=acquirefn, desc=desc,
1712 acquirefn=acquirefn, desc=desc,
1713 inheritchecker=inheritchecker,
1713 inheritchecker=inheritchecker,
1714 parentlock=parentlock,
1714 parentlock=parentlock,
1715 signalsafe=signalsafe)
1715 signalsafe=signalsafe)
1716 return l
1716 return l
1717
1717
1718 def _afterlock(self, callback):
1718 def _afterlock(self, callback):
1719 """add a callback to be run when the repository is fully unlocked
1719 """add a callback to be run when the repository is fully unlocked
1720
1720
1721 The callback will be executed when the outermost lock is released
1721 The callback will be executed when the outermost lock is released
1722 (with wlock being higher level than 'lock')."""
1722 (with wlock being higher level than 'lock')."""
1723 for ref in (self._wlockref, self._lockref):
1723 for ref in (self._wlockref, self._lockref):
1724 l = ref and ref()
1724 l = ref and ref()
1725 if l and l.held:
1725 if l and l.held:
1726 l.postrelease.append(callback)
1726 l.postrelease.append(callback)
1727 break
1727 break
1728 else: # no lock have been found.
1728 else: # no lock have been found.
1729 callback()
1729 callback()
1730
1730
1731 def lock(self, wait=True):
1731 def lock(self, wait=True):
1732 '''Lock the repository store (.hg/store) and return a weak reference
1732 '''Lock the repository store (.hg/store) and return a weak reference
1733 to the lock. Use this before modifying the store (e.g. committing or
1733 to the lock. Use this before modifying the store (e.g. committing or
1734 stripping). If you are opening a transaction, get a lock as well.)
1734 stripping). If you are opening a transaction, get a lock as well.)
1735
1735
1736 If both 'lock' and 'wlock' must be acquired, ensure you always acquires
1736 If both 'lock' and 'wlock' must be acquired, ensure you always acquires
1737 'wlock' first to avoid a dead-lock hazard.'''
1737 'wlock' first to avoid a dead-lock hazard.'''
1738 l = self._currentlock(self._lockref)
1738 l = self._currentlock(self._lockref)
1739 if l is not None:
1739 if l is not None:
1740 l.lock()
1740 l.lock()
1741 return l
1741 return l
1742
1742
1743 l = self._lock(self.svfs, "lock", wait, None,
1743 l = self._lock(self.svfs, "lock", wait, None,
1744 self.invalidate, _('repository %s') % self.origroot)
1744 self.invalidate, _('repository %s') % self.origroot)
1745 self._lockref = weakref.ref(l)
1745 self._lockref = weakref.ref(l)
1746 return l
1746 return l
1747
1747
1748 def _wlockchecktransaction(self):
1748 def _wlockchecktransaction(self):
1749 if self.currenttransaction() is not None:
1749 if self.currenttransaction() is not None:
1750 raise error.LockInheritanceContractViolation(
1750 raise error.LockInheritanceContractViolation(
1751 'wlock cannot be inherited in the middle of a transaction')
1751 'wlock cannot be inherited in the middle of a transaction')
1752
1752
1753 def wlock(self, wait=True):
1753 def wlock(self, wait=True):
1754 '''Lock the non-store parts of the repository (everything under
1754 '''Lock the non-store parts of the repository (everything under
1755 .hg except .hg/store) and return a weak reference to the lock.
1755 .hg except .hg/store) and return a weak reference to the lock.
1756
1756
1757 Use this before modifying files in .hg.
1757 Use this before modifying files in .hg.
1758
1758
1759 If both 'lock' and 'wlock' must be acquired, ensure you always acquires
1759 If both 'lock' and 'wlock' must be acquired, ensure you always acquires
1760 'wlock' first to avoid a dead-lock hazard.'''
1760 'wlock' first to avoid a dead-lock hazard.'''
1761 l = self._wlockref and self._wlockref()
1761 l = self._wlockref and self._wlockref()
1762 if l is not None and l.held:
1762 if l is not None and l.held:
1763 l.lock()
1763 l.lock()
1764 return l
1764 return l
1765
1765
1766 # We do not need to check for non-waiting lock acquisition. Such
1766 # We do not need to check for non-waiting lock acquisition. Such
1767 # acquisition would not cause dead-lock as they would just fail.
1767 # acquisition would not cause dead-lock as they would just fail.
1768 if wait and (self.ui.configbool('devel', 'all-warnings')
1768 if wait and (self.ui.configbool('devel', 'all-warnings')
1769 or self.ui.configbool('devel', 'check-locks')):
1769 or self.ui.configbool('devel', 'check-locks')):
1770 if self._currentlock(self._lockref) is not None:
1770 if self._currentlock(self._lockref) is not None:
1771 self.ui.develwarn('"wlock" acquired after "lock"')
1771 self.ui.develwarn('"wlock" acquired after "lock"')
1772
1772
1773 def unlock():
1773 def unlock():
1774 if self.dirstate.pendingparentchange():
1774 if self.dirstate.pendingparentchange():
1775 self.dirstate.invalidate()
1775 self.dirstate.invalidate()
1776 else:
1776 else:
1777 self.dirstate.write(None)
1777 self.dirstate.write(None)
1778
1778
1779 self._filecache['dirstate'].refresh()
1779 self._filecache['dirstate'].refresh()
1780
1780
1781 l = self._lock(self.vfs, "wlock", wait, unlock,
1781 l = self._lock(self.vfs, "wlock", wait, unlock,
1782 self.invalidatedirstate, _('working directory of %s') %
1782 self.invalidatedirstate, _('working directory of %s') %
1783 self.origroot,
1783 self.origroot,
1784 inheritchecker=self._wlockchecktransaction,
1784 inheritchecker=self._wlockchecktransaction,
1785 parentenvvar='HG_WLOCK_LOCKER')
1785 parentenvvar='HG_WLOCK_LOCKER')
1786 self._wlockref = weakref.ref(l)
1786 self._wlockref = weakref.ref(l)
1787 return l
1787 return l
1788
1788
1789 def _currentlock(self, lockref):
1789 def _currentlock(self, lockref):
1790 """Returns the lock if it's held, or None if it's not."""
1790 """Returns the lock if it's held, or None if it's not."""
1791 if lockref is None:
1791 if lockref is None:
1792 return None
1792 return None
1793 l = lockref()
1793 l = lockref()
1794 if l is None or not l.held:
1794 if l is None or not l.held:
1795 return None
1795 return None
1796 return l
1796 return l
1797
1797
1798 def currentwlock(self):
1798 def currentwlock(self):
1799 """Returns the wlock if it's held, or None if it's not."""
1799 """Returns the wlock if it's held, or None if it's not."""
1800 return self._currentlock(self._wlockref)
1800 return self._currentlock(self._wlockref)
1801
1801
1802 def _filecommit(self, fctx, manifest1, manifest2, linkrev, tr, changelist):
1802 def _filecommit(self, fctx, manifest1, manifest2, linkrev, tr, changelist):
1803 """
1803 """
1804 commit an individual file as part of a larger transaction
1804 commit an individual file as part of a larger transaction
1805 """
1805 """
1806
1806
1807 fname = fctx.path()
1807 fname = fctx.path()
1808 fparent1 = manifest1.get(fname, nullid)
1808 fparent1 = manifest1.get(fname, nullid)
1809 fparent2 = manifest2.get(fname, nullid)
1809 fparent2 = manifest2.get(fname, nullid)
1810 if isinstance(fctx, context.filectx):
1810 if isinstance(fctx, context.filectx):
1811 node = fctx.filenode()
1811 node = fctx.filenode()
1812 if node in [fparent1, fparent2]:
1812 if node in [fparent1, fparent2]:
1813 self.ui.debug('reusing %s filelog entry\n' % fname)
1813 self.ui.debug('reusing %s filelog entry\n' % fname)
1814 if manifest1.flags(fname) != fctx.flags():
1814 if manifest1.flags(fname) != fctx.flags():
1815 changelist.append(fname)
1815 changelist.append(fname)
1816 return node
1816 return node
1817
1817
1818 flog = self.file(fname)
1818 flog = self.file(fname)
1819 meta = {}
1819 meta = {}
1820 copy = fctx.renamed()
1820 copy = fctx.renamed()
1821 if copy and copy[0] != fname:
1821 if copy and copy[0] != fname:
1822 # Mark the new revision of this file as a copy of another
1822 # Mark the new revision of this file as a copy of another
1823 # file. This copy data will effectively act as a parent
1823 # file. This copy data will effectively act as a parent
1824 # of this new revision. If this is a merge, the first
1824 # of this new revision. If this is a merge, the first
1825 # parent will be the nullid (meaning "look up the copy data")
1825 # parent will be the nullid (meaning "look up the copy data")
1826 # and the second one will be the other parent. For example:
1826 # and the second one will be the other parent. For example:
1827 #
1827 #
1828 # 0 --- 1 --- 3 rev1 changes file foo
1828 # 0 --- 1 --- 3 rev1 changes file foo
1829 # \ / rev2 renames foo to bar and changes it
1829 # \ / rev2 renames foo to bar and changes it
1830 # \- 2 -/ rev3 should have bar with all changes and
1830 # \- 2 -/ rev3 should have bar with all changes and
1831 # should record that bar descends from
1831 # should record that bar descends from
1832 # bar in rev2 and foo in rev1
1832 # bar in rev2 and foo in rev1
1833 #
1833 #
1834 # this allows this merge to succeed:
1834 # this allows this merge to succeed:
1835 #
1835 #
1836 # 0 --- 1 --- 3 rev4 reverts the content change from rev2
1836 # 0 --- 1 --- 3 rev4 reverts the content change from rev2
1837 # \ / merging rev3 and rev4 should use bar@rev2
1837 # \ / merging rev3 and rev4 should use bar@rev2
1838 # \- 2 --- 4 as the merge base
1838 # \- 2 --- 4 as the merge base
1839 #
1839 #
1840
1840
1841 cfname = copy[0]
1841 cfname = copy[0]
1842 crev = manifest1.get(cfname)
1842 crev = manifest1.get(cfname)
1843 newfparent = fparent2
1843 newfparent = fparent2
1844
1844
1845 if manifest2: # branch merge
1845 if manifest2: # branch merge
1846 if fparent2 == nullid or crev is None: # copied on remote side
1846 if fparent2 == nullid or crev is None: # copied on remote side
1847 if cfname in manifest2:
1847 if cfname in manifest2:
1848 crev = manifest2[cfname]
1848 crev = manifest2[cfname]
1849 newfparent = fparent1
1849 newfparent = fparent1
1850
1850
1851 # Here, we used to search backwards through history to try to find
1851 # Here, we used to search backwards through history to try to find
1852 # where the file copy came from if the source of a copy was not in
1852 # where the file copy came from if the source of a copy was not in
1853 # the parent directory. However, this doesn't actually make sense to
1853 # the parent directory. However, this doesn't actually make sense to
1854 # do (what does a copy from something not in your working copy even
1854 # do (what does a copy from something not in your working copy even
1855 # mean?) and it causes bugs (eg, issue4476). Instead, we will warn
1855 # mean?) and it causes bugs (eg, issue4476). Instead, we will warn
1856 # the user that copy information was dropped, so if they didn't
1856 # the user that copy information was dropped, so if they didn't
1857 # expect this outcome it can be fixed, but this is the correct
1857 # expect this outcome it can be fixed, but this is the correct
1858 # behavior in this circumstance.
1858 # behavior in this circumstance.
1859
1859
1860 if crev:
1860 if crev:
1861 self.ui.debug(" %s: copy %s:%s\n" % (fname, cfname, hex(crev)))
1861 self.ui.debug(" %s: copy %s:%s\n" % (fname, cfname, hex(crev)))
1862 meta["copy"] = cfname
1862 meta["copy"] = cfname
1863 meta["copyrev"] = hex(crev)
1863 meta["copyrev"] = hex(crev)
1864 fparent1, fparent2 = nullid, newfparent
1864 fparent1, fparent2 = nullid, newfparent
1865 else:
1865 else:
1866 self.ui.warn(_("warning: can't find ancestor for '%s' "
1866 self.ui.warn(_("warning: can't find ancestor for '%s' "
1867 "copied from '%s'!\n") % (fname, cfname))
1867 "copied from '%s'!\n") % (fname, cfname))
1868
1868
1869 elif fparent1 == nullid:
1869 elif fparent1 == nullid:
1870 fparent1, fparent2 = fparent2, nullid
1870 fparent1, fparent2 = fparent2, nullid
1871 elif fparent2 != nullid:
1871 elif fparent2 != nullid:
1872 # is one parent an ancestor of the other?
1872 # is one parent an ancestor of the other?
1873 fparentancestors = flog.commonancestorsheads(fparent1, fparent2)
1873 fparentancestors = flog.commonancestorsheads(fparent1, fparent2)
1874 if fparent1 in fparentancestors:
1874 if fparent1 in fparentancestors:
1875 fparent1, fparent2 = fparent2, nullid
1875 fparent1, fparent2 = fparent2, nullid
1876 elif fparent2 in fparentancestors:
1876 elif fparent2 in fparentancestors:
1877 fparent2 = nullid
1877 fparent2 = nullid
1878
1878
1879 # is the file changed?
1879 # is the file changed?
1880 text = fctx.data()
1880 text = fctx.data()
1881 if fparent2 != nullid or flog.cmp(fparent1, text) or meta:
1881 if fparent2 != nullid or flog.cmp(fparent1, text) or meta:
1882 changelist.append(fname)
1882 changelist.append(fname)
1883 return flog.add(text, meta, tr, linkrev, fparent1, fparent2)
1883 return flog.add(text, meta, tr, linkrev, fparent1, fparent2)
1884 # are just the flags changed during merge?
1884 # are just the flags changed during merge?
1885 elif fname in manifest1 and manifest1.flags(fname) != fctx.flags():
1885 elif fname in manifest1 and manifest1.flags(fname) != fctx.flags():
1886 changelist.append(fname)
1886 changelist.append(fname)
1887
1887
1888 return fparent1
1888 return fparent1
1889
1889
1890 def checkcommitpatterns(self, wctx, vdirs, match, status, fail):
1890 def checkcommitpatterns(self, wctx, vdirs, match, status, fail):
1891 """check for commit arguments that aren't committable"""
1891 """check for commit arguments that aren't committable"""
1892 if match.isexact() or match.prefix():
1892 if match.isexact() or match.prefix():
1893 matched = set(status.modified + status.added + status.removed)
1893 matched = set(status.modified + status.added + status.removed)
1894
1894
1895 for f in match.files():
1895 for f in match.files():
1896 f = self.dirstate.normalize(f)
1896 f = self.dirstate.normalize(f)
1897 if f == '.' or f in matched or f in wctx.substate:
1897 if f == '.' or f in matched or f in wctx.substate:
1898 continue
1898 continue
1899 if f in status.deleted:
1899 if f in status.deleted:
1900 fail(f, _('file not found!'))
1900 fail(f, _('file not found!'))
1901 if f in vdirs: # visited directory
1901 if f in vdirs: # visited directory
1902 d = f + '/'
1902 d = f + '/'
1903 for mf in matched:
1903 for mf in matched:
1904 if mf.startswith(d):
1904 if mf.startswith(d):
1905 break
1905 break
1906 else:
1906 else:
1907 fail(f, _("no match under directory!"))
1907 fail(f, _("no match under directory!"))
1908 elif f not in self.dirstate:
1908 elif f not in self.dirstate:
1909 fail(f, _("file not tracked!"))
1909 fail(f, _("file not tracked!"))
1910
1910
1911 @unfilteredmethod
1911 @unfilteredmethod
1912 def commit(self, text="", user=None, date=None, match=None, force=False,
1912 def commit(self, text="", user=None, date=None, match=None, force=False,
1913 editor=False, extra=None):
1913 editor=False, extra=None):
1914 """Add a new revision to current repository.
1914 """Add a new revision to current repository.
1915
1915
1916 Revision information is gathered from the working directory,
1916 Revision information is gathered from the working directory,
1917 match can be used to filter the committed files. If editor is
1917 match can be used to filter the committed files. If editor is
1918 supplied, it is called to get a commit message.
1918 supplied, it is called to get a commit message.
1919 """
1919 """
1920 if extra is None:
1920 if extra is None:
1921 extra = {}
1921 extra = {}
1922
1922
1923 def fail(f, msg):
1923 def fail(f, msg):
1924 raise error.Abort('%s: %s' % (f, msg))
1924 raise error.Abort('%s: %s' % (f, msg))
1925
1925
1926 if not match:
1926 if not match:
1927 match = matchmod.always(self.root, '')
1927 match = matchmod.always(self.root, '')
1928
1928
1929 if not force:
1929 if not force:
1930 vdirs = []
1930 vdirs = []
1931 match.explicitdir = vdirs.append
1931 match.explicitdir = vdirs.append
1932 match.bad = fail
1932 match.bad = fail
1933
1933
1934 wlock = lock = tr = None
1934 wlock = lock = tr = None
1935 try:
1935 try:
1936 wlock = self.wlock()
1936 wlock = self.wlock()
1937 lock = self.lock() # for recent changelog (see issue4368)
1937 lock = self.lock() # for recent changelog (see issue4368)
1938
1938
1939 wctx = self[None]
1939 wctx = self[None]
1940 merge = len(wctx.parents()) > 1
1940 merge = len(wctx.parents()) > 1
1941
1941
1942 if not force and merge and not match.always():
1942 if not force and merge and not match.always():
1943 raise error.Abort(_('cannot partially commit a merge '
1943 raise error.Abort(_('cannot partially commit a merge '
1944 '(do not specify files or patterns)'))
1944 '(do not specify files or patterns)'))
1945
1945
1946 status = self.status(match=match, clean=force)
1946 status = self.status(match=match, clean=force)
1947 if force:
1947 if force:
1948 status.modified.extend(status.clean) # mq may commit clean files
1948 status.modified.extend(status.clean) # mq may commit clean files
1949
1949
1950 # check subrepos
1950 # check subrepos
1951 subs, commitsubs, newstate = subrepoutil.precommit(
1951 subs, commitsubs, newstate = subrepoutil.precommit(
1952 self.ui, wctx, status, match, force=force)
1952 self.ui, wctx, status, match, force=force)
1953
1953
1954 # make sure all explicit patterns are matched
1954 # make sure all explicit patterns are matched
1955 if not force:
1955 if not force:
1956 self.checkcommitpatterns(wctx, vdirs, match, status, fail)
1956 self.checkcommitpatterns(wctx, vdirs, match, status, fail)
1957
1957
1958 cctx = context.workingcommitctx(self, status,
1958 cctx = context.workingcommitctx(self, status,
1959 text, user, date, extra)
1959 text, user, date, extra)
1960
1960
1961 # internal config: ui.allowemptycommit
1961 # internal config: ui.allowemptycommit
1962 allowemptycommit = (wctx.branch() != wctx.p1().branch()
1962 allowemptycommit = (wctx.branch() != wctx.p1().branch()
1963 or extra.get('close') or merge or cctx.files()
1963 or extra.get('close') or merge or cctx.files()
1964 or self.ui.configbool('ui', 'allowemptycommit'))
1964 or self.ui.configbool('ui', 'allowemptycommit'))
1965 if not allowemptycommit:
1965 if not allowemptycommit:
1966 return None
1966 return None
1967
1967
1968 if merge and cctx.deleted():
1968 if merge and cctx.deleted():
1969 raise error.Abort(_("cannot commit merge with missing files"))
1969 raise error.Abort(_("cannot commit merge with missing files"))
1970
1970
1971 ms = mergemod.mergestate.read(self)
1971 ms = mergemod.mergestate.read(self)
1972 mergeutil.checkunresolved(ms)
1972 mergeutil.checkunresolved(ms)
1973
1973
1974 if editor:
1974 if editor:
1975 cctx._text = editor(self, cctx, subs)
1975 cctx._text = editor(self, cctx, subs)
1976 edited = (text != cctx._text)
1976 edited = (text != cctx._text)
1977
1977
1978 # Save commit message in case this transaction gets rolled back
1978 # Save commit message in case this transaction gets rolled back
1979 # (e.g. by a pretxncommit hook). Leave the content alone on
1979 # (e.g. by a pretxncommit hook). Leave the content alone on
1980 # the assumption that the user will use the same editor again.
1980 # the assumption that the user will use the same editor again.
1981 msgfn = self.savecommitmessage(cctx._text)
1981 msgfn = self.savecommitmessage(cctx._text)
1982
1982
1983 # commit subs and write new state
1983 # commit subs and write new state
1984 if subs:
1984 if subs:
1985 for s in sorted(commitsubs):
1985 for s in sorted(commitsubs):
1986 sub = wctx.sub(s)
1986 sub = wctx.sub(s)
1987 self.ui.status(_('committing subrepository %s\n') %
1987 self.ui.status(_('committing subrepository %s\n') %
1988 subrepoutil.subrelpath(sub))
1988 subrepoutil.subrelpath(sub))
1989 sr = sub.commit(cctx._text, user, date)
1989 sr = sub.commit(cctx._text, user, date)
1990 newstate[s] = (newstate[s][0], sr)
1990 newstate[s] = (newstate[s][0], sr)
1991 subrepoutil.writestate(self, newstate)
1991 subrepoutil.writestate(self, newstate)
1992
1992
1993 p1, p2 = self.dirstate.parents()
1993 p1, p2 = self.dirstate.parents()
1994 hookp1, hookp2 = hex(p1), (p2 != nullid and hex(p2) or '')
1994 hookp1, hookp2 = hex(p1), (p2 != nullid and hex(p2) or '')
1995 try:
1995 try:
1996 self.hook("precommit", throw=True, parent1=hookp1,
1996 self.hook("precommit", throw=True, parent1=hookp1,
1997 parent2=hookp2)
1997 parent2=hookp2)
1998 tr = self.transaction('commit')
1998 tr = self.transaction('commit')
1999 ret = self.commitctx(cctx, True)
1999 ret = self.commitctx(cctx, True)
2000 except: # re-raises
2000 except: # re-raises
2001 if edited:
2001 if edited:
2002 self.ui.write(
2002 self.ui.write(
2003 _('note: commit message saved in %s\n') % msgfn)
2003 _('note: commit message saved in %s\n') % msgfn)
2004 raise
2004 raise
2005 # update bookmarks, dirstate and mergestate
2005 # update bookmarks, dirstate and mergestate
2006 bookmarks.update(self, [p1, p2], ret)
2006 bookmarks.update(self, [p1, p2], ret)
2007 cctx.markcommitted(ret)
2007 cctx.markcommitted(ret)
2008 ms.reset()
2008 ms.reset()
2009 tr.close()
2009 tr.close()
2010
2010
2011 finally:
2011 finally:
2012 lockmod.release(tr, lock, wlock)
2012 lockmod.release(tr, lock, wlock)
2013
2013
2014 def commithook(node=hex(ret), parent1=hookp1, parent2=hookp2):
2014 def commithook(node=hex(ret), parent1=hookp1, parent2=hookp2):
2015 # hack for command that use a temporary commit (eg: histedit)
2015 # hack for command that use a temporary commit (eg: histedit)
2016 # temporary commit got stripped before hook release
2016 # temporary commit got stripped before hook release
2017 if self.changelog.hasnode(ret):
2017 if self.changelog.hasnode(ret):
2018 self.hook("commit", node=node, parent1=parent1,
2018 self.hook("commit", node=node, parent1=parent1,
2019 parent2=parent2)
2019 parent2=parent2)
2020 self._afterlock(commithook)
2020 self._afterlock(commithook)
2021 return ret
2021 return ret
2022
2022
2023 @unfilteredmethod
2023 @unfilteredmethod
2024 def commitctx(self, ctx, error=False):
2024 def commitctx(self, ctx, error=False):
2025 """Add a new revision to current repository.
2025 """Add a new revision to current repository.
2026 Revision information is passed via the context argument.
2026 Revision information is passed via the context argument.
2027 """
2027 """
2028
2028
2029 tr = None
2029 tr = None
2030 p1, p2 = ctx.p1(), ctx.p2()
2030 p1, p2 = ctx.p1(), ctx.p2()
2031 user = ctx.user()
2031 user = ctx.user()
2032
2032
2033 lock = self.lock()
2033 lock = self.lock()
2034 try:
2034 try:
2035 tr = self.transaction("commit")
2035 tr = self.transaction("commit")
2036 trp = weakref.proxy(tr)
2036 trp = weakref.proxy(tr)
2037
2037
2038 if ctx.manifestnode():
2038 if ctx.manifestnode():
2039 # reuse an existing manifest revision
2039 # reuse an existing manifest revision
2040 mn = ctx.manifestnode()
2040 mn = ctx.manifestnode()
2041 files = ctx.files()
2041 files = ctx.files()
2042 elif ctx.files():
2042 elif ctx.files():
2043 m1ctx = p1.manifestctx()
2043 m1ctx = p1.manifestctx()
2044 m2ctx = p2.manifestctx()
2044 m2ctx = p2.manifestctx()
2045 mctx = m1ctx.copy()
2045 mctx = m1ctx.copy()
2046
2046
2047 m = mctx.read()
2047 m = mctx.read()
2048 m1 = m1ctx.read()
2048 m1 = m1ctx.read()
2049 m2 = m2ctx.read()
2049 m2 = m2ctx.read()
2050
2050
2051 # check in files
2051 # check in files
2052 added = []
2052 added = []
2053 changed = []
2053 changed = []
2054 removed = list(ctx.removed())
2054 removed = list(ctx.removed())
2055 linkrev = len(self)
2055 linkrev = len(self)
2056 self.ui.note(_("committing files:\n"))
2056 self.ui.note(_("committing files:\n"))
2057 for f in sorted(ctx.modified() + ctx.added()):
2057 for f in sorted(ctx.modified() + ctx.added()):
2058 self.ui.note(f + "\n")
2058 self.ui.note(f + "\n")
2059 try:
2059 try:
2060 fctx = ctx[f]
2060 fctx = ctx[f]
2061 if fctx is None:
2061 if fctx is None:
2062 removed.append(f)
2062 removed.append(f)
2063 else:
2063 else:
2064 added.append(f)
2064 added.append(f)
2065 m[f] = self._filecommit(fctx, m1, m2, linkrev,
2065 m[f] = self._filecommit(fctx, m1, m2, linkrev,
2066 trp, changed)
2066 trp, changed)
2067 m.setflag(f, fctx.flags())
2067 m.setflag(f, fctx.flags())
2068 except OSError as inst:
2068 except OSError as inst:
2069 self.ui.warn(_("trouble committing %s!\n") % f)
2069 self.ui.warn(_("trouble committing %s!\n") % f)
2070 raise
2070 raise
2071 except IOError as inst:
2071 except IOError as inst:
2072 errcode = getattr(inst, 'errno', errno.ENOENT)
2072 errcode = getattr(inst, 'errno', errno.ENOENT)
2073 if error or errcode and errcode != errno.ENOENT:
2073 if error or errcode and errcode != errno.ENOENT:
2074 self.ui.warn(_("trouble committing %s!\n") % f)
2074 self.ui.warn(_("trouble committing %s!\n") % f)
2075 raise
2075 raise
2076
2076
2077 # update manifest
2077 # update manifest
2078 self.ui.note(_("committing manifest\n"))
2078 self.ui.note(_("committing manifest\n"))
2079 removed = [f for f in sorted(removed) if f in m1 or f in m2]
2079 removed = [f for f in sorted(removed) if f in m1 or f in m2]
2080 drop = [f for f in removed if f in m]
2080 drop = [f for f in removed if f in m]
2081 for f in drop:
2081 for f in drop:
2082 del m[f]
2082 del m[f]
2083 mn = mctx.write(trp, linkrev,
2083 mn = mctx.write(trp, linkrev,
2084 p1.manifestnode(), p2.manifestnode(),
2084 p1.manifestnode(), p2.manifestnode(),
2085 added, drop)
2085 added, drop)
2086 files = changed + removed
2086 files = changed + removed
2087 else:
2087 else:
2088 mn = p1.manifestnode()
2088 mn = p1.manifestnode()
2089 files = []
2089 files = []
2090
2090
2091 # update changelog
2091 # update changelog
2092 self.ui.note(_("committing changelog\n"))
2092 self.ui.note(_("committing changelog\n"))
2093 self.changelog.delayupdate(tr)
2093 self.changelog.delayupdate(tr)
2094 n = self.changelog.add(mn, files, ctx.description(),
2094 n = self.changelog.add(mn, files, ctx.description(),
2095 trp, p1.node(), p2.node(),
2095 trp, p1.node(), p2.node(),
2096 user, ctx.date(), ctx.extra().copy())
2096 user, ctx.date(), ctx.extra().copy())
2097 xp1, xp2 = p1.hex(), p2 and p2.hex() or ''
2097 xp1, xp2 = p1.hex(), p2 and p2.hex() or ''
2098 self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1,
2098 self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1,
2099 parent2=xp2)
2099 parent2=xp2)
2100 # set the new commit is proper phase
2100 # set the new commit is proper phase
2101 targetphase = subrepoutil.newcommitphase(self.ui, ctx)
2101 targetphase = subrepoutil.newcommitphase(self.ui, ctx)
2102 if targetphase:
2102 if targetphase:
2103 # retract boundary do not alter parent changeset.
2103 # retract boundary do not alter parent changeset.
2104 # if a parent have higher the resulting phase will
2104 # if a parent have higher the resulting phase will
2105 # be compliant anyway
2105 # be compliant anyway
2106 #
2106 #
2107 # if minimal phase was 0 we don't need to retract anything
2107 # if minimal phase was 0 we don't need to retract anything
2108 phases.registernew(self, tr, targetphase, [n])
2108 phases.registernew(self, tr, targetphase, [n])
2109 tr.close()
2109 tr.close()
2110 return n
2110 return n
2111 finally:
2111 finally:
2112 if tr:
2112 if tr:
2113 tr.release()
2113 tr.release()
2114 lock.release()
2114 lock.release()
2115
2115
2116 @unfilteredmethod
2116 @unfilteredmethod
2117 def destroying(self):
2117 def destroying(self):
2118 '''Inform the repository that nodes are about to be destroyed.
2118 '''Inform the repository that nodes are about to be destroyed.
2119 Intended for use by strip and rollback, so there's a common
2119 Intended for use by strip and rollback, so there's a common
2120 place for anything that has to be done before destroying history.
2120 place for anything that has to be done before destroying history.
2121
2121
2122 This is mostly useful for saving state that is in memory and waiting
2122 This is mostly useful for saving state that is in memory and waiting
2123 to be flushed when the current lock is released. Because a call to
2123 to be flushed when the current lock is released. Because a call to
2124 destroyed is imminent, the repo will be invalidated causing those
2124 destroyed is imminent, the repo will be invalidated causing those
2125 changes to stay in memory (waiting for the next unlock), or vanish
2125 changes to stay in memory (waiting for the next unlock), or vanish
2126 completely.
2126 completely.
2127 '''
2127 '''
2128 # When using the same lock to commit and strip, the phasecache is left
2128 # When using the same lock to commit and strip, the phasecache is left
2129 # dirty after committing. Then when we strip, the repo is invalidated,
2129 # dirty after committing. Then when we strip, the repo is invalidated,
2130 # causing those changes to disappear.
2130 # causing those changes to disappear.
2131 if '_phasecache' in vars(self):
2131 if '_phasecache' in vars(self):
2132 self._phasecache.write()
2132 self._phasecache.write()
2133
2133
2134 @unfilteredmethod
2134 @unfilteredmethod
2135 def destroyed(self):
2135 def destroyed(self):
2136 '''Inform the repository that nodes have been destroyed.
2136 '''Inform the repository that nodes have been destroyed.
2137 Intended for use by strip and rollback, so there's a common
2137 Intended for use by strip and rollback, so there's a common
2138 place for anything that has to be done after destroying history.
2138 place for anything that has to be done after destroying history.
2139 '''
2139 '''
2140 # When one tries to:
2140 # When one tries to:
2141 # 1) destroy nodes thus calling this method (e.g. strip)
2141 # 1) destroy nodes thus calling this method (e.g. strip)
2142 # 2) use phasecache somewhere (e.g. commit)
2142 # 2) use phasecache somewhere (e.g. commit)
2143 #
2143 #
2144 # then 2) will fail because the phasecache contains nodes that were
2144 # then 2) will fail because the phasecache contains nodes that were
2145 # removed. We can either remove phasecache from the filecache,
2145 # removed. We can either remove phasecache from the filecache,
2146 # causing it to reload next time it is accessed, or simply filter
2146 # causing it to reload next time it is accessed, or simply filter
2147 # the removed nodes now and write the updated cache.
2147 # the removed nodes now and write the updated cache.
2148 self._phasecache.filterunknown(self)
2148 self._phasecache.filterunknown(self)
2149 self._phasecache.write()
2149 self._phasecache.write()
2150
2150
2151 # refresh all repository caches
2151 # refresh all repository caches
2152 self.updatecaches()
2152 self.updatecaches()
2153
2153
2154 # Ensure the persistent tag cache is updated. Doing it now
2154 # Ensure the persistent tag cache is updated. Doing it now
2155 # means that the tag cache only has to worry about destroyed
2155 # means that the tag cache only has to worry about destroyed
2156 # heads immediately after a strip/rollback. That in turn
2156 # heads immediately after a strip/rollback. That in turn
2157 # guarantees that "cachetip == currenttip" (comparing both rev
2157 # guarantees that "cachetip == currenttip" (comparing both rev
2158 # and node) always means no nodes have been added or destroyed.
2158 # and node) always means no nodes have been added or destroyed.
2159
2159
2160 # XXX this is suboptimal when qrefresh'ing: we strip the current
2160 # XXX this is suboptimal when qrefresh'ing: we strip the current
2161 # head, refresh the tag cache, then immediately add a new head.
2161 # head, refresh the tag cache, then immediately add a new head.
2162 # But I think doing it this way is necessary for the "instant
2162 # But I think doing it this way is necessary for the "instant
2163 # tag cache retrieval" case to work.
2163 # tag cache retrieval" case to work.
2164 self.invalidate()
2164 self.invalidate()
2165
2165
2166 def status(self, node1='.', node2=None, match=None,
2166 def status(self, node1='.', node2=None, match=None,
2167 ignored=False, clean=False, unknown=False,
2167 ignored=False, clean=False, unknown=False,
2168 listsubrepos=False):
2168 listsubrepos=False):
2169 '''a convenience method that calls node1.status(node2)'''
2169 '''a convenience method that calls node1.status(node2)'''
2170 return self[node1].status(node2, match, ignored, clean, unknown,
2170 return self[node1].status(node2, match, ignored, clean, unknown,
2171 listsubrepos)
2171 listsubrepos)
2172
2172
2173 def addpostdsstatus(self, ps):
2173 def addpostdsstatus(self, ps):
2174 """Add a callback to run within the wlock, at the point at which status
2174 """Add a callback to run within the wlock, at the point at which status
2175 fixups happen.
2175 fixups happen.
2176
2176
2177 On status completion, callback(wctx, status) will be called with the
2177 On status completion, callback(wctx, status) will be called with the
2178 wlock held, unless the dirstate has changed from underneath or the wlock
2178 wlock held, unless the dirstate has changed from underneath or the wlock
2179 couldn't be grabbed.
2179 couldn't be grabbed.
2180
2180
2181 Callbacks should not capture and use a cached copy of the dirstate --
2181 Callbacks should not capture and use a cached copy of the dirstate --
2182 it might change in the meanwhile. Instead, they should access the
2182 it might change in the meanwhile. Instead, they should access the
2183 dirstate via wctx.repo().dirstate.
2183 dirstate via wctx.repo().dirstate.
2184
2184
2185 This list is emptied out after each status run -- extensions should
2185 This list is emptied out after each status run -- extensions should
2186 make sure it adds to this list each time dirstate.status is called.
2186 make sure it adds to this list each time dirstate.status is called.
2187 Extensions should also make sure they don't call this for statuses
2187 Extensions should also make sure they don't call this for statuses
2188 that don't involve the dirstate.
2188 that don't involve the dirstate.
2189 """
2189 """
2190
2190
2191 # The list is located here for uniqueness reasons -- it is actually
2191 # The list is located here for uniqueness reasons -- it is actually
2192 # managed by the workingctx, but that isn't unique per-repo.
2192 # managed by the workingctx, but that isn't unique per-repo.
2193 self._postdsstatus.append(ps)
2193 self._postdsstatus.append(ps)
2194
2194
2195 def postdsstatus(self):
2195 def postdsstatus(self):
2196 """Used by workingctx to get the list of post-dirstate-status hooks."""
2196 """Used by workingctx to get the list of post-dirstate-status hooks."""
2197 return self._postdsstatus
2197 return self._postdsstatus
2198
2198
2199 def clearpostdsstatus(self):
2199 def clearpostdsstatus(self):
2200 """Used by workingctx to clear post-dirstate-status hooks."""
2200 """Used by workingctx to clear post-dirstate-status hooks."""
2201 del self._postdsstatus[:]
2201 del self._postdsstatus[:]
2202
2202
2203 def heads(self, start=None):
2203 def heads(self, start=None):
2204 if start is None:
2204 if start is None:
2205 cl = self.changelog
2205 cl = self.changelog
2206 headrevs = reversed(cl.headrevs())
2206 headrevs = reversed(cl.headrevs())
2207 return [cl.node(rev) for rev in headrevs]
2207 return [cl.node(rev) for rev in headrevs]
2208
2208
2209 heads = self.changelog.heads(start)
2209 heads = self.changelog.heads(start)
2210 # sort the output in rev descending order
2210 # sort the output in rev descending order
2211 return sorted(heads, key=self.changelog.rev, reverse=True)
2211 return sorted(heads, key=self.changelog.rev, reverse=True)
2212
2212
2213 def branchheads(self, branch=None, start=None, closed=False):
2213 def branchheads(self, branch=None, start=None, closed=False):
2214 '''return a (possibly filtered) list of heads for the given branch
2214 '''return a (possibly filtered) list of heads for the given branch
2215
2215
2216 Heads are returned in topological order, from newest to oldest.
2216 Heads are returned in topological order, from newest to oldest.
2217 If branch is None, use the dirstate branch.
2217 If branch is None, use the dirstate branch.
2218 If start is not None, return only heads reachable from start.
2218 If start is not None, return only heads reachable from start.
2219 If closed is True, return heads that are marked as closed as well.
2219 If closed is True, return heads that are marked as closed as well.
2220 '''
2220 '''
2221 if branch is None:
2221 if branch is None:
2222 branch = self[None].branch()
2222 branch = self[None].branch()
2223 branches = self.branchmap()
2223 branches = self.branchmap()
2224 if branch not in branches:
2224 if branch not in branches:
2225 return []
2225 return []
2226 # the cache returns heads ordered lowest to highest
2226 # the cache returns heads ordered lowest to highest
2227 bheads = list(reversed(branches.branchheads(branch, closed=closed)))
2227 bheads = list(reversed(branches.branchheads(branch, closed=closed)))
2228 if start is not None:
2228 if start is not None:
2229 # filter out the heads that cannot be reached from startrev
2229 # filter out the heads that cannot be reached from startrev
2230 fbheads = set(self.changelog.nodesbetween([start], bheads)[2])
2230 fbheads = set(self.changelog.nodesbetween([start], bheads)[2])
2231 bheads = [h for h in bheads if h in fbheads]
2231 bheads = [h for h in bheads if h in fbheads]
2232 return bheads
2232 return bheads
2233
2233
2234 def branches(self, nodes):
2234 def branches(self, nodes):
2235 if not nodes:
2235 if not nodes:
2236 nodes = [self.changelog.tip()]
2236 nodes = [self.changelog.tip()]
2237 b = []
2237 b = []
2238 for n in nodes:
2238 for n in nodes:
2239 t = n
2239 t = n
2240 while True:
2240 while True:
2241 p = self.changelog.parents(n)
2241 p = self.changelog.parents(n)
2242 if p[1] != nullid or p[0] == nullid:
2242 if p[1] != nullid or p[0] == nullid:
2243 b.append((t, n, p[0], p[1]))
2243 b.append((t, n, p[0], p[1]))
2244 break
2244 break
2245 n = p[0]
2245 n = p[0]
2246 return b
2246 return b
2247
2247
2248 def between(self, pairs):
2248 def between(self, pairs):
2249 r = []
2249 r = []
2250
2250
2251 for top, bottom in pairs:
2251 for top, bottom in pairs:
2252 n, l, i = top, [], 0
2252 n, l, i = top, [], 0
2253 f = 1
2253 f = 1
2254
2254
2255 while n != bottom and n != nullid:
2255 while n != bottom and n != nullid:
2256 p = self.changelog.parents(n)[0]
2256 p = self.changelog.parents(n)[0]
2257 if i == f:
2257 if i == f:
2258 l.append(n)
2258 l.append(n)
2259 f = f * 2
2259 f = f * 2
2260 n = p
2260 n = p
2261 i += 1
2261 i += 1
2262
2262
2263 r.append(l)
2263 r.append(l)
2264
2264
2265 return r
2265 return r
2266
2266
2267 def checkpush(self, pushop):
2267 def checkpush(self, pushop):
2268 """Extensions can override this function if additional checks have
2268 """Extensions can override this function if additional checks have
2269 to be performed before pushing, or call it if they override push
2269 to be performed before pushing, or call it if they override push
2270 command.
2270 command.
2271 """
2271 """
2272
2272
2273 @unfilteredpropertycache
2273 @unfilteredpropertycache
2274 def prepushoutgoinghooks(self):
2274 def prepushoutgoinghooks(self):
2275 """Return util.hooks consists of a pushop with repo, remote, outgoing
2275 """Return util.hooks consists of a pushop with repo, remote, outgoing
2276 methods, which are called before pushing changesets.
2276 methods, which are called before pushing changesets.
2277 """
2277 """
2278 return util.hooks()
2278 return util.hooks()
2279
2279
2280 def pushkey(self, namespace, key, old, new):
2280 def pushkey(self, namespace, key, old, new):
2281 try:
2281 try:
2282 tr = self.currenttransaction()
2282 tr = self.currenttransaction()
2283 hookargs = {}
2283 hookargs = {}
2284 if tr is not None:
2284 if tr is not None:
2285 hookargs.update(tr.hookargs)
2285 hookargs.update(tr.hookargs)
2286 hookargs = pycompat.strkwargs(hookargs)
2286 hookargs = pycompat.strkwargs(hookargs)
2287 hookargs[r'namespace'] = namespace
2287 hookargs[r'namespace'] = namespace
2288 hookargs[r'key'] = key
2288 hookargs[r'key'] = key
2289 hookargs[r'old'] = old
2289 hookargs[r'old'] = old
2290 hookargs[r'new'] = new
2290 hookargs[r'new'] = new
2291 self.hook('prepushkey', throw=True, **hookargs)
2291 self.hook('prepushkey', throw=True, **hookargs)
2292 except error.HookAbort as exc:
2292 except error.HookAbort as exc:
2293 self.ui.write_err(_("pushkey-abort: %s\n") % exc)
2293 self.ui.write_err(_("pushkey-abort: %s\n") % exc)
2294 if exc.hint:
2294 if exc.hint:
2295 self.ui.write_err(_("(%s)\n") % exc.hint)
2295 self.ui.write_err(_("(%s)\n") % exc.hint)
2296 return False
2296 return False
2297 self.ui.debug('pushing key for "%s:%s"\n' % (namespace, key))
2297 self.ui.debug('pushing key for "%s:%s"\n' % (namespace, key))
2298 ret = pushkey.push(self, namespace, key, old, new)
2298 ret = pushkey.push(self, namespace, key, old, new)
2299 def runhook():
2299 def runhook():
2300 self.hook('pushkey', namespace=namespace, key=key, old=old, new=new,
2300 self.hook('pushkey', namespace=namespace, key=key, old=old, new=new,
2301 ret=ret)
2301 ret=ret)
2302 self._afterlock(runhook)
2302 self._afterlock(runhook)
2303 return ret
2303 return ret
2304
2304
2305 def listkeys(self, namespace):
2305 def listkeys(self, namespace):
2306 self.hook('prelistkeys', throw=True, namespace=namespace)
2306 self.hook('prelistkeys', throw=True, namespace=namespace)
2307 self.ui.debug('listing keys for "%s"\n' % namespace)
2307 self.ui.debug('listing keys for "%s"\n' % namespace)
2308 values = pushkey.list(self, namespace)
2308 values = pushkey.list(self, namespace)
2309 self.hook('listkeys', namespace=namespace, values=values)
2309 self.hook('listkeys', namespace=namespace, values=values)
2310 return values
2310 return values
2311
2311
2312 def debugwireargs(self, one, two, three=None, four=None, five=None):
2312 def debugwireargs(self, one, two, three=None, four=None, five=None):
2313 '''used to test argument passing over the wire'''
2313 '''used to test argument passing over the wire'''
2314 return "%s %s %s %s %s" % (one, two, pycompat.bytestr(three),
2314 return "%s %s %s %s %s" % (one, two, pycompat.bytestr(three),
2315 pycompat.bytestr(four),
2315 pycompat.bytestr(four),
2316 pycompat.bytestr(five))
2316 pycompat.bytestr(five))
2317
2317
2318 def savecommitmessage(self, text):
2318 def savecommitmessage(self, text):
2319 fp = self.vfs('last-message.txt', 'wb')
2319 fp = self.vfs('last-message.txt', 'wb')
2320 try:
2320 try:
2321 fp.write(text)
2321 fp.write(text)
2322 finally:
2322 finally:
2323 fp.close()
2323 fp.close()
2324 return self.pathto(fp.name[len(self.root) + 1:])
2324 return self.pathto(fp.name[len(self.root) + 1:])
2325
2325
2326 # used to avoid circular references so destructors work
2326 # used to avoid circular references so destructors work
2327 def aftertrans(files):
2327 def aftertrans(files):
2328 renamefiles = [tuple(t) for t in files]
2328 renamefiles = [tuple(t) for t in files]
2329 def a():
2329 def a():
2330 for vfs, src, dest in renamefiles:
2330 for vfs, src, dest in renamefiles:
2331 # if src and dest refer to a same file, vfs.rename is a no-op,
2331 # if src and dest refer to a same file, vfs.rename is a no-op,
2332 # leaving both src and dest on disk. delete dest to make sure
2332 # leaving both src and dest on disk. delete dest to make sure
2333 # the rename couldn't be such a no-op.
2333 # the rename couldn't be such a no-op.
2334 vfs.tryunlink(dest)
2334 vfs.tryunlink(dest)
2335 try:
2335 try:
2336 vfs.rename(src, dest)
2336 vfs.rename(src, dest)
2337 except OSError: # journal file does not yet exist
2337 except OSError: # journal file does not yet exist
2338 pass
2338 pass
2339 return a
2339 return a
2340
2340
2341 def undoname(fn):
2341 def undoname(fn):
2342 base, name = os.path.split(fn)
2342 base, name = os.path.split(fn)
2343 assert name.startswith('journal')
2343 assert name.startswith('journal')
2344 return os.path.join(base, name.replace('journal', 'undo', 1))
2344 return os.path.join(base, name.replace('journal', 'undo', 1))
2345
2345
2346 def instance(ui, path, create, intents=None):
2346 def instance(ui, path, create, intents=None):
2347 return localrepository(ui, util.urllocalpath(path), create,
2347 return localrepository(ui, util.urllocalpath(path), create,
2348 intents=intents)
2348 intents=intents)
2349
2349
2350 def islocal(path):
2350 def islocal(path):
2351 return True
2351 return True
2352
2352
2353 def newreporequirements(repo):
2353 def newreporequirements(repo):
2354 """Determine the set of requirements for a new local repository.
2354 """Determine the set of requirements for a new local repository.
2355
2355
2356 Extensions can wrap this function to specify custom requirements for
2356 Extensions can wrap this function to specify custom requirements for
2357 new repositories.
2357 new repositories.
2358 """
2358 """
2359 ui = repo.ui
2359 ui = repo.ui
2360 requirements = {'revlogv1'}
2360 requirements = {'revlogv1'}
2361 if ui.configbool('format', 'usestore'):
2361 if ui.configbool('format', 'usestore'):
2362 requirements.add('store')
2362 requirements.add('store')
2363 if ui.configbool('format', 'usefncache'):
2363 if ui.configbool('format', 'usefncache'):
2364 requirements.add('fncache')
2364 requirements.add('fncache')
2365 if ui.configbool('format', 'dotencode'):
2365 if ui.configbool('format', 'dotencode'):
2366 requirements.add('dotencode')
2366 requirements.add('dotencode')
2367
2367
2368 compengine = ui.config('experimental', 'format.compression')
2368 compengine = ui.config('experimental', 'format.compression')
2369 if compengine not in util.compengines:
2369 if compengine not in util.compengines:
2370 raise error.Abort(_('compression engine %s defined by '
2370 raise error.Abort(_('compression engine %s defined by '
2371 'experimental.format.compression not available') %
2371 'experimental.format.compression not available') %
2372 compengine,
2372 compengine,
2373 hint=_('run "hg debuginstall" to list available '
2373 hint=_('run "hg debuginstall" to list available '
2374 'compression engines'))
2374 'compression engines'))
2375
2375
2376 # zlib is the historical default and doesn't need an explicit requirement.
2376 # zlib is the historical default and doesn't need an explicit requirement.
2377 if compengine != 'zlib':
2377 if compengine != 'zlib':
2378 requirements.add('exp-compression-%s' % compengine)
2378 requirements.add('exp-compression-%s' % compengine)
2379
2379
2380 if scmutil.gdinitconfig(ui):
2380 if scmutil.gdinitconfig(ui):
2381 requirements.add('generaldelta')
2381 requirements.add('generaldelta')
2382 if ui.configbool('experimental', 'treemanifest'):
2382 if ui.configbool('experimental', 'treemanifest'):
2383 requirements.add('treemanifest')
2383 requirements.add('treemanifest')
2384 # experimental config: format.sparse-revlog
2384 # experimental config: format.sparse-revlog
2385 if ui.configbool('format', 'sparse-revlog'):
2385 if ui.configbool('format', 'sparse-revlog'):
2386 requirements.add(SPARSEREVLOG_REQUIREMENT)
2386 requirements.add(SPARSEREVLOG_REQUIREMENT)
2387
2387
2388 revlogv2 = ui.config('experimental', 'revlogv2')
2388 revlogv2 = ui.config('experimental', 'revlogv2')
2389 if revlogv2 == 'enable-unstable-format-and-corrupt-my-data':
2389 if revlogv2 == 'enable-unstable-format-and-corrupt-my-data':
2390 requirements.remove('revlogv1')
2390 requirements.remove('revlogv1')
2391 # generaldelta is implied by revlogv2.
2391 # generaldelta is implied by revlogv2.
2392 requirements.discard('generaldelta')
2392 requirements.discard('generaldelta')
2393 requirements.add(REVLOGV2_REQUIREMENT)
2393 requirements.add(REVLOGV2_REQUIREMENT)
2394
2394
2395 return requirements
2395 return requirements
@@ -1,402 +1,402 b''
1 #require no-reposimplestore
1 #require no-reposimplestore
2
2
3 Check whether size of generaldelta revlog is not bigger than its
3 Check whether size of generaldelta revlog is not bigger than its
4 regular equivalent. Test would fail if generaldelta was naive
4 regular equivalent. Test would fail if generaldelta was naive
5 implementation of parentdelta: third manifest revision would be fully
5 implementation of parentdelta: third manifest revision would be fully
6 inserted due to big distance from its paren revision (zero).
6 inserted due to big distance from its paren revision (zero).
7
7
8 $ hg init repo --config format.generaldelta=no --config format.usegeneraldelta=no
8 $ hg init repo --config format.generaldelta=no --config format.usegeneraldelta=no
9 $ cd repo
9 $ cd repo
10 $ echo foo > foo
10 $ echo foo > foo
11 $ echo bar > bar
11 $ echo bar > bar
12 $ echo baz > baz
12 $ echo baz > baz
13 $ hg commit -q -Am boo
13 $ hg commit -q -Am boo
14 $ hg clone --pull . ../gdrepo -q --config format.generaldelta=yes
14 $ hg clone --pull . ../gdrepo -q --config format.generaldelta=yes
15 $ for r in 1 2 3; do
15 $ for r in 1 2 3; do
16 > echo $r > foo
16 > echo $r > foo
17 > hg commit -q -m $r
17 > hg commit -q -m $r
18 > hg up -q -r 0
18 > hg up -q -r 0
19 > hg pull . -q -r $r -R ../gdrepo
19 > hg pull . -q -r $r -R ../gdrepo
20 > done
20 > done
21
21
22 $ cd ..
22 $ cd ..
23 >>> from __future__ import print_function
23 >>> from __future__ import print_function
24 >>> import os
24 >>> import os
25 >>> regsize = os.stat("repo/.hg/store/00manifest.i").st_size
25 >>> regsize = os.stat("repo/.hg/store/00manifest.i").st_size
26 >>> gdsize = os.stat("gdrepo/.hg/store/00manifest.i").st_size
26 >>> gdsize = os.stat("gdrepo/.hg/store/00manifest.i").st_size
27 >>> if regsize < gdsize:
27 >>> if regsize < gdsize:
28 ... print('generaldata increased size of manifest')
28 ... print('generaldata increased size of manifest')
29
29
30 Verify rev reordering doesnt create invalid bundles (issue4462)
30 Verify rev reordering doesnt create invalid bundles (issue4462)
31 This requires a commit tree that when pulled will reorder manifest revs such
31 This requires a commit tree that when pulled will reorder manifest revs such
32 that the second manifest to create a file rev will be ordered before the first
32 that the second manifest to create a file rev will be ordered before the first
33 manifest to create that file rev. We also need to do a partial pull to ensure
33 manifest to create that file rev. We also need to do a partial pull to ensure
34 reordering happens. At the end we verify the linkrev points at the earliest
34 reordering happens. At the end we verify the linkrev points at the earliest
35 commit.
35 commit.
36
36
37 $ hg init server --config format.generaldelta=True
37 $ hg init server --config format.generaldelta=True
38 $ cd server
38 $ cd server
39 $ touch a
39 $ touch a
40 $ hg commit -Aqm a
40 $ hg commit -Aqm a
41 $ echo x > x
41 $ echo x > x
42 $ echo y > y
42 $ echo y > y
43 $ hg commit -Aqm xy
43 $ hg commit -Aqm xy
44 $ hg up -q '.^'
44 $ hg up -q '.^'
45 $ echo x > x
45 $ echo x > x
46 $ echo z > z
46 $ echo z > z
47 $ hg commit -Aqm xz
47 $ hg commit -Aqm xz
48 $ hg up -q 1
48 $ hg up -q 1
49 $ echo b > b
49 $ echo b > b
50 $ hg commit -Aqm b
50 $ hg commit -Aqm b
51 $ hg merge -q 2
51 $ hg merge -q 2
52 $ hg commit -Aqm merge
52 $ hg commit -Aqm merge
53 $ echo c > c
53 $ echo c > c
54 $ hg commit -Aqm c
54 $ hg commit -Aqm c
55 $ hg log -G -T '{rev} {shortest(node)} {desc}'
55 $ hg log -G -T '{rev} {shortest(node)} {desc}'
56 @ 5 ebb8 c
56 @ 5 ebb8 c
57 |
57 |
58 o 4 baf7 merge
58 o 4 baf7 merge
59 |\
59 |\
60 | o 3 a129 b
60 | o 3 a129 b
61 | |
61 | |
62 o | 2 958c xz
62 o | 2 958c xz
63 | |
63 | |
64 | o 1 f00c xy
64 | o 1 f00c xy
65 |/
65 |/
66 o 0 3903 a
66 o 0 3903 a
67
67
68 $ cd ..
68 $ cd ..
69 $ hg init client --config format.generaldelta=false --config format.usegeneraldelta=false
69 $ hg init client --config format.generaldelta=false --config format.usegeneraldelta=false
70 $ cd client
70 $ cd client
71 $ hg pull -q ../server -r 4
71 $ hg pull -q ../server -r 4
72 $ hg debugdeltachain x
72 $ hg debugdeltachain x
73 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
73 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
74 0 1 1 -1 base 3 2 3 1.50000 3 0 0.00000
74 0 1 1 -1 base 3 2 3 1.50000 3 0 0.00000
75
75
76 $ cd ..
76 $ cd ..
77
77
78 Test "usegeneraldelta" config
78 Test "usegeneraldelta" config
79 (repo are general delta, but incoming bundle are not re-deltafied)
79 (repo are general delta, but incoming bundle are not re-deltafied)
80
80
81 delta coming from the server base delta server are not recompressed.
81 delta coming from the server base delta server are not recompressed.
82 (also include the aggressive version for comparison)
82 (also include the aggressive version for comparison)
83
83
84 $ hg clone repo --pull --config format.usegeneraldelta=1 usegd
84 $ hg clone repo --pull --config format.usegeneraldelta=1 usegd
85 requesting all changes
85 requesting all changes
86 adding changesets
86 adding changesets
87 adding manifests
87 adding manifests
88 adding file changes
88 adding file changes
89 added 4 changesets with 6 changes to 3 files (+2 heads)
89 added 4 changesets with 6 changes to 3 files (+2 heads)
90 new changesets 0ea3fcf9d01d:bba78d330d9c
90 new changesets 0ea3fcf9d01d:bba78d330d9c
91 updating to branch default
91 updating to branch default
92 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
93 $ hg clone repo --pull --config format.generaldelta=1 full
93 $ hg clone repo --pull --config format.generaldelta=1 full
94 requesting all changes
94 requesting all changes
95 adding changesets
95 adding changesets
96 adding manifests
96 adding manifests
97 adding file changes
97 adding file changes
98 added 4 changesets with 6 changes to 3 files (+2 heads)
98 added 4 changesets with 6 changes to 3 files (+2 heads)
99 new changesets 0ea3fcf9d01d:bba78d330d9c
99 new changesets 0ea3fcf9d01d:bba78d330d9c
100 updating to branch default
100 updating to branch default
101 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
101 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
102 $ hg -R repo debugdeltachain -m
102 $ hg -R repo debugdeltachain -m
103 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
103 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
104 0 1 1 -1 base 104 135 104 0.77037 104 0 0.00000
104 0 1 1 -1 base 104 135 104 0.77037 104 0 0.00000
105 1 1 2 0 prev 57 135 161 1.19259 161 0 0.00000
105 1 1 2 0 prev 57 135 161 1.19259 161 0 0.00000
106 2 1 3 1 prev 57 135 218 1.61481 218 0 0.00000
106 2 1 3 1 prev 57 135 218 1.61481 218 0 0.00000
107 3 2 1 -1 base 104 135 104 0.77037 104 0 0.00000
107 3 2 1 -1 base 104 135 104 0.77037 104 0 0.00000
108 $ hg -R usegd debugdeltachain -m
108 $ hg -R usegd debugdeltachain -m
109 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
109 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
110 0 1 1 -1 base 104 135 104 0.77037 104 0 0.00000
110 0 1 1 -1 base 104 135 104 0.77037 104 0 0.00000
111 1 1 2 0 p1 57 135 161 1.19259 161 0 0.00000
111 1 1 2 0 p1 57 135 161 1.19259 161 0 0.00000
112 2 1 3 1 prev 57 135 218 1.61481 218 0 0.00000
112 2 1 3 1 prev 57 135 218 1.61481 218 0 0.00000
113 3 1 2 0 p1 57 135 161 1.19259 275 114 0.70807
113 3 1 2 0 p1 57 135 161 1.19259 275 114 0.70807
114 $ hg -R full debugdeltachain -m
114 $ hg -R full debugdeltachain -m
115 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
115 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
116 0 1 1 -1 base 104 135 104 0.77037 104 0 0.00000
116 0 1 1 -1 base 104 135 104 0.77037 104 0 0.00000
117 1 1 2 0 p1 57 135 161 1.19259 161 0 0.00000
117 1 1 2 0 p1 57 135 161 1.19259 161 0 0.00000
118 2 1 2 0 p1 57 135 161 1.19259 218 57 0.35404
118 2 1 2 0 p1 57 135 161 1.19259 218 57 0.35404
119 3 1 2 0 p1 57 135 161 1.19259 275 114 0.70807
119 3 1 2 0 p1 57 135 161 1.19259 275 114 0.70807
120
120
121 Test revlog.optimize-delta-parent-choice
121 Test revlog.optimize-delta-parent-choice
122
122
123 $ hg init --config format.generaldelta=1 aggressive
123 $ hg init --config format.generaldelta=1 aggressive
124 $ cd aggressive
124 $ cd aggressive
125 $ cat << EOF >> .hg/hgrc
125 $ cat << EOF >> .hg/hgrc
126 > [format]
126 > [format]
127 > generaldelta = 1
127 > generaldelta = 1
128 > EOF
128 > EOF
129 $ touch a b c d e
129 $ touch a b c d e
130 $ hg commit -Aqm side1
130 $ hg commit -Aqm side1
131 $ hg up -q null
131 $ hg up -q null
132 $ touch x y
132 $ touch x y
133 $ hg commit -Aqm side2
133 $ hg commit -Aqm side2
134
134
135 - Verify non-aggressive merge uses p1 (commit 1) as delta parent
135 - Verify non-aggressive merge uses p1 (commit 1) as delta parent
136 $ hg merge -q 0
136 $ hg merge -q 0
137 $ hg commit -q -m merge
137 $ hg commit -q -m merge
138 $ hg debugdeltachain -m
138 $ hg debugdeltachain -m
139 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
139 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
140 0 1 1 -1 base 59 215 59 0.27442 59 0 0.00000
140 0 1 1 -1 base 59 215 59 0.27442 59 0 0.00000
141 1 1 2 0 prev 61 86 120 1.39535 120 0 0.00000
141 1 1 2 0 prev 61 86 120 1.39535 120 0 0.00000
142 2 1 2 0 p2 62 301 121 0.40199 182 61 0.50413
142 2 1 2 0 p2 62 301 121 0.40199 182 61 0.50413
143
143
144 $ hg strip -q -r . --config extensions.strip=
144 $ hg strip -q -r . --config extensions.strip=
145
145
146 - Verify aggressive merge uses p2 (commit 0) as delta parent
146 - Verify aggressive merge uses p2 (commit 0) as delta parent
147 $ hg up -q -C 1
147 $ hg up -q -C 1
148 $ hg merge -q 0
148 $ hg merge -q 0
149 $ hg commit -q -m merge --config revlog.optimize-delta-parent-choice=yes
149 $ hg commit -q -m merge --config storage.revlog.optimize-delta-parent-choice=yes
150 $ hg debugdeltachain -m
150 $ hg debugdeltachain -m
151 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
151 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
152 0 1 1 -1 base 59 215 59 0.27442 59 0 0.00000
152 0 1 1 -1 base 59 215 59 0.27442 59 0 0.00000
153 1 1 2 0 prev 61 86 120 1.39535 120 0 0.00000
153 1 1 2 0 prev 61 86 120 1.39535 120 0 0.00000
154 2 1 2 0 p2 62 301 121 0.40199 182 61 0.50413
154 2 1 2 0 p2 62 301 121 0.40199 182 61 0.50413
155
155
156 Test that strip bundle use bundle2
156 Test that strip bundle use bundle2
157 $ hg --config extensions.strip= strip .
157 $ hg --config extensions.strip= strip .
158 0 files updated, 0 files merged, 5 files removed, 0 files unresolved
158 0 files updated, 0 files merged, 5 files removed, 0 files unresolved
159 saved backup bundle to $TESTTMP/aggressive/.hg/strip-backup/1c5d4dc9a8b8-6c68e60c-backup.hg
159 saved backup bundle to $TESTTMP/aggressive/.hg/strip-backup/1c5d4dc9a8b8-6c68e60c-backup.hg
160 $ hg debugbundle .hg/strip-backup/*
160 $ hg debugbundle .hg/strip-backup/*
161 Stream params: {Compression: BZ}
161 Stream params: {Compression: BZ}
162 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
162 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
163 1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9
163 1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9
164 cache:rev-branch-cache -- {} (mandatory: False)
164 cache:rev-branch-cache -- {} (mandatory: False)
165 phase-heads -- {} (mandatory: True)
165 phase-heads -- {} (mandatory: True)
166 1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9 draft
166 1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9 draft
167
167
168 $ cd ..
168 $ cd ..
169
169
170 test maxdeltachainspan
170 test maxdeltachainspan
171
171
172 $ hg init source-repo
172 $ hg init source-repo
173 $ cd source-repo
173 $ cd source-repo
174 $ hg debugbuilddag --new-file '.+5:brancha$.+11:branchb$.+30:branchc<brancha+2<branchb+2'
174 $ hg debugbuilddag --new-file '.+5:brancha$.+11:branchb$.+30:branchc<brancha+2<branchb+2'
175 # add an empty revision somewhere
175 # add an empty revision somewhere
176 $ hg up tip
176 $ hg up tip
177 14 files updated, 0 files merged, 0 files removed, 0 files unresolved
177 14 files updated, 0 files merged, 0 files removed, 0 files unresolved
178 $ hg rm .
178 $ hg rm .
179 removing nf10
179 removing nf10
180 removing nf11
180 removing nf11
181 removing nf12
181 removing nf12
182 removing nf13
182 removing nf13
183 removing nf14
183 removing nf14
184 removing nf15
184 removing nf15
185 removing nf16
185 removing nf16
186 removing nf17
186 removing nf17
187 removing nf51
187 removing nf51
188 removing nf52
188 removing nf52
189 removing nf6
189 removing nf6
190 removing nf7
190 removing nf7
191 removing nf8
191 removing nf8
192 removing nf9
192 removing nf9
193 $ hg commit -m 'empty all'
193 $ hg commit -m 'empty all'
194 $ hg revert --all --rev 'p1(.)'
194 $ hg revert --all --rev 'p1(.)'
195 adding nf10
195 adding nf10
196 adding nf11
196 adding nf11
197 adding nf12
197 adding nf12
198 adding nf13
198 adding nf13
199 adding nf14
199 adding nf14
200 adding nf15
200 adding nf15
201 adding nf16
201 adding nf16
202 adding nf17
202 adding nf17
203 adding nf51
203 adding nf51
204 adding nf52
204 adding nf52
205 adding nf6
205 adding nf6
206 adding nf7
206 adding nf7
207 adding nf8
207 adding nf8
208 adding nf9
208 adding nf9
209 $ hg commit -m 'restore all'
209 $ hg commit -m 'restore all'
210 $ hg up null
210 $ hg up null
211 0 files updated, 0 files merged, 14 files removed, 0 files unresolved
211 0 files updated, 0 files merged, 14 files removed, 0 files unresolved
212 $
212 $
213 $ cd ..
213 $ cd ..
214 $ hg -R source-repo debugdeltachain -m
214 $ hg -R source-repo debugdeltachain -m
215 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
215 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
216 0 1 1 -1 base 46 45 46 1.02222 46 0 0.00000
216 0 1 1 -1 base 46 45 46 1.02222 46 0 0.00000
217 1 1 2 0 p1 57 90 103 1.14444 103 0 0.00000
217 1 1 2 0 p1 57 90 103 1.14444 103 0 0.00000
218 2 1 3 1 p1 57 135 160 1.18519 160 0 0.00000
218 2 1 3 1 p1 57 135 160 1.18519 160 0 0.00000
219 3 1 4 2 p1 57 180 217 1.20556 217 0 0.00000
219 3 1 4 2 p1 57 180 217 1.20556 217 0 0.00000
220 4 1 5 3 p1 57 225 274 1.21778 274 0 0.00000
220 4 1 5 3 p1 57 225 274 1.21778 274 0 0.00000
221 5 1 6 4 p1 57 270 331 1.22593 331 0 0.00000
221 5 1 6 4 p1 57 270 331 1.22593 331 0 0.00000
222 6 2 1 -1 base 46 45 46 1.02222 46 0 0.00000
222 6 2 1 -1 base 46 45 46 1.02222 46 0 0.00000
223 7 2 2 6 p1 57 90 103 1.14444 103 0 0.00000
223 7 2 2 6 p1 57 90 103 1.14444 103 0 0.00000
224 8 2 3 7 p1 57 135 160 1.18519 160 0 0.00000
224 8 2 3 7 p1 57 135 160 1.18519 160 0 0.00000
225 9 2 4 8 p1 57 180 217 1.20556 217 0 0.00000
225 9 2 4 8 p1 57 180 217 1.20556 217 0 0.00000
226 10 2 5 9 p1 58 226 275 1.21681 275 0 0.00000
226 10 2 5 9 p1 58 226 275 1.21681 275 0 0.00000
227 11 2 6 10 p1 58 272 333 1.22426 333 0 0.00000
227 11 2 6 10 p1 58 272 333 1.22426 333 0 0.00000
228 12 2 7 11 p1 58 318 391 1.22956 391 0 0.00000
228 12 2 7 11 p1 58 318 391 1.22956 391 0 0.00000
229 13 2 8 12 p1 58 364 449 1.23352 449 0 0.00000
229 13 2 8 12 p1 58 364 449 1.23352 449 0 0.00000
230 14 2 9 13 p1 58 410 507 1.23659 507 0 0.00000
230 14 2 9 13 p1 58 410 507 1.23659 507 0 0.00000
231 15 2 10 14 p1 58 456 565 1.23904 565 0 0.00000
231 15 2 10 14 p1 58 456 565 1.23904 565 0 0.00000
232 16 2 11 15 p1 58 502 623 1.24104 623 0 0.00000
232 16 2 11 15 p1 58 502 623 1.24104 623 0 0.00000
233 17 2 12 16 p1 58 548 681 1.24270 681 0 0.00000
233 17 2 12 16 p1 58 548 681 1.24270 681 0 0.00000
234 18 3 1 -1 base 47 46 47 1.02174 47 0 0.00000
234 18 3 1 -1 base 47 46 47 1.02174 47 0 0.00000
235 19 3 2 18 p1 58 92 105 1.14130 105 0 0.00000
235 19 3 2 18 p1 58 92 105 1.14130 105 0 0.00000
236 20 3 3 19 p1 58 138 163 1.18116 163 0 0.00000
236 20 3 3 19 p1 58 138 163 1.18116 163 0 0.00000
237 21 3 4 20 p1 58 184 221 1.20109 221 0 0.00000
237 21 3 4 20 p1 58 184 221 1.20109 221 0 0.00000
238 22 3 5 21 p1 58 230 279 1.21304 279 0 0.00000
238 22 3 5 21 p1 58 230 279 1.21304 279 0 0.00000
239 23 3 6 22 p1 58 276 337 1.22101 337 0 0.00000
239 23 3 6 22 p1 58 276 337 1.22101 337 0 0.00000
240 24 3 7 23 p1 58 322 395 1.22671 395 0 0.00000
240 24 3 7 23 p1 58 322 395 1.22671 395 0 0.00000
241 25 3 8 24 p1 58 368 453 1.23098 453 0 0.00000
241 25 3 8 24 p1 58 368 453 1.23098 453 0 0.00000
242 26 3 9 25 p1 58 414 511 1.23430 511 0 0.00000
242 26 3 9 25 p1 58 414 511 1.23430 511 0 0.00000
243 27 3 10 26 p1 58 460 569 1.23696 569 0 0.00000
243 27 3 10 26 p1 58 460 569 1.23696 569 0 0.00000
244 28 3 11 27 p1 58 506 627 1.23913 627 0 0.00000
244 28 3 11 27 p1 58 506 627 1.23913 627 0 0.00000
245 29 3 12 28 p1 58 552 685 1.24094 685 0 0.00000
245 29 3 12 28 p1 58 552 685 1.24094 685 0 0.00000
246 30 3 13 29 p1 58 598 743 1.24247 743 0 0.00000
246 30 3 13 29 p1 58 598 743 1.24247 743 0 0.00000
247 31 3 14 30 p1 58 644 801 1.24379 801 0 0.00000
247 31 3 14 30 p1 58 644 801 1.24379 801 0 0.00000
248 32 3 15 31 p1 58 690 859 1.24493 859 0 0.00000
248 32 3 15 31 p1 58 690 859 1.24493 859 0 0.00000
249 33 3 16 32 p1 58 736 917 1.24592 917 0 0.00000
249 33 3 16 32 p1 58 736 917 1.24592 917 0 0.00000
250 34 3 17 33 p1 58 782 975 1.24680 975 0 0.00000
250 34 3 17 33 p1 58 782 975 1.24680 975 0 0.00000
251 35 3 18 34 p1 58 828 1033 1.24758 1033 0 0.00000
251 35 3 18 34 p1 58 828 1033 1.24758 1033 0 0.00000
252 36 3 19 35 p1 58 874 1091 1.24828 1091 0 0.00000
252 36 3 19 35 p1 58 874 1091 1.24828 1091 0 0.00000
253 37 3 20 36 p1 58 920 1149 1.24891 1149 0 0.00000
253 37 3 20 36 p1 58 920 1149 1.24891 1149 0 0.00000
254 38 3 21 37 p1 58 966 1207 1.24948 1207 0 0.00000
254 38 3 21 37 p1 58 966 1207 1.24948 1207 0 0.00000
255 39 3 22 38 p1 58 1012 1265 1.25000 1265 0 0.00000
255 39 3 22 38 p1 58 1012 1265 1.25000 1265 0 0.00000
256 40 3 23 39 p1 58 1058 1323 1.25047 1323 0 0.00000
256 40 3 23 39 p1 58 1058 1323 1.25047 1323 0 0.00000
257 41 3 24 40 p1 58 1104 1381 1.25091 1381 0 0.00000
257 41 3 24 40 p1 58 1104 1381 1.25091 1381 0 0.00000
258 42 3 25 41 p1 58 1150 1439 1.25130 1439 0 0.00000
258 42 3 25 41 p1 58 1150 1439 1.25130 1439 0 0.00000
259 43 3 26 42 p1 58 1196 1497 1.25167 1497 0 0.00000
259 43 3 26 42 p1 58 1196 1497 1.25167 1497 0 0.00000
260 44 3 27 43 p1 58 1242 1555 1.25201 1555 0 0.00000
260 44 3 27 43 p1 58 1242 1555 1.25201 1555 0 0.00000
261 45 3 28 44 p1 58 1288 1613 1.25233 1613 0 0.00000
261 45 3 28 44 p1 58 1288 1613 1.25233 1613 0 0.00000
262 46 3 29 45 p1 58 1334 1671 1.25262 1671 0 0.00000
262 46 3 29 45 p1 58 1334 1671 1.25262 1671 0 0.00000
263 47 3 30 46 p1 58 1380 1729 1.25290 1729 0 0.00000
263 47 3 30 46 p1 58 1380 1729 1.25290 1729 0 0.00000
264 48 3 31 47 p1 58 1426 1787 1.25316 1787 0 0.00000
264 48 3 31 47 p1 58 1426 1787 1.25316 1787 0 0.00000
265 49 4 1 -1 base 197 316 197 0.62342 197 0 0.00000
265 49 4 1 -1 base 197 316 197 0.62342 197 0 0.00000
266 50 4 2 49 p1 58 362 255 0.70442 255 0 0.00000
266 50 4 2 49 p1 58 362 255 0.70442 255 0 0.00000
267 51 4 3 50 prev 356 594 611 1.02862 611 0 0.00000
267 51 4 3 50 prev 356 594 611 1.02862 611 0 0.00000
268 52 4 4 51 p1 58 640 669 1.04531 669 0 0.00000
268 52 4 4 51 p1 58 640 669 1.04531 669 0 0.00000
269 53 5 1 -1 base 0 0 0 0.00000 0 0 0.00000
269 53 5 1 -1 base 0 0 0 0.00000 0 0 0.00000
270 54 5 2 53 p1 376 640 376 0.58750 376 0 0.00000
270 54 5 2 53 p1 376 640 376 0.58750 376 0 0.00000
271 $ hg clone --pull source-repo --config experimental.maxdeltachainspan=2800 relax-chain --config format.generaldelta=yes
271 $ hg clone --pull source-repo --config experimental.maxdeltachainspan=2800 relax-chain --config format.generaldelta=yes
272 requesting all changes
272 requesting all changes
273 adding changesets
273 adding changesets
274 adding manifests
274 adding manifests
275 adding file changes
275 adding file changes
276 added 55 changesets with 53 changes to 53 files (+2 heads)
276 added 55 changesets with 53 changes to 53 files (+2 heads)
277 new changesets 61246295ee1e:c930ac4a5b32
277 new changesets 61246295ee1e:c930ac4a5b32
278 updating to branch default
278 updating to branch default
279 14 files updated, 0 files merged, 0 files removed, 0 files unresolved
279 14 files updated, 0 files merged, 0 files removed, 0 files unresolved
280 $ hg -R relax-chain debugdeltachain -m
280 $ hg -R relax-chain debugdeltachain -m
281 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
281 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
282 0 1 1 -1 base 46 45 46 1.02222 46 0 0.00000
282 0 1 1 -1 base 46 45 46 1.02222 46 0 0.00000
283 1 1 2 0 p1 57 90 103 1.14444 103 0 0.00000
283 1 1 2 0 p1 57 90 103 1.14444 103 0 0.00000
284 2 1 3 1 p1 57 135 160 1.18519 160 0 0.00000
284 2 1 3 1 p1 57 135 160 1.18519 160 0 0.00000
285 3 1 4 2 p1 57 180 217 1.20556 217 0 0.00000
285 3 1 4 2 p1 57 180 217 1.20556 217 0 0.00000
286 4 1 5 3 p1 57 225 274 1.21778 274 0 0.00000
286 4 1 5 3 p1 57 225 274 1.21778 274 0 0.00000
287 5 1 6 4 p1 57 270 331 1.22593 331 0 0.00000
287 5 1 6 4 p1 57 270 331 1.22593 331 0 0.00000
288 6 2 1 -1 base 46 45 46 1.02222 46 0 0.00000
288 6 2 1 -1 base 46 45 46 1.02222 46 0 0.00000
289 7 2 2 6 p1 57 90 103 1.14444 103 0 0.00000
289 7 2 2 6 p1 57 90 103 1.14444 103 0 0.00000
290 8 2 3 7 p1 57 135 160 1.18519 160 0 0.00000
290 8 2 3 7 p1 57 135 160 1.18519 160 0 0.00000
291 9 2 4 8 p1 57 180 217 1.20556 217 0 0.00000
291 9 2 4 8 p1 57 180 217 1.20556 217 0 0.00000
292 10 2 5 9 p1 58 226 275 1.21681 275 0 0.00000
292 10 2 5 9 p1 58 226 275 1.21681 275 0 0.00000
293 11 2 6 10 p1 58 272 333 1.22426 333 0 0.00000
293 11 2 6 10 p1 58 272 333 1.22426 333 0 0.00000
294 12 2 7 11 p1 58 318 391 1.22956 391 0 0.00000
294 12 2 7 11 p1 58 318 391 1.22956 391 0 0.00000
295 13 2 8 12 p1 58 364 449 1.23352 449 0 0.00000
295 13 2 8 12 p1 58 364 449 1.23352 449 0 0.00000
296 14 2 9 13 p1 58 410 507 1.23659 507 0 0.00000
296 14 2 9 13 p1 58 410 507 1.23659 507 0 0.00000
297 15 2 10 14 p1 58 456 565 1.23904 565 0 0.00000
297 15 2 10 14 p1 58 456 565 1.23904 565 0 0.00000
298 16 2 11 15 p1 58 502 623 1.24104 623 0 0.00000
298 16 2 11 15 p1 58 502 623 1.24104 623 0 0.00000
299 17 2 12 16 p1 58 548 681 1.24270 681 0 0.00000
299 17 2 12 16 p1 58 548 681 1.24270 681 0 0.00000
300 18 3 1 -1 base 47 46 47 1.02174 47 0 0.00000
300 18 3 1 -1 base 47 46 47 1.02174 47 0 0.00000
301 19 3 2 18 p1 58 92 105 1.14130 105 0 0.00000
301 19 3 2 18 p1 58 92 105 1.14130 105 0 0.00000
302 20 3 3 19 p1 58 138 163 1.18116 163 0 0.00000
302 20 3 3 19 p1 58 138 163 1.18116 163 0 0.00000
303 21 3 4 20 p1 58 184 221 1.20109 221 0 0.00000
303 21 3 4 20 p1 58 184 221 1.20109 221 0 0.00000
304 22 3 5 21 p1 58 230 279 1.21304 279 0 0.00000
304 22 3 5 21 p1 58 230 279 1.21304 279 0 0.00000
305 23 3 6 22 p1 58 276 337 1.22101 337 0 0.00000
305 23 3 6 22 p1 58 276 337 1.22101 337 0 0.00000
306 24 3 7 23 p1 58 322 395 1.22671 395 0 0.00000
306 24 3 7 23 p1 58 322 395 1.22671 395 0 0.00000
307 25 3 8 24 p1 58 368 453 1.23098 453 0 0.00000
307 25 3 8 24 p1 58 368 453 1.23098 453 0 0.00000
308 26 3 9 25 p1 58 414 511 1.23430 511 0 0.00000
308 26 3 9 25 p1 58 414 511 1.23430 511 0 0.00000
309 27 3 10 26 p1 58 460 569 1.23696 569 0 0.00000
309 27 3 10 26 p1 58 460 569 1.23696 569 0 0.00000
310 28 3 11 27 p1 58 506 627 1.23913 627 0 0.00000
310 28 3 11 27 p1 58 506 627 1.23913 627 0 0.00000
311 29 3 12 28 p1 58 552 685 1.24094 685 0 0.00000
311 29 3 12 28 p1 58 552 685 1.24094 685 0 0.00000
312 30 3 13 29 p1 58 598 743 1.24247 743 0 0.00000
312 30 3 13 29 p1 58 598 743 1.24247 743 0 0.00000
313 31 3 14 30 p1 58 644 801 1.24379 801 0 0.00000
313 31 3 14 30 p1 58 644 801 1.24379 801 0 0.00000
314 32 3 15 31 p1 58 690 859 1.24493 859 0 0.00000
314 32 3 15 31 p1 58 690 859 1.24493 859 0 0.00000
315 33 3 16 32 p1 58 736 917 1.24592 917 0 0.00000
315 33 3 16 32 p1 58 736 917 1.24592 917 0 0.00000
316 34 3 17 33 p1 58 782 975 1.24680 975 0 0.00000
316 34 3 17 33 p1 58 782 975 1.24680 975 0 0.00000
317 35 3 18 34 p1 58 828 1033 1.24758 1033 0 0.00000
317 35 3 18 34 p1 58 828 1033 1.24758 1033 0 0.00000
318 36 3 19 35 p1 58 874 1091 1.24828 1091 0 0.00000
318 36 3 19 35 p1 58 874 1091 1.24828 1091 0 0.00000
319 37 3 20 36 p1 58 920 1149 1.24891 1149 0 0.00000
319 37 3 20 36 p1 58 920 1149 1.24891 1149 0 0.00000
320 38 3 21 37 p1 58 966 1207 1.24948 1207 0 0.00000
320 38 3 21 37 p1 58 966 1207 1.24948 1207 0 0.00000
321 39 3 22 38 p1 58 1012 1265 1.25000 1265 0 0.00000
321 39 3 22 38 p1 58 1012 1265 1.25000 1265 0 0.00000
322 40 3 23 39 p1 58 1058 1323 1.25047 1323 0 0.00000
322 40 3 23 39 p1 58 1058 1323 1.25047 1323 0 0.00000
323 41 3 24 40 p1 58 1104 1381 1.25091 1381 0 0.00000
323 41 3 24 40 p1 58 1104 1381 1.25091 1381 0 0.00000
324 42 3 25 41 p1 58 1150 1439 1.25130 1439 0 0.00000
324 42 3 25 41 p1 58 1150 1439 1.25130 1439 0 0.00000
325 43 3 26 42 p1 58 1196 1497 1.25167 1497 0 0.00000
325 43 3 26 42 p1 58 1196 1497 1.25167 1497 0 0.00000
326 44 3 27 43 p1 58 1242 1555 1.25201 1555 0 0.00000
326 44 3 27 43 p1 58 1242 1555 1.25201 1555 0 0.00000
327 45 3 28 44 p1 58 1288 1613 1.25233 1613 0 0.00000
327 45 3 28 44 p1 58 1288 1613 1.25233 1613 0 0.00000
328 46 3 29 45 p1 58 1334 1671 1.25262 1671 0 0.00000
328 46 3 29 45 p1 58 1334 1671 1.25262 1671 0 0.00000
329 47 3 30 46 p1 58 1380 1729 1.25290 1729 0 0.00000
329 47 3 30 46 p1 58 1380 1729 1.25290 1729 0 0.00000
330 48 3 31 47 p1 58 1426 1787 1.25316 1787 0 0.00000
330 48 3 31 47 p1 58 1426 1787 1.25316 1787 0 0.00000
331 49 4 1 -1 base 197 316 197 0.62342 197 0 0.00000
331 49 4 1 -1 base 197 316 197 0.62342 197 0 0.00000
332 50 4 2 49 p1 58 362 255 0.70442 255 0 0.00000
332 50 4 2 49 p1 58 362 255 0.70442 255 0 0.00000
333 51 2 13 17 p1 58 594 739 1.24411 2781 2042 2.76319
333 51 2 13 17 p1 58 594 739 1.24411 2781 2042 2.76319
334 52 5 1 -1 base 369 640 369 0.57656 369 0 0.00000
334 52 5 1 -1 base 369 640 369 0.57656 369 0 0.00000
335 53 6 1 -1 base 0 0 0 0.00000 0 0 0.00000
335 53 6 1 -1 base 0 0 0 0.00000 0 0 0.00000
336 54 6 2 53 p1 376 640 376 0.58750 376 0 0.00000
336 54 6 2 53 p1 376 640 376 0.58750 376 0 0.00000
337 $ hg clone --pull source-repo --config experimental.maxdeltachainspan=0 noconst-chain --config format.generaldelta=yes
337 $ hg clone --pull source-repo --config experimental.maxdeltachainspan=0 noconst-chain --config format.generaldelta=yes
338 requesting all changes
338 requesting all changes
339 adding changesets
339 adding changesets
340 adding manifests
340 adding manifests
341 adding file changes
341 adding file changes
342 added 55 changesets with 53 changes to 53 files (+2 heads)
342 added 55 changesets with 53 changes to 53 files (+2 heads)
343 new changesets 61246295ee1e:c930ac4a5b32
343 new changesets 61246295ee1e:c930ac4a5b32
344 updating to branch default
344 updating to branch default
345 14 files updated, 0 files merged, 0 files removed, 0 files unresolved
345 14 files updated, 0 files merged, 0 files removed, 0 files unresolved
346 $ hg -R noconst-chain debugdeltachain -m
346 $ hg -R noconst-chain debugdeltachain -m
347 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
347 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
348 0 1 1 -1 base 46 45 46 1.02222 46 0 0.00000
348 0 1 1 -1 base 46 45 46 1.02222 46 0 0.00000
349 1 1 2 0 p1 57 90 103 1.14444 103 0 0.00000
349 1 1 2 0 p1 57 90 103 1.14444 103 0 0.00000
350 2 1 3 1 p1 57 135 160 1.18519 160 0 0.00000
350 2 1 3 1 p1 57 135 160 1.18519 160 0 0.00000
351 3 1 4 2 p1 57 180 217 1.20556 217 0 0.00000
351 3 1 4 2 p1 57 180 217 1.20556 217 0 0.00000
352 4 1 5 3 p1 57 225 274 1.21778 274 0 0.00000
352 4 1 5 3 p1 57 225 274 1.21778 274 0 0.00000
353 5 1 6 4 p1 57 270 331 1.22593 331 0 0.00000
353 5 1 6 4 p1 57 270 331 1.22593 331 0 0.00000
354 6 2 1 -1 base 46 45 46 1.02222 46 0 0.00000
354 6 2 1 -1 base 46 45 46 1.02222 46 0 0.00000
355 7 2 2 6 p1 57 90 103 1.14444 103 0 0.00000
355 7 2 2 6 p1 57 90 103 1.14444 103 0 0.00000
356 8 2 3 7 p1 57 135 160 1.18519 160 0 0.00000
356 8 2 3 7 p1 57 135 160 1.18519 160 0 0.00000
357 9 2 4 8 p1 57 180 217 1.20556 217 0 0.00000
357 9 2 4 8 p1 57 180 217 1.20556 217 0 0.00000
358 10 2 5 9 p1 58 226 275 1.21681 275 0 0.00000
358 10 2 5 9 p1 58 226 275 1.21681 275 0 0.00000
359 11 2 6 10 p1 58 272 333 1.22426 333 0 0.00000
359 11 2 6 10 p1 58 272 333 1.22426 333 0 0.00000
360 12 2 7 11 p1 58 318 391 1.22956 391 0 0.00000
360 12 2 7 11 p1 58 318 391 1.22956 391 0 0.00000
361 13 2 8 12 p1 58 364 449 1.23352 449 0 0.00000
361 13 2 8 12 p1 58 364 449 1.23352 449 0 0.00000
362 14 2 9 13 p1 58 410 507 1.23659 507 0 0.00000
362 14 2 9 13 p1 58 410 507 1.23659 507 0 0.00000
363 15 2 10 14 p1 58 456 565 1.23904 565 0 0.00000
363 15 2 10 14 p1 58 456 565 1.23904 565 0 0.00000
364 16 2 11 15 p1 58 502 623 1.24104 623 0 0.00000
364 16 2 11 15 p1 58 502 623 1.24104 623 0 0.00000
365 17 2 12 16 p1 58 548 681 1.24270 681 0 0.00000
365 17 2 12 16 p1 58 548 681 1.24270 681 0 0.00000
366 18 3 1 -1 base 47 46 47 1.02174 47 0 0.00000
366 18 3 1 -1 base 47 46 47 1.02174 47 0 0.00000
367 19 3 2 18 p1 58 92 105 1.14130 105 0 0.00000
367 19 3 2 18 p1 58 92 105 1.14130 105 0 0.00000
368 20 3 3 19 p1 58 138 163 1.18116 163 0 0.00000
368 20 3 3 19 p1 58 138 163 1.18116 163 0 0.00000
369 21 3 4 20 p1 58 184 221 1.20109 221 0 0.00000
369 21 3 4 20 p1 58 184 221 1.20109 221 0 0.00000
370 22 3 5 21 p1 58 230 279 1.21304 279 0 0.00000
370 22 3 5 21 p1 58 230 279 1.21304 279 0 0.00000
371 23 3 6 22 p1 58 276 337 1.22101 337 0 0.00000
371 23 3 6 22 p1 58 276 337 1.22101 337 0 0.00000
372 24 3 7 23 p1 58 322 395 1.22671 395 0 0.00000
372 24 3 7 23 p1 58 322 395 1.22671 395 0 0.00000
373 25 3 8 24 p1 58 368 453 1.23098 453 0 0.00000
373 25 3 8 24 p1 58 368 453 1.23098 453 0 0.00000
374 26 3 9 25 p1 58 414 511 1.23430 511 0 0.00000
374 26 3 9 25 p1 58 414 511 1.23430 511 0 0.00000
375 27 3 10 26 p1 58 460 569 1.23696 569 0 0.00000
375 27 3 10 26 p1 58 460 569 1.23696 569 0 0.00000
376 28 3 11 27 p1 58 506 627 1.23913 627 0 0.00000
376 28 3 11 27 p1 58 506 627 1.23913 627 0 0.00000
377 29 3 12 28 p1 58 552 685 1.24094 685 0 0.00000
377 29 3 12 28 p1 58 552 685 1.24094 685 0 0.00000
378 30 3 13 29 p1 58 598 743 1.24247 743 0 0.00000
378 30 3 13 29 p1 58 598 743 1.24247 743 0 0.00000
379 31 3 14 30 p1 58 644 801 1.24379 801 0 0.00000
379 31 3 14 30 p1 58 644 801 1.24379 801 0 0.00000
380 32 3 15 31 p1 58 690 859 1.24493 859 0 0.00000
380 32 3 15 31 p1 58 690 859 1.24493 859 0 0.00000
381 33 3 16 32 p1 58 736 917 1.24592 917 0 0.00000
381 33 3 16 32 p1 58 736 917 1.24592 917 0 0.00000
382 34 3 17 33 p1 58 782 975 1.24680 975 0 0.00000
382 34 3 17 33 p1 58 782 975 1.24680 975 0 0.00000
383 35 3 18 34 p1 58 828 1033 1.24758 1033 0 0.00000
383 35 3 18 34 p1 58 828 1033 1.24758 1033 0 0.00000
384 36 3 19 35 p1 58 874 1091 1.24828 1091 0 0.00000
384 36 3 19 35 p1 58 874 1091 1.24828 1091 0 0.00000
385 37 3 20 36 p1 58 920 1149 1.24891 1149 0 0.00000
385 37 3 20 36 p1 58 920 1149 1.24891 1149 0 0.00000
386 38 3 21 37 p1 58 966 1207 1.24948 1207 0 0.00000
386 38 3 21 37 p1 58 966 1207 1.24948 1207 0 0.00000
387 39 3 22 38 p1 58 1012 1265 1.25000 1265 0 0.00000
387 39 3 22 38 p1 58 1012 1265 1.25000 1265 0 0.00000
388 40 3 23 39 p1 58 1058 1323 1.25047 1323 0 0.00000
388 40 3 23 39 p1 58 1058 1323 1.25047 1323 0 0.00000
389 41 3 24 40 p1 58 1104 1381 1.25091 1381 0 0.00000
389 41 3 24 40 p1 58 1104 1381 1.25091 1381 0 0.00000
390 42 3 25 41 p1 58 1150 1439 1.25130 1439 0 0.00000
390 42 3 25 41 p1 58 1150 1439 1.25130 1439 0 0.00000
391 43 3 26 42 p1 58 1196 1497 1.25167 1497 0 0.00000
391 43 3 26 42 p1 58 1196 1497 1.25167 1497 0 0.00000
392 44 3 27 43 p1 58 1242 1555 1.25201 1555 0 0.00000
392 44 3 27 43 p1 58 1242 1555 1.25201 1555 0 0.00000
393 45 3 28 44 p1 58 1288 1613 1.25233 1613 0 0.00000
393 45 3 28 44 p1 58 1288 1613 1.25233 1613 0 0.00000
394 46 3 29 45 p1 58 1334 1671 1.25262 1671 0 0.00000
394 46 3 29 45 p1 58 1334 1671 1.25262 1671 0 0.00000
395 47 3 30 46 p1 58 1380 1729 1.25290 1729 0 0.00000
395 47 3 30 46 p1 58 1380 1729 1.25290 1729 0 0.00000
396 48 3 31 47 p1 58 1426 1787 1.25316 1787 0 0.00000
396 48 3 31 47 p1 58 1426 1787 1.25316 1787 0 0.00000
397 49 1 7 5 p1 58 316 389 1.23101 2857 2468 6.34447
397 49 1 7 5 p1 58 316 389 1.23101 2857 2468 6.34447
398 50 1 8 49 p1 58 362 447 1.23481 2915 2468 5.52125
398 50 1 8 49 p1 58 362 447 1.23481 2915 2468 5.52125
399 51 2 13 17 p1 58 594 739 1.24411 2642 1903 2.57510
399 51 2 13 17 p1 58 594 739 1.24411 2642 1903 2.57510
400 52 2 14 51 p1 58 640 797 1.24531 2700 1903 2.38770
400 52 2 14 51 p1 58 640 797 1.24531 2700 1903 2.38770
401 53 4 1 -1 base 0 0 0 0.00000 0 0 0.00000
401 53 4 1 -1 base 0 0 0 0.00000 0 0 0.00000
402 54 4 2 53 p1 376 640 376 0.58750 376 0 0.00000
402 54 4 2 53 p1 376 640 376 0.58750 376 0 0.00000
General Comments 0
You need to be logged in to leave comments. Login now