##// END OF EJS Templates
diff: graduate word-diff option from experimental...
Yuya Nishihara -
r38610:be441eb6 default
parent child Browse files
Show More
@@ -1,1361 +1,1364
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',
151 default=False,
152 )
150 coreconfigitem('auth', 'cookiefile',
153 coreconfigitem('auth', 'cookiefile',
151 default=None,
154 default=None,
152 )
155 )
153 # bookmarks.pushing: internal hack for discovery
156 # bookmarks.pushing: internal hack for discovery
154 coreconfigitem('bookmarks', 'pushing',
157 coreconfigitem('bookmarks', 'pushing',
155 default=list,
158 default=list,
156 )
159 )
157 # bundle.mainreporoot: internal hack for bundlerepo
160 # bundle.mainreporoot: internal hack for bundlerepo
158 coreconfigitem('bundle', 'mainreporoot',
161 coreconfigitem('bundle', 'mainreporoot',
159 default='',
162 default='',
160 )
163 )
161 # bundle.reorder: experimental config
164 # bundle.reorder: experimental config
162 coreconfigitem('bundle', 'reorder',
165 coreconfigitem('bundle', 'reorder',
163 default='auto',
166 default='auto',
164 )
167 )
165 coreconfigitem('censor', 'policy',
168 coreconfigitem('censor', 'policy',
166 default='abort',
169 default='abort',
167 )
170 )
168 coreconfigitem('chgserver', 'idletimeout',
171 coreconfigitem('chgserver', 'idletimeout',
169 default=3600,
172 default=3600,
170 )
173 )
171 coreconfigitem('chgserver', 'skiphash',
174 coreconfigitem('chgserver', 'skiphash',
172 default=False,
175 default=False,
173 )
176 )
174 coreconfigitem('cmdserver', 'log',
177 coreconfigitem('cmdserver', 'log',
175 default=None,
178 default=None,
176 )
179 )
177 coreconfigitem('color', '.*',
180 coreconfigitem('color', '.*',
178 default=None,
181 default=None,
179 generic=True,
182 generic=True,
180 )
183 )
181 coreconfigitem('color', 'mode',
184 coreconfigitem('color', 'mode',
182 default='auto',
185 default='auto',
183 )
186 )
184 coreconfigitem('color', 'pagermode',
187 coreconfigitem('color', 'pagermode',
185 default=dynamicdefault,
188 default=dynamicdefault,
186 )
189 )
187 coreconfigitem('commands', 'show.aliasprefix',
190 coreconfigitem('commands', 'show.aliasprefix',
188 default=list,
191 default=list,
189 )
192 )
190 coreconfigitem('commands', 'status.relative',
193 coreconfigitem('commands', 'status.relative',
191 default=False,
194 default=False,
192 )
195 )
193 coreconfigitem('commands', 'status.skipstates',
196 coreconfigitem('commands', 'status.skipstates',
194 default=[],
197 default=[],
195 )
198 )
196 coreconfigitem('commands', 'status.terse',
199 coreconfigitem('commands', 'status.terse',
197 default='',
200 default='',
198 )
201 )
199 coreconfigitem('commands', 'status.verbose',
202 coreconfigitem('commands', 'status.verbose',
200 default=False,
203 default=False,
201 )
204 )
202 coreconfigitem('commands', 'update.check',
205 coreconfigitem('commands', 'update.check',
203 default=None,
206 default=None,
204 )
207 )
205 coreconfigitem('commands', 'update.requiredest',
208 coreconfigitem('commands', 'update.requiredest',
206 default=False,
209 default=False,
207 )
210 )
208 coreconfigitem('committemplate', '.*',
211 coreconfigitem('committemplate', '.*',
209 default=None,
212 default=None,
210 generic=True,
213 generic=True,
211 )
214 )
212 coreconfigitem('convert', 'bzr.saverev',
215 coreconfigitem('convert', 'bzr.saverev',
213 default=True,
216 default=True,
214 )
217 )
215 coreconfigitem('convert', 'cvsps.cache',
218 coreconfigitem('convert', 'cvsps.cache',
216 default=True,
219 default=True,
217 )
220 )
218 coreconfigitem('convert', 'cvsps.fuzz',
221 coreconfigitem('convert', 'cvsps.fuzz',
219 default=60,
222 default=60,
220 )
223 )
221 coreconfigitem('convert', 'cvsps.logencoding',
224 coreconfigitem('convert', 'cvsps.logencoding',
222 default=None,
225 default=None,
223 )
226 )
224 coreconfigitem('convert', 'cvsps.mergefrom',
227 coreconfigitem('convert', 'cvsps.mergefrom',
225 default=None,
228 default=None,
226 )
229 )
227 coreconfigitem('convert', 'cvsps.mergeto',
230 coreconfigitem('convert', 'cvsps.mergeto',
228 default=None,
231 default=None,
229 )
232 )
230 coreconfigitem('convert', 'git.committeractions',
233 coreconfigitem('convert', 'git.committeractions',
231 default=lambda: ['messagedifferent'],
234 default=lambda: ['messagedifferent'],
232 )
235 )
233 coreconfigitem('convert', 'git.extrakeys',
236 coreconfigitem('convert', 'git.extrakeys',
234 default=list,
237 default=list,
235 )
238 )
236 coreconfigitem('convert', 'git.findcopiesharder',
239 coreconfigitem('convert', 'git.findcopiesharder',
237 default=False,
240 default=False,
238 )
241 )
239 coreconfigitem('convert', 'git.remoteprefix',
242 coreconfigitem('convert', 'git.remoteprefix',
240 default='remote',
243 default='remote',
241 )
244 )
242 coreconfigitem('convert', 'git.renamelimit',
245 coreconfigitem('convert', 'git.renamelimit',
243 default=400,
246 default=400,
244 )
247 )
245 coreconfigitem('convert', 'git.saverev',
248 coreconfigitem('convert', 'git.saverev',
246 default=True,
249 default=True,
247 )
250 )
248 coreconfigitem('convert', 'git.similarity',
251 coreconfigitem('convert', 'git.similarity',
249 default=50,
252 default=50,
250 )
253 )
251 coreconfigitem('convert', 'git.skipsubmodules',
254 coreconfigitem('convert', 'git.skipsubmodules',
252 default=False,
255 default=False,
253 )
256 )
254 coreconfigitem('convert', 'hg.clonebranches',
257 coreconfigitem('convert', 'hg.clonebranches',
255 default=False,
258 default=False,
256 )
259 )
257 coreconfigitem('convert', 'hg.ignoreerrors',
260 coreconfigitem('convert', 'hg.ignoreerrors',
258 default=False,
261 default=False,
259 )
262 )
260 coreconfigitem('convert', 'hg.revs',
263 coreconfigitem('convert', 'hg.revs',
261 default=None,
264 default=None,
262 )
265 )
263 coreconfigitem('convert', 'hg.saverev',
266 coreconfigitem('convert', 'hg.saverev',
264 default=False,
267 default=False,
265 )
268 )
266 coreconfigitem('convert', 'hg.sourcename',
269 coreconfigitem('convert', 'hg.sourcename',
267 default=None,
270 default=None,
268 )
271 )
269 coreconfigitem('convert', 'hg.startrev',
272 coreconfigitem('convert', 'hg.startrev',
270 default=None,
273 default=None,
271 )
274 )
272 coreconfigitem('convert', 'hg.tagsbranch',
275 coreconfigitem('convert', 'hg.tagsbranch',
273 default='default',
276 default='default',
274 )
277 )
275 coreconfigitem('convert', 'hg.usebranchnames',
278 coreconfigitem('convert', 'hg.usebranchnames',
276 default=True,
279 default=True,
277 )
280 )
278 coreconfigitem('convert', 'ignoreancestorcheck',
281 coreconfigitem('convert', 'ignoreancestorcheck',
279 default=False,
282 default=False,
280 )
283 )
281 coreconfigitem('convert', 'localtimezone',
284 coreconfigitem('convert', 'localtimezone',
282 default=False,
285 default=False,
283 )
286 )
284 coreconfigitem('convert', 'p4.encoding',
287 coreconfigitem('convert', 'p4.encoding',
285 default=dynamicdefault,
288 default=dynamicdefault,
286 )
289 )
287 coreconfigitem('convert', 'p4.startrev',
290 coreconfigitem('convert', 'p4.startrev',
288 default=0,
291 default=0,
289 )
292 )
290 coreconfigitem('convert', 'skiptags',
293 coreconfigitem('convert', 'skiptags',
291 default=False,
294 default=False,
292 )
295 )
293 coreconfigitem('convert', 'svn.debugsvnlog',
296 coreconfigitem('convert', 'svn.debugsvnlog',
294 default=True,
297 default=True,
295 )
298 )
296 coreconfigitem('convert', 'svn.trunk',
299 coreconfigitem('convert', 'svn.trunk',
297 default=None,
300 default=None,
298 )
301 )
299 coreconfigitem('convert', 'svn.tags',
302 coreconfigitem('convert', 'svn.tags',
300 default=None,
303 default=None,
301 )
304 )
302 coreconfigitem('convert', 'svn.branches',
305 coreconfigitem('convert', 'svn.branches',
303 default=None,
306 default=None,
304 )
307 )
305 coreconfigitem('convert', 'svn.startrev',
308 coreconfigitem('convert', 'svn.startrev',
306 default=0,
309 default=0,
307 )
310 )
308 coreconfigitem('debug', 'dirstate.delaywrite',
311 coreconfigitem('debug', 'dirstate.delaywrite',
309 default=0,
312 default=0,
310 )
313 )
311 coreconfigitem('defaults', '.*',
314 coreconfigitem('defaults', '.*',
312 default=None,
315 default=None,
313 generic=True,
316 generic=True,
314 )
317 )
315 coreconfigitem('devel', 'all-warnings',
318 coreconfigitem('devel', 'all-warnings',
316 default=False,
319 default=False,
317 )
320 )
318 coreconfigitem('devel', 'bundle2.debug',
321 coreconfigitem('devel', 'bundle2.debug',
319 default=False,
322 default=False,
320 )
323 )
321 coreconfigitem('devel', 'cache-vfs',
324 coreconfigitem('devel', 'cache-vfs',
322 default=None,
325 default=None,
323 )
326 )
324 coreconfigitem('devel', 'check-locks',
327 coreconfigitem('devel', 'check-locks',
325 default=False,
328 default=False,
326 )
329 )
327 coreconfigitem('devel', 'check-relroot',
330 coreconfigitem('devel', 'check-relroot',
328 default=False,
331 default=False,
329 )
332 )
330 coreconfigitem('devel', 'default-date',
333 coreconfigitem('devel', 'default-date',
331 default=None,
334 default=None,
332 )
335 )
333 coreconfigitem('devel', 'deprec-warn',
336 coreconfigitem('devel', 'deprec-warn',
334 default=False,
337 default=False,
335 )
338 )
336 coreconfigitem('devel', 'disableloaddefaultcerts',
339 coreconfigitem('devel', 'disableloaddefaultcerts',
337 default=False,
340 default=False,
338 )
341 )
339 coreconfigitem('devel', 'warn-empty-changegroup',
342 coreconfigitem('devel', 'warn-empty-changegroup',
340 default=False,
343 default=False,
341 )
344 )
342 coreconfigitem('devel', 'legacy.exchange',
345 coreconfigitem('devel', 'legacy.exchange',
343 default=list,
346 default=list,
344 )
347 )
345 coreconfigitem('devel', 'servercafile',
348 coreconfigitem('devel', 'servercafile',
346 default='',
349 default='',
347 )
350 )
348 coreconfigitem('devel', 'serverexactprotocol',
351 coreconfigitem('devel', 'serverexactprotocol',
349 default='',
352 default='',
350 )
353 )
351 coreconfigitem('devel', 'serverrequirecert',
354 coreconfigitem('devel', 'serverrequirecert',
352 default=False,
355 default=False,
353 )
356 )
354 coreconfigitem('devel', 'strip-obsmarkers',
357 coreconfigitem('devel', 'strip-obsmarkers',
355 default=True,
358 default=True,
356 )
359 )
357 coreconfigitem('devel', 'warn-config',
360 coreconfigitem('devel', 'warn-config',
358 default=None,
361 default=None,
359 )
362 )
360 coreconfigitem('devel', 'warn-config-default',
363 coreconfigitem('devel', 'warn-config-default',
361 default=None,
364 default=None,
362 )
365 )
363 coreconfigitem('devel', 'user.obsmarker',
366 coreconfigitem('devel', 'user.obsmarker',
364 default=None,
367 default=None,
365 )
368 )
366 coreconfigitem('devel', 'warn-config-unknown',
369 coreconfigitem('devel', 'warn-config-unknown',
367 default=None,
370 default=None,
368 )
371 )
369 coreconfigitem('devel', 'debug.peer-request',
372 coreconfigitem('devel', 'debug.peer-request',
370 default=False,
373 default=False,
371 )
374 )
372 coreconfigitem('diff', 'nodates',
375 coreconfigitem('diff', 'nodates',
373 default=False,
376 default=False,
374 )
377 )
375 coreconfigitem('diff', 'showfunc',
378 coreconfigitem('diff', 'showfunc',
376 default=False,
379 default=False,
377 )
380 )
378 coreconfigitem('diff', 'unified',
381 coreconfigitem('diff', 'unified',
379 default=None,
382 default=None,
380 )
383 )
381 coreconfigitem('diff', 'git',
384 coreconfigitem('diff', 'git',
382 default=False,
385 default=False,
383 )
386 )
384 coreconfigitem('diff', 'ignorews',
387 coreconfigitem('diff', 'ignorews',
385 default=False,
388 default=False,
386 )
389 )
387 coreconfigitem('diff', 'ignorewsamount',
390 coreconfigitem('diff', 'ignorewsamount',
388 default=False,
391 default=False,
389 )
392 )
390 coreconfigitem('diff', 'ignoreblanklines',
393 coreconfigitem('diff', 'ignoreblanklines',
391 default=False,
394 default=False,
392 )
395 )
393 coreconfigitem('diff', 'ignorewseol',
396 coreconfigitem('diff', 'ignorewseol',
394 default=False,
397 default=False,
395 )
398 )
396 coreconfigitem('diff', 'nobinary',
399 coreconfigitem('diff', 'nobinary',
397 default=False,
400 default=False,
398 )
401 )
399 coreconfigitem('diff', 'noprefix',
402 coreconfigitem('diff', 'noprefix',
400 default=False,
403 default=False,
401 )
404 )
405 coreconfigitem('diff', 'word-diff',
406 default=False,
407 )
402 coreconfigitem('email', 'bcc',
408 coreconfigitem('email', 'bcc',
403 default=None,
409 default=None,
404 )
410 )
405 coreconfigitem('email', 'cc',
411 coreconfigitem('email', 'cc',
406 default=None,
412 default=None,
407 )
413 )
408 coreconfigitem('email', 'charsets',
414 coreconfigitem('email', 'charsets',
409 default=list,
415 default=list,
410 )
416 )
411 coreconfigitem('email', 'from',
417 coreconfigitem('email', 'from',
412 default=None,
418 default=None,
413 )
419 )
414 coreconfigitem('email', 'method',
420 coreconfigitem('email', 'method',
415 default='smtp',
421 default='smtp',
416 )
422 )
417 coreconfigitem('email', 'reply-to',
423 coreconfigitem('email', 'reply-to',
418 default=None,
424 default=None,
419 )
425 )
420 coreconfigitem('email', 'to',
426 coreconfigitem('email', 'to',
421 default=None,
427 default=None,
422 )
428 )
423 coreconfigitem('experimental', 'archivemetatemplate',
429 coreconfigitem('experimental', 'archivemetatemplate',
424 default=dynamicdefault,
430 default=dynamicdefault,
425 )
431 )
426 coreconfigitem('experimental', 'bundle-phases',
432 coreconfigitem('experimental', 'bundle-phases',
427 default=False,
433 default=False,
428 )
434 )
429 coreconfigitem('experimental', 'bundle2-advertise',
435 coreconfigitem('experimental', 'bundle2-advertise',
430 default=True,
436 default=True,
431 )
437 )
432 coreconfigitem('experimental', 'bundle2-output-capture',
438 coreconfigitem('experimental', 'bundle2-output-capture',
433 default=False,
439 default=False,
434 )
440 )
435 coreconfigitem('experimental', 'bundle2.pushback',
441 coreconfigitem('experimental', 'bundle2.pushback',
436 default=False,
442 default=False,
437 )
443 )
438 coreconfigitem('experimental', 'bundle2.stream',
444 coreconfigitem('experimental', 'bundle2.stream',
439 default=False,
445 default=False,
440 )
446 )
441 coreconfigitem('experimental', 'bundle2lazylocking',
447 coreconfigitem('experimental', 'bundle2lazylocking',
442 default=False,
448 default=False,
443 )
449 )
444 coreconfigitem('experimental', 'bundlecomplevel',
450 coreconfigitem('experimental', 'bundlecomplevel',
445 default=None,
451 default=None,
446 )
452 )
447 coreconfigitem('experimental', 'bundlecomplevel.bzip2',
453 coreconfigitem('experimental', 'bundlecomplevel.bzip2',
448 default=None,
454 default=None,
449 )
455 )
450 coreconfigitem('experimental', 'bundlecomplevel.gzip',
456 coreconfigitem('experimental', 'bundlecomplevel.gzip',
451 default=None,
457 default=None,
452 )
458 )
453 coreconfigitem('experimental', 'bundlecomplevel.none',
459 coreconfigitem('experimental', 'bundlecomplevel.none',
454 default=None,
460 default=None,
455 )
461 )
456 coreconfigitem('experimental', 'bundlecomplevel.zstd',
462 coreconfigitem('experimental', 'bundlecomplevel.zstd',
457 default=None,
463 default=None,
458 )
464 )
459 coreconfigitem('experimental', 'changegroup3',
465 coreconfigitem('experimental', 'changegroup3',
460 default=False,
466 default=False,
461 )
467 )
462 coreconfigitem('experimental', 'clientcompressionengines',
468 coreconfigitem('experimental', 'clientcompressionengines',
463 default=list,
469 default=list,
464 )
470 )
465 coreconfigitem('experimental', 'copytrace',
471 coreconfigitem('experimental', 'copytrace',
466 default='on',
472 default='on',
467 )
473 )
468 coreconfigitem('experimental', 'copytrace.movecandidateslimit',
474 coreconfigitem('experimental', 'copytrace.movecandidateslimit',
469 default=100,
475 default=100,
470 )
476 )
471 coreconfigitem('experimental', 'copytrace.sourcecommitlimit',
477 coreconfigitem('experimental', 'copytrace.sourcecommitlimit',
472 default=100,
478 default=100,
473 )
479 )
474 coreconfigitem('experimental', 'crecordtest',
480 coreconfigitem('experimental', 'crecordtest',
475 default=None,
481 default=None,
476 )
482 )
477 coreconfigitem('experimental', 'directaccess',
483 coreconfigitem('experimental', 'directaccess',
478 default=False,
484 default=False,
479 )
485 )
480 coreconfigitem('experimental', 'directaccess.revnums',
486 coreconfigitem('experimental', 'directaccess.revnums',
481 default=False,
487 default=False,
482 )
488 )
483 coreconfigitem('experimental', 'editortmpinhg',
489 coreconfigitem('experimental', 'editortmpinhg',
484 default=False,
490 default=False,
485 )
491 )
486 coreconfigitem('experimental', 'evolution',
492 coreconfigitem('experimental', 'evolution',
487 default=list,
493 default=list,
488 )
494 )
489 coreconfigitem('experimental', 'evolution.allowdivergence',
495 coreconfigitem('experimental', 'evolution.allowdivergence',
490 default=False,
496 default=False,
491 alias=[('experimental', 'allowdivergence')]
497 alias=[('experimental', 'allowdivergence')]
492 )
498 )
493 coreconfigitem('experimental', 'evolution.allowunstable',
499 coreconfigitem('experimental', 'evolution.allowunstable',
494 default=None,
500 default=None,
495 )
501 )
496 coreconfigitem('experimental', 'evolution.createmarkers',
502 coreconfigitem('experimental', 'evolution.createmarkers',
497 default=None,
503 default=None,
498 )
504 )
499 coreconfigitem('experimental', 'evolution.effect-flags',
505 coreconfigitem('experimental', 'evolution.effect-flags',
500 default=True,
506 default=True,
501 alias=[('experimental', 'effect-flags')]
507 alias=[('experimental', 'effect-flags')]
502 )
508 )
503 coreconfigitem('experimental', 'evolution.exchange',
509 coreconfigitem('experimental', 'evolution.exchange',
504 default=None,
510 default=None,
505 )
511 )
506 coreconfigitem('experimental', 'evolution.bundle-obsmarker',
512 coreconfigitem('experimental', 'evolution.bundle-obsmarker',
507 default=False,
513 default=False,
508 )
514 )
509 coreconfigitem('experimental', 'evolution.report-instabilities',
515 coreconfigitem('experimental', 'evolution.report-instabilities',
510 default=True,
516 default=True,
511 )
517 )
512 coreconfigitem('experimental', 'evolution.track-operation',
518 coreconfigitem('experimental', 'evolution.track-operation',
513 default=True,
519 default=True,
514 )
520 )
515 coreconfigitem('experimental', 'worddiff',
516 default=False,
517 )
518 coreconfigitem('experimental', 'maxdeltachainspan',
521 coreconfigitem('experimental', 'maxdeltachainspan',
519 default=-1,
522 default=-1,
520 )
523 )
521 coreconfigitem('experimental', 'mergetempdirprefix',
524 coreconfigitem('experimental', 'mergetempdirprefix',
522 default=None,
525 default=None,
523 )
526 )
524 coreconfigitem('experimental', 'mmapindexthreshold',
527 coreconfigitem('experimental', 'mmapindexthreshold',
525 default=None,
528 default=None,
526 )
529 )
527 coreconfigitem('experimental', 'nonnormalparanoidcheck',
530 coreconfigitem('experimental', 'nonnormalparanoidcheck',
528 default=False,
531 default=False,
529 )
532 )
530 coreconfigitem('experimental', 'exportableenviron',
533 coreconfigitem('experimental', 'exportableenviron',
531 default=list,
534 default=list,
532 )
535 )
533 coreconfigitem('experimental', 'extendedheader.index',
536 coreconfigitem('experimental', 'extendedheader.index',
534 default=None,
537 default=None,
535 )
538 )
536 coreconfigitem('experimental', 'extendedheader.similarity',
539 coreconfigitem('experimental', 'extendedheader.similarity',
537 default=False,
540 default=False,
538 )
541 )
539 coreconfigitem('experimental', 'format.compression',
542 coreconfigitem('experimental', 'format.compression',
540 default='zlib',
543 default='zlib',
541 )
544 )
542 coreconfigitem('experimental', 'graphshorten',
545 coreconfigitem('experimental', 'graphshorten',
543 default=False,
546 default=False,
544 )
547 )
545 coreconfigitem('experimental', 'graphstyle.parent',
548 coreconfigitem('experimental', 'graphstyle.parent',
546 default=dynamicdefault,
549 default=dynamicdefault,
547 )
550 )
548 coreconfigitem('experimental', 'graphstyle.missing',
551 coreconfigitem('experimental', 'graphstyle.missing',
549 default=dynamicdefault,
552 default=dynamicdefault,
550 )
553 )
551 coreconfigitem('experimental', 'graphstyle.grandparent',
554 coreconfigitem('experimental', 'graphstyle.grandparent',
552 default=dynamicdefault,
555 default=dynamicdefault,
553 )
556 )
554 coreconfigitem('experimental', 'hook-track-tags',
557 coreconfigitem('experimental', 'hook-track-tags',
555 default=False,
558 default=False,
556 )
559 )
557 coreconfigitem('experimental', 'httppeer.advertise-v2',
560 coreconfigitem('experimental', 'httppeer.advertise-v2',
558 default=False,
561 default=False,
559 )
562 )
560 coreconfigitem('experimental', 'httppostargs',
563 coreconfigitem('experimental', 'httppostargs',
561 default=False,
564 default=False,
562 )
565 )
563 coreconfigitem('experimental', 'mergedriver',
566 coreconfigitem('experimental', 'mergedriver',
564 default=None,
567 default=None,
565 )
568 )
566 coreconfigitem('experimental', 'nointerrupt', default=False)
569 coreconfigitem('experimental', 'nointerrupt', default=False)
567 coreconfigitem('experimental', 'nointerrupt-interactiveonly', default=True)
570 coreconfigitem('experimental', 'nointerrupt-interactiveonly', default=True)
568
571
569 coreconfigitem('experimental', 'obsmarkers-exchange-debug',
572 coreconfigitem('experimental', 'obsmarkers-exchange-debug',
570 default=False,
573 default=False,
571 )
574 )
572 coreconfigitem('experimental', 'remotenames',
575 coreconfigitem('experimental', 'remotenames',
573 default=False,
576 default=False,
574 )
577 )
575 coreconfigitem('experimental', 'removeemptydirs',
578 coreconfigitem('experimental', 'removeemptydirs',
576 default=True,
579 default=True,
577 )
580 )
578 coreconfigitem('experimental', 'revlogv2',
581 coreconfigitem('experimental', 'revlogv2',
579 default=None,
582 default=None,
580 )
583 )
581 coreconfigitem('experimental', 'single-head-per-branch',
584 coreconfigitem('experimental', 'single-head-per-branch',
582 default=False,
585 default=False,
583 )
586 )
584 coreconfigitem('experimental', 'sshserver.support-v2',
587 coreconfigitem('experimental', 'sshserver.support-v2',
585 default=False,
588 default=False,
586 )
589 )
587 coreconfigitem('experimental', 'spacemovesdown',
590 coreconfigitem('experimental', 'spacemovesdown',
588 default=False,
591 default=False,
589 )
592 )
590 coreconfigitem('experimental', 'sparse-read',
593 coreconfigitem('experimental', 'sparse-read',
591 default=False,
594 default=False,
592 )
595 )
593 coreconfigitem('experimental', 'sparse-read.density-threshold',
596 coreconfigitem('experimental', 'sparse-read.density-threshold',
594 default=0.25,
597 default=0.25,
595 )
598 )
596 coreconfigitem('experimental', 'sparse-read.min-gap-size',
599 coreconfigitem('experimental', 'sparse-read.min-gap-size',
597 default='256K',
600 default='256K',
598 )
601 )
599 coreconfigitem('experimental', 'treemanifest',
602 coreconfigitem('experimental', 'treemanifest',
600 default=False,
603 default=False,
601 )
604 )
602 coreconfigitem('experimental', 'update.atomic-file',
605 coreconfigitem('experimental', 'update.atomic-file',
603 default=False,
606 default=False,
604 )
607 )
605 coreconfigitem('experimental', 'sshpeer.advertise-v2',
608 coreconfigitem('experimental', 'sshpeer.advertise-v2',
606 default=False,
609 default=False,
607 )
610 )
608 coreconfigitem('experimental', 'web.apiserver',
611 coreconfigitem('experimental', 'web.apiserver',
609 default=False,
612 default=False,
610 )
613 )
611 coreconfigitem('experimental', 'web.api.http-v2',
614 coreconfigitem('experimental', 'web.api.http-v2',
612 default=False,
615 default=False,
613 )
616 )
614 coreconfigitem('experimental', 'web.api.debugreflect',
617 coreconfigitem('experimental', 'web.api.debugreflect',
615 default=False,
618 default=False,
616 )
619 )
617 coreconfigitem('experimental', 'xdiff',
620 coreconfigitem('experimental', 'xdiff',
618 default=False,
621 default=False,
619 )
622 )
620 coreconfigitem('extensions', '.*',
623 coreconfigitem('extensions', '.*',
621 default=None,
624 default=None,
622 generic=True,
625 generic=True,
623 )
626 )
624 coreconfigitem('extdata', '.*',
627 coreconfigitem('extdata', '.*',
625 default=None,
628 default=None,
626 generic=True,
629 generic=True,
627 )
630 )
628 coreconfigitem('format', 'aggressivemergedeltas',
631 coreconfigitem('format', 'aggressivemergedeltas',
629 default=False,
632 default=False,
630 )
633 )
631 coreconfigitem('format', 'chunkcachesize',
634 coreconfigitem('format', 'chunkcachesize',
632 default=None,
635 default=None,
633 )
636 )
634 coreconfigitem('format', 'dotencode',
637 coreconfigitem('format', 'dotencode',
635 default=True,
638 default=True,
636 )
639 )
637 coreconfigitem('format', 'generaldelta',
640 coreconfigitem('format', 'generaldelta',
638 default=False,
641 default=False,
639 )
642 )
640 coreconfigitem('format', 'manifestcachesize',
643 coreconfigitem('format', 'manifestcachesize',
641 default=None,
644 default=None,
642 )
645 )
643 coreconfigitem('format', 'maxchainlen',
646 coreconfigitem('format', 'maxchainlen',
644 default=None,
647 default=None,
645 )
648 )
646 coreconfigitem('format', 'obsstore-version',
649 coreconfigitem('format', 'obsstore-version',
647 default=None,
650 default=None,
648 )
651 )
649 coreconfigitem('format', 'usefncache',
652 coreconfigitem('format', 'usefncache',
650 default=True,
653 default=True,
651 )
654 )
652 coreconfigitem('format', 'usegeneraldelta',
655 coreconfigitem('format', 'usegeneraldelta',
653 default=True,
656 default=True,
654 )
657 )
655 coreconfigitem('format', 'usestore',
658 coreconfigitem('format', 'usestore',
656 default=True,
659 default=True,
657 )
660 )
658 coreconfigitem('fsmonitor', 'warn_when_unused',
661 coreconfigitem('fsmonitor', 'warn_when_unused',
659 default=True,
662 default=True,
660 )
663 )
661 coreconfigitem('fsmonitor', 'warn_update_file_count',
664 coreconfigitem('fsmonitor', 'warn_update_file_count',
662 default=50000,
665 default=50000,
663 )
666 )
664 coreconfigitem('hooks', '.*',
667 coreconfigitem('hooks', '.*',
665 default=dynamicdefault,
668 default=dynamicdefault,
666 generic=True,
669 generic=True,
667 )
670 )
668 coreconfigitem('hgweb-paths', '.*',
671 coreconfigitem('hgweb-paths', '.*',
669 default=list,
672 default=list,
670 generic=True,
673 generic=True,
671 )
674 )
672 coreconfigitem('hostfingerprints', '.*',
675 coreconfigitem('hostfingerprints', '.*',
673 default=list,
676 default=list,
674 generic=True,
677 generic=True,
675 )
678 )
676 coreconfigitem('hostsecurity', 'ciphers',
679 coreconfigitem('hostsecurity', 'ciphers',
677 default=None,
680 default=None,
678 )
681 )
679 coreconfigitem('hostsecurity', 'disabletls10warning',
682 coreconfigitem('hostsecurity', 'disabletls10warning',
680 default=False,
683 default=False,
681 )
684 )
682 coreconfigitem('hostsecurity', 'minimumprotocol',
685 coreconfigitem('hostsecurity', 'minimumprotocol',
683 default=dynamicdefault,
686 default=dynamicdefault,
684 )
687 )
685 coreconfigitem('hostsecurity', '.*:minimumprotocol$',
688 coreconfigitem('hostsecurity', '.*:minimumprotocol$',
686 default=dynamicdefault,
689 default=dynamicdefault,
687 generic=True,
690 generic=True,
688 )
691 )
689 coreconfigitem('hostsecurity', '.*:ciphers$',
692 coreconfigitem('hostsecurity', '.*:ciphers$',
690 default=dynamicdefault,
693 default=dynamicdefault,
691 generic=True,
694 generic=True,
692 )
695 )
693 coreconfigitem('hostsecurity', '.*:fingerprints$',
696 coreconfigitem('hostsecurity', '.*:fingerprints$',
694 default=list,
697 default=list,
695 generic=True,
698 generic=True,
696 )
699 )
697 coreconfigitem('hostsecurity', '.*:verifycertsfile$',
700 coreconfigitem('hostsecurity', '.*:verifycertsfile$',
698 default=None,
701 default=None,
699 generic=True,
702 generic=True,
700 )
703 )
701
704
702 coreconfigitem('http_proxy', 'always',
705 coreconfigitem('http_proxy', 'always',
703 default=False,
706 default=False,
704 )
707 )
705 coreconfigitem('http_proxy', 'host',
708 coreconfigitem('http_proxy', 'host',
706 default=None,
709 default=None,
707 )
710 )
708 coreconfigitem('http_proxy', 'no',
711 coreconfigitem('http_proxy', 'no',
709 default=list,
712 default=list,
710 )
713 )
711 coreconfigitem('http_proxy', 'passwd',
714 coreconfigitem('http_proxy', 'passwd',
712 default=None,
715 default=None,
713 )
716 )
714 coreconfigitem('http_proxy', 'user',
717 coreconfigitem('http_proxy', 'user',
715 default=None,
718 default=None,
716 )
719 )
717 coreconfigitem('logtoprocess', 'commandexception',
720 coreconfigitem('logtoprocess', 'commandexception',
718 default=None,
721 default=None,
719 )
722 )
720 coreconfigitem('logtoprocess', 'commandfinish',
723 coreconfigitem('logtoprocess', 'commandfinish',
721 default=None,
724 default=None,
722 )
725 )
723 coreconfigitem('logtoprocess', 'command',
726 coreconfigitem('logtoprocess', 'command',
724 default=None,
727 default=None,
725 )
728 )
726 coreconfigitem('logtoprocess', 'develwarn',
729 coreconfigitem('logtoprocess', 'develwarn',
727 default=None,
730 default=None,
728 )
731 )
729 coreconfigitem('logtoprocess', 'uiblocked',
732 coreconfigitem('logtoprocess', 'uiblocked',
730 default=None,
733 default=None,
731 )
734 )
732 coreconfigitem('merge', 'checkunknown',
735 coreconfigitem('merge', 'checkunknown',
733 default='abort',
736 default='abort',
734 )
737 )
735 coreconfigitem('merge', 'checkignored',
738 coreconfigitem('merge', 'checkignored',
736 default='abort',
739 default='abort',
737 )
740 )
738 coreconfigitem('experimental', 'merge.checkpathconflicts',
741 coreconfigitem('experimental', 'merge.checkpathconflicts',
739 default=False,
742 default=False,
740 )
743 )
741 coreconfigitem('merge', 'followcopies',
744 coreconfigitem('merge', 'followcopies',
742 default=True,
745 default=True,
743 )
746 )
744 coreconfigitem('merge', 'on-failure',
747 coreconfigitem('merge', 'on-failure',
745 default='continue',
748 default='continue',
746 )
749 )
747 coreconfigitem('merge', 'preferancestor',
750 coreconfigitem('merge', 'preferancestor',
748 default=lambda: ['*'],
751 default=lambda: ['*'],
749 )
752 )
750 coreconfigitem('merge-tools', '.*',
753 coreconfigitem('merge-tools', '.*',
751 default=None,
754 default=None,
752 generic=True,
755 generic=True,
753 )
756 )
754 coreconfigitem('merge-tools', br'.*\.args$',
757 coreconfigitem('merge-tools', br'.*\.args$',
755 default="$local $base $other",
758 default="$local $base $other",
756 generic=True,
759 generic=True,
757 priority=-1,
760 priority=-1,
758 )
761 )
759 coreconfigitem('merge-tools', br'.*\.binary$',
762 coreconfigitem('merge-tools', br'.*\.binary$',
760 default=False,
763 default=False,
761 generic=True,
764 generic=True,
762 priority=-1,
765 priority=-1,
763 )
766 )
764 coreconfigitem('merge-tools', br'.*\.check$',
767 coreconfigitem('merge-tools', br'.*\.check$',
765 default=list,
768 default=list,
766 generic=True,
769 generic=True,
767 priority=-1,
770 priority=-1,
768 )
771 )
769 coreconfigitem('merge-tools', br'.*\.checkchanged$',
772 coreconfigitem('merge-tools', br'.*\.checkchanged$',
770 default=False,
773 default=False,
771 generic=True,
774 generic=True,
772 priority=-1,
775 priority=-1,
773 )
776 )
774 coreconfigitem('merge-tools', br'.*\.executable$',
777 coreconfigitem('merge-tools', br'.*\.executable$',
775 default=dynamicdefault,
778 default=dynamicdefault,
776 generic=True,
779 generic=True,
777 priority=-1,
780 priority=-1,
778 )
781 )
779 coreconfigitem('merge-tools', br'.*\.fixeol$',
782 coreconfigitem('merge-tools', br'.*\.fixeol$',
780 default=False,
783 default=False,
781 generic=True,
784 generic=True,
782 priority=-1,
785 priority=-1,
783 )
786 )
784 coreconfigitem('merge-tools', br'.*\.gui$',
787 coreconfigitem('merge-tools', br'.*\.gui$',
785 default=False,
788 default=False,
786 generic=True,
789 generic=True,
787 priority=-1,
790 priority=-1,
788 )
791 )
789 coreconfigitem('merge-tools', br'.*\.mergemarkers$',
792 coreconfigitem('merge-tools', br'.*\.mergemarkers$',
790 default='basic',
793 default='basic',
791 generic=True,
794 generic=True,
792 priority=-1,
795 priority=-1,
793 )
796 )
794 coreconfigitem('merge-tools', br'.*\.mergemarkertemplate$',
797 coreconfigitem('merge-tools', br'.*\.mergemarkertemplate$',
795 default=dynamicdefault, # take from ui.mergemarkertemplate
798 default=dynamicdefault, # take from ui.mergemarkertemplate
796 generic=True,
799 generic=True,
797 priority=-1,
800 priority=-1,
798 )
801 )
799 coreconfigitem('merge-tools', br'.*\.priority$',
802 coreconfigitem('merge-tools', br'.*\.priority$',
800 default=0,
803 default=0,
801 generic=True,
804 generic=True,
802 priority=-1,
805 priority=-1,
803 )
806 )
804 coreconfigitem('merge-tools', br'.*\.premerge$',
807 coreconfigitem('merge-tools', br'.*\.premerge$',
805 default=dynamicdefault,
808 default=dynamicdefault,
806 generic=True,
809 generic=True,
807 priority=-1,
810 priority=-1,
808 )
811 )
809 coreconfigitem('merge-tools', br'.*\.symlink$',
812 coreconfigitem('merge-tools', br'.*\.symlink$',
810 default=False,
813 default=False,
811 generic=True,
814 generic=True,
812 priority=-1,
815 priority=-1,
813 )
816 )
814 coreconfigitem('pager', 'attend-.*',
817 coreconfigitem('pager', 'attend-.*',
815 default=dynamicdefault,
818 default=dynamicdefault,
816 generic=True,
819 generic=True,
817 )
820 )
818 coreconfigitem('pager', 'ignore',
821 coreconfigitem('pager', 'ignore',
819 default=list,
822 default=list,
820 )
823 )
821 coreconfigitem('pager', 'pager',
824 coreconfigitem('pager', 'pager',
822 default=dynamicdefault,
825 default=dynamicdefault,
823 )
826 )
824 coreconfigitem('patch', 'eol',
827 coreconfigitem('patch', 'eol',
825 default='strict',
828 default='strict',
826 )
829 )
827 coreconfigitem('patch', 'fuzz',
830 coreconfigitem('patch', 'fuzz',
828 default=2,
831 default=2,
829 )
832 )
830 coreconfigitem('paths', 'default',
833 coreconfigitem('paths', 'default',
831 default=None,
834 default=None,
832 )
835 )
833 coreconfigitem('paths', 'default-push',
836 coreconfigitem('paths', 'default-push',
834 default=None,
837 default=None,
835 )
838 )
836 coreconfigitem('paths', '.*',
839 coreconfigitem('paths', '.*',
837 default=None,
840 default=None,
838 generic=True,
841 generic=True,
839 )
842 )
840 coreconfigitem('phases', 'checksubrepos',
843 coreconfigitem('phases', 'checksubrepos',
841 default='follow',
844 default='follow',
842 )
845 )
843 coreconfigitem('phases', 'new-commit',
846 coreconfigitem('phases', 'new-commit',
844 default='draft',
847 default='draft',
845 )
848 )
846 coreconfigitem('phases', 'publish',
849 coreconfigitem('phases', 'publish',
847 default=True,
850 default=True,
848 )
851 )
849 coreconfigitem('profiling', 'enabled',
852 coreconfigitem('profiling', 'enabled',
850 default=False,
853 default=False,
851 )
854 )
852 coreconfigitem('profiling', 'format',
855 coreconfigitem('profiling', 'format',
853 default='text',
856 default='text',
854 )
857 )
855 coreconfigitem('profiling', 'freq',
858 coreconfigitem('profiling', 'freq',
856 default=1000,
859 default=1000,
857 )
860 )
858 coreconfigitem('profiling', 'limit',
861 coreconfigitem('profiling', 'limit',
859 default=30,
862 default=30,
860 )
863 )
861 coreconfigitem('profiling', 'nested',
864 coreconfigitem('profiling', 'nested',
862 default=0,
865 default=0,
863 )
866 )
864 coreconfigitem('profiling', 'output',
867 coreconfigitem('profiling', 'output',
865 default=None,
868 default=None,
866 )
869 )
867 coreconfigitem('profiling', 'showmax',
870 coreconfigitem('profiling', 'showmax',
868 default=0.999,
871 default=0.999,
869 )
872 )
870 coreconfigitem('profiling', 'showmin',
873 coreconfigitem('profiling', 'showmin',
871 default=dynamicdefault,
874 default=dynamicdefault,
872 )
875 )
873 coreconfigitem('profiling', 'sort',
876 coreconfigitem('profiling', 'sort',
874 default='inlinetime',
877 default='inlinetime',
875 )
878 )
876 coreconfigitem('profiling', 'statformat',
879 coreconfigitem('profiling', 'statformat',
877 default='hotpath',
880 default='hotpath',
878 )
881 )
879 coreconfigitem('profiling', 'time-track',
882 coreconfigitem('profiling', 'time-track',
880 default='cpu',
883 default='cpu',
881 )
884 )
882 coreconfigitem('profiling', 'type',
885 coreconfigitem('profiling', 'type',
883 default='stat',
886 default='stat',
884 )
887 )
885 coreconfigitem('progress', 'assume-tty',
888 coreconfigitem('progress', 'assume-tty',
886 default=False,
889 default=False,
887 )
890 )
888 coreconfigitem('progress', 'changedelay',
891 coreconfigitem('progress', 'changedelay',
889 default=1,
892 default=1,
890 )
893 )
891 coreconfigitem('progress', 'clear-complete',
894 coreconfigitem('progress', 'clear-complete',
892 default=True,
895 default=True,
893 )
896 )
894 coreconfigitem('progress', 'debug',
897 coreconfigitem('progress', 'debug',
895 default=False,
898 default=False,
896 )
899 )
897 coreconfigitem('progress', 'delay',
900 coreconfigitem('progress', 'delay',
898 default=3,
901 default=3,
899 )
902 )
900 coreconfigitem('progress', 'disable',
903 coreconfigitem('progress', 'disable',
901 default=False,
904 default=False,
902 )
905 )
903 coreconfigitem('progress', 'estimateinterval',
906 coreconfigitem('progress', 'estimateinterval',
904 default=60.0,
907 default=60.0,
905 )
908 )
906 coreconfigitem('progress', 'format',
909 coreconfigitem('progress', 'format',
907 default=lambda: ['topic', 'bar', 'number', 'estimate'],
910 default=lambda: ['topic', 'bar', 'number', 'estimate'],
908 )
911 )
909 coreconfigitem('progress', 'refresh',
912 coreconfigitem('progress', 'refresh',
910 default=0.1,
913 default=0.1,
911 )
914 )
912 coreconfigitem('progress', 'width',
915 coreconfigitem('progress', 'width',
913 default=dynamicdefault,
916 default=dynamicdefault,
914 )
917 )
915 coreconfigitem('push', 'pushvars.server',
918 coreconfigitem('push', 'pushvars.server',
916 default=False,
919 default=False,
917 )
920 )
918 coreconfigitem('server', 'bookmarks-pushkey-compat',
921 coreconfigitem('server', 'bookmarks-pushkey-compat',
919 default=True,
922 default=True,
920 )
923 )
921 coreconfigitem('server', 'bundle1',
924 coreconfigitem('server', 'bundle1',
922 default=True,
925 default=True,
923 )
926 )
924 coreconfigitem('server', 'bundle1gd',
927 coreconfigitem('server', 'bundle1gd',
925 default=None,
928 default=None,
926 )
929 )
927 coreconfigitem('server', 'bundle1.pull',
930 coreconfigitem('server', 'bundle1.pull',
928 default=None,
931 default=None,
929 )
932 )
930 coreconfigitem('server', 'bundle1gd.pull',
933 coreconfigitem('server', 'bundle1gd.pull',
931 default=None,
934 default=None,
932 )
935 )
933 coreconfigitem('server', 'bundle1.push',
936 coreconfigitem('server', 'bundle1.push',
934 default=None,
937 default=None,
935 )
938 )
936 coreconfigitem('server', 'bundle1gd.push',
939 coreconfigitem('server', 'bundle1gd.push',
937 default=None,
940 default=None,
938 )
941 )
939 coreconfigitem('server', 'compressionengines',
942 coreconfigitem('server', 'compressionengines',
940 default=list,
943 default=list,
941 )
944 )
942 coreconfigitem('server', 'concurrent-push-mode',
945 coreconfigitem('server', 'concurrent-push-mode',
943 default='strict',
946 default='strict',
944 )
947 )
945 coreconfigitem('server', 'disablefullbundle',
948 coreconfigitem('server', 'disablefullbundle',
946 default=False,
949 default=False,
947 )
950 )
948 coreconfigitem('server', 'maxhttpheaderlen',
951 coreconfigitem('server', 'maxhttpheaderlen',
949 default=1024,
952 default=1024,
950 )
953 )
951 coreconfigitem('server', 'pullbundle',
954 coreconfigitem('server', 'pullbundle',
952 default=False,
955 default=False,
953 )
956 )
954 coreconfigitem('server', 'preferuncompressed',
957 coreconfigitem('server', 'preferuncompressed',
955 default=False,
958 default=False,
956 )
959 )
957 coreconfigitem('server', 'streamunbundle',
960 coreconfigitem('server', 'streamunbundle',
958 default=False,
961 default=False,
959 )
962 )
960 coreconfigitem('server', 'uncompressed',
963 coreconfigitem('server', 'uncompressed',
961 default=True,
964 default=True,
962 )
965 )
963 coreconfigitem('server', 'uncompressedallowsecret',
966 coreconfigitem('server', 'uncompressedallowsecret',
964 default=False,
967 default=False,
965 )
968 )
966 coreconfigitem('server', 'validate',
969 coreconfigitem('server', 'validate',
967 default=False,
970 default=False,
968 )
971 )
969 coreconfigitem('server', 'zliblevel',
972 coreconfigitem('server', 'zliblevel',
970 default=-1,
973 default=-1,
971 )
974 )
972 coreconfigitem('server', 'zstdlevel',
975 coreconfigitem('server', 'zstdlevel',
973 default=3,
976 default=3,
974 )
977 )
975 coreconfigitem('share', 'pool',
978 coreconfigitem('share', 'pool',
976 default=None,
979 default=None,
977 )
980 )
978 coreconfigitem('share', 'poolnaming',
981 coreconfigitem('share', 'poolnaming',
979 default='identity',
982 default='identity',
980 )
983 )
981 coreconfigitem('smtp', 'host',
984 coreconfigitem('smtp', 'host',
982 default=None,
985 default=None,
983 )
986 )
984 coreconfigitem('smtp', 'local_hostname',
987 coreconfigitem('smtp', 'local_hostname',
985 default=None,
988 default=None,
986 )
989 )
987 coreconfigitem('smtp', 'password',
990 coreconfigitem('smtp', 'password',
988 default=None,
991 default=None,
989 )
992 )
990 coreconfigitem('smtp', 'port',
993 coreconfigitem('smtp', 'port',
991 default=dynamicdefault,
994 default=dynamicdefault,
992 )
995 )
993 coreconfigitem('smtp', 'tls',
996 coreconfigitem('smtp', 'tls',
994 default='none',
997 default='none',
995 )
998 )
996 coreconfigitem('smtp', 'username',
999 coreconfigitem('smtp', 'username',
997 default=None,
1000 default=None,
998 )
1001 )
999 coreconfigitem('sparse', 'missingwarning',
1002 coreconfigitem('sparse', 'missingwarning',
1000 default=True,
1003 default=True,
1001 )
1004 )
1002 coreconfigitem('subrepos', 'allowed',
1005 coreconfigitem('subrepos', 'allowed',
1003 default=dynamicdefault, # to make backporting simpler
1006 default=dynamicdefault, # to make backporting simpler
1004 )
1007 )
1005 coreconfigitem('subrepos', 'hg:allowed',
1008 coreconfigitem('subrepos', 'hg:allowed',
1006 default=dynamicdefault,
1009 default=dynamicdefault,
1007 )
1010 )
1008 coreconfigitem('subrepos', 'git:allowed',
1011 coreconfigitem('subrepos', 'git:allowed',
1009 default=dynamicdefault,
1012 default=dynamicdefault,
1010 )
1013 )
1011 coreconfigitem('subrepos', 'svn:allowed',
1014 coreconfigitem('subrepos', 'svn:allowed',
1012 default=dynamicdefault,
1015 default=dynamicdefault,
1013 )
1016 )
1014 coreconfigitem('templates', '.*',
1017 coreconfigitem('templates', '.*',
1015 default=None,
1018 default=None,
1016 generic=True,
1019 generic=True,
1017 )
1020 )
1018 coreconfigitem('trusted', 'groups',
1021 coreconfigitem('trusted', 'groups',
1019 default=list,
1022 default=list,
1020 )
1023 )
1021 coreconfigitem('trusted', 'users',
1024 coreconfigitem('trusted', 'users',
1022 default=list,
1025 default=list,
1023 )
1026 )
1024 coreconfigitem('ui', '_usedassubrepo',
1027 coreconfigitem('ui', '_usedassubrepo',
1025 default=False,
1028 default=False,
1026 )
1029 )
1027 coreconfigitem('ui', 'allowemptycommit',
1030 coreconfigitem('ui', 'allowemptycommit',
1028 default=False,
1031 default=False,
1029 )
1032 )
1030 coreconfigitem('ui', 'archivemeta',
1033 coreconfigitem('ui', 'archivemeta',
1031 default=True,
1034 default=True,
1032 )
1035 )
1033 coreconfigitem('ui', 'askusername',
1036 coreconfigitem('ui', 'askusername',
1034 default=False,
1037 default=False,
1035 )
1038 )
1036 coreconfigitem('ui', 'clonebundlefallback',
1039 coreconfigitem('ui', 'clonebundlefallback',
1037 default=False,
1040 default=False,
1038 )
1041 )
1039 coreconfigitem('ui', 'clonebundleprefers',
1042 coreconfigitem('ui', 'clonebundleprefers',
1040 default=list,
1043 default=list,
1041 )
1044 )
1042 coreconfigitem('ui', 'clonebundles',
1045 coreconfigitem('ui', 'clonebundles',
1043 default=True,
1046 default=True,
1044 )
1047 )
1045 coreconfigitem('ui', 'color',
1048 coreconfigitem('ui', 'color',
1046 default='auto',
1049 default='auto',
1047 )
1050 )
1048 coreconfigitem('ui', 'commitsubrepos',
1051 coreconfigitem('ui', 'commitsubrepos',
1049 default=False,
1052 default=False,
1050 )
1053 )
1051 coreconfigitem('ui', 'debug',
1054 coreconfigitem('ui', 'debug',
1052 default=False,
1055 default=False,
1053 )
1056 )
1054 coreconfigitem('ui', 'debugger',
1057 coreconfigitem('ui', 'debugger',
1055 default=None,
1058 default=None,
1056 )
1059 )
1057 coreconfigitem('ui', 'editor',
1060 coreconfigitem('ui', 'editor',
1058 default=dynamicdefault,
1061 default=dynamicdefault,
1059 )
1062 )
1060 coreconfigitem('ui', 'fallbackencoding',
1063 coreconfigitem('ui', 'fallbackencoding',
1061 default=None,
1064 default=None,
1062 )
1065 )
1063 coreconfigitem('ui', 'forcecwd',
1066 coreconfigitem('ui', 'forcecwd',
1064 default=None,
1067 default=None,
1065 )
1068 )
1066 coreconfigitem('ui', 'forcemerge',
1069 coreconfigitem('ui', 'forcemerge',
1067 default=None,
1070 default=None,
1068 )
1071 )
1069 coreconfigitem('ui', 'formatdebug',
1072 coreconfigitem('ui', 'formatdebug',
1070 default=False,
1073 default=False,
1071 )
1074 )
1072 coreconfigitem('ui', 'formatjson',
1075 coreconfigitem('ui', 'formatjson',
1073 default=False,
1076 default=False,
1074 )
1077 )
1075 coreconfigitem('ui', 'formatted',
1078 coreconfigitem('ui', 'formatted',
1076 default=None,
1079 default=None,
1077 )
1080 )
1078 coreconfigitem('ui', 'graphnodetemplate',
1081 coreconfigitem('ui', 'graphnodetemplate',
1079 default=None,
1082 default=None,
1080 )
1083 )
1081 coreconfigitem('ui', 'interactive',
1084 coreconfigitem('ui', 'interactive',
1082 default=None,
1085 default=None,
1083 )
1086 )
1084 coreconfigitem('ui', 'interface',
1087 coreconfigitem('ui', 'interface',
1085 default=None,
1088 default=None,
1086 )
1089 )
1087 coreconfigitem('ui', 'interface.chunkselector',
1090 coreconfigitem('ui', 'interface.chunkselector',
1088 default=None,
1091 default=None,
1089 )
1092 )
1090 coreconfigitem('ui', 'logblockedtimes',
1093 coreconfigitem('ui', 'logblockedtimes',
1091 default=False,
1094 default=False,
1092 )
1095 )
1093 coreconfigitem('ui', 'logtemplate',
1096 coreconfigitem('ui', 'logtemplate',
1094 default=None,
1097 default=None,
1095 )
1098 )
1096 coreconfigitem('ui', 'merge',
1099 coreconfigitem('ui', 'merge',
1097 default=None,
1100 default=None,
1098 )
1101 )
1099 coreconfigitem('ui', 'mergemarkers',
1102 coreconfigitem('ui', 'mergemarkers',
1100 default='basic',
1103 default='basic',
1101 )
1104 )
1102 coreconfigitem('ui', 'mergemarkertemplate',
1105 coreconfigitem('ui', 'mergemarkertemplate',
1103 default=('{node|short} '
1106 default=('{node|short} '
1104 '{ifeq(tags, "tip", "", '
1107 '{ifeq(tags, "tip", "", '
1105 'ifeq(tags, "", "", "{tags} "))}'
1108 'ifeq(tags, "", "", "{tags} "))}'
1106 '{if(bookmarks, "{bookmarks} ")}'
1109 '{if(bookmarks, "{bookmarks} ")}'
1107 '{ifeq(branch, "default", "", "{branch} ")}'
1110 '{ifeq(branch, "default", "", "{branch} ")}'
1108 '- {author|user}: {desc|firstline}')
1111 '- {author|user}: {desc|firstline}')
1109 )
1112 )
1110 coreconfigitem('ui', 'nontty',
1113 coreconfigitem('ui', 'nontty',
1111 default=False,
1114 default=False,
1112 )
1115 )
1113 coreconfigitem('ui', 'origbackuppath',
1116 coreconfigitem('ui', 'origbackuppath',
1114 default=None,
1117 default=None,
1115 )
1118 )
1116 coreconfigitem('ui', 'paginate',
1119 coreconfigitem('ui', 'paginate',
1117 default=True,
1120 default=True,
1118 )
1121 )
1119 coreconfigitem('ui', 'patch',
1122 coreconfigitem('ui', 'patch',
1120 default=None,
1123 default=None,
1121 )
1124 )
1122 coreconfigitem('ui', 'portablefilenames',
1125 coreconfigitem('ui', 'portablefilenames',
1123 default='warn',
1126 default='warn',
1124 )
1127 )
1125 coreconfigitem('ui', 'promptecho',
1128 coreconfigitem('ui', 'promptecho',
1126 default=False,
1129 default=False,
1127 )
1130 )
1128 coreconfigitem('ui', 'quiet',
1131 coreconfigitem('ui', 'quiet',
1129 default=False,
1132 default=False,
1130 )
1133 )
1131 coreconfigitem('ui', 'quietbookmarkmove',
1134 coreconfigitem('ui', 'quietbookmarkmove',
1132 default=False,
1135 default=False,
1133 )
1136 )
1134 coreconfigitem('ui', 'remotecmd',
1137 coreconfigitem('ui', 'remotecmd',
1135 default='hg',
1138 default='hg',
1136 )
1139 )
1137 coreconfigitem('ui', 'report_untrusted',
1140 coreconfigitem('ui', 'report_untrusted',
1138 default=True,
1141 default=True,
1139 )
1142 )
1140 coreconfigitem('ui', 'rollback',
1143 coreconfigitem('ui', 'rollback',
1141 default=True,
1144 default=True,
1142 )
1145 )
1143 coreconfigitem('ui', 'signal-safe-lock',
1146 coreconfigitem('ui', 'signal-safe-lock',
1144 default=True,
1147 default=True,
1145 )
1148 )
1146 coreconfigitem('ui', 'slash',
1149 coreconfigitem('ui', 'slash',
1147 default=False,
1150 default=False,
1148 )
1151 )
1149 coreconfigitem('ui', 'ssh',
1152 coreconfigitem('ui', 'ssh',
1150 default='ssh',
1153 default='ssh',
1151 )
1154 )
1152 coreconfigitem('ui', 'ssherrorhint',
1155 coreconfigitem('ui', 'ssherrorhint',
1153 default=None,
1156 default=None,
1154 )
1157 )
1155 coreconfigitem('ui', 'statuscopies',
1158 coreconfigitem('ui', 'statuscopies',
1156 default=False,
1159 default=False,
1157 )
1160 )
1158 coreconfigitem('ui', 'strict',
1161 coreconfigitem('ui', 'strict',
1159 default=False,
1162 default=False,
1160 )
1163 )
1161 coreconfigitem('ui', 'style',
1164 coreconfigitem('ui', 'style',
1162 default='',
1165 default='',
1163 )
1166 )
1164 coreconfigitem('ui', 'supportcontact',
1167 coreconfigitem('ui', 'supportcontact',
1165 default=None,
1168 default=None,
1166 )
1169 )
1167 coreconfigitem('ui', 'textwidth',
1170 coreconfigitem('ui', 'textwidth',
1168 default=78,
1171 default=78,
1169 )
1172 )
1170 coreconfigitem('ui', 'timeout',
1173 coreconfigitem('ui', 'timeout',
1171 default='600',
1174 default='600',
1172 )
1175 )
1173 coreconfigitem('ui', 'timeout.warn',
1176 coreconfigitem('ui', 'timeout.warn',
1174 default=0,
1177 default=0,
1175 )
1178 )
1176 coreconfigitem('ui', 'traceback',
1179 coreconfigitem('ui', 'traceback',
1177 default=False,
1180 default=False,
1178 )
1181 )
1179 coreconfigitem('ui', 'tweakdefaults',
1182 coreconfigitem('ui', 'tweakdefaults',
1180 default=False,
1183 default=False,
1181 )
1184 )
1182 coreconfigitem('ui', 'username',
1185 coreconfigitem('ui', 'username',
1183 alias=[('ui', 'user')]
1186 alias=[('ui', 'user')]
1184 )
1187 )
1185 coreconfigitem('ui', 'verbose',
1188 coreconfigitem('ui', 'verbose',
1186 default=False,
1189 default=False,
1187 )
1190 )
1188 coreconfigitem('verify', 'skipflags',
1191 coreconfigitem('verify', 'skipflags',
1189 default=None,
1192 default=None,
1190 )
1193 )
1191 coreconfigitem('web', 'allowbz2',
1194 coreconfigitem('web', 'allowbz2',
1192 default=False,
1195 default=False,
1193 )
1196 )
1194 coreconfigitem('web', 'allowgz',
1197 coreconfigitem('web', 'allowgz',
1195 default=False,
1198 default=False,
1196 )
1199 )
1197 coreconfigitem('web', 'allow-pull',
1200 coreconfigitem('web', 'allow-pull',
1198 alias=[('web', 'allowpull')],
1201 alias=[('web', 'allowpull')],
1199 default=True,
1202 default=True,
1200 )
1203 )
1201 coreconfigitem('web', 'allow-push',
1204 coreconfigitem('web', 'allow-push',
1202 alias=[('web', 'allow_push')],
1205 alias=[('web', 'allow_push')],
1203 default=list,
1206 default=list,
1204 )
1207 )
1205 coreconfigitem('web', 'allowzip',
1208 coreconfigitem('web', 'allowzip',
1206 default=False,
1209 default=False,
1207 )
1210 )
1208 coreconfigitem('web', 'archivesubrepos',
1211 coreconfigitem('web', 'archivesubrepos',
1209 default=False,
1212 default=False,
1210 )
1213 )
1211 coreconfigitem('web', 'cache',
1214 coreconfigitem('web', 'cache',
1212 default=True,
1215 default=True,
1213 )
1216 )
1214 coreconfigitem('web', 'contact',
1217 coreconfigitem('web', 'contact',
1215 default=None,
1218 default=None,
1216 )
1219 )
1217 coreconfigitem('web', 'deny_push',
1220 coreconfigitem('web', 'deny_push',
1218 default=list,
1221 default=list,
1219 )
1222 )
1220 coreconfigitem('web', 'guessmime',
1223 coreconfigitem('web', 'guessmime',
1221 default=False,
1224 default=False,
1222 )
1225 )
1223 coreconfigitem('web', 'hidden',
1226 coreconfigitem('web', 'hidden',
1224 default=False,
1227 default=False,
1225 )
1228 )
1226 coreconfigitem('web', 'labels',
1229 coreconfigitem('web', 'labels',
1227 default=list,
1230 default=list,
1228 )
1231 )
1229 coreconfigitem('web', 'logoimg',
1232 coreconfigitem('web', 'logoimg',
1230 default='hglogo.png',
1233 default='hglogo.png',
1231 )
1234 )
1232 coreconfigitem('web', 'logourl',
1235 coreconfigitem('web', 'logourl',
1233 default='https://mercurial-scm.org/',
1236 default='https://mercurial-scm.org/',
1234 )
1237 )
1235 coreconfigitem('web', 'accesslog',
1238 coreconfigitem('web', 'accesslog',
1236 default='-',
1239 default='-',
1237 )
1240 )
1238 coreconfigitem('web', 'address',
1241 coreconfigitem('web', 'address',
1239 default='',
1242 default='',
1240 )
1243 )
1241 coreconfigitem('web', 'allow-archive',
1244 coreconfigitem('web', 'allow-archive',
1242 alias=[('web', 'allow_archive')],
1245 alias=[('web', 'allow_archive')],
1243 default=list,
1246 default=list,
1244 )
1247 )
1245 coreconfigitem('web', 'allow_read',
1248 coreconfigitem('web', 'allow_read',
1246 default=list,
1249 default=list,
1247 )
1250 )
1248 coreconfigitem('web', 'baseurl',
1251 coreconfigitem('web', 'baseurl',
1249 default=None,
1252 default=None,
1250 )
1253 )
1251 coreconfigitem('web', 'cacerts',
1254 coreconfigitem('web', 'cacerts',
1252 default=None,
1255 default=None,
1253 )
1256 )
1254 coreconfigitem('web', 'certificate',
1257 coreconfigitem('web', 'certificate',
1255 default=None,
1258 default=None,
1256 )
1259 )
1257 coreconfigitem('web', 'collapse',
1260 coreconfigitem('web', 'collapse',
1258 default=False,
1261 default=False,
1259 )
1262 )
1260 coreconfigitem('web', 'csp',
1263 coreconfigitem('web', 'csp',
1261 default=None,
1264 default=None,
1262 )
1265 )
1263 coreconfigitem('web', 'deny_read',
1266 coreconfigitem('web', 'deny_read',
1264 default=list,
1267 default=list,
1265 )
1268 )
1266 coreconfigitem('web', 'descend',
1269 coreconfigitem('web', 'descend',
1267 default=True,
1270 default=True,
1268 )
1271 )
1269 coreconfigitem('web', 'description',
1272 coreconfigitem('web', 'description',
1270 default="",
1273 default="",
1271 )
1274 )
1272 coreconfigitem('web', 'encoding',
1275 coreconfigitem('web', 'encoding',
1273 default=lambda: encoding.encoding,
1276 default=lambda: encoding.encoding,
1274 )
1277 )
1275 coreconfigitem('web', 'errorlog',
1278 coreconfigitem('web', 'errorlog',
1276 default='-',
1279 default='-',
1277 )
1280 )
1278 coreconfigitem('web', 'ipv6',
1281 coreconfigitem('web', 'ipv6',
1279 default=False,
1282 default=False,
1280 )
1283 )
1281 coreconfigitem('web', 'maxchanges',
1284 coreconfigitem('web', 'maxchanges',
1282 default=10,
1285 default=10,
1283 )
1286 )
1284 coreconfigitem('web', 'maxfiles',
1287 coreconfigitem('web', 'maxfiles',
1285 default=10,
1288 default=10,
1286 )
1289 )
1287 coreconfigitem('web', 'maxshortchanges',
1290 coreconfigitem('web', 'maxshortchanges',
1288 default=60,
1291 default=60,
1289 )
1292 )
1290 coreconfigitem('web', 'motd',
1293 coreconfigitem('web', 'motd',
1291 default='',
1294 default='',
1292 )
1295 )
1293 coreconfigitem('web', 'name',
1296 coreconfigitem('web', 'name',
1294 default=dynamicdefault,
1297 default=dynamicdefault,
1295 )
1298 )
1296 coreconfigitem('web', 'port',
1299 coreconfigitem('web', 'port',
1297 default=8000,
1300 default=8000,
1298 )
1301 )
1299 coreconfigitem('web', 'prefix',
1302 coreconfigitem('web', 'prefix',
1300 default='',
1303 default='',
1301 )
1304 )
1302 coreconfigitem('web', 'push_ssl',
1305 coreconfigitem('web', 'push_ssl',
1303 default=True,
1306 default=True,
1304 )
1307 )
1305 coreconfigitem('web', 'refreshinterval',
1308 coreconfigitem('web', 'refreshinterval',
1306 default=20,
1309 default=20,
1307 )
1310 )
1308 coreconfigitem('web', 'server-header',
1311 coreconfigitem('web', 'server-header',
1309 default=None,
1312 default=None,
1310 )
1313 )
1311 coreconfigitem('web', 'staticurl',
1314 coreconfigitem('web', 'staticurl',
1312 default=None,
1315 default=None,
1313 )
1316 )
1314 coreconfigitem('web', 'stripes',
1317 coreconfigitem('web', 'stripes',
1315 default=1,
1318 default=1,
1316 )
1319 )
1317 coreconfigitem('web', 'style',
1320 coreconfigitem('web', 'style',
1318 default='paper',
1321 default='paper',
1319 )
1322 )
1320 coreconfigitem('web', 'templates',
1323 coreconfigitem('web', 'templates',
1321 default=None,
1324 default=None,
1322 )
1325 )
1323 coreconfigitem('web', 'view',
1326 coreconfigitem('web', 'view',
1324 default='served',
1327 default='served',
1325 )
1328 )
1326 coreconfigitem('worker', 'backgroundclose',
1329 coreconfigitem('worker', 'backgroundclose',
1327 default=dynamicdefault,
1330 default=dynamicdefault,
1328 )
1331 )
1329 # Windows defaults to a limit of 512 open files. A buffer of 128
1332 # Windows defaults to a limit of 512 open files. A buffer of 128
1330 # should give us enough headway.
1333 # should give us enough headway.
1331 coreconfigitem('worker', 'backgroundclosemaxqueue',
1334 coreconfigitem('worker', 'backgroundclosemaxqueue',
1332 default=384,
1335 default=384,
1333 )
1336 )
1334 coreconfigitem('worker', 'backgroundcloseminfilecount',
1337 coreconfigitem('worker', 'backgroundcloseminfilecount',
1335 default=2048,
1338 default=2048,
1336 )
1339 )
1337 coreconfigitem('worker', 'backgroundclosethreadcount',
1340 coreconfigitem('worker', 'backgroundclosethreadcount',
1338 default=4,
1341 default=4,
1339 )
1342 )
1340 coreconfigitem('worker', 'enabled',
1343 coreconfigitem('worker', 'enabled',
1341 default=True,
1344 default=True,
1342 )
1345 )
1343 coreconfigitem('worker', 'numcpus',
1346 coreconfigitem('worker', 'numcpus',
1344 default=None,
1347 default=None,
1345 )
1348 )
1346
1349
1347 # Rebase related configuration moved to core because other extension are doing
1350 # Rebase related configuration moved to core because other extension are doing
1348 # strange things. For example, shelve import the extensions to reuse some bit
1351 # strange things. For example, shelve import the extensions to reuse some bit
1349 # without formally loading it.
1352 # without formally loading it.
1350 coreconfigitem('commands', 'rebase.requiredest',
1353 coreconfigitem('commands', 'rebase.requiredest',
1351 default=False,
1354 default=False,
1352 )
1355 )
1353 coreconfigitem('experimental', 'rebaseskipobsolete',
1356 coreconfigitem('experimental', 'rebaseskipobsolete',
1354 default=True,
1357 default=True,
1355 )
1358 )
1356 coreconfigitem('rebase', 'singletransaction',
1359 coreconfigitem('rebase', 'singletransaction',
1357 default=False,
1360 default=False,
1358 )
1361 )
1359 coreconfigitem('rebase', 'experimental.inmemory',
1362 coreconfigitem('rebase', 'experimental.inmemory',
1360 default=False,
1363 default=False,
1361 )
1364 )
@@ -1,105 +1,105
1 # diffutil.py - utility functions related to diff and patch
1 # diffutil.py - utility functions related to diff and patch
2 #
2 #
3 # Copyright 2006 Brendan Cully <brendan@kublai.com>
3 # Copyright 2006 Brendan Cully <brendan@kublai.com>
4 # Copyright 2007 Chris Mason <chris.mason@oracle.com>
4 # Copyright 2007 Chris Mason <chris.mason@oracle.com>
5 # Copyright 2018 Octobus <octobus@octobus.net>
5 # Copyright 2018 Octobus <octobus@octobus.net>
6 #
6 #
7 # This software may be used and distributed according to the terms of the
7 # This software may be used and distributed according to the terms of the
8 # GNU General Public License version 2 or any later version.
8 # GNU General Public License version 2 or any later version.
9
9
10 from __future__ import absolute_import
10 from __future__ import absolute_import
11
11
12 from .i18n import _
12 from .i18n import _
13
13
14 from . import (
14 from . import (
15 mdiff,
15 mdiff,
16 pycompat,
16 pycompat,
17 )
17 )
18
18
19 def diffallopts(ui, opts=None, untrusted=False, section='diff'):
19 def diffallopts(ui, opts=None, untrusted=False, section='diff'):
20 '''return diffopts with all features supported and parsed'''
20 '''return diffopts with all features supported and parsed'''
21 return difffeatureopts(ui, opts=opts, untrusted=untrusted, section=section,
21 return difffeatureopts(ui, opts=opts, untrusted=untrusted, section=section,
22 git=True, whitespace=True, formatchanging=True)
22 git=True, whitespace=True, formatchanging=True)
23
23
24 def difffeatureopts(ui, opts=None, untrusted=False, section='diff', git=False,
24 def difffeatureopts(ui, opts=None, untrusted=False, section='diff', git=False,
25 whitespace=False, formatchanging=False):
25 whitespace=False, formatchanging=False):
26 '''return diffopts with only opted-in features parsed
26 '''return diffopts with only opted-in features parsed
27
27
28 Features:
28 Features:
29 - git: git-style diffs
29 - git: git-style diffs
30 - whitespace: whitespace options like ignoreblanklines and ignorews
30 - whitespace: whitespace options like ignoreblanklines and ignorews
31 - formatchanging: options that will likely break or cause correctness issues
31 - formatchanging: options that will likely break or cause correctness issues
32 with most diff parsers
32 with most diff parsers
33 '''
33 '''
34 def get(key, name=None, getter=ui.configbool, forceplain=None):
34 def get(key, name=None, getter=ui.configbool, forceplain=None):
35 if opts:
35 if opts:
36 v = opts.get(key)
36 v = opts.get(key)
37 # diffopts flags are either None-default (which is passed
37 # diffopts flags are either None-default (which is passed
38 # through unchanged, so we can identify unset values), or
38 # through unchanged, so we can identify unset values), or
39 # some other falsey default (eg --unified, which defaults
39 # some other falsey default (eg --unified, which defaults
40 # to an empty string). We only want to override the config
40 # to an empty string). We only want to override the config
41 # entries from hgrc with command line values if they
41 # entries from hgrc with command line values if they
42 # appear to have been set, which is any truthy value,
42 # appear to have been set, which is any truthy value,
43 # True, or False.
43 # True, or False.
44 if v or isinstance(v, bool):
44 if v or isinstance(v, bool):
45 return v
45 return v
46 if forceplain is not None and ui.plain():
46 if forceplain is not None and ui.plain():
47 return forceplain
47 return forceplain
48 return getter(section, name or key, untrusted=untrusted)
48 return getter(section, name or key, untrusted=untrusted)
49
49
50 # core options, expected to be understood by every diff parser
50 # core options, expected to be understood by every diff parser
51 buildopts = {
51 buildopts = {
52 'nodates': get('nodates'),
52 'nodates': get('nodates'),
53 'showfunc': get('show_function', 'showfunc'),
53 'showfunc': get('show_function', 'showfunc'),
54 'context': get('unified', getter=ui.config),
54 'context': get('unified', getter=ui.config),
55 }
55 }
56 buildopts['worddiff'] = ui.configbool('experimental', 'worddiff')
57 buildopts['xdiff'] = ui.configbool('experimental', 'xdiff')
56 buildopts['xdiff'] = ui.configbool('experimental', 'xdiff')
58
57
59 if git:
58 if git:
60 buildopts['git'] = get('git')
59 buildopts['git'] = get('git')
61
60
62 # since this is in the experimental section, we need to call
61 # since this is in the experimental section, we need to call
63 # ui.configbool directory
62 # ui.configbool directory
64 buildopts['showsimilarity'] = ui.configbool('experimental',
63 buildopts['showsimilarity'] = ui.configbool('experimental',
65 'extendedheader.similarity')
64 'extendedheader.similarity')
66
65
67 # need to inspect the ui object instead of using get() since we want to
66 # need to inspect the ui object instead of using get() since we want to
68 # test for an int
67 # test for an int
69 hconf = ui.config('experimental', 'extendedheader.index')
68 hconf = ui.config('experimental', 'extendedheader.index')
70 if hconf is not None:
69 if hconf is not None:
71 hlen = None
70 hlen = None
72 try:
71 try:
73 # the hash config could be an integer (for length of hash) or a
72 # the hash config could be an integer (for length of hash) or a
74 # word (e.g. short, full, none)
73 # word (e.g. short, full, none)
75 hlen = int(hconf)
74 hlen = int(hconf)
76 if hlen < 0 or hlen > 40:
75 if hlen < 0 or hlen > 40:
77 msg = _("invalid length for extendedheader.index: '%d'\n")
76 msg = _("invalid length for extendedheader.index: '%d'\n")
78 ui.warn(msg % hlen)
77 ui.warn(msg % hlen)
79 except ValueError:
78 except ValueError:
80 # default value
79 # default value
81 if hconf == 'short' or hconf == '':
80 if hconf == 'short' or hconf == '':
82 hlen = 12
81 hlen = 12
83 elif hconf == 'full':
82 elif hconf == 'full':
84 hlen = 40
83 hlen = 40
85 elif hconf != 'none':
84 elif hconf != 'none':
86 msg = _("invalid value for extendedheader.index: '%s'\n")
85 msg = _("invalid value for extendedheader.index: '%s'\n")
87 ui.warn(msg % hconf)
86 ui.warn(msg % hconf)
88 finally:
87 finally:
89 buildopts['index'] = hlen
88 buildopts['index'] = hlen
90
89
91 if whitespace:
90 if whitespace:
92 buildopts['ignorews'] = get('ignore_all_space', 'ignorews')
91 buildopts['ignorews'] = get('ignore_all_space', 'ignorews')
93 buildopts['ignorewsamount'] = get('ignore_space_change',
92 buildopts['ignorewsamount'] = get('ignore_space_change',
94 'ignorewsamount')
93 'ignorewsamount')
95 buildopts['ignoreblanklines'] = get('ignore_blank_lines',
94 buildopts['ignoreblanklines'] = get('ignore_blank_lines',
96 'ignoreblanklines')
95 'ignoreblanklines')
97 buildopts['ignorewseol'] = get('ignore_space_at_eol', 'ignorewseol')
96 buildopts['ignorewseol'] = get('ignore_space_at_eol', 'ignorewseol')
98 if formatchanging:
97 if formatchanging:
99 buildopts['text'] = opts and opts.get('text')
98 buildopts['text'] = opts and opts.get('text')
100 binary = None if opts is None else opts.get('binary')
99 binary = None if opts is None else opts.get('binary')
101 buildopts['nobinary'] = (not binary if binary is not None
100 buildopts['nobinary'] = (not binary if binary is not None
102 else get('nobinary', forceplain=False))
101 else get('nobinary', forceplain=False))
103 buildopts['noprefix'] = get('noprefix', forceplain=False)
102 buildopts['noprefix'] = get('noprefix', forceplain=False)
103 buildopts['worddiff'] = get('word_diff', 'word-diff', forceplain=False)
104
104
105 return mdiff.diffopts(**pycompat.strkwargs(buildopts))
105 return mdiff.diffopts(**pycompat.strkwargs(buildopts))
@@ -1,2650 +1,2653
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``
706 Highlight changed words.
707
705 ``email``
708 ``email``
706 ---------
709 ---------
707
710
708 Settings for extensions that send email messages.
711 Settings for extensions that send email messages.
709
712
710 ``from``
713 ``from``
711 Optional. Email address to use in "From" header and SMTP envelope
714 Optional. Email address to use in "From" header and SMTP envelope
712 of outgoing messages.
715 of outgoing messages.
713
716
714 ``to``
717 ``to``
715 Optional. Comma-separated list of recipients' email addresses.
718 Optional. Comma-separated list of recipients' email addresses.
716
719
717 ``cc``
720 ``cc``
718 Optional. Comma-separated list of carbon copy recipients'
721 Optional. Comma-separated list of carbon copy recipients'
719 email addresses.
722 email addresses.
720
723
721 ``bcc``
724 ``bcc``
722 Optional. Comma-separated list of blind carbon copy recipients'
725 Optional. Comma-separated list of blind carbon copy recipients'
723 email addresses.
726 email addresses.
724
727
725 ``method``
728 ``method``
726 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``
727 (default), use SMTP (see the ``[smtp]`` section for configuration).
730 (default), use SMTP (see the ``[smtp]`` section for configuration).
728 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
729 (takes ``-f`` option for sender, list of recipients on command line,
732 (takes ``-f`` option for sender, list of recipients on command line,
730 message on stdin). Normally, setting this to ``sendmail`` or
733 message on stdin). Normally, setting this to ``sendmail`` or
731 ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
734 ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
732
735
733 ``charsets``
736 ``charsets``
734 Optional. Comma-separated list of character sets considered
737 Optional. Comma-separated list of character sets considered
735 convenient for recipients. Addresses, headers, and parts not
738 convenient for recipients. Addresses, headers, and parts not
736 containing patches of outgoing messages will be encoded in the
739 containing patches of outgoing messages will be encoded in the
737 first character set to which conversion from local encoding
740 first character set to which conversion from local encoding
738 (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
741 (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
739 conversion fails, the text in question is sent as is.
742 conversion fails, the text in question is sent as is.
740 (default: '')
743 (default: '')
741
744
742 Order of outgoing email character sets:
745 Order of outgoing email character sets:
743
746
744 1. ``us-ascii``: always first, regardless of settings
747 1. ``us-ascii``: always first, regardless of settings
745 2. ``email.charsets``: in order given by user
748 2. ``email.charsets``: in order given by user
746 3. ``ui.fallbackencoding``: if not in email.charsets
749 3. ``ui.fallbackencoding``: if not in email.charsets
747 4. ``$HGENCODING``: if not in email.charsets
750 4. ``$HGENCODING``: if not in email.charsets
748 5. ``utf-8``: always last, regardless of settings
751 5. ``utf-8``: always last, regardless of settings
749
752
750 Email example::
753 Email example::
751
754
752 [email]
755 [email]
753 from = Joseph User <joe.user@example.com>
756 from = Joseph User <joe.user@example.com>
754 method = /usr/sbin/sendmail
757 method = /usr/sbin/sendmail
755 # charsets for western Europeans
758 # charsets for western Europeans
756 # 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
757 charsets = iso-8859-1, iso-8859-15, windows-1252
760 charsets = iso-8859-1, iso-8859-15, windows-1252
758
761
759
762
760 ``extensions``
763 ``extensions``
761 --------------
764 --------------
762
765
763 Mercurial has an extension mechanism for adding new features. To
766 Mercurial has an extension mechanism for adding new features. To
764 enable an extension, create an entry for it in this section.
767 enable an extension, create an entry for it in this section.
765
768
766 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,
767 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
768 after the ``=``.
771 after the ``=``.
769
772
770 Otherwise, give a name that you choose, followed by ``=``, followed by
773 Otherwise, give a name that you choose, followed by ``=``, followed by
771 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
772 defines the extension.
775 defines the extension.
773
776
774 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
775 broader scope, prepend its path with ``!``, as in ``foo = !/ext/path``
778 broader scope, prepend its path with ``!``, as in ``foo = !/ext/path``
776 or ``foo = !`` when path is not supplied.
779 or ``foo = !`` when path is not supplied.
777
780
778 Example for ``~/.hgrc``::
781 Example for ``~/.hgrc``::
779
782
780 [extensions]
783 [extensions]
781 # (the churn extension will get loaded from Mercurial's path)
784 # (the churn extension will get loaded from Mercurial's path)
782 churn =
785 churn =
783 # (this extension will get loaded from the file specified)
786 # (this extension will get loaded from the file specified)
784 myfeature = ~/.hgext/myfeature.py
787 myfeature = ~/.hgext/myfeature.py
785
788
786
789
787 ``format``
790 ``format``
788 ----------
791 ----------
789
792
790 ``usegeneraldelta``
793 ``usegeneraldelta``
791 Enable or disable the "generaldelta" repository format which improves
794 Enable or disable the "generaldelta" repository format which improves
792 repository compression by allowing "revlog" to store delta against arbitrary
795 repository compression by allowing "revlog" to store delta against arbitrary
793 revision instead of the previous stored one. This provides significant
796 revision instead of the previous stored one. This provides significant
794 improvement for repositories with branches.
797 improvement for repositories with branches.
795
798
796 Repositories with this on-disk format require Mercurial version 1.9.
799 Repositories with this on-disk format require Mercurial version 1.9.
797
800
798 Enabled by default.
801 Enabled by default.
799
802
800 ``dotencode``
803 ``dotencode``
801 Enable or disable the "dotencode" repository format which enhances
804 Enable or disable the "dotencode" repository format which enhances
802 the "fncache" repository format (which has to be enabled to use
805 the "fncache" repository format (which has to be enabled to use
803 dotencode) to avoid issues with filenames starting with ._ on
806 dotencode) to avoid issues with filenames starting with ._ on
804 Mac OS X and spaces on Windows.
807 Mac OS X and spaces on Windows.
805
808
806 Repositories with this on-disk format require Mercurial version 1.7.
809 Repositories with this on-disk format require Mercurial version 1.7.
807
810
808 Enabled by default.
811 Enabled by default.
809
812
810 ``usefncache``
813 ``usefncache``
811 Enable or disable the "fncache" repository format which enhances
814 Enable or disable the "fncache" repository format which enhances
812 the "store" repository format (which has to be enabled to use
815 the "store" repository format (which has to be enabled to use
813 fncache) to allow longer filenames and avoids using Windows
816 fncache) to allow longer filenames and avoids using Windows
814 reserved names, e.g. "nul".
817 reserved names, e.g. "nul".
815
818
816 Repositories with this on-disk format require Mercurial version 1.1.
819 Repositories with this on-disk format require Mercurial version 1.1.
817
820
818 Enabled by default.
821 Enabled by default.
819
822
820 ``usestore``
823 ``usestore``
821 Enable or disable the "store" repository format which improves
824 Enable or disable the "store" repository format which improves
822 compatibility with systems that fold case or otherwise mangle
825 compatibility with systems that fold case or otherwise mangle
823 filenames. Disabling this option will allow you to store longer filenames
826 filenames. Disabling this option will allow you to store longer filenames
824 in some situations at the expense of compatibility.
827 in some situations at the expense of compatibility.
825
828
826 Repositories with this on-disk format require Mercurial version 0.9.4.
829 Repositories with this on-disk format require Mercurial version 0.9.4.
827
830
828 Enabled by default.
831 Enabled by default.
829
832
830 ``graph``
833 ``graph``
831 ---------
834 ---------
832
835
833 Web graph view configuration. This section let you change graph
836 Web graph view configuration. This section let you change graph
834 elements display properties by branches, for instance to make the
837 elements display properties by branches, for instance to make the
835 ``default`` branch stand out.
838 ``default`` branch stand out.
836
839
837 Each line has the following format::
840 Each line has the following format::
838
841
839 <branch>.<argument> = <value>
842 <branch>.<argument> = <value>
840
843
841 where ``<branch>`` is the name of the branch being
844 where ``<branch>`` is the name of the branch being
842 customized. Example::
845 customized. Example::
843
846
844 [graph]
847 [graph]
845 # 2px width
848 # 2px width
846 default.width = 2
849 default.width = 2
847 # red color
850 # red color
848 default.color = FF0000
851 default.color = FF0000
849
852
850 Supported arguments:
853 Supported arguments:
851
854
852 ``width``
855 ``width``
853 Set branch edges width in pixels.
856 Set branch edges width in pixels.
854
857
855 ``color``
858 ``color``
856 Set branch edges color in hexadecimal RGB notation.
859 Set branch edges color in hexadecimal RGB notation.
857
860
858 ``hooks``
861 ``hooks``
859 ---------
862 ---------
860
863
861 Commands or Python functions that get automatically executed by
864 Commands or Python functions that get automatically executed by
862 various actions such as starting or finishing a commit. Multiple
865 various actions such as starting or finishing a commit. Multiple
863 hooks can be run for the same action by appending a suffix to the
866 hooks can be run for the same action by appending a suffix to the
864 action. Overriding a site-wide hook can be done by changing its
867 action. Overriding a site-wide hook can be done by changing its
865 value or setting it to an empty string. Hooks can be prioritized
868 value or setting it to an empty string. Hooks can be prioritized
866 by adding a prefix of ``priority.`` to the hook name on a new line
869 by adding a prefix of ``priority.`` to the hook name on a new line
867 and setting the priority. The default priority is 0.
870 and setting the priority. The default priority is 0.
868
871
869 Example ``.hg/hgrc``::
872 Example ``.hg/hgrc``::
870
873
871 [hooks]
874 [hooks]
872 # update working directory after adding changesets
875 # update working directory after adding changesets
873 changegroup.update = hg update
876 changegroup.update = hg update
874 # do not use the site-wide hook
877 # do not use the site-wide hook
875 incoming =
878 incoming =
876 incoming.email = /my/email/hook
879 incoming.email = /my/email/hook
877 incoming.autobuild = /my/build/hook
880 incoming.autobuild = /my/build/hook
878 # force autobuild hook to run before other incoming hooks
881 # force autobuild hook to run before other incoming hooks
879 priority.incoming.autobuild = 1
882 priority.incoming.autobuild = 1
880
883
881 Most hooks are run with environment variables set that give useful
884 Most hooks are run with environment variables set that give useful
882 additional information. For each hook below, the environment variables
885 additional information. For each hook below, the environment variables
883 it is passed are listed with names in the form ``$HG_foo``. The
886 it is passed are listed with names in the form ``$HG_foo``. The
884 ``$HG_HOOKTYPE`` and ``$HG_HOOKNAME`` variables are set for all hooks.
887 ``$HG_HOOKTYPE`` and ``$HG_HOOKNAME`` variables are set for all hooks.
885 They contain the type of hook which triggered the run and the full name
888 They contain the type of hook which triggered the run and the full name
886 of the hook in the config, respectively. In the example above, this will
889 of the hook in the config, respectively. In the example above, this will
887 be ``$HG_HOOKTYPE=incoming`` and ``$HG_HOOKNAME=incoming.email``.
890 be ``$HG_HOOKTYPE=incoming`` and ``$HG_HOOKNAME=incoming.email``.
888
891
889 .. container:: windows
892 .. container:: windows
890
893
891 Some basic Unix syntax is supported for portability, including ``$VAR``
894 Some basic Unix syntax is supported for portability, including ``$VAR``
892 and ``${VAR}`` style variables. To use a literal ``$``, it must be
895 and ``${VAR}`` style variables. To use a literal ``$``, it must be
893 escaped with a back slash or inside of a strong quote.
896 escaped with a back slash or inside of a strong quote.
894
897
895 ``changegroup``
898 ``changegroup``
896 Run after a changegroup has been added via push, pull or unbundle. The ID of
899 Run after a changegroup has been added via push, pull or unbundle. The ID of
897 the first new changeset is in ``$HG_NODE`` and last is in ``$HG_NODE_LAST``.
900 the first new changeset is in ``$HG_NODE`` and last is in ``$HG_NODE_LAST``.
898 The URL from which changes came is in ``$HG_URL``.
901 The URL from which changes came is in ``$HG_URL``.
899
902
900 ``commit``
903 ``commit``
901 Run after a changeset has been created in the local repository. The ID
904 Run after a changeset has been created in the local repository. The ID
902 of the newly created changeset is in ``$HG_NODE``. Parent changeset
905 of the newly created changeset is in ``$HG_NODE``. Parent changeset
903 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
906 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
904
907
905 ``incoming``
908 ``incoming``
906 Run after a changeset has been pulled, pushed, or unbundled into
909 Run after a changeset has been pulled, pushed, or unbundled into
907 the local repository. The ID of the newly arrived changeset is in
910 the local repository. The ID of the newly arrived changeset is in
908 ``$HG_NODE``. The URL that was source of the changes is in ``$HG_URL``.
911 ``$HG_NODE``. The URL that was source of the changes is in ``$HG_URL``.
909
912
910 ``outgoing``
913 ``outgoing``
911 Run after sending changes from the local repository to another. The ID of
914 Run after sending changes from the local repository to another. The ID of
912 first changeset sent is in ``$HG_NODE``. The source of operation is in
915 first changeset sent is in ``$HG_NODE``. The source of operation is in
913 ``$HG_SOURCE``. Also see :hg:`help config.hooks.preoutgoing`.
916 ``$HG_SOURCE``. Also see :hg:`help config.hooks.preoutgoing`.
914
917
915 ``post-<command>``
918 ``post-<command>``
916 Run after successful invocations of the associated command. The
919 Run after successful invocations of the associated command. The
917 contents of the command line are passed as ``$HG_ARGS`` and the result
920 contents of the command line are passed as ``$HG_ARGS`` and the result
918 code in ``$HG_RESULT``. Parsed command line arguments are passed as
921 code in ``$HG_RESULT``. Parsed command line arguments are passed as
919 ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of
922 ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of
920 the python data internally passed to <command>. ``$HG_OPTS`` is a
923 the python data internally passed to <command>. ``$HG_OPTS`` is a
921 dictionary of options (with unspecified options set to their defaults).
924 dictionary of options (with unspecified options set to their defaults).
922 ``$HG_PATS`` is a list of arguments. Hook failure is ignored.
925 ``$HG_PATS`` is a list of arguments. Hook failure is ignored.
923
926
924 ``fail-<command>``
927 ``fail-<command>``
925 Run after a failed invocation of an associated command. The contents
928 Run after a failed invocation of an associated command. The contents
926 of the command line are passed as ``$HG_ARGS``. Parsed command line
929 of the command line are passed as ``$HG_ARGS``. Parsed command line
927 arguments are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain
930 arguments are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain
928 string representations of the python data internally passed to
931 string representations of the python data internally passed to
929 <command>. ``$HG_OPTS`` is a dictionary of options (with unspecified
932 <command>. ``$HG_OPTS`` is a dictionary of options (with unspecified
930 options set to their defaults). ``$HG_PATS`` is a list of arguments.
933 options set to their defaults). ``$HG_PATS`` is a list of arguments.
931 Hook failure is ignored.
934 Hook failure is ignored.
932
935
933 ``pre-<command>``
936 ``pre-<command>``
934 Run before executing the associated command. The contents of the
937 Run before executing the associated command. The contents of the
935 command line are passed as ``$HG_ARGS``. Parsed command line arguments
938 command line are passed as ``$HG_ARGS``. Parsed command line arguments
936 are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string
939 are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string
937 representations of the data internally passed to <command>. ``$HG_OPTS``
940 representations of the data internally passed to <command>. ``$HG_OPTS``
938 is a dictionary of options (with unspecified options set to their
941 is a dictionary of options (with unspecified options set to their
939 defaults). ``$HG_PATS`` is a list of arguments. If the hook returns
942 defaults). ``$HG_PATS`` is a list of arguments. If the hook returns
940 failure, the command doesn't execute and Mercurial returns the failure
943 failure, the command doesn't execute and Mercurial returns the failure
941 code.
944 code.
942
945
943 ``prechangegroup``
946 ``prechangegroup``
944 Run before a changegroup is added via push, pull or unbundle. Exit
947 Run before a changegroup is added via push, pull or unbundle. Exit
945 status 0 allows the changegroup to proceed. A non-zero status will
948 status 0 allows the changegroup to proceed. A non-zero status will
946 cause the push, pull or unbundle to fail. The URL from which changes
949 cause the push, pull or unbundle to fail. The URL from which changes
947 will come is in ``$HG_URL``.
950 will come is in ``$HG_URL``.
948
951
949 ``precommit``
952 ``precommit``
950 Run before starting a local commit. Exit status 0 allows the
953 Run before starting a local commit. Exit status 0 allows the
951 commit to proceed. A non-zero status will cause the commit to fail.
954 commit to proceed. A non-zero status will cause the commit to fail.
952 Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
955 Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
953
956
954 ``prelistkeys``
957 ``prelistkeys``
955 Run before listing pushkeys (like bookmarks) in the
958 Run before listing pushkeys (like bookmarks) in the
956 repository. A non-zero status will cause failure. The key namespace is
959 repository. A non-zero status will cause failure. The key namespace is
957 in ``$HG_NAMESPACE``.
960 in ``$HG_NAMESPACE``.
958
961
959 ``preoutgoing``
962 ``preoutgoing``
960 Run before collecting changes to send from the local repository to
963 Run before collecting changes to send from the local repository to
961 another. A non-zero status will cause failure. This lets you prevent
964 another. A non-zero status will cause failure. This lets you prevent
962 pull over HTTP or SSH. It can also prevent propagating commits (via
965 pull over HTTP or SSH. It can also prevent propagating commits (via
963 local pull, push (outbound) or bundle commands), but not completely,
966 local pull, push (outbound) or bundle commands), but not completely,
964 since you can just copy files instead. The source of operation is in
967 since you can just copy files instead. The source of operation is in
965 ``$HG_SOURCE``. If "serve", the operation is happening on behalf of a remote
968 ``$HG_SOURCE``. If "serve", the operation is happening on behalf of a remote
966 SSH or HTTP repository. If "push", "pull" or "bundle", the operation
969 SSH or HTTP repository. If "push", "pull" or "bundle", the operation
967 is happening on behalf of a repository on same system.
970 is happening on behalf of a repository on same system.
968
971
969 ``prepushkey``
972 ``prepushkey``
970 Run before a pushkey (like a bookmark) is added to the
973 Run before a pushkey (like a bookmark) is added to the
971 repository. A non-zero status will cause the key to be rejected. The
974 repository. A non-zero status will cause the key to be rejected. The
972 key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``,
975 key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``,
973 the old value (if any) is in ``$HG_OLD``, and the new value is in
976 the old value (if any) is in ``$HG_OLD``, and the new value is in
974 ``$HG_NEW``.
977 ``$HG_NEW``.
975
978
976 ``pretag``
979 ``pretag``
977 Run before creating a tag. Exit status 0 allows the tag to be
980 Run before creating a tag. Exit status 0 allows the tag to be
978 created. A non-zero status will cause the tag to fail. The ID of the
981 created. A non-zero status will cause the tag to fail. The ID of the
979 changeset to tag is in ``$HG_NODE``. The name of tag is in ``$HG_TAG``. The
982 changeset to tag is in ``$HG_NODE``. The name of tag is in ``$HG_TAG``. The
980 tag is local if ``$HG_LOCAL=1``, or in the repository if ``$HG_LOCAL=0``.
983 tag is local if ``$HG_LOCAL=1``, or in the repository if ``$HG_LOCAL=0``.
981
984
982 ``pretxnopen``
985 ``pretxnopen``
983 Run before any new repository transaction is open. The reason for the
986 Run before any new repository transaction is open. The reason for the
984 transaction will be in ``$HG_TXNNAME``, and a unique identifier for the
987 transaction will be in ``$HG_TXNNAME``, and a unique identifier for the
985 transaction will be in ``HG_TXNID``. A non-zero status will prevent the
988 transaction will be in ``HG_TXNID``. A non-zero status will prevent the
986 transaction from being opened.
989 transaction from being opened.
987
990
988 ``pretxnclose``
991 ``pretxnclose``
989 Run right before the transaction is actually finalized. Any repository change
992 Run right before the transaction is actually finalized. Any repository change
990 will be visible to the hook program. This lets you validate the transaction
993 will be visible to the hook program. This lets you validate the transaction
991 content or change it. Exit status 0 allows the commit to proceed. A non-zero
994 content or change it. Exit status 0 allows the commit to proceed. A non-zero
992 status will cause the transaction to be rolled back. The reason for the
995 status will cause the transaction to be rolled back. The reason for the
993 transaction opening will be in ``$HG_TXNNAME``, and a unique identifier for
996 transaction opening will be in ``$HG_TXNNAME``, and a unique identifier for
994 the transaction will be in ``HG_TXNID``. The rest of the available data will
997 the transaction will be in ``HG_TXNID``. The rest of the available data will
995 vary according the transaction type. New changesets will add ``$HG_NODE``
998 vary according the transaction type. New changesets will add ``$HG_NODE``
996 (the ID of the first added changeset), ``$HG_NODE_LAST`` (the ID of the last
999 (the ID of the first added changeset), ``$HG_NODE_LAST`` (the ID of the last
997 added changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables. Bookmark and
1000 added changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables. Bookmark and
998 phase changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1``
1001 phase changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1``
999 respectively, etc.
1002 respectively, etc.
1000
1003
1001 ``pretxnclose-bookmark``
1004 ``pretxnclose-bookmark``
1002 Run right before a bookmark change is actually finalized. Any repository
1005 Run right before a bookmark change is actually finalized. Any repository
1003 change will be visible to the hook program. This lets you validate the
1006 change will be visible to the hook program. This lets you validate the
1004 transaction content or change it. Exit status 0 allows the commit to
1007 transaction content or change it. Exit status 0 allows the commit to
1005 proceed. A non-zero status will cause the transaction to be rolled back.
1008 proceed. A non-zero status will cause the transaction to be rolled back.
1006 The name of the bookmark will be available in ``$HG_BOOKMARK``, the new
1009 The name of the bookmark will be available in ``$HG_BOOKMARK``, the new
1007 bookmark location will be available in ``$HG_NODE`` while the previous
1010 bookmark location will be available in ``$HG_NODE`` while the previous
1008 location will be available in ``$HG_OLDNODE``. In case of a bookmark
1011 location will be available in ``$HG_OLDNODE``. In case of a bookmark
1009 creation ``$HG_OLDNODE`` will be empty. In case of deletion ``$HG_NODE``
1012 creation ``$HG_OLDNODE`` will be empty. In case of deletion ``$HG_NODE``
1010 will be empty.
1013 will be empty.
1011 In addition, the reason for the transaction opening will be in
1014 In addition, the reason for the transaction opening will be in
1012 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1015 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1013 ``HG_TXNID``.
1016 ``HG_TXNID``.
1014
1017
1015 ``pretxnclose-phase``
1018 ``pretxnclose-phase``
1016 Run right before a phase change is actually finalized. Any repository change
1019 Run right before a phase change is actually finalized. Any repository change
1017 will be visible to the hook program. This lets you validate the transaction
1020 will be visible to the hook program. This lets you validate the transaction
1018 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1021 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1019 status will cause the transaction to be rolled back. The hook is called
1022 status will cause the transaction to be rolled back. The hook is called
1020 multiple times, once for each revision affected by a phase change.
1023 multiple times, once for each revision affected by a phase change.
1021 The affected node is available in ``$HG_NODE``, the phase in ``$HG_PHASE``
1024 The affected node is available in ``$HG_NODE``, the phase in ``$HG_PHASE``
1022 while the previous ``$HG_OLDPHASE``. In case of new node, ``$HG_OLDPHASE``
1025 while the previous ``$HG_OLDPHASE``. In case of new node, ``$HG_OLDPHASE``
1023 will be empty. In addition, the reason for the transaction opening will be in
1026 will be empty. In addition, the reason for the transaction opening will be in
1024 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1027 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1025 ``HG_TXNID``. The hook is also run for newly added revisions. In this case
1028 ``HG_TXNID``. The hook is also run for newly added revisions. In this case
1026 the ``$HG_OLDPHASE`` entry will be empty.
1029 the ``$HG_OLDPHASE`` entry will be empty.
1027
1030
1028 ``txnclose``
1031 ``txnclose``
1029 Run after any repository transaction has been committed. At this
1032 Run after any repository transaction has been committed. At this
1030 point, the transaction can no longer be rolled back. The hook will run
1033 point, the transaction can no longer be rolled back. The hook will run
1031 after the lock is released. See :hg:`help config.hooks.pretxnclose` for
1034 after the lock is released. See :hg:`help config.hooks.pretxnclose` for
1032 details about available variables.
1035 details about available variables.
1033
1036
1034 ``txnclose-bookmark``
1037 ``txnclose-bookmark``
1035 Run after any bookmark change has been committed. At this point, the
1038 Run after any bookmark change has been committed. At this point, the
1036 transaction can no longer be rolled back. The hook will run after the lock
1039 transaction can no longer be rolled back. The hook will run after the lock
1037 is released. See :hg:`help config.hooks.pretxnclose-bookmark` for details
1040 is released. See :hg:`help config.hooks.pretxnclose-bookmark` for details
1038 about available variables.
1041 about available variables.
1039
1042
1040 ``txnclose-phase``
1043 ``txnclose-phase``
1041 Run after any phase change has been committed. At this point, the
1044 Run after any phase change has been committed. At this point, the
1042 transaction can no longer be rolled back. The hook will run after the lock
1045 transaction can no longer be rolled back. The hook will run after the lock
1043 is released. See :hg:`help config.hooks.pretxnclose-phase` for details about
1046 is released. See :hg:`help config.hooks.pretxnclose-phase` for details about
1044 available variables.
1047 available variables.
1045
1048
1046 ``txnabort``
1049 ``txnabort``
1047 Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose`
1050 Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose`
1048 for details about available variables.
1051 for details about available variables.
1049
1052
1050 ``pretxnchangegroup``
1053 ``pretxnchangegroup``
1051 Run after a changegroup has been added via push, pull or unbundle, but before
1054 Run after a changegroup has been added via push, pull or unbundle, but before
1052 the transaction has been committed. The changegroup is visible to the hook
1055 the transaction has been committed. The changegroup is visible to the hook
1053 program. This allows validation of incoming changes before accepting them.
1056 program. This allows validation of incoming changes before accepting them.
1054 The ID of the first new changeset is in ``$HG_NODE`` and last is in
1057 The ID of the first new changeset is in ``$HG_NODE`` and last is in
1055 ``$HG_NODE_LAST``. Exit status 0 allows the transaction to commit. A non-zero
1058 ``$HG_NODE_LAST``. Exit status 0 allows the transaction to commit. A non-zero
1056 status will cause the transaction to be rolled back, and the push, pull or
1059 status will cause the transaction to be rolled back, and the push, pull or
1057 unbundle will fail. The URL that was the source of changes is in ``$HG_URL``.
1060 unbundle will fail. The URL that was the source of changes is in ``$HG_URL``.
1058
1061
1059 ``pretxncommit``
1062 ``pretxncommit``
1060 Run after a changeset has been created, but before the transaction is
1063 Run after a changeset has been created, but before the transaction is
1061 committed. The changeset is visible to the hook program. This allows
1064 committed. The changeset is visible to the hook program. This allows
1062 validation of the commit message and changes. Exit status 0 allows the
1065 validation of the commit message and changes. Exit status 0 allows the
1063 commit to proceed. A non-zero status will cause the transaction to
1066 commit to proceed. A non-zero status will cause the transaction to
1064 be rolled back. The ID of the new changeset is in ``$HG_NODE``. The parent
1067 be rolled back. The ID of the new changeset is in ``$HG_NODE``. The parent
1065 changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1068 changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1066
1069
1067 ``preupdate``
1070 ``preupdate``
1068 Run before updating the working directory. Exit status 0 allows
1071 Run before updating the working directory. Exit status 0 allows
1069 the update to proceed. A non-zero status will prevent the update.
1072 the update to proceed. A non-zero status will prevent the update.
1070 The changeset ID of first new parent is in ``$HG_PARENT1``. If updating to a
1073 The changeset ID of first new parent is in ``$HG_PARENT1``. If updating to a
1071 merge, the ID of second new parent is in ``$HG_PARENT2``.
1074 merge, the ID of second new parent is in ``$HG_PARENT2``.
1072
1075
1073 ``listkeys``
1076 ``listkeys``
1074 Run after listing pushkeys (like bookmarks) in the repository. The
1077 Run after listing pushkeys (like bookmarks) in the repository. The
1075 key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a
1078 key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a
1076 dictionary containing the keys and values.
1079 dictionary containing the keys and values.
1077
1080
1078 ``pushkey``
1081 ``pushkey``
1079 Run after a pushkey (like a bookmark) is added to the
1082 Run after a pushkey (like a bookmark) is added to the
1080 repository. The key namespace is in ``$HG_NAMESPACE``, the key is in
1083 repository. The key namespace is in ``$HG_NAMESPACE``, the key is in
1081 ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new
1084 ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new
1082 value is in ``$HG_NEW``.
1085 value is in ``$HG_NEW``.
1083
1086
1084 ``tag``
1087 ``tag``
1085 Run after a tag is created. The ID of the tagged changeset is in ``$HG_NODE``.
1088 Run after a tag is created. The ID of the tagged changeset is in ``$HG_NODE``.
1086 The name of tag is in ``$HG_TAG``. The tag is local if ``$HG_LOCAL=1``, or in
1089 The name of tag is in ``$HG_TAG``. The tag is local if ``$HG_LOCAL=1``, or in
1087 the repository if ``$HG_LOCAL=0``.
1090 the repository if ``$HG_LOCAL=0``.
1088
1091
1089 ``update``
1092 ``update``
1090 Run after updating the working directory. The changeset ID of first
1093 Run after updating the working directory. The changeset ID of first
1091 new parent is in ``$HG_PARENT1``. If updating to a merge, the ID of second new
1094 new parent is in ``$HG_PARENT1``. If updating to a merge, the ID of second new
1092 parent is in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
1095 parent is in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
1093 update failed (e.g. because conflicts were not resolved), ``$HG_ERROR=1``.
1096 update failed (e.g. because conflicts were not resolved), ``$HG_ERROR=1``.
1094
1097
1095 .. note::
1098 .. note::
1096
1099
1097 It is generally better to use standard hooks rather than the
1100 It is generally better to use standard hooks rather than the
1098 generic pre- and post- command hooks, as they are guaranteed to be
1101 generic pre- and post- command hooks, as they are guaranteed to be
1099 called in the appropriate contexts for influencing transactions.
1102 called in the appropriate contexts for influencing transactions.
1100 Also, hooks like "commit" will be called in all contexts that
1103 Also, hooks like "commit" will be called in all contexts that
1101 generate a commit (e.g. tag) and not just the commit command.
1104 generate a commit (e.g. tag) and not just the commit command.
1102
1105
1103 .. note::
1106 .. note::
1104
1107
1105 Environment variables with empty values may not be passed to
1108 Environment variables with empty values may not be passed to
1106 hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
1109 hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
1107 will have an empty value under Unix-like platforms for non-merge
1110 will have an empty value under Unix-like platforms for non-merge
1108 changesets, while it will not be available at all under Windows.
1111 changesets, while it will not be available at all under Windows.
1109
1112
1110 The syntax for Python hooks is as follows::
1113 The syntax for Python hooks is as follows::
1111
1114
1112 hookname = python:modulename.submodule.callable
1115 hookname = python:modulename.submodule.callable
1113 hookname = python:/path/to/python/module.py:callable
1116 hookname = python:/path/to/python/module.py:callable
1114
1117
1115 Python hooks are run within the Mercurial process. Each hook is
1118 Python hooks are run within the Mercurial process. Each hook is
1116 called with at least three keyword arguments: a ui object (keyword
1119 called with at least three keyword arguments: a ui object (keyword
1117 ``ui``), a repository object (keyword ``repo``), and a ``hooktype``
1120 ``ui``), a repository object (keyword ``repo``), and a ``hooktype``
1118 keyword that tells what kind of hook is used. Arguments listed as
1121 keyword that tells what kind of hook is used. Arguments listed as
1119 environment variables above are passed as keyword arguments, with no
1122 environment variables above are passed as keyword arguments, with no
1120 ``HG_`` prefix, and names in lower case.
1123 ``HG_`` prefix, and names in lower case.
1121
1124
1122 If a Python hook returns a "true" value or raises an exception, this
1125 If a Python hook returns a "true" value or raises an exception, this
1123 is treated as a failure.
1126 is treated as a failure.
1124
1127
1125
1128
1126 ``hostfingerprints``
1129 ``hostfingerprints``
1127 --------------------
1130 --------------------
1128
1131
1129 (Deprecated. Use ``[hostsecurity]``'s ``fingerprints`` options instead.)
1132 (Deprecated. Use ``[hostsecurity]``'s ``fingerprints`` options instead.)
1130
1133
1131 Fingerprints of the certificates of known HTTPS servers.
1134 Fingerprints of the certificates of known HTTPS servers.
1132
1135
1133 A HTTPS connection to a server with a fingerprint configured here will
1136 A HTTPS connection to a server with a fingerprint configured here will
1134 only succeed if the servers certificate matches the fingerprint.
1137 only succeed if the servers certificate matches the fingerprint.
1135 This is very similar to how ssh known hosts works.
1138 This is very similar to how ssh known hosts works.
1136
1139
1137 The fingerprint is the SHA-1 hash value of the DER encoded certificate.
1140 The fingerprint is the SHA-1 hash value of the DER encoded certificate.
1138 Multiple values can be specified (separated by spaces or commas). This can
1141 Multiple values can be specified (separated by spaces or commas). This can
1139 be used to define both old and new fingerprints while a host transitions
1142 be used to define both old and new fingerprints while a host transitions
1140 to a new certificate.
1143 to a new certificate.
1141
1144
1142 The CA chain and web.cacerts is not used for servers with a fingerprint.
1145 The CA chain and web.cacerts is not used for servers with a fingerprint.
1143
1146
1144 For example::
1147 For example::
1145
1148
1146 [hostfingerprints]
1149 [hostfingerprints]
1147 hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1150 hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1148 hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1151 hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1149
1152
1150 ``hostsecurity``
1153 ``hostsecurity``
1151 ----------------
1154 ----------------
1152
1155
1153 Used to specify global and per-host security settings for connecting to
1156 Used to specify global and per-host security settings for connecting to
1154 other machines.
1157 other machines.
1155
1158
1156 The following options control default behavior for all hosts.
1159 The following options control default behavior for all hosts.
1157
1160
1158 ``ciphers``
1161 ``ciphers``
1159 Defines the cryptographic ciphers to use for connections.
1162 Defines the cryptographic ciphers to use for connections.
1160
1163
1161 Value must be a valid OpenSSL Cipher List Format as documented at
1164 Value must be a valid OpenSSL Cipher List Format as documented at
1162 https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT.
1165 https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT.
1163
1166
1164 This setting is for advanced users only. Setting to incorrect values
1167 This setting is for advanced users only. Setting to incorrect values
1165 can significantly lower connection security or decrease performance.
1168 can significantly lower connection security or decrease performance.
1166 You have been warned.
1169 You have been warned.
1167
1170
1168 This option requires Python 2.7.
1171 This option requires Python 2.7.
1169
1172
1170 ``minimumprotocol``
1173 ``minimumprotocol``
1171 Defines the minimum channel encryption protocol to use.
1174 Defines the minimum channel encryption protocol to use.
1172
1175
1173 By default, the highest version of TLS supported by both client and server
1176 By default, the highest version of TLS supported by both client and server
1174 is used.
1177 is used.
1175
1178
1176 Allowed values are: ``tls1.0``, ``tls1.1``, ``tls1.2``.
1179 Allowed values are: ``tls1.0``, ``tls1.1``, ``tls1.2``.
1177
1180
1178 When running on an old Python version, only ``tls1.0`` is allowed since
1181 When running on an old Python version, only ``tls1.0`` is allowed since
1179 old versions of Python only support up to TLS 1.0.
1182 old versions of Python only support up to TLS 1.0.
1180
1183
1181 When running a Python that supports modern TLS versions, the default is
1184 When running a Python that supports modern TLS versions, the default is
1182 ``tls1.1``. ``tls1.0`` can still be used to allow TLS 1.0. However, this
1185 ``tls1.1``. ``tls1.0`` can still be used to allow TLS 1.0. However, this
1183 weakens security and should only be used as a feature of last resort if
1186 weakens security and should only be used as a feature of last resort if
1184 a server does not support TLS 1.1+.
1187 a server does not support TLS 1.1+.
1185
1188
1186 Options in the ``[hostsecurity]`` section can have the form
1189 Options in the ``[hostsecurity]`` section can have the form
1187 ``hostname``:``setting``. This allows multiple settings to be defined on a
1190 ``hostname``:``setting``. This allows multiple settings to be defined on a
1188 per-host basis.
1191 per-host basis.
1189
1192
1190 The following per-host settings can be defined.
1193 The following per-host settings can be defined.
1191
1194
1192 ``ciphers``
1195 ``ciphers``
1193 This behaves like ``ciphers`` as described above except it only applies
1196 This behaves like ``ciphers`` as described above except it only applies
1194 to the host on which it is defined.
1197 to the host on which it is defined.
1195
1198
1196 ``fingerprints``
1199 ``fingerprints``
1197 A list of hashes of the DER encoded peer/remote certificate. Values have
1200 A list of hashes of the DER encoded peer/remote certificate. Values have
1198 the form ``algorithm``:``fingerprint``. e.g.
1201 the form ``algorithm``:``fingerprint``. e.g.
1199 ``sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2``.
1202 ``sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2``.
1200 In addition, colons (``:``) can appear in the fingerprint part.
1203 In addition, colons (``:``) can appear in the fingerprint part.
1201
1204
1202 The following algorithms/prefixes are supported: ``sha1``, ``sha256``,
1205 The following algorithms/prefixes are supported: ``sha1``, ``sha256``,
1203 ``sha512``.
1206 ``sha512``.
1204
1207
1205 Use of ``sha256`` or ``sha512`` is preferred.
1208 Use of ``sha256`` or ``sha512`` is preferred.
1206
1209
1207 If a fingerprint is specified, the CA chain is not validated for this
1210 If a fingerprint is specified, the CA chain is not validated for this
1208 host and Mercurial will require the remote certificate to match one
1211 host and Mercurial will require the remote certificate to match one
1209 of the fingerprints specified. This means if the server updates its
1212 of the fingerprints specified. This means if the server updates its
1210 certificate, Mercurial will abort until a new fingerprint is defined.
1213 certificate, Mercurial will abort until a new fingerprint is defined.
1211 This can provide stronger security than traditional CA-based validation
1214 This can provide stronger security than traditional CA-based validation
1212 at the expense of convenience.
1215 at the expense of convenience.
1213
1216
1214 This option takes precedence over ``verifycertsfile``.
1217 This option takes precedence over ``verifycertsfile``.
1215
1218
1216 ``minimumprotocol``
1219 ``minimumprotocol``
1217 This behaves like ``minimumprotocol`` as described above except it
1220 This behaves like ``minimumprotocol`` as described above except it
1218 only applies to the host on which it is defined.
1221 only applies to the host on which it is defined.
1219
1222
1220 ``verifycertsfile``
1223 ``verifycertsfile``
1221 Path to file a containing a list of PEM encoded certificates used to
1224 Path to file a containing a list of PEM encoded certificates used to
1222 verify the server certificate. Environment variables and ``~user``
1225 verify the server certificate. Environment variables and ``~user``
1223 constructs are expanded in the filename.
1226 constructs are expanded in the filename.
1224
1227
1225 The server certificate or the certificate's certificate authority (CA)
1228 The server certificate or the certificate's certificate authority (CA)
1226 must match a certificate from this file or certificate verification
1229 must match a certificate from this file or certificate verification
1227 will fail and connections to the server will be refused.
1230 will fail and connections to the server will be refused.
1228
1231
1229 If defined, only certificates provided by this file will be used:
1232 If defined, only certificates provided by this file will be used:
1230 ``web.cacerts`` and any system/default certificates will not be
1233 ``web.cacerts`` and any system/default certificates will not be
1231 used.
1234 used.
1232
1235
1233 This option has no effect if the per-host ``fingerprints`` option
1236 This option has no effect if the per-host ``fingerprints`` option
1234 is set.
1237 is set.
1235
1238
1236 The format of the file is as follows::
1239 The format of the file is as follows::
1237
1240
1238 -----BEGIN CERTIFICATE-----
1241 -----BEGIN CERTIFICATE-----
1239 ... (certificate in base64 PEM encoding) ...
1242 ... (certificate in base64 PEM encoding) ...
1240 -----END CERTIFICATE-----
1243 -----END CERTIFICATE-----
1241 -----BEGIN CERTIFICATE-----
1244 -----BEGIN CERTIFICATE-----
1242 ... (certificate in base64 PEM encoding) ...
1245 ... (certificate in base64 PEM encoding) ...
1243 -----END CERTIFICATE-----
1246 -----END CERTIFICATE-----
1244
1247
1245 For example::
1248 For example::
1246
1249
1247 [hostsecurity]
1250 [hostsecurity]
1248 hg.example.com:fingerprints = sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
1251 hg.example.com:fingerprints = sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
1249 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
1252 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
1250 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
1253 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
1251 foo.example.com:verifycertsfile = /etc/ssl/trusted-ca-certs.pem
1254 foo.example.com:verifycertsfile = /etc/ssl/trusted-ca-certs.pem
1252
1255
1253 To change the default minimum protocol version to TLS 1.2 but to allow TLS 1.1
1256 To change the default minimum protocol version to TLS 1.2 but to allow TLS 1.1
1254 when connecting to ``hg.example.com``::
1257 when connecting to ``hg.example.com``::
1255
1258
1256 [hostsecurity]
1259 [hostsecurity]
1257 minimumprotocol = tls1.2
1260 minimumprotocol = tls1.2
1258 hg.example.com:minimumprotocol = tls1.1
1261 hg.example.com:minimumprotocol = tls1.1
1259
1262
1260 ``http_proxy``
1263 ``http_proxy``
1261 --------------
1264 --------------
1262
1265
1263 Used to access web-based Mercurial repositories through a HTTP
1266 Used to access web-based Mercurial repositories through a HTTP
1264 proxy.
1267 proxy.
1265
1268
1266 ``host``
1269 ``host``
1267 Host name and (optional) port of the proxy server, for example
1270 Host name and (optional) port of the proxy server, for example
1268 "myproxy:8000".
1271 "myproxy:8000".
1269
1272
1270 ``no``
1273 ``no``
1271 Optional. Comma-separated list of host names that should bypass
1274 Optional. Comma-separated list of host names that should bypass
1272 the proxy.
1275 the proxy.
1273
1276
1274 ``passwd``
1277 ``passwd``
1275 Optional. Password to authenticate with at the proxy server.
1278 Optional. Password to authenticate with at the proxy server.
1276
1279
1277 ``user``
1280 ``user``
1278 Optional. User name to authenticate with at the proxy server.
1281 Optional. User name to authenticate with at the proxy server.
1279
1282
1280 ``always``
1283 ``always``
1281 Optional. Always use the proxy, even for localhost and any entries
1284 Optional. Always use the proxy, even for localhost and any entries
1282 in ``http_proxy.no``. (default: False)
1285 in ``http_proxy.no``. (default: False)
1283
1286
1284 ``merge``
1287 ``merge``
1285 ---------
1288 ---------
1286
1289
1287 This section specifies behavior during merges and updates.
1290 This section specifies behavior during merges and updates.
1288
1291
1289 ``checkignored``
1292 ``checkignored``
1290 Controls behavior when an ignored file on disk has the same name as a tracked
1293 Controls behavior when an ignored file on disk has the same name as a tracked
1291 file in the changeset being merged or updated to, and has different
1294 file in the changeset being merged or updated to, and has different
1292 contents. Options are ``abort``, ``warn`` and ``ignore``. With ``abort``,
1295 contents. Options are ``abort``, ``warn`` and ``ignore``. With ``abort``,
1293 abort on such files. With ``warn``, warn on such files and back them up as
1296 abort on such files. With ``warn``, warn on such files and back them up as
1294 ``.orig``. With ``ignore``, don't print a warning and back them up as
1297 ``.orig``. With ``ignore``, don't print a warning and back them up as
1295 ``.orig``. (default: ``abort``)
1298 ``.orig``. (default: ``abort``)
1296
1299
1297 ``checkunknown``
1300 ``checkunknown``
1298 Controls behavior when an unknown file that isn't ignored has the same name
1301 Controls behavior when an unknown file that isn't ignored has the same name
1299 as a tracked file in the changeset being merged or updated to, and has
1302 as a tracked file in the changeset being merged or updated to, and has
1300 different contents. Similar to ``merge.checkignored``, except for files that
1303 different contents. Similar to ``merge.checkignored``, except for files that
1301 are not ignored. (default: ``abort``)
1304 are not ignored. (default: ``abort``)
1302
1305
1303 ``on-failure``
1306 ``on-failure``
1304 When set to ``continue`` (the default), the merge process attempts to
1307 When set to ``continue`` (the default), the merge process attempts to
1305 merge all unresolved files using the merge chosen tool, regardless of
1308 merge all unresolved files using the merge chosen tool, regardless of
1306 whether previous file merge attempts during the process succeeded or not.
1309 whether previous file merge attempts during the process succeeded or not.
1307 Setting this to ``prompt`` will prompt after any merge failure continue
1310 Setting this to ``prompt`` will prompt after any merge failure continue
1308 or halt the merge process. Setting this to ``halt`` will automatically
1311 or halt the merge process. Setting this to ``halt`` will automatically
1309 halt the merge process on any merge tool failure. The merge process
1312 halt the merge process on any merge tool failure. The merge process
1310 can be restarted by using the ``resolve`` command. When a merge is
1313 can be restarted by using the ``resolve`` command. When a merge is
1311 halted, the repository is left in a normal ``unresolved`` merge state.
1314 halted, the repository is left in a normal ``unresolved`` merge state.
1312 (default: ``continue``)
1315 (default: ``continue``)
1313
1316
1314 ``merge-patterns``
1317 ``merge-patterns``
1315 ------------------
1318 ------------------
1316
1319
1317 This section specifies merge tools to associate with particular file
1320 This section specifies merge tools to associate with particular file
1318 patterns. Tools matched here will take precedence over the default
1321 patterns. Tools matched here will take precedence over the default
1319 merge tool. Patterns are globs by default, rooted at the repository
1322 merge tool. Patterns are globs by default, rooted at the repository
1320 root.
1323 root.
1321
1324
1322 Example::
1325 Example::
1323
1326
1324 [merge-patterns]
1327 [merge-patterns]
1325 **.c = kdiff3
1328 **.c = kdiff3
1326 **.jpg = myimgmerge
1329 **.jpg = myimgmerge
1327
1330
1328 ``merge-tools``
1331 ``merge-tools``
1329 ---------------
1332 ---------------
1330
1333
1331 This section configures external merge tools to use for file-level
1334 This section configures external merge tools to use for file-level
1332 merges. This section has likely been preconfigured at install time.
1335 merges. This section has likely been preconfigured at install time.
1333 Use :hg:`config merge-tools` to check the existing configuration.
1336 Use :hg:`config merge-tools` to check the existing configuration.
1334 Also see :hg:`help merge-tools` for more details.
1337 Also see :hg:`help merge-tools` for more details.
1335
1338
1336 Example ``~/.hgrc``::
1339 Example ``~/.hgrc``::
1337
1340
1338 [merge-tools]
1341 [merge-tools]
1339 # Override stock tool location
1342 # Override stock tool location
1340 kdiff3.executable = ~/bin/kdiff3
1343 kdiff3.executable = ~/bin/kdiff3
1341 # Specify command line
1344 # Specify command line
1342 kdiff3.args = $base $local $other -o $output
1345 kdiff3.args = $base $local $other -o $output
1343 # Give higher priority
1346 # Give higher priority
1344 kdiff3.priority = 1
1347 kdiff3.priority = 1
1345
1348
1346 # Changing the priority of preconfigured tool
1349 # Changing the priority of preconfigured tool
1347 meld.priority = 0
1350 meld.priority = 0
1348
1351
1349 # Disable a preconfigured tool
1352 # Disable a preconfigured tool
1350 vimdiff.disabled = yes
1353 vimdiff.disabled = yes
1351
1354
1352 # Define new tool
1355 # Define new tool
1353 myHtmlTool.args = -m $local $other $base $output
1356 myHtmlTool.args = -m $local $other $base $output
1354 myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
1357 myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
1355 myHtmlTool.priority = 1
1358 myHtmlTool.priority = 1
1356
1359
1357 Supported arguments:
1360 Supported arguments:
1358
1361
1359 ``priority``
1362 ``priority``
1360 The priority in which to evaluate this tool.
1363 The priority in which to evaluate this tool.
1361 (default: 0)
1364 (default: 0)
1362
1365
1363 ``executable``
1366 ``executable``
1364 Either just the name of the executable or its pathname.
1367 Either just the name of the executable or its pathname.
1365
1368
1366 .. container:: windows
1369 .. container:: windows
1367
1370
1368 On Windows, the path can use environment variables with ${ProgramFiles}
1371 On Windows, the path can use environment variables with ${ProgramFiles}
1369 syntax.
1372 syntax.
1370
1373
1371 (default: the tool name)
1374 (default: the tool name)
1372
1375
1373 ``args``
1376 ``args``
1374 The arguments to pass to the tool executable. You can refer to the
1377 The arguments to pass to the tool executable. You can refer to the
1375 files being merged as well as the output file through these
1378 files being merged as well as the output file through these
1376 variables: ``$base``, ``$local``, ``$other``, ``$output``.
1379 variables: ``$base``, ``$local``, ``$other``, ``$output``.
1377
1380
1378 The meaning of ``$local`` and ``$other`` can vary depending on which action is
1381 The meaning of ``$local`` and ``$other`` can vary depending on which action is
1379 being performed. During an update or merge, ``$local`` represents the original
1382 being performed. During an update or merge, ``$local`` represents the original
1380 state of the file, while ``$other`` represents the commit you are updating to or
1383 state of the file, while ``$other`` represents the commit you are updating to or
1381 the commit you are merging with. During a rebase, ``$local`` represents the
1384 the commit you are merging with. During a rebase, ``$local`` represents the
1382 destination of the rebase, and ``$other`` represents the commit being rebased.
1385 destination of the rebase, and ``$other`` represents the commit being rebased.
1383
1386
1384 Some operations define custom labels to assist with identifying the revisions,
1387 Some operations define custom labels to assist with identifying the revisions,
1385 accessible via ``$labellocal``, ``$labelother``, and ``$labelbase``. If custom
1388 accessible via ``$labellocal``, ``$labelother``, and ``$labelbase``. If custom
1386 labels are not available, these will be ``local``, ``other``, and ``base``,
1389 labels are not available, these will be ``local``, ``other``, and ``base``,
1387 respectively.
1390 respectively.
1388 (default: ``$local $base $other``)
1391 (default: ``$local $base $other``)
1389
1392
1390 ``premerge``
1393 ``premerge``
1391 Attempt to run internal non-interactive 3-way merge tool before
1394 Attempt to run internal non-interactive 3-way merge tool before
1392 launching external tool. Options are ``true``, ``false``, ``keep`` or
1395 launching external tool. Options are ``true``, ``false``, ``keep`` or
1393 ``keep-merge3``. The ``keep`` option will leave markers in the file if the
1396 ``keep-merge3``. The ``keep`` option will leave markers in the file if the
1394 premerge fails. The ``keep-merge3`` will do the same but include information
1397 premerge fails. The ``keep-merge3`` will do the same but include information
1395 about the base of the merge in the marker (see internal :merge3 in
1398 about the base of the merge in the marker (see internal :merge3 in
1396 :hg:`help merge-tools`).
1399 :hg:`help merge-tools`).
1397 (default: True)
1400 (default: True)
1398
1401
1399 ``binary``
1402 ``binary``
1400 This tool can merge binary files. (default: False, unless tool
1403 This tool can merge binary files. (default: False, unless tool
1401 was selected by file pattern match)
1404 was selected by file pattern match)
1402
1405
1403 ``symlink``
1406 ``symlink``
1404 This tool can merge symlinks. (default: False)
1407 This tool can merge symlinks. (default: False)
1405
1408
1406 ``check``
1409 ``check``
1407 A list of merge success-checking options:
1410 A list of merge success-checking options:
1408
1411
1409 ``changed``
1412 ``changed``
1410 Ask whether merge was successful when the merged file shows no changes.
1413 Ask whether merge was successful when the merged file shows no changes.
1411 ``conflicts``
1414 ``conflicts``
1412 Check whether there are conflicts even though the tool reported success.
1415 Check whether there are conflicts even though the tool reported success.
1413 ``prompt``
1416 ``prompt``
1414 Always prompt for merge success, regardless of success reported by tool.
1417 Always prompt for merge success, regardless of success reported by tool.
1415
1418
1416 ``fixeol``
1419 ``fixeol``
1417 Attempt to fix up EOL changes caused by the merge tool.
1420 Attempt to fix up EOL changes caused by the merge tool.
1418 (default: False)
1421 (default: False)
1419
1422
1420 ``gui``
1423 ``gui``
1421 This tool requires a graphical interface to run. (default: False)
1424 This tool requires a graphical interface to run. (default: False)
1422
1425
1423 ``mergemarkers``
1426 ``mergemarkers``
1424 Controls whether the labels passed via ``$labellocal``, ``$labelother``, and
1427 Controls whether the labels passed via ``$labellocal``, ``$labelother``, and
1425 ``$labelbase`` are ``detailed`` (respecting ``mergemarkertemplate``) or
1428 ``$labelbase`` are ``detailed`` (respecting ``mergemarkertemplate``) or
1426 ``basic``. If ``premerge`` is ``keep`` or ``keep-merge3``, the conflict
1429 ``basic``. If ``premerge`` is ``keep`` or ``keep-merge3``, the conflict
1427 markers generated during premerge will be ``detailed`` if either this option or
1430 markers generated during premerge will be ``detailed`` if either this option or
1428 the corresponding option in the ``[ui]`` section is ``detailed``.
1431 the corresponding option in the ``[ui]`` section is ``detailed``.
1429 (default: ``basic``)
1432 (default: ``basic``)
1430
1433
1431 ``mergemarkertemplate``
1434 ``mergemarkertemplate``
1432 This setting can be used to override ``mergemarkertemplate`` from the ``[ui]``
1435 This setting can be used to override ``mergemarkertemplate`` from the ``[ui]``
1433 section on a per-tool basis; this applies to the ``$label``-prefixed variables
1436 section on a per-tool basis; this applies to the ``$label``-prefixed variables
1434 and to the conflict markers that are generated if ``premerge`` is ``keep` or
1437 and to the conflict markers that are generated if ``premerge`` is ``keep` or
1435 ``keep-merge3``. See the corresponding variable in ``[ui]`` for more
1438 ``keep-merge3``. See the corresponding variable in ``[ui]`` for more
1436 information.
1439 information.
1437
1440
1438 .. container:: windows
1441 .. container:: windows
1439
1442
1440 ``regkey``
1443 ``regkey``
1441 Windows registry key which describes install location of this
1444 Windows registry key which describes install location of this
1442 tool. Mercurial will search for this key first under
1445 tool. Mercurial will search for this key first under
1443 ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
1446 ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
1444 (default: None)
1447 (default: None)
1445
1448
1446 ``regkeyalt``
1449 ``regkeyalt``
1447 An alternate Windows registry key to try if the first key is not
1450 An alternate Windows registry key to try if the first key is not
1448 found. The alternate key uses the same ``regname`` and ``regappend``
1451 found. The alternate key uses the same ``regname`` and ``regappend``
1449 semantics of the primary key. The most common use for this key
1452 semantics of the primary key. The most common use for this key
1450 is to search for 32bit applications on 64bit operating systems.
1453 is to search for 32bit applications on 64bit operating systems.
1451 (default: None)
1454 (default: None)
1452
1455
1453 ``regname``
1456 ``regname``
1454 Name of value to read from specified registry key.
1457 Name of value to read from specified registry key.
1455 (default: the unnamed (default) value)
1458 (default: the unnamed (default) value)
1456
1459
1457 ``regappend``
1460 ``regappend``
1458 String to append to the value read from the registry, typically
1461 String to append to the value read from the registry, typically
1459 the executable name of the tool.
1462 the executable name of the tool.
1460 (default: None)
1463 (default: None)
1461
1464
1462 ``pager``
1465 ``pager``
1463 ---------
1466 ---------
1464
1467
1465 Setting used to control when to paginate and with what external tool. See
1468 Setting used to control when to paginate and with what external tool. See
1466 :hg:`help pager` for details.
1469 :hg:`help pager` for details.
1467
1470
1468 ``pager``
1471 ``pager``
1469 Define the external tool used as pager.
1472 Define the external tool used as pager.
1470
1473
1471 If no pager is set, Mercurial uses the environment variable $PAGER.
1474 If no pager is set, Mercurial uses the environment variable $PAGER.
1472 If neither pager.pager, nor $PAGER is set, a default pager will be
1475 If neither pager.pager, nor $PAGER is set, a default pager will be
1473 used, typically `less` on Unix and `more` on Windows. Example::
1476 used, typically `less` on Unix and `more` on Windows. Example::
1474
1477
1475 [pager]
1478 [pager]
1476 pager = less -FRX
1479 pager = less -FRX
1477
1480
1478 ``ignore``
1481 ``ignore``
1479 List of commands to disable the pager for. Example::
1482 List of commands to disable the pager for. Example::
1480
1483
1481 [pager]
1484 [pager]
1482 ignore = version, help, update
1485 ignore = version, help, update
1483
1486
1484 ``patch``
1487 ``patch``
1485 ---------
1488 ---------
1486
1489
1487 Settings used when applying patches, for instance through the 'import'
1490 Settings used when applying patches, for instance through the 'import'
1488 command or with Mercurial Queues extension.
1491 command or with Mercurial Queues extension.
1489
1492
1490 ``eol``
1493 ``eol``
1491 When set to 'strict' patch content and patched files end of lines
1494 When set to 'strict' patch content and patched files end of lines
1492 are preserved. When set to ``lf`` or ``crlf``, both files end of
1495 are preserved. When set to ``lf`` or ``crlf``, both files end of
1493 lines are ignored when patching and the result line endings are
1496 lines are ignored when patching and the result line endings are
1494 normalized to either LF (Unix) or CRLF (Windows). When set to
1497 normalized to either LF (Unix) or CRLF (Windows). When set to
1495 ``auto``, end of lines are again ignored while patching but line
1498 ``auto``, end of lines are again ignored while patching but line
1496 endings in patched files are normalized to their original setting
1499 endings in patched files are normalized to their original setting
1497 on a per-file basis. If target file does not exist or has no end
1500 on a per-file basis. If target file does not exist or has no end
1498 of line, patch line endings are preserved.
1501 of line, patch line endings are preserved.
1499 (default: strict)
1502 (default: strict)
1500
1503
1501 ``fuzz``
1504 ``fuzz``
1502 The number of lines of 'fuzz' to allow when applying patches. This
1505 The number of lines of 'fuzz' to allow when applying patches. This
1503 controls how much context the patcher is allowed to ignore when
1506 controls how much context the patcher is allowed to ignore when
1504 trying to apply a patch.
1507 trying to apply a patch.
1505 (default: 2)
1508 (default: 2)
1506
1509
1507 ``paths``
1510 ``paths``
1508 ---------
1511 ---------
1509
1512
1510 Assigns symbolic names and behavior to repositories.
1513 Assigns symbolic names and behavior to repositories.
1511
1514
1512 Options are symbolic names defining the URL or directory that is the
1515 Options are symbolic names defining the URL or directory that is the
1513 location of the repository. Example::
1516 location of the repository. Example::
1514
1517
1515 [paths]
1518 [paths]
1516 my_server = https://example.com/my_repo
1519 my_server = https://example.com/my_repo
1517 local_path = /home/me/repo
1520 local_path = /home/me/repo
1518
1521
1519 These symbolic names can be used from the command line. To pull
1522 These symbolic names can be used from the command line. To pull
1520 from ``my_server``: :hg:`pull my_server`. To push to ``local_path``:
1523 from ``my_server``: :hg:`pull my_server`. To push to ``local_path``:
1521 :hg:`push local_path`.
1524 :hg:`push local_path`.
1522
1525
1523 Options containing colons (``:``) denote sub-options that can influence
1526 Options containing colons (``:``) denote sub-options that can influence
1524 behavior for that specific path. Example::
1527 behavior for that specific path. Example::
1525
1528
1526 [paths]
1529 [paths]
1527 my_server = https://example.com/my_path
1530 my_server = https://example.com/my_path
1528 my_server:pushurl = ssh://example.com/my_path
1531 my_server:pushurl = ssh://example.com/my_path
1529
1532
1530 The following sub-options can be defined:
1533 The following sub-options can be defined:
1531
1534
1532 ``pushurl``
1535 ``pushurl``
1533 The URL to use for push operations. If not defined, the location
1536 The URL to use for push operations. If not defined, the location
1534 defined by the path's main entry is used.
1537 defined by the path's main entry is used.
1535
1538
1536 ``pushrev``
1539 ``pushrev``
1537 A revset defining which revisions to push by default.
1540 A revset defining which revisions to push by default.
1538
1541
1539 When :hg:`push` is executed without a ``-r`` argument, the revset
1542 When :hg:`push` is executed without a ``-r`` argument, the revset
1540 defined by this sub-option is evaluated to determine what to push.
1543 defined by this sub-option is evaluated to determine what to push.
1541
1544
1542 For example, a value of ``.`` will push the working directory's
1545 For example, a value of ``.`` will push the working directory's
1543 revision by default.
1546 revision by default.
1544
1547
1545 Revsets specifying bookmarks will not result in the bookmark being
1548 Revsets specifying bookmarks will not result in the bookmark being
1546 pushed.
1549 pushed.
1547
1550
1548 The following special named paths exist:
1551 The following special named paths exist:
1549
1552
1550 ``default``
1553 ``default``
1551 The URL or directory to use when no source or remote is specified.
1554 The URL or directory to use when no source or remote is specified.
1552
1555
1553 :hg:`clone` will automatically define this path to the location the
1556 :hg:`clone` will automatically define this path to the location the
1554 repository was cloned from.
1557 repository was cloned from.
1555
1558
1556 ``default-push``
1559 ``default-push``
1557 (deprecated) The URL or directory for the default :hg:`push` location.
1560 (deprecated) The URL or directory for the default :hg:`push` location.
1558 ``default:pushurl`` should be used instead.
1561 ``default:pushurl`` should be used instead.
1559
1562
1560 ``phases``
1563 ``phases``
1561 ----------
1564 ----------
1562
1565
1563 Specifies default handling of phases. See :hg:`help phases` for more
1566 Specifies default handling of phases. See :hg:`help phases` for more
1564 information about working with phases.
1567 information about working with phases.
1565
1568
1566 ``publish``
1569 ``publish``
1567 Controls draft phase behavior when working as a server. When true,
1570 Controls draft phase behavior when working as a server. When true,
1568 pushed changesets are set to public in both client and server and
1571 pushed changesets are set to public in both client and server and
1569 pulled or cloned changesets are set to public in the client.
1572 pulled or cloned changesets are set to public in the client.
1570 (default: True)
1573 (default: True)
1571
1574
1572 ``new-commit``
1575 ``new-commit``
1573 Phase of newly-created commits.
1576 Phase of newly-created commits.
1574 (default: draft)
1577 (default: draft)
1575
1578
1576 ``checksubrepos``
1579 ``checksubrepos``
1577 Check the phase of the current revision of each subrepository. Allowed
1580 Check the phase of the current revision of each subrepository. Allowed
1578 values are "ignore", "follow" and "abort". For settings other than
1581 values are "ignore", "follow" and "abort". For settings other than
1579 "ignore", the phase of the current revision of each subrepository is
1582 "ignore", the phase of the current revision of each subrepository is
1580 checked before committing the parent repository. If any of those phases is
1583 checked before committing the parent repository. If any of those phases is
1581 greater than the phase of the parent repository (e.g. if a subrepo is in a
1584 greater than the phase of the parent repository (e.g. if a subrepo is in a
1582 "secret" phase while the parent repo is in "draft" phase), the commit is
1585 "secret" phase while the parent repo is in "draft" phase), the commit is
1583 either aborted (if checksubrepos is set to "abort") or the higher phase is
1586 either aborted (if checksubrepos is set to "abort") or the higher phase is
1584 used for the parent repository commit (if set to "follow").
1587 used for the parent repository commit (if set to "follow").
1585 (default: follow)
1588 (default: follow)
1586
1589
1587
1590
1588 ``profiling``
1591 ``profiling``
1589 -------------
1592 -------------
1590
1593
1591 Specifies profiling type, format, and file output. Two profilers are
1594 Specifies profiling type, format, and file output. Two profilers are
1592 supported: an instrumenting profiler (named ``ls``), and a sampling
1595 supported: an instrumenting profiler (named ``ls``), and a sampling
1593 profiler (named ``stat``).
1596 profiler (named ``stat``).
1594
1597
1595 In this section description, 'profiling data' stands for the raw data
1598 In this section description, 'profiling data' stands for the raw data
1596 collected during profiling, while 'profiling report' stands for a
1599 collected during profiling, while 'profiling report' stands for a
1597 statistical text report generated from the profiling data.
1600 statistical text report generated from the profiling data.
1598
1601
1599 ``enabled``
1602 ``enabled``
1600 Enable the profiler.
1603 Enable the profiler.
1601 (default: false)
1604 (default: false)
1602
1605
1603 This is equivalent to passing ``--profile`` on the command line.
1606 This is equivalent to passing ``--profile`` on the command line.
1604
1607
1605 ``type``
1608 ``type``
1606 The type of profiler to use.
1609 The type of profiler to use.
1607 (default: stat)
1610 (default: stat)
1608
1611
1609 ``ls``
1612 ``ls``
1610 Use Python's built-in instrumenting profiler. This profiler
1613 Use Python's built-in instrumenting profiler. This profiler
1611 works on all platforms, but each line number it reports is the
1614 works on all platforms, but each line number it reports is the
1612 first line of a function. This restriction makes it difficult to
1615 first line of a function. This restriction makes it difficult to
1613 identify the expensive parts of a non-trivial function.
1616 identify the expensive parts of a non-trivial function.
1614 ``stat``
1617 ``stat``
1615 Use a statistical profiler, statprof. This profiler is most
1618 Use a statistical profiler, statprof. This profiler is most
1616 useful for profiling commands that run for longer than about 0.1
1619 useful for profiling commands that run for longer than about 0.1
1617 seconds.
1620 seconds.
1618
1621
1619 ``format``
1622 ``format``
1620 Profiling format. Specific to the ``ls`` instrumenting profiler.
1623 Profiling format. Specific to the ``ls`` instrumenting profiler.
1621 (default: text)
1624 (default: text)
1622
1625
1623 ``text``
1626 ``text``
1624 Generate a profiling report. When saving to a file, it should be
1627 Generate a profiling report. When saving to a file, it should be
1625 noted that only the report is saved, and the profiling data is
1628 noted that only the report is saved, and the profiling data is
1626 not kept.
1629 not kept.
1627 ``kcachegrind``
1630 ``kcachegrind``
1628 Format profiling data for kcachegrind use: when saving to a
1631 Format profiling data for kcachegrind use: when saving to a
1629 file, the generated file can directly be loaded into
1632 file, the generated file can directly be loaded into
1630 kcachegrind.
1633 kcachegrind.
1631
1634
1632 ``statformat``
1635 ``statformat``
1633 Profiling format for the ``stat`` profiler.
1636 Profiling format for the ``stat`` profiler.
1634 (default: hotpath)
1637 (default: hotpath)
1635
1638
1636 ``hotpath``
1639 ``hotpath``
1637 Show a tree-based display containing the hot path of execution (where
1640 Show a tree-based display containing the hot path of execution (where
1638 most time was spent).
1641 most time was spent).
1639 ``bymethod``
1642 ``bymethod``
1640 Show a table of methods ordered by how frequently they are active.
1643 Show a table of methods ordered by how frequently they are active.
1641 ``byline``
1644 ``byline``
1642 Show a table of lines in files ordered by how frequently they are active.
1645 Show a table of lines in files ordered by how frequently they are active.
1643 ``json``
1646 ``json``
1644 Render profiling data as JSON.
1647 Render profiling data as JSON.
1645
1648
1646 ``frequency``
1649 ``frequency``
1647 Sampling frequency. Specific to the ``stat`` sampling profiler.
1650 Sampling frequency. Specific to the ``stat`` sampling profiler.
1648 (default: 1000)
1651 (default: 1000)
1649
1652
1650 ``output``
1653 ``output``
1651 File path where profiling data or report should be saved. If the
1654 File path where profiling data or report should be saved. If the
1652 file exists, it is replaced. (default: None, data is printed on
1655 file exists, it is replaced. (default: None, data is printed on
1653 stderr)
1656 stderr)
1654
1657
1655 ``sort``
1658 ``sort``
1656 Sort field. Specific to the ``ls`` instrumenting profiler.
1659 Sort field. Specific to the ``ls`` instrumenting profiler.
1657 One of ``callcount``, ``reccallcount``, ``totaltime`` and
1660 One of ``callcount``, ``reccallcount``, ``totaltime`` and
1658 ``inlinetime``.
1661 ``inlinetime``.
1659 (default: inlinetime)
1662 (default: inlinetime)
1660
1663
1661 ``time-track``
1664 ``time-track``
1662 Control if the stat profiler track ``cpu`` or ``real`` time.
1665 Control if the stat profiler track ``cpu`` or ``real`` time.
1663 (default: ``cpu``)
1666 (default: ``cpu``)
1664
1667
1665 ``limit``
1668 ``limit``
1666 Number of lines to show. Specific to the ``ls`` instrumenting profiler.
1669 Number of lines to show. Specific to the ``ls`` instrumenting profiler.
1667 (default: 30)
1670 (default: 30)
1668
1671
1669 ``nested``
1672 ``nested``
1670 Show at most this number of lines of drill-down info after each main entry.
1673 Show at most this number of lines of drill-down info after each main entry.
1671 This can help explain the difference between Total and Inline.
1674 This can help explain the difference between Total and Inline.
1672 Specific to the ``ls`` instrumenting profiler.
1675 Specific to the ``ls`` instrumenting profiler.
1673 (default: 0)
1676 (default: 0)
1674
1677
1675 ``showmin``
1678 ``showmin``
1676 Minimum fraction of samples an entry must have for it to be displayed.
1679 Minimum fraction of samples an entry must have for it to be displayed.
1677 Can be specified as a float between ``0.0`` and ``1.0`` or can have a
1680 Can be specified as a float between ``0.0`` and ``1.0`` or can have a
1678 ``%`` afterwards to allow values up to ``100``. e.g. ``5%``.
1681 ``%`` afterwards to allow values up to ``100``. e.g. ``5%``.
1679
1682
1680 Only used by the ``stat`` profiler.
1683 Only used by the ``stat`` profiler.
1681
1684
1682 For the ``hotpath`` format, default is ``0.05``.
1685 For the ``hotpath`` format, default is ``0.05``.
1683 For the ``chrome`` format, default is ``0.005``.
1686 For the ``chrome`` format, default is ``0.005``.
1684
1687
1685 The option is unused on other formats.
1688 The option is unused on other formats.
1686
1689
1687 ``showmax``
1690 ``showmax``
1688 Maximum fraction of samples an entry can have before it is ignored in
1691 Maximum fraction of samples an entry can have before it is ignored in
1689 display. Values format is the same as ``showmin``.
1692 display. Values format is the same as ``showmin``.
1690
1693
1691 Only used by the ``stat`` profiler.
1694 Only used by the ``stat`` profiler.
1692
1695
1693 For the ``chrome`` format, default is ``0.999``.
1696 For the ``chrome`` format, default is ``0.999``.
1694
1697
1695 The option is unused on other formats.
1698 The option is unused on other formats.
1696
1699
1697 ``progress``
1700 ``progress``
1698 ------------
1701 ------------
1699
1702
1700 Mercurial commands can draw progress bars that are as informative as
1703 Mercurial commands can draw progress bars that are as informative as
1701 possible. Some progress bars only offer indeterminate information, while others
1704 possible. Some progress bars only offer indeterminate information, while others
1702 have a definite end point.
1705 have a definite end point.
1703
1706
1704 ``delay``
1707 ``delay``
1705 Number of seconds (float) before showing the progress bar. (default: 3)
1708 Number of seconds (float) before showing the progress bar. (default: 3)
1706
1709
1707 ``changedelay``
1710 ``changedelay``
1708 Minimum delay before showing a new topic. When set to less than 3 * refresh,
1711 Minimum delay before showing a new topic. When set to less than 3 * refresh,
1709 that value will be used instead. (default: 1)
1712 that value will be used instead. (default: 1)
1710
1713
1711 ``estimateinterval``
1714 ``estimateinterval``
1712 Maximum sampling interval in seconds for speed and estimated time
1715 Maximum sampling interval in seconds for speed and estimated time
1713 calculation. (default: 60)
1716 calculation. (default: 60)
1714
1717
1715 ``refresh``
1718 ``refresh``
1716 Time in seconds between refreshes of the progress bar. (default: 0.1)
1719 Time in seconds between refreshes of the progress bar. (default: 0.1)
1717
1720
1718 ``format``
1721 ``format``
1719 Format of the progress bar.
1722 Format of the progress bar.
1720
1723
1721 Valid entries for the format field are ``topic``, ``bar``, ``number``,
1724 Valid entries for the format field are ``topic``, ``bar``, ``number``,
1722 ``unit``, ``estimate``, ``speed``, and ``item``. ``item`` defaults to the
1725 ``unit``, ``estimate``, ``speed``, and ``item``. ``item`` defaults to the
1723 last 20 characters of the item, but this can be changed by adding either
1726 last 20 characters of the item, but this can be changed by adding either
1724 ``-<num>`` which would take the last num characters, or ``+<num>`` for the
1727 ``-<num>`` which would take the last num characters, or ``+<num>`` for the
1725 first num characters.
1728 first num characters.
1726
1729
1727 (default: topic bar number estimate)
1730 (default: topic bar number estimate)
1728
1731
1729 ``width``
1732 ``width``
1730 If set, the maximum width of the progress information (that is, min(width,
1733 If set, the maximum width of the progress information (that is, min(width,
1731 term width) will be used).
1734 term width) will be used).
1732
1735
1733 ``clear-complete``
1736 ``clear-complete``
1734 Clear the progress bar after it's done. (default: True)
1737 Clear the progress bar after it's done. (default: True)
1735
1738
1736 ``disable``
1739 ``disable``
1737 If true, don't show a progress bar.
1740 If true, don't show a progress bar.
1738
1741
1739 ``assume-tty``
1742 ``assume-tty``
1740 If true, ALWAYS show a progress bar, unless disable is given.
1743 If true, ALWAYS show a progress bar, unless disable is given.
1741
1744
1742 ``rebase``
1745 ``rebase``
1743 ----------
1746 ----------
1744
1747
1745 ``evolution.allowdivergence``
1748 ``evolution.allowdivergence``
1746 Default to False, when True allow creating divergence when performing
1749 Default to False, when True allow creating divergence when performing
1747 rebase of obsolete changesets.
1750 rebase of obsolete changesets.
1748
1751
1749 ``revsetalias``
1752 ``revsetalias``
1750 ---------------
1753 ---------------
1751
1754
1752 Alias definitions for revsets. See :hg:`help revsets` for details.
1755 Alias definitions for revsets. See :hg:`help revsets` for details.
1753
1756
1754 ``server``
1757 ``server``
1755 ----------
1758 ----------
1756
1759
1757 Controls generic server settings.
1760 Controls generic server settings.
1758
1761
1759 ``bookmarks-pushkey-compat``
1762 ``bookmarks-pushkey-compat``
1760 Trigger pushkey hook when being pushed bookmark updates. This config exist
1763 Trigger pushkey hook when being pushed bookmark updates. This config exist
1761 for compatibility purpose (default to True)
1764 for compatibility purpose (default to True)
1762
1765
1763 If you use ``pushkey`` and ``pre-pushkey`` hooks to control bookmark
1766 If you use ``pushkey`` and ``pre-pushkey`` hooks to control bookmark
1764 movement we recommend you migrate them to ``txnclose-bookmark`` and
1767 movement we recommend you migrate them to ``txnclose-bookmark`` and
1765 ``pretxnclose-bookmark``.
1768 ``pretxnclose-bookmark``.
1766
1769
1767 ``compressionengines``
1770 ``compressionengines``
1768 List of compression engines and their relative priority to advertise
1771 List of compression engines and their relative priority to advertise
1769 to clients.
1772 to clients.
1770
1773
1771 The order of compression engines determines their priority, the first
1774 The order of compression engines determines their priority, the first
1772 having the highest priority. If a compression engine is not listed
1775 having the highest priority. If a compression engine is not listed
1773 here, it won't be advertised to clients.
1776 here, it won't be advertised to clients.
1774
1777
1775 If not set (the default), built-in defaults are used. Run
1778 If not set (the default), built-in defaults are used. Run
1776 :hg:`debuginstall` to list available compression engines and their
1779 :hg:`debuginstall` to list available compression engines and their
1777 default wire protocol priority.
1780 default wire protocol priority.
1778
1781
1779 Older Mercurial clients only support zlib compression and this setting
1782 Older Mercurial clients only support zlib compression and this setting
1780 has no effect for legacy clients.
1783 has no effect for legacy clients.
1781
1784
1782 ``uncompressed``
1785 ``uncompressed``
1783 Whether to allow clients to clone a repository using the
1786 Whether to allow clients to clone a repository using the
1784 uncompressed streaming protocol. This transfers about 40% more
1787 uncompressed streaming protocol. This transfers about 40% more
1785 data than a regular clone, but uses less memory and CPU on both
1788 data than a regular clone, but uses less memory and CPU on both
1786 server and client. Over a LAN (100 Mbps or better) or a very fast
1789 server and client. Over a LAN (100 Mbps or better) or a very fast
1787 WAN, an uncompressed streaming clone is a lot faster (~10x) than a
1790 WAN, an uncompressed streaming clone is a lot faster (~10x) than a
1788 regular clone. Over most WAN connections (anything slower than
1791 regular clone. Over most WAN connections (anything slower than
1789 about 6 Mbps), uncompressed streaming is slower, because of the
1792 about 6 Mbps), uncompressed streaming is slower, because of the
1790 extra data transfer overhead. This mode will also temporarily hold
1793 extra data transfer overhead. This mode will also temporarily hold
1791 the write lock while determining what data to transfer.
1794 the write lock while determining what data to transfer.
1792 (default: True)
1795 (default: True)
1793
1796
1794 ``uncompressedallowsecret``
1797 ``uncompressedallowsecret``
1795 Whether to allow stream clones when the repository contains secret
1798 Whether to allow stream clones when the repository contains secret
1796 changesets. (default: False)
1799 changesets. (default: False)
1797
1800
1798 ``preferuncompressed``
1801 ``preferuncompressed``
1799 When set, clients will try to use the uncompressed streaming
1802 When set, clients will try to use the uncompressed streaming
1800 protocol. (default: False)
1803 protocol. (default: False)
1801
1804
1802 ``disablefullbundle``
1805 ``disablefullbundle``
1803 When set, servers will refuse attempts to do pull-based clones.
1806 When set, servers will refuse attempts to do pull-based clones.
1804 If this option is set, ``preferuncompressed`` and/or clone bundles
1807 If this option is set, ``preferuncompressed`` and/or clone bundles
1805 are highly recommended. Partial clones will still be allowed.
1808 are highly recommended. Partial clones will still be allowed.
1806 (default: False)
1809 (default: False)
1807
1810
1808 ``streamunbundle``
1811 ``streamunbundle``
1809 When set, servers will apply data sent from the client directly,
1812 When set, servers will apply data sent from the client directly,
1810 otherwise it will be written to a temporary file first. This option
1813 otherwise it will be written to a temporary file first. This option
1811 effectively prevents concurrent pushes.
1814 effectively prevents concurrent pushes.
1812
1815
1813 ``pullbundle``
1816 ``pullbundle``
1814 When set, the server will check pullbundle.manifest for bundles
1817 When set, the server will check pullbundle.manifest for bundles
1815 covering the requested heads and common nodes. The first matching
1818 covering the requested heads and common nodes. The first matching
1816 entry will be streamed to the client.
1819 entry will be streamed to the client.
1817
1820
1818 For HTTP transport, the stream will still use zlib compression
1821 For HTTP transport, the stream will still use zlib compression
1819 for older clients.
1822 for older clients.
1820
1823
1821 ``concurrent-push-mode``
1824 ``concurrent-push-mode``
1822 Level of allowed race condition between two pushing clients.
1825 Level of allowed race condition between two pushing clients.
1823
1826
1824 - 'strict': push is abort if another client touched the repository
1827 - 'strict': push is abort if another client touched the repository
1825 while the push was preparing. (default)
1828 while the push was preparing. (default)
1826 - 'check-related': push is only aborted if it affects head that got also
1829 - 'check-related': push is only aborted if it affects head that got also
1827 affected while the push was preparing.
1830 affected while the push was preparing.
1828
1831
1829 This requires compatible client (version 4.3 and later). Old client will
1832 This requires compatible client (version 4.3 and later). Old client will
1830 use 'strict'.
1833 use 'strict'.
1831
1834
1832 ``validate``
1835 ``validate``
1833 Whether to validate the completeness of pushed changesets by
1836 Whether to validate the completeness of pushed changesets by
1834 checking that all new file revisions specified in manifests are
1837 checking that all new file revisions specified in manifests are
1835 present. (default: False)
1838 present. (default: False)
1836
1839
1837 ``maxhttpheaderlen``
1840 ``maxhttpheaderlen``
1838 Instruct HTTP clients not to send request headers longer than this
1841 Instruct HTTP clients not to send request headers longer than this
1839 many bytes. (default: 1024)
1842 many bytes. (default: 1024)
1840
1843
1841 ``bundle1``
1844 ``bundle1``
1842 Whether to allow clients to push and pull using the legacy bundle1
1845 Whether to allow clients to push and pull using the legacy bundle1
1843 exchange format. (default: True)
1846 exchange format. (default: True)
1844
1847
1845 ``bundle1gd``
1848 ``bundle1gd``
1846 Like ``bundle1`` but only used if the repository is using the
1849 Like ``bundle1`` but only used if the repository is using the
1847 *generaldelta* storage format. (default: True)
1850 *generaldelta* storage format. (default: True)
1848
1851
1849 ``bundle1.push``
1852 ``bundle1.push``
1850 Whether to allow clients to push using the legacy bundle1 exchange
1853 Whether to allow clients to push using the legacy bundle1 exchange
1851 format. (default: True)
1854 format. (default: True)
1852
1855
1853 ``bundle1gd.push``
1856 ``bundle1gd.push``
1854 Like ``bundle1.push`` but only used if the repository is using the
1857 Like ``bundle1.push`` but only used if the repository is using the
1855 *generaldelta* storage format. (default: True)
1858 *generaldelta* storage format. (default: True)
1856
1859
1857 ``bundle1.pull``
1860 ``bundle1.pull``
1858 Whether to allow clients to pull using the legacy bundle1 exchange
1861 Whether to allow clients to pull using the legacy bundle1 exchange
1859 format. (default: True)
1862 format. (default: True)
1860
1863
1861 ``bundle1gd.pull``
1864 ``bundle1gd.pull``
1862 Like ``bundle1.pull`` but only used if the repository is using the
1865 Like ``bundle1.pull`` but only used if the repository is using the
1863 *generaldelta* storage format. (default: True)
1866 *generaldelta* storage format. (default: True)
1864
1867
1865 Large repositories using the *generaldelta* storage format should
1868 Large repositories using the *generaldelta* storage format should
1866 consider setting this option because converting *generaldelta*
1869 consider setting this option because converting *generaldelta*
1867 repositories to the exchange format required by the bundle1 data
1870 repositories to the exchange format required by the bundle1 data
1868 format can consume a lot of CPU.
1871 format can consume a lot of CPU.
1869
1872
1870 ``zliblevel``
1873 ``zliblevel``
1871 Integer between ``-1`` and ``9`` that controls the zlib compression level
1874 Integer between ``-1`` and ``9`` that controls the zlib compression level
1872 for wire protocol commands that send zlib compressed output (notably the
1875 for wire protocol commands that send zlib compressed output (notably the
1873 commands that send repository history data).
1876 commands that send repository history data).
1874
1877
1875 The default (``-1``) uses the default zlib compression level, which is
1878 The default (``-1``) uses the default zlib compression level, which is
1876 likely equivalent to ``6``. ``0`` means no compression. ``9`` means
1879 likely equivalent to ``6``. ``0`` means no compression. ``9`` means
1877 maximum compression.
1880 maximum compression.
1878
1881
1879 Setting this option allows server operators to make trade-offs between
1882 Setting this option allows server operators to make trade-offs between
1880 bandwidth and CPU used. Lowering the compression lowers CPU utilization
1883 bandwidth and CPU used. Lowering the compression lowers CPU utilization
1881 but sends more bytes to clients.
1884 but sends more bytes to clients.
1882
1885
1883 This option only impacts the HTTP server.
1886 This option only impacts the HTTP server.
1884
1887
1885 ``zstdlevel``
1888 ``zstdlevel``
1886 Integer between ``1`` and ``22`` that controls the zstd compression level
1889 Integer between ``1`` and ``22`` that controls the zstd compression level
1887 for wire protocol commands. ``1`` is the minimal amount of compression and
1890 for wire protocol commands. ``1`` is the minimal amount of compression and
1888 ``22`` is the highest amount of compression.
1891 ``22`` is the highest amount of compression.
1889
1892
1890 The default (``3``) should be significantly faster than zlib while likely
1893 The default (``3``) should be significantly faster than zlib while likely
1891 delivering better compression ratios.
1894 delivering better compression ratios.
1892
1895
1893 This option only impacts the HTTP server.
1896 This option only impacts the HTTP server.
1894
1897
1895 See also ``server.zliblevel``.
1898 See also ``server.zliblevel``.
1896
1899
1897 ``smtp``
1900 ``smtp``
1898 --------
1901 --------
1899
1902
1900 Configuration for extensions that need to send email messages.
1903 Configuration for extensions that need to send email messages.
1901
1904
1902 ``host``
1905 ``host``
1903 Host name of mail server, e.g. "mail.example.com".
1906 Host name of mail server, e.g. "mail.example.com".
1904
1907
1905 ``port``
1908 ``port``
1906 Optional. Port to connect to on mail server. (default: 465 if
1909 Optional. Port to connect to on mail server. (default: 465 if
1907 ``tls`` is smtps; 25 otherwise)
1910 ``tls`` is smtps; 25 otherwise)
1908
1911
1909 ``tls``
1912 ``tls``
1910 Optional. Method to enable TLS when connecting to mail server: starttls,
1913 Optional. Method to enable TLS when connecting to mail server: starttls,
1911 smtps or none. (default: none)
1914 smtps or none. (default: none)
1912
1915
1913 ``username``
1916 ``username``
1914 Optional. User name for authenticating with the SMTP server.
1917 Optional. User name for authenticating with the SMTP server.
1915 (default: None)
1918 (default: None)
1916
1919
1917 ``password``
1920 ``password``
1918 Optional. Password for authenticating with the SMTP server. If not
1921 Optional. Password for authenticating with the SMTP server. If not
1919 specified, interactive sessions will prompt the user for a
1922 specified, interactive sessions will prompt the user for a
1920 password; non-interactive sessions will fail. (default: None)
1923 password; non-interactive sessions will fail. (default: None)
1921
1924
1922 ``local_hostname``
1925 ``local_hostname``
1923 Optional. The hostname that the sender can use to identify
1926 Optional. The hostname that the sender can use to identify
1924 itself to the MTA.
1927 itself to the MTA.
1925
1928
1926
1929
1927 ``subpaths``
1930 ``subpaths``
1928 ------------
1931 ------------
1929
1932
1930 Subrepository source URLs can go stale if a remote server changes name
1933 Subrepository source URLs can go stale if a remote server changes name
1931 or becomes temporarily unavailable. This section lets you define
1934 or becomes temporarily unavailable. This section lets you define
1932 rewrite rules of the form::
1935 rewrite rules of the form::
1933
1936
1934 <pattern> = <replacement>
1937 <pattern> = <replacement>
1935
1938
1936 where ``pattern`` is a regular expression matching a subrepository
1939 where ``pattern`` is a regular expression matching a subrepository
1937 source URL and ``replacement`` is the replacement string used to
1940 source URL and ``replacement`` is the replacement string used to
1938 rewrite it. Groups can be matched in ``pattern`` and referenced in
1941 rewrite it. Groups can be matched in ``pattern`` and referenced in
1939 ``replacements``. For instance::
1942 ``replacements``. For instance::
1940
1943
1941 http://server/(.*)-hg/ = http://hg.server/\1/
1944 http://server/(.*)-hg/ = http://hg.server/\1/
1942
1945
1943 rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``.
1946 rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``.
1944
1947
1945 Relative subrepository paths are first made absolute, and the
1948 Relative subrepository paths are first made absolute, and the
1946 rewrite rules are then applied on the full (absolute) path. If ``pattern``
1949 rewrite rules are then applied on the full (absolute) path. If ``pattern``
1947 doesn't match the full path, an attempt is made to apply it on the
1950 doesn't match the full path, an attempt is made to apply it on the
1948 relative path alone. The rules are applied in definition order.
1951 relative path alone. The rules are applied in definition order.
1949
1952
1950 ``subrepos``
1953 ``subrepos``
1951 ------------
1954 ------------
1952
1955
1953 This section contains options that control the behavior of the
1956 This section contains options that control the behavior of the
1954 subrepositories feature. See also :hg:`help subrepos`.
1957 subrepositories feature. See also :hg:`help subrepos`.
1955
1958
1956 Security note: auditing in Mercurial is known to be insufficient to
1959 Security note: auditing in Mercurial is known to be insufficient to
1957 prevent clone-time code execution with carefully constructed Git
1960 prevent clone-time code execution with carefully constructed Git
1958 subrepos. It is unknown if a similar detect is present in Subversion
1961 subrepos. It is unknown if a similar detect is present in Subversion
1959 subrepos. Both Git and Subversion subrepos are disabled by default
1962 subrepos. Both Git and Subversion subrepos are disabled by default
1960 out of security concerns. These subrepo types can be enabled using
1963 out of security concerns. These subrepo types can be enabled using
1961 the respective options below.
1964 the respective options below.
1962
1965
1963 ``allowed``
1966 ``allowed``
1964 Whether subrepositories are allowed in the working directory.
1967 Whether subrepositories are allowed in the working directory.
1965
1968
1966 When false, commands involving subrepositories (like :hg:`update`)
1969 When false, commands involving subrepositories (like :hg:`update`)
1967 will fail for all subrepository types.
1970 will fail for all subrepository types.
1968 (default: true)
1971 (default: true)
1969
1972
1970 ``hg:allowed``
1973 ``hg:allowed``
1971 Whether Mercurial subrepositories are allowed in the working
1974 Whether Mercurial subrepositories are allowed in the working
1972 directory. This option only has an effect if ``subrepos.allowed``
1975 directory. This option only has an effect if ``subrepos.allowed``
1973 is true.
1976 is true.
1974 (default: true)
1977 (default: true)
1975
1978
1976 ``git:allowed``
1979 ``git:allowed``
1977 Whether Git subrepositories are allowed in the working directory.
1980 Whether Git subrepositories are allowed in the working directory.
1978 This option only has an effect if ``subrepos.allowed`` is true.
1981 This option only has an effect if ``subrepos.allowed`` is true.
1979
1982
1980 See the security note above before enabling Git subrepos.
1983 See the security note above before enabling Git subrepos.
1981 (default: false)
1984 (default: false)
1982
1985
1983 ``svn:allowed``
1986 ``svn:allowed``
1984 Whether Subversion subrepositories are allowed in the working
1987 Whether Subversion subrepositories are allowed in the working
1985 directory. This option only has an effect if ``subrepos.allowed``
1988 directory. This option only has an effect if ``subrepos.allowed``
1986 is true.
1989 is true.
1987
1990
1988 See the security note above before enabling Subversion subrepos.
1991 See the security note above before enabling Subversion subrepos.
1989 (default: false)
1992 (default: false)
1990
1993
1991 ``templatealias``
1994 ``templatealias``
1992 -----------------
1995 -----------------
1993
1996
1994 Alias definitions for templates. See :hg:`help templates` for details.
1997 Alias definitions for templates. See :hg:`help templates` for details.
1995
1998
1996 ``templates``
1999 ``templates``
1997 -------------
2000 -------------
1998
2001
1999 Use the ``[templates]`` section to define template strings.
2002 Use the ``[templates]`` section to define template strings.
2000 See :hg:`help templates` for details.
2003 See :hg:`help templates` for details.
2001
2004
2002 ``trusted``
2005 ``trusted``
2003 -----------
2006 -----------
2004
2007
2005 Mercurial will not use the settings in the
2008 Mercurial will not use the settings in the
2006 ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
2009 ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
2007 user or to a trusted group, as various hgrc features allow arbitrary
2010 user or to a trusted group, as various hgrc features allow arbitrary
2008 commands to be run. This issue is often encountered when configuring
2011 commands to be run. This issue is often encountered when configuring
2009 hooks or extensions for shared repositories or servers. However,
2012 hooks or extensions for shared repositories or servers. However,
2010 the web interface will use some safe settings from the ``[web]``
2013 the web interface will use some safe settings from the ``[web]``
2011 section.
2014 section.
2012
2015
2013 This section specifies what users and groups are trusted. The
2016 This section specifies what users and groups are trusted. The
2014 current user is always trusted. To trust everybody, list a user or a
2017 current user is always trusted. To trust everybody, list a user or a
2015 group with name ``*``. These settings must be placed in an
2018 group with name ``*``. These settings must be placed in an
2016 *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the
2019 *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the
2017 user or service running Mercurial.
2020 user or service running Mercurial.
2018
2021
2019 ``users``
2022 ``users``
2020 Comma-separated list of trusted users.
2023 Comma-separated list of trusted users.
2021
2024
2022 ``groups``
2025 ``groups``
2023 Comma-separated list of trusted groups.
2026 Comma-separated list of trusted groups.
2024
2027
2025
2028
2026 ``ui``
2029 ``ui``
2027 ------
2030 ------
2028
2031
2029 User interface controls.
2032 User interface controls.
2030
2033
2031 ``archivemeta``
2034 ``archivemeta``
2032 Whether to include the .hg_archival.txt file containing meta data
2035 Whether to include the .hg_archival.txt file containing meta data
2033 (hashes for the repository base and for tip) in archives created
2036 (hashes for the repository base and for tip) in archives created
2034 by the :hg:`archive` command or downloaded via hgweb.
2037 by the :hg:`archive` command or downloaded via hgweb.
2035 (default: True)
2038 (default: True)
2036
2039
2037 ``askusername``
2040 ``askusername``
2038 Whether to prompt for a username when committing. If True, and
2041 Whether to prompt for a username when committing. If True, and
2039 neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
2042 neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
2040 be prompted to enter a username. If no username is entered, the
2043 be prompted to enter a username. If no username is entered, the
2041 default ``USER@HOST`` is used instead.
2044 default ``USER@HOST`` is used instead.
2042 (default: False)
2045 (default: False)
2043
2046
2044 ``clonebundles``
2047 ``clonebundles``
2045 Whether the "clone bundles" feature is enabled.
2048 Whether the "clone bundles" feature is enabled.
2046
2049
2047 When enabled, :hg:`clone` may download and apply a server-advertised
2050 When enabled, :hg:`clone` may download and apply a server-advertised
2048 bundle file from a URL instead of using the normal exchange mechanism.
2051 bundle file from a URL instead of using the normal exchange mechanism.
2049
2052
2050 This can likely result in faster and more reliable clones.
2053 This can likely result in faster and more reliable clones.
2051
2054
2052 (default: True)
2055 (default: True)
2053
2056
2054 ``clonebundlefallback``
2057 ``clonebundlefallback``
2055 Whether failure to apply an advertised "clone bundle" from a server
2058 Whether failure to apply an advertised "clone bundle" from a server
2056 should result in fallback to a regular clone.
2059 should result in fallback to a regular clone.
2057
2060
2058 This is disabled by default because servers advertising "clone
2061 This is disabled by default because servers advertising "clone
2059 bundles" often do so to reduce server load. If advertised bundles
2062 bundles" often do so to reduce server load. If advertised bundles
2060 start mass failing and clients automatically fall back to a regular
2063 start mass failing and clients automatically fall back to a regular
2061 clone, this would add significant and unexpected load to the server
2064 clone, this would add significant and unexpected load to the server
2062 since the server is expecting clone operations to be offloaded to
2065 since the server is expecting clone operations to be offloaded to
2063 pre-generated bundles. Failing fast (the default behavior) ensures
2066 pre-generated bundles. Failing fast (the default behavior) ensures
2064 clients don't overwhelm the server when "clone bundle" application
2067 clients don't overwhelm the server when "clone bundle" application
2065 fails.
2068 fails.
2066
2069
2067 (default: False)
2070 (default: False)
2068
2071
2069 ``clonebundleprefers``
2072 ``clonebundleprefers``
2070 Defines preferences for which "clone bundles" to use.
2073 Defines preferences for which "clone bundles" to use.
2071
2074
2072 Servers advertising "clone bundles" may advertise multiple available
2075 Servers advertising "clone bundles" may advertise multiple available
2073 bundles. Each bundle may have different attributes, such as the bundle
2076 bundles. Each bundle may have different attributes, such as the bundle
2074 type and compression format. This option is used to prefer a particular
2077 type and compression format. This option is used to prefer a particular
2075 bundle over another.
2078 bundle over another.
2076
2079
2077 The following keys are defined by Mercurial:
2080 The following keys are defined by Mercurial:
2078
2081
2079 BUNDLESPEC
2082 BUNDLESPEC
2080 A bundle type specifier. These are strings passed to :hg:`bundle -t`.
2083 A bundle type specifier. These are strings passed to :hg:`bundle -t`.
2081 e.g. ``gzip-v2`` or ``bzip2-v1``.
2084 e.g. ``gzip-v2`` or ``bzip2-v1``.
2082
2085
2083 COMPRESSION
2086 COMPRESSION
2084 The compression format of the bundle. e.g. ``gzip`` and ``bzip2``.
2087 The compression format of the bundle. e.g. ``gzip`` and ``bzip2``.
2085
2088
2086 Server operators may define custom keys.
2089 Server operators may define custom keys.
2087
2090
2088 Example values: ``COMPRESSION=bzip2``,
2091 Example values: ``COMPRESSION=bzip2``,
2089 ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``.
2092 ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``.
2090
2093
2091 By default, the first bundle advertised by the server is used.
2094 By default, the first bundle advertised by the server is used.
2092
2095
2093 ``color``
2096 ``color``
2094 When to colorize output. Possible value are Boolean ("yes" or "no"), or
2097 When to colorize output. Possible value are Boolean ("yes" or "no"), or
2095 "debug", or "always". (default: "yes"). "yes" will use color whenever it
2098 "debug", or "always". (default: "yes"). "yes" will use color whenever it
2096 seems possible. See :hg:`help color` for details.
2099 seems possible. See :hg:`help color` for details.
2097
2100
2098 ``commitsubrepos``
2101 ``commitsubrepos``
2099 Whether to commit modified subrepositories when committing the
2102 Whether to commit modified subrepositories when committing the
2100 parent repository. If False and one subrepository has uncommitted
2103 parent repository. If False and one subrepository has uncommitted
2101 changes, abort the commit.
2104 changes, abort the commit.
2102 (default: False)
2105 (default: False)
2103
2106
2104 ``debug``
2107 ``debug``
2105 Print debugging information. (default: False)
2108 Print debugging information. (default: False)
2106
2109
2107 ``editor``
2110 ``editor``
2108 The editor to use during a commit. (default: ``$EDITOR`` or ``vi``)
2111 The editor to use during a commit. (default: ``$EDITOR`` or ``vi``)
2109
2112
2110 ``fallbackencoding``
2113 ``fallbackencoding``
2111 Encoding to try if it's not possible to decode the changelog using
2114 Encoding to try if it's not possible to decode the changelog using
2112 UTF-8. (default: ISO-8859-1)
2115 UTF-8. (default: ISO-8859-1)
2113
2116
2114 ``graphnodetemplate``
2117 ``graphnodetemplate``
2115 The template used to print changeset nodes in an ASCII revision graph.
2118 The template used to print changeset nodes in an ASCII revision graph.
2116 (default: ``{graphnode}``)
2119 (default: ``{graphnode}``)
2117
2120
2118 ``ignore``
2121 ``ignore``
2119 A file to read per-user ignore patterns from. This file should be
2122 A file to read per-user ignore patterns from. This file should be
2120 in the same format as a repository-wide .hgignore file. Filenames
2123 in the same format as a repository-wide .hgignore file. Filenames
2121 are relative to the repository root. This option supports hook syntax,
2124 are relative to the repository root. This option supports hook syntax,
2122 so if you want to specify multiple ignore files, you can do so by
2125 so if you want to specify multiple ignore files, you can do so by
2123 setting something like ``ignore.other = ~/.hgignore2``. For details
2126 setting something like ``ignore.other = ~/.hgignore2``. For details
2124 of the ignore file format, see the ``hgignore(5)`` man page.
2127 of the ignore file format, see the ``hgignore(5)`` man page.
2125
2128
2126 ``interactive``
2129 ``interactive``
2127 Allow to prompt the user. (default: True)
2130 Allow to prompt the user. (default: True)
2128
2131
2129 ``interface``
2132 ``interface``
2130 Select the default interface for interactive features (default: text).
2133 Select the default interface for interactive features (default: text).
2131 Possible values are 'text' and 'curses'.
2134 Possible values are 'text' and 'curses'.
2132
2135
2133 ``interface.chunkselector``
2136 ``interface.chunkselector``
2134 Select the interface for change recording (e.g. :hg:`commit -i`).
2137 Select the interface for change recording (e.g. :hg:`commit -i`).
2135 Possible values are 'text' and 'curses'.
2138 Possible values are 'text' and 'curses'.
2136 This config overrides the interface specified by ui.interface.
2139 This config overrides the interface specified by ui.interface.
2137
2140
2138 ``logtemplate``
2141 ``logtemplate``
2139 Template string for commands that print changesets.
2142 Template string for commands that print changesets.
2140
2143
2141 ``merge``
2144 ``merge``
2142 The conflict resolution program to use during a manual merge.
2145 The conflict resolution program to use during a manual merge.
2143 For more information on merge tools see :hg:`help merge-tools`.
2146 For more information on merge tools see :hg:`help merge-tools`.
2144 For configuring merge tools see the ``[merge-tools]`` section.
2147 For configuring merge tools see the ``[merge-tools]`` section.
2145
2148
2146 ``mergemarkers``
2149 ``mergemarkers``
2147 Sets the merge conflict marker label styling. The ``detailed``
2150 Sets the merge conflict marker label styling. The ``detailed``
2148 style uses the ``mergemarkertemplate`` setting to style the labels.
2151 style uses the ``mergemarkertemplate`` setting to style the labels.
2149 The ``basic`` style just uses 'local' and 'other' as the marker label.
2152 The ``basic`` style just uses 'local' and 'other' as the marker label.
2150 One of ``basic`` or ``detailed``.
2153 One of ``basic`` or ``detailed``.
2151 (default: ``basic``)
2154 (default: ``basic``)
2152
2155
2153 ``mergemarkertemplate``
2156 ``mergemarkertemplate``
2154 The template used to print the commit description next to each conflict
2157 The template used to print the commit description next to each conflict
2155 marker during merge conflicts. See :hg:`help templates` for the template
2158 marker during merge conflicts. See :hg:`help templates` for the template
2156 format.
2159 format.
2157
2160
2158 Defaults to showing the hash, tags, branches, bookmarks, author, and
2161 Defaults to showing the hash, tags, branches, bookmarks, author, and
2159 the first line of the commit description.
2162 the first line of the commit description.
2160
2163
2161 If you use non-ASCII characters in names for tags, branches, bookmarks,
2164 If you use non-ASCII characters in names for tags, branches, bookmarks,
2162 authors, and/or commit descriptions, you must pay attention to encodings of
2165 authors, and/or commit descriptions, you must pay attention to encodings of
2163 managed files. At template expansion, non-ASCII characters use the encoding
2166 managed files. At template expansion, non-ASCII characters use the encoding
2164 specified by the ``--encoding`` global option, ``HGENCODING`` or other
2167 specified by the ``--encoding`` global option, ``HGENCODING`` or other
2165 environment variables that govern your locale. If the encoding of the merge
2168 environment variables that govern your locale. If the encoding of the merge
2166 markers is different from the encoding of the merged files,
2169 markers is different from the encoding of the merged files,
2167 serious problems may occur.
2170 serious problems may occur.
2168
2171
2169 Can be overridden per-merge-tool, see the ``[merge-tools]`` section.
2172 Can be overridden per-merge-tool, see the ``[merge-tools]`` section.
2170
2173
2171 ``origbackuppath``
2174 ``origbackuppath``
2172 The path to a directory used to store generated .orig files. If the path is
2175 The path to a directory used to store generated .orig files. If the path is
2173 not a directory, one will be created. If set, files stored in this
2176 not a directory, one will be created. If set, files stored in this
2174 directory have the same name as the original file and do not have a .orig
2177 directory have the same name as the original file and do not have a .orig
2175 suffix.
2178 suffix.
2176
2179
2177 ``paginate``
2180 ``paginate``
2178 Control the pagination of command output (default: True). See :hg:`help pager`
2181 Control the pagination of command output (default: True). See :hg:`help pager`
2179 for details.
2182 for details.
2180
2183
2181 ``patch``
2184 ``patch``
2182 An optional external tool that ``hg import`` and some extensions
2185 An optional external tool that ``hg import`` and some extensions
2183 will use for applying patches. By default Mercurial uses an
2186 will use for applying patches. By default Mercurial uses an
2184 internal patch utility. The external tool must work as the common
2187 internal patch utility. The external tool must work as the common
2185 Unix ``patch`` program. In particular, it must accept a ``-p``
2188 Unix ``patch`` program. In particular, it must accept a ``-p``
2186 argument to strip patch headers, a ``-d`` argument to specify the
2189 argument to strip patch headers, a ``-d`` argument to specify the
2187 current directory, a file name to patch, and a patch file to take
2190 current directory, a file name to patch, and a patch file to take
2188 from stdin.
2191 from stdin.
2189
2192
2190 It is possible to specify a patch tool together with extra
2193 It is possible to specify a patch tool together with extra
2191 arguments. For example, setting this option to ``patch --merge``
2194 arguments. For example, setting this option to ``patch --merge``
2192 will use the ``patch`` program with its 2-way merge option.
2195 will use the ``patch`` program with its 2-way merge option.
2193
2196
2194 ``portablefilenames``
2197 ``portablefilenames``
2195 Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``.
2198 Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``.
2196 (default: ``warn``)
2199 (default: ``warn``)
2197
2200
2198 ``warn``
2201 ``warn``
2199 Print a warning message on POSIX platforms, if a file with a non-portable
2202 Print a warning message on POSIX platforms, if a file with a non-portable
2200 filename is added (e.g. a file with a name that can't be created on
2203 filename is added (e.g. a file with a name that can't be created on
2201 Windows because it contains reserved parts like ``AUX``, reserved
2204 Windows because it contains reserved parts like ``AUX``, reserved
2202 characters like ``:``, or would cause a case collision with an existing
2205 characters like ``:``, or would cause a case collision with an existing
2203 file).
2206 file).
2204
2207
2205 ``ignore``
2208 ``ignore``
2206 Don't print a warning.
2209 Don't print a warning.
2207
2210
2208 ``abort``
2211 ``abort``
2209 The command is aborted.
2212 The command is aborted.
2210
2213
2211 ``true``
2214 ``true``
2212 Alias for ``warn``.
2215 Alias for ``warn``.
2213
2216
2214 ``false``
2217 ``false``
2215 Alias for ``ignore``.
2218 Alias for ``ignore``.
2216
2219
2217 .. container:: windows
2220 .. container:: windows
2218
2221
2219 On Windows, this configuration option is ignored and the command aborted.
2222 On Windows, this configuration option is ignored and the command aborted.
2220
2223
2221 ``quiet``
2224 ``quiet``
2222 Reduce the amount of output printed.
2225 Reduce the amount of output printed.
2223 (default: False)
2226 (default: False)
2224
2227
2225 ``remotecmd``
2228 ``remotecmd``
2226 Remote command to use for clone/push/pull operations.
2229 Remote command to use for clone/push/pull operations.
2227 (default: ``hg``)
2230 (default: ``hg``)
2228
2231
2229 ``report_untrusted``
2232 ``report_untrusted``
2230 Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
2233 Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
2231 trusted user or group.
2234 trusted user or group.
2232 (default: True)
2235 (default: True)
2233
2236
2234 ``slash``
2237 ``slash``
2235 (Deprecated. Use ``slashpath`` template filter instead.)
2238 (Deprecated. Use ``slashpath`` template filter instead.)
2236
2239
2237 Display paths using a slash (``/``) as the path separator. This
2240 Display paths using a slash (``/``) as the path separator. This
2238 only makes a difference on systems where the default path
2241 only makes a difference on systems where the default path
2239 separator is not the slash character (e.g. Windows uses the
2242 separator is not the slash character (e.g. Windows uses the
2240 backslash character (``\``)).
2243 backslash character (``\``)).
2241 (default: False)
2244 (default: False)
2242
2245
2243 ``statuscopies``
2246 ``statuscopies``
2244 Display copies in the status command.
2247 Display copies in the status command.
2245
2248
2246 ``ssh``
2249 ``ssh``
2247 Command to use for SSH connections. (default: ``ssh``)
2250 Command to use for SSH connections. (default: ``ssh``)
2248
2251
2249 ``ssherrorhint``
2252 ``ssherrorhint``
2250 A hint shown to the user in the case of SSH error (e.g.
2253 A hint shown to the user in the case of SSH error (e.g.
2251 ``Please see http://company/internalwiki/ssh.html``)
2254 ``Please see http://company/internalwiki/ssh.html``)
2252
2255
2253 ``strict``
2256 ``strict``
2254 Require exact command names, instead of allowing unambiguous
2257 Require exact command names, instead of allowing unambiguous
2255 abbreviations. (default: False)
2258 abbreviations. (default: False)
2256
2259
2257 ``style``
2260 ``style``
2258 Name of style to use for command output.
2261 Name of style to use for command output.
2259
2262
2260 ``supportcontact``
2263 ``supportcontact``
2261 A URL where users should report a Mercurial traceback. Use this if you are a
2264 A URL where users should report a Mercurial traceback. Use this if you are a
2262 large organisation with its own Mercurial deployment process and crash
2265 large organisation with its own Mercurial deployment process and crash
2263 reports should be addressed to your internal support.
2266 reports should be addressed to your internal support.
2264
2267
2265 ``textwidth``
2268 ``textwidth``
2266 Maximum width of help text. A longer line generated by ``hg help`` or
2269 Maximum width of help text. A longer line generated by ``hg help`` or
2267 ``hg subcommand --help`` will be broken after white space to get this
2270 ``hg subcommand --help`` will be broken after white space to get this
2268 width or the terminal width, whichever comes first.
2271 width or the terminal width, whichever comes first.
2269 A non-positive value will disable this and the terminal width will be
2272 A non-positive value will disable this and the terminal width will be
2270 used. (default: 78)
2273 used. (default: 78)
2271
2274
2272 ``timeout``
2275 ``timeout``
2273 The timeout used when a lock is held (in seconds), a negative value
2276 The timeout used when a lock is held (in seconds), a negative value
2274 means no timeout. (default: 600)
2277 means no timeout. (default: 600)
2275
2278
2276 ``timeout.warn``
2279 ``timeout.warn``
2277 Time (in seconds) before a warning is printed about held lock. A negative
2280 Time (in seconds) before a warning is printed about held lock. A negative
2278 value means no warning. (default: 0)
2281 value means no warning. (default: 0)
2279
2282
2280 ``traceback``
2283 ``traceback``
2281 Mercurial always prints a traceback when an unknown exception
2284 Mercurial always prints a traceback when an unknown exception
2282 occurs. Setting this to True will make Mercurial print a traceback
2285 occurs. Setting this to True will make Mercurial print a traceback
2283 on all exceptions, even those recognized by Mercurial (such as
2286 on all exceptions, even those recognized by Mercurial (such as
2284 IOError or MemoryError). (default: False)
2287 IOError or MemoryError). (default: False)
2285
2288
2286 ``tweakdefaults``
2289 ``tweakdefaults``
2287
2290
2288 By default Mercurial's behavior changes very little from release
2291 By default Mercurial's behavior changes very little from release
2289 to release, but over time the recommended config settings
2292 to release, but over time the recommended config settings
2290 shift. Enable this config to opt in to get automatic tweaks to
2293 shift. Enable this config to opt in to get automatic tweaks to
2291 Mercurial's behavior over time. This config setting will have no
2294 Mercurial's behavior over time. This config setting will have no
2292 effet if ``HGPLAIN` is set or ``HGPLAINEXCEPT`` is set and does
2295 effet if ``HGPLAIN` is set or ``HGPLAINEXCEPT`` is set and does
2293 not include ``tweakdefaults``. (default: False)
2296 not include ``tweakdefaults``. (default: False)
2294
2297
2295 ``username``
2298 ``username``
2296 The committer of a changeset created when running "commit".
2299 The committer of a changeset created when running "commit".
2297 Typically a person's name and email address, e.g. ``Fred Widget
2300 Typically a person's name and email address, e.g. ``Fred Widget
2298 <fred@example.com>``. Environment variables in the
2301 <fred@example.com>``. Environment variables in the
2299 username are expanded.
2302 username are expanded.
2300
2303
2301 (default: ``$EMAIL`` or ``username@hostname``. If the username in
2304 (default: ``$EMAIL`` or ``username@hostname``. If the username in
2302 hgrc is empty, e.g. if the system admin set ``username =`` in the
2305 hgrc is empty, e.g. if the system admin set ``username =`` in the
2303 system hgrc, it has to be specified manually or in a different
2306 system hgrc, it has to be specified manually or in a different
2304 hgrc file)
2307 hgrc file)
2305
2308
2306 ``verbose``
2309 ``verbose``
2307 Increase the amount of output printed. (default: False)
2310 Increase the amount of output printed. (default: False)
2308
2311
2309
2312
2310 ``web``
2313 ``web``
2311 -------
2314 -------
2312
2315
2313 Web interface configuration. The settings in this section apply to
2316 Web interface configuration. The settings in this section apply to
2314 both the builtin webserver (started by :hg:`serve`) and the script you
2317 both the builtin webserver (started by :hg:`serve`) and the script you
2315 run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI
2318 run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI
2316 and WSGI).
2319 and WSGI).
2317
2320
2318 The Mercurial webserver does no authentication (it does not prompt for
2321 The Mercurial webserver does no authentication (it does not prompt for
2319 usernames and passwords to validate *who* users are), but it does do
2322 usernames and passwords to validate *who* users are), but it does do
2320 authorization (it grants or denies access for *authenticated users*
2323 authorization (it grants or denies access for *authenticated users*
2321 based on settings in this section). You must either configure your
2324 based on settings in this section). You must either configure your
2322 webserver to do authentication for you, or disable the authorization
2325 webserver to do authentication for you, or disable the authorization
2323 checks.
2326 checks.
2324
2327
2325 For a quick setup in a trusted environment, e.g., a private LAN, where
2328 For a quick setup in a trusted environment, e.g., a private LAN, where
2326 you want it to accept pushes from anybody, you can use the following
2329 you want it to accept pushes from anybody, you can use the following
2327 command line::
2330 command line::
2328
2331
2329 $ hg --config web.allow-push=* --config web.push_ssl=False serve
2332 $ hg --config web.allow-push=* --config web.push_ssl=False serve
2330
2333
2331 Note that this will allow anybody to push anything to the server and
2334 Note that this will allow anybody to push anything to the server and
2332 that this should not be used for public servers.
2335 that this should not be used for public servers.
2333
2336
2334 The full set of options is:
2337 The full set of options is:
2335
2338
2336 ``accesslog``
2339 ``accesslog``
2337 Where to output the access log. (default: stdout)
2340 Where to output the access log. (default: stdout)
2338
2341
2339 ``address``
2342 ``address``
2340 Interface address to bind to. (default: all)
2343 Interface address to bind to. (default: all)
2341
2344
2342 ``allow-archive``
2345 ``allow-archive``
2343 List of archive format (bz2, gz, zip) allowed for downloading.
2346 List of archive format (bz2, gz, zip) allowed for downloading.
2344 (default: empty)
2347 (default: empty)
2345
2348
2346 ``allowbz2``
2349 ``allowbz2``
2347 (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
2350 (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
2348 revisions.
2351 revisions.
2349 (default: False)
2352 (default: False)
2350
2353
2351 ``allowgz``
2354 ``allowgz``
2352 (DEPRECATED) Whether to allow .tar.gz downloading of repository
2355 (DEPRECATED) Whether to allow .tar.gz downloading of repository
2353 revisions.
2356 revisions.
2354 (default: False)
2357 (default: False)
2355
2358
2356 ``allow-pull``
2359 ``allow-pull``
2357 Whether to allow pulling from the repository. (default: True)
2360 Whether to allow pulling from the repository. (default: True)
2358
2361
2359 ``allow-push``
2362 ``allow-push``
2360 Whether to allow pushing to the repository. If empty or not set,
2363 Whether to allow pushing to the repository. If empty or not set,
2361 pushing is not allowed. If the special value ``*``, any remote
2364 pushing is not allowed. If the special value ``*``, any remote
2362 user can push, including unauthenticated users. Otherwise, the
2365 user can push, including unauthenticated users. Otherwise, the
2363 remote user must have been authenticated, and the authenticated
2366 remote user must have been authenticated, and the authenticated
2364 user name must be present in this list. The contents of the
2367 user name must be present in this list. The contents of the
2365 allow-push list are examined after the deny_push list.
2368 allow-push list are examined after the deny_push list.
2366
2369
2367 ``allow_read``
2370 ``allow_read``
2368 If the user has not already been denied repository access due to
2371 If the user has not already been denied repository access due to
2369 the contents of deny_read, this list determines whether to grant
2372 the contents of deny_read, this list determines whether to grant
2370 repository access to the user. If this list is not empty, and the
2373 repository access to the user. If this list is not empty, and the
2371 user is unauthenticated or not present in the list, then access is
2374 user is unauthenticated or not present in the list, then access is
2372 denied for the user. If the list is empty or not set, then access
2375 denied for the user. If the list is empty or not set, then access
2373 is permitted to all users by default. Setting allow_read to the
2376 is permitted to all users by default. Setting allow_read to the
2374 special value ``*`` is equivalent to it not being set (i.e. access
2377 special value ``*`` is equivalent to it not being set (i.e. access
2375 is permitted to all users). The contents of the allow_read list are
2378 is permitted to all users). The contents of the allow_read list are
2376 examined after the deny_read list.
2379 examined after the deny_read list.
2377
2380
2378 ``allowzip``
2381 ``allowzip``
2379 (DEPRECATED) Whether to allow .zip downloading of repository
2382 (DEPRECATED) Whether to allow .zip downloading of repository
2380 revisions. This feature creates temporary files.
2383 revisions. This feature creates temporary files.
2381 (default: False)
2384 (default: False)
2382
2385
2383 ``archivesubrepos``
2386 ``archivesubrepos``
2384 Whether to recurse into subrepositories when archiving.
2387 Whether to recurse into subrepositories when archiving.
2385 (default: False)
2388 (default: False)
2386
2389
2387 ``baseurl``
2390 ``baseurl``
2388 Base URL to use when publishing URLs in other locations, so
2391 Base URL to use when publishing URLs in other locations, so
2389 third-party tools like email notification hooks can construct
2392 third-party tools like email notification hooks can construct
2390 URLs. Example: ``http://hgserver/repos/``.
2393 URLs. Example: ``http://hgserver/repos/``.
2391
2394
2392 ``cacerts``
2395 ``cacerts``
2393 Path to file containing a list of PEM encoded certificate
2396 Path to file containing a list of PEM encoded certificate
2394 authority certificates. Environment variables and ``~user``
2397 authority certificates. Environment variables and ``~user``
2395 constructs are expanded in the filename. If specified on the
2398 constructs are expanded in the filename. If specified on the
2396 client, then it will verify the identity of remote HTTPS servers
2399 client, then it will verify the identity of remote HTTPS servers
2397 with these certificates.
2400 with these certificates.
2398
2401
2399 To disable SSL verification temporarily, specify ``--insecure`` from
2402 To disable SSL verification temporarily, specify ``--insecure`` from
2400 command line.
2403 command line.
2401
2404
2402 You can use OpenSSL's CA certificate file if your platform has
2405 You can use OpenSSL's CA certificate file if your platform has
2403 one. On most Linux systems this will be
2406 one. On most Linux systems this will be
2404 ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to
2407 ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to
2405 generate this file manually. The form must be as follows::
2408 generate this file manually. The form must be as follows::
2406
2409
2407 -----BEGIN CERTIFICATE-----
2410 -----BEGIN CERTIFICATE-----
2408 ... (certificate in base64 PEM encoding) ...
2411 ... (certificate in base64 PEM encoding) ...
2409 -----END CERTIFICATE-----
2412 -----END CERTIFICATE-----
2410 -----BEGIN CERTIFICATE-----
2413 -----BEGIN CERTIFICATE-----
2411 ... (certificate in base64 PEM encoding) ...
2414 ... (certificate in base64 PEM encoding) ...
2412 -----END CERTIFICATE-----
2415 -----END CERTIFICATE-----
2413
2416
2414 ``cache``
2417 ``cache``
2415 Whether to support caching in hgweb. (default: True)
2418 Whether to support caching in hgweb. (default: True)
2416
2419
2417 ``certificate``
2420 ``certificate``
2418 Certificate to use when running :hg:`serve`.
2421 Certificate to use when running :hg:`serve`.
2419
2422
2420 ``collapse``
2423 ``collapse``
2421 With ``descend`` enabled, repositories in subdirectories are shown at
2424 With ``descend`` enabled, repositories in subdirectories are shown at
2422 a single level alongside repositories in the current path. With
2425 a single level alongside repositories in the current path. With
2423 ``collapse`` also enabled, repositories residing at a deeper level than
2426 ``collapse`` also enabled, repositories residing at a deeper level than
2424 the current path are grouped behind navigable directory entries that
2427 the current path are grouped behind navigable directory entries that
2425 lead to the locations of these repositories. In effect, this setting
2428 lead to the locations of these repositories. In effect, this setting
2426 collapses each collection of repositories found within a subdirectory
2429 collapses each collection of repositories found within a subdirectory
2427 into a single entry for that subdirectory. (default: False)
2430 into a single entry for that subdirectory. (default: False)
2428
2431
2429 ``comparisoncontext``
2432 ``comparisoncontext``
2430 Number of lines of context to show in side-by-side file comparison. If
2433 Number of lines of context to show in side-by-side file comparison. If
2431 negative or the value ``full``, whole files are shown. (default: 5)
2434 negative or the value ``full``, whole files are shown. (default: 5)
2432
2435
2433 This setting can be overridden by a ``context`` request parameter to the
2436 This setting can be overridden by a ``context`` request parameter to the
2434 ``comparison`` command, taking the same values.
2437 ``comparison`` command, taking the same values.
2435
2438
2436 ``contact``
2439 ``contact``
2437 Name or email address of the person in charge of the repository.
2440 Name or email address of the person in charge of the repository.
2438 (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty)
2441 (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty)
2439
2442
2440 ``csp``
2443 ``csp``
2441 Send a ``Content-Security-Policy`` HTTP header with this value.
2444 Send a ``Content-Security-Policy`` HTTP header with this value.
2442
2445
2443 The value may contain a special string ``%nonce%``, which will be replaced
2446 The value may contain a special string ``%nonce%``, which will be replaced
2444 by a randomly-generated one-time use value. If the value contains
2447 by a randomly-generated one-time use value. If the value contains
2445 ``%nonce%``, ``web.cache`` will be disabled, as caching undermines the
2448 ``%nonce%``, ``web.cache`` will be disabled, as caching undermines the
2446 one-time property of the nonce. This nonce will also be inserted into
2449 one-time property of the nonce. This nonce will also be inserted into
2447 ``<script>`` elements containing inline JavaScript.
2450 ``<script>`` elements containing inline JavaScript.
2448
2451
2449 Note: lots of HTML content sent by the server is derived from repository
2452 Note: lots of HTML content sent by the server is derived from repository
2450 data. Please consider the potential for malicious repository data to
2453 data. Please consider the potential for malicious repository data to
2451 "inject" itself into generated HTML content as part of your security
2454 "inject" itself into generated HTML content as part of your security
2452 threat model.
2455 threat model.
2453
2456
2454 ``deny_push``
2457 ``deny_push``
2455 Whether to deny pushing to the repository. If empty or not set,
2458 Whether to deny pushing to the repository. If empty or not set,
2456 push is not denied. If the special value ``*``, all remote users are
2459 push is not denied. If the special value ``*``, all remote users are
2457 denied push. Otherwise, unauthenticated users are all denied, and
2460 denied push. Otherwise, unauthenticated users are all denied, and
2458 any authenticated user name present in this list is also denied. The
2461 any authenticated user name present in this list is also denied. The
2459 contents of the deny_push list are examined before the allow-push list.
2462 contents of the deny_push list are examined before the allow-push list.
2460
2463
2461 ``deny_read``
2464 ``deny_read``
2462 Whether to deny reading/viewing of the repository. If this list is
2465 Whether to deny reading/viewing of the repository. If this list is
2463 not empty, unauthenticated users are all denied, and any
2466 not empty, unauthenticated users are all denied, and any
2464 authenticated user name present in this list is also denied access to
2467 authenticated user name present in this list is also denied access to
2465 the repository. If set to the special value ``*``, all remote users
2468 the repository. If set to the special value ``*``, all remote users
2466 are denied access (rarely needed ;). If deny_read is empty or not set,
2469 are denied access (rarely needed ;). If deny_read is empty or not set,
2467 the determination of repository access depends on the presence and
2470 the determination of repository access depends on the presence and
2468 content of the allow_read list (see description). If both
2471 content of the allow_read list (see description). If both
2469 deny_read and allow_read are empty or not set, then access is
2472 deny_read and allow_read are empty or not set, then access is
2470 permitted to all users by default. If the repository is being
2473 permitted to all users by default. If the repository is being
2471 served via hgwebdir, denied users will not be able to see it in
2474 served via hgwebdir, denied users will not be able to see it in
2472 the list of repositories. The contents of the deny_read list have
2475 the list of repositories. The contents of the deny_read list have
2473 priority over (are examined before) the contents of the allow_read
2476 priority over (are examined before) the contents of the allow_read
2474 list.
2477 list.
2475
2478
2476 ``descend``
2479 ``descend``
2477 hgwebdir indexes will not descend into subdirectories. Only repositories
2480 hgwebdir indexes will not descend into subdirectories. Only repositories
2478 directly in the current path will be shown (other repositories are still
2481 directly in the current path will be shown (other repositories are still
2479 available from the index corresponding to their containing path).
2482 available from the index corresponding to their containing path).
2480
2483
2481 ``description``
2484 ``description``
2482 Textual description of the repository's purpose or contents.
2485 Textual description of the repository's purpose or contents.
2483 (default: "unknown")
2486 (default: "unknown")
2484
2487
2485 ``encoding``
2488 ``encoding``
2486 Character encoding name. (default: the current locale charset)
2489 Character encoding name. (default: the current locale charset)
2487 Example: "UTF-8".
2490 Example: "UTF-8".
2488
2491
2489 ``errorlog``
2492 ``errorlog``
2490 Where to output the error log. (default: stderr)
2493 Where to output the error log. (default: stderr)
2491
2494
2492 ``guessmime``
2495 ``guessmime``
2493 Control MIME types for raw download of file content.
2496 Control MIME types for raw download of file content.
2494 Set to True to let hgweb guess the content type from the file
2497 Set to True to let hgweb guess the content type from the file
2495 extension. This will serve HTML files as ``text/html`` and might
2498 extension. This will serve HTML files as ``text/html`` and might
2496 allow cross-site scripting attacks when serving untrusted
2499 allow cross-site scripting attacks when serving untrusted
2497 repositories. (default: False)
2500 repositories. (default: False)
2498
2501
2499 ``hidden``
2502 ``hidden``
2500 Whether to hide the repository in the hgwebdir index.
2503 Whether to hide the repository in the hgwebdir index.
2501 (default: False)
2504 (default: False)
2502
2505
2503 ``ipv6``
2506 ``ipv6``
2504 Whether to use IPv6. (default: False)
2507 Whether to use IPv6. (default: False)
2505
2508
2506 ``labels``
2509 ``labels``
2507 List of string *labels* associated with the repository.
2510 List of string *labels* associated with the repository.
2508
2511
2509 Labels are exposed as a template keyword and can be used to customize
2512 Labels are exposed as a template keyword and can be used to customize
2510 output. e.g. the ``index`` template can group or filter repositories
2513 output. e.g. the ``index`` template can group or filter repositories
2511 by labels and the ``summary`` template can display additional content
2514 by labels and the ``summary`` template can display additional content
2512 if a specific label is present.
2515 if a specific label is present.
2513
2516
2514 ``logoimg``
2517 ``logoimg``
2515 File name of the logo image that some templates display on each page.
2518 File name of the logo image that some templates display on each page.
2516 The file name is relative to ``staticurl``. That is, the full path to
2519 The file name is relative to ``staticurl``. That is, the full path to
2517 the logo image is "staticurl/logoimg".
2520 the logo image is "staticurl/logoimg".
2518 If unset, ``hglogo.png`` will be used.
2521 If unset, ``hglogo.png`` will be used.
2519
2522
2520 ``logourl``
2523 ``logourl``
2521 Base URL to use for logos. If unset, ``https://mercurial-scm.org/``
2524 Base URL to use for logos. If unset, ``https://mercurial-scm.org/``
2522 will be used.
2525 will be used.
2523
2526
2524 ``maxchanges``
2527 ``maxchanges``
2525 Maximum number of changes to list on the changelog. (default: 10)
2528 Maximum number of changes to list on the changelog. (default: 10)
2526
2529
2527 ``maxfiles``
2530 ``maxfiles``
2528 Maximum number of files to list per changeset. (default: 10)
2531 Maximum number of files to list per changeset. (default: 10)
2529
2532
2530 ``maxshortchanges``
2533 ``maxshortchanges``
2531 Maximum number of changes to list on the shortlog, graph or filelog
2534 Maximum number of changes to list on the shortlog, graph or filelog
2532 pages. (default: 60)
2535 pages. (default: 60)
2533
2536
2534 ``name``
2537 ``name``
2535 Repository name to use in the web interface.
2538 Repository name to use in the web interface.
2536 (default: current working directory)
2539 (default: current working directory)
2537
2540
2538 ``port``
2541 ``port``
2539 Port to listen on. (default: 8000)
2542 Port to listen on. (default: 8000)
2540
2543
2541 ``prefix``
2544 ``prefix``
2542 Prefix path to serve from. (default: '' (server root))
2545 Prefix path to serve from. (default: '' (server root))
2543
2546
2544 ``push_ssl``
2547 ``push_ssl``
2545 Whether to require that inbound pushes be transported over SSL to
2548 Whether to require that inbound pushes be transported over SSL to
2546 prevent password sniffing. (default: True)
2549 prevent password sniffing. (default: True)
2547
2550
2548 ``refreshinterval``
2551 ``refreshinterval``
2549 How frequently directory listings re-scan the filesystem for new
2552 How frequently directory listings re-scan the filesystem for new
2550 repositories, in seconds. This is relevant when wildcards are used
2553 repositories, in seconds. This is relevant when wildcards are used
2551 to define paths. Depending on how much filesystem traversal is
2554 to define paths. Depending on how much filesystem traversal is
2552 required, refreshing may negatively impact performance.
2555 required, refreshing may negatively impact performance.
2553
2556
2554 Values less than or equal to 0 always refresh.
2557 Values less than or equal to 0 always refresh.
2555 (default: 20)
2558 (default: 20)
2556
2559
2557 ``server-header``
2560 ``server-header``
2558 Value for HTTP ``Server`` response header.
2561 Value for HTTP ``Server`` response header.
2559
2562
2560 ``staticurl``
2563 ``staticurl``
2561 Base URL to use for static files. If unset, static files (e.g. the
2564 Base URL to use for static files. If unset, static files (e.g. the
2562 hgicon.png favicon) will be served by the CGI script itself. Use
2565 hgicon.png favicon) will be served by the CGI script itself. Use
2563 this setting to serve them directly with the HTTP server.
2566 this setting to serve them directly with the HTTP server.
2564 Example: ``http://hgserver/static/``.
2567 Example: ``http://hgserver/static/``.
2565
2568
2566 ``stripes``
2569 ``stripes``
2567 How many lines a "zebra stripe" should span in multi-line output.
2570 How many lines a "zebra stripe" should span in multi-line output.
2568 Set to 0 to disable. (default: 1)
2571 Set to 0 to disable. (default: 1)
2569
2572
2570 ``style``
2573 ``style``
2571 Which template map style to use. The available options are the names of
2574 Which template map style to use. The available options are the names of
2572 subdirectories in the HTML templates path. (default: ``paper``)
2575 subdirectories in the HTML templates path. (default: ``paper``)
2573 Example: ``monoblue``.
2576 Example: ``monoblue``.
2574
2577
2575 ``templates``
2578 ``templates``
2576 Where to find the HTML templates. The default path to the HTML templates
2579 Where to find the HTML templates. The default path to the HTML templates
2577 can be obtained from ``hg debuginstall``.
2580 can be obtained from ``hg debuginstall``.
2578
2581
2579 ``websub``
2582 ``websub``
2580 ----------
2583 ----------
2581
2584
2582 Web substitution filter definition. You can use this section to
2585 Web substitution filter definition. You can use this section to
2583 define a set of regular expression substitution patterns which
2586 define a set of regular expression substitution patterns which
2584 let you automatically modify the hgweb server output.
2587 let you automatically modify the hgweb server output.
2585
2588
2586 The default hgweb templates only apply these substitution patterns
2589 The default hgweb templates only apply these substitution patterns
2587 on the revision description fields. You can apply them anywhere
2590 on the revision description fields. You can apply them anywhere
2588 you want when you create your own templates by adding calls to the
2591 you want when you create your own templates by adding calls to the
2589 "websub" filter (usually after calling the "escape" filter).
2592 "websub" filter (usually after calling the "escape" filter).
2590
2593
2591 This can be used, for example, to convert issue references to links
2594 This can be used, for example, to convert issue references to links
2592 to your issue tracker, or to convert "markdown-like" syntax into
2595 to your issue tracker, or to convert "markdown-like" syntax into
2593 HTML (see the examples below).
2596 HTML (see the examples below).
2594
2597
2595 Each entry in this section names a substitution filter.
2598 Each entry in this section names a substitution filter.
2596 The value of each entry defines the substitution expression itself.
2599 The value of each entry defines the substitution expression itself.
2597 The websub expressions follow the old interhg extension syntax,
2600 The websub expressions follow the old interhg extension syntax,
2598 which in turn imitates the Unix sed replacement syntax::
2601 which in turn imitates the Unix sed replacement syntax::
2599
2602
2600 patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i]
2603 patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i]
2601
2604
2602 You can use any separator other than "/". The final "i" is optional
2605 You can use any separator other than "/". The final "i" is optional
2603 and indicates that the search must be case insensitive.
2606 and indicates that the search must be case insensitive.
2604
2607
2605 Examples::
2608 Examples::
2606
2609
2607 [websub]
2610 [websub]
2608 issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i
2611 issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i
2609 italic = s/\b_(\S+)_\b/<i>\1<\/i>/
2612 italic = s/\b_(\S+)_\b/<i>\1<\/i>/
2610 bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/
2613 bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/
2611
2614
2612 ``worker``
2615 ``worker``
2613 ----------
2616 ----------
2614
2617
2615 Parallel master/worker configuration. We currently perform working
2618 Parallel master/worker configuration. We currently perform working
2616 directory updates in parallel on Unix-like systems, which greatly
2619 directory updates in parallel on Unix-like systems, which greatly
2617 helps performance.
2620 helps performance.
2618
2621
2619 ``enabled``
2622 ``enabled``
2620 Whether to enable workers code to be used.
2623 Whether to enable workers code to be used.
2621 (default: true)
2624 (default: true)
2622
2625
2623 ``numcpus``
2626 ``numcpus``
2624 Number of CPUs to use for parallel operations. A zero or
2627 Number of CPUs to use for parallel operations. A zero or
2625 negative value is treated as ``use the default``.
2628 negative value is treated as ``use the default``.
2626 (default: 4 or the number of CPUs on the system, whichever is larger)
2629 (default: 4 or the number of CPUs on the system, whichever is larger)
2627
2630
2628 ``backgroundclose``
2631 ``backgroundclose``
2629 Whether to enable closing file handles on background threads during certain
2632 Whether to enable closing file handles on background threads during certain
2630 operations. Some platforms aren't very efficient at closing file
2633 operations. Some platforms aren't very efficient at closing file
2631 handles that have been written or appended to. By performing file closing
2634 handles that have been written or appended to. By performing file closing
2632 on background threads, file write rate can increase substantially.
2635 on background threads, file write rate can increase substantially.
2633 (default: true on Windows, false elsewhere)
2636 (default: true on Windows, false elsewhere)
2634
2637
2635 ``backgroundcloseminfilecount``
2638 ``backgroundcloseminfilecount``
2636 Minimum number of files required to trigger background file closing.
2639 Minimum number of files required to trigger background file closing.
2637 Operations not writing this many files won't start background close
2640 Operations not writing this many files won't start background close
2638 threads.
2641 threads.
2639 (default: 2048)
2642 (default: 2048)
2640
2643
2641 ``backgroundclosemaxqueue``
2644 ``backgroundclosemaxqueue``
2642 The maximum number of opened file handles waiting to be closed in the
2645 The maximum number of opened file handles waiting to be closed in the
2643 background. This option only has an effect if ``backgroundclose`` is
2646 background. This option only has an effect if ``backgroundclose`` is
2644 enabled.
2647 enabled.
2645 (default: 384)
2648 (default: 384)
2646
2649
2647 ``backgroundclosethreadcount``
2650 ``backgroundclosethreadcount``
2648 Number of threads to process background file closes. Only relevant if
2651 Number of threads to process background file closes. Only relevant if
2649 ``backgroundclose`` is enabled.
2652 ``backgroundclose`` is enabled.
2650 (default: 4)
2653 (default: 4)
@@ -1,393 +1,393
1 Setup
1 Setup
2
2
3 $ cat <<EOF >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [ui]
4 > [ui]
5 > color = yes
5 > color = yes
6 > formatted = always
6 > formatted = always
7 > paginate = never
7 > paginate = never
8 > [color]
8 > [color]
9 > mode = ansi
9 > mode = ansi
10 > EOF
10 > EOF
11 $ hg init repo
11 $ hg init repo
12 $ cd repo
12 $ cd repo
13 $ cat > a <<EOF
13 $ cat > a <<EOF
14 > c
14 > c
15 > c
15 > c
16 > a
16 > a
17 > a
17 > a
18 > b
18 > b
19 > a
19 > a
20 > a
20 > a
21 > c
21 > c
22 > c
22 > c
23 > EOF
23 > EOF
24 $ hg ci -Am adda
24 $ hg ci -Am adda
25 adding a
25 adding a
26 $ cat > a <<EOF
26 $ cat > a <<EOF
27 > c
27 > c
28 > c
28 > c
29 > a
29 > a
30 > a
30 > a
31 > dd
31 > dd
32 > a
32 > a
33 > a
33 > a
34 > c
34 > c
35 > c
35 > c
36 > EOF
36 > EOF
37
37
38 default context
38 default context
39
39
40 $ hg diff --nodates
40 $ hg diff --nodates
41 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
41 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
42 \x1b[0;31;1m--- a/a\x1b[0m (esc)
42 \x1b[0;31;1m--- a/a\x1b[0m (esc)
43 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
43 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
44 \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
44 \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
45 c
45 c
46 a
46 a
47 a
47 a
48 \x1b[0;31m-b\x1b[0m (esc)
48 \x1b[0;31m-b\x1b[0m (esc)
49 \x1b[0;32m+dd\x1b[0m (esc)
49 \x1b[0;32m+dd\x1b[0m (esc)
50 a
50 a
51 a
51 a
52 c
52 c
53
53
54 (check that 'ui.color=yes' match '--color=auto')
54 (check that 'ui.color=yes' match '--color=auto')
55
55
56 $ hg diff --nodates --config ui.formatted=no
56 $ hg diff --nodates --config ui.formatted=no
57 diff -r cf9f4ba66af2 a
57 diff -r cf9f4ba66af2 a
58 --- a/a
58 --- a/a
59 +++ b/a
59 +++ b/a
60 @@ -2,7 +2,7 @@
60 @@ -2,7 +2,7 @@
61 c
61 c
62 a
62 a
63 a
63 a
64 -b
64 -b
65 +dd
65 +dd
66 a
66 a
67 a
67 a
68 c
68 c
69
69
70 (check that 'ui.color=no' disable color)
70 (check that 'ui.color=no' disable color)
71
71
72 $ hg diff --nodates --config ui.formatted=yes --config ui.color=no
72 $ hg diff --nodates --config ui.formatted=yes --config ui.color=no
73 diff -r cf9f4ba66af2 a
73 diff -r cf9f4ba66af2 a
74 --- a/a
74 --- a/a
75 +++ b/a
75 +++ b/a
76 @@ -2,7 +2,7 @@
76 @@ -2,7 +2,7 @@
77 c
77 c
78 a
78 a
79 a
79 a
80 -b
80 -b
81 +dd
81 +dd
82 a
82 a
83 a
83 a
84 c
84 c
85
85
86 (check that 'ui.color=always' force color)
86 (check that 'ui.color=always' force color)
87
87
88 $ hg diff --nodates --config ui.formatted=no --config ui.color=always
88 $ hg diff --nodates --config ui.formatted=no --config ui.color=always
89 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
89 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
90 \x1b[0;31;1m--- a/a\x1b[0m (esc)
90 \x1b[0;31;1m--- a/a\x1b[0m (esc)
91 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
91 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
92 \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
92 \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
93 c
93 c
94 a
94 a
95 a
95 a
96 \x1b[0;31m-b\x1b[0m (esc)
96 \x1b[0;31m-b\x1b[0m (esc)
97 \x1b[0;32m+dd\x1b[0m (esc)
97 \x1b[0;32m+dd\x1b[0m (esc)
98 a
98 a
99 a
99 a
100 c
100 c
101
101
102 --unified=2
102 --unified=2
103
103
104 $ hg diff --nodates -U 2
104 $ hg diff --nodates -U 2
105 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
105 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
106 \x1b[0;31;1m--- a/a\x1b[0m (esc)
106 \x1b[0;31;1m--- a/a\x1b[0m (esc)
107 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
107 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
108 \x1b[0;35m@@ -3,5 +3,5 @@\x1b[0m (esc)
108 \x1b[0;35m@@ -3,5 +3,5 @@\x1b[0m (esc)
109 a
109 a
110 a
110 a
111 \x1b[0;31m-b\x1b[0m (esc)
111 \x1b[0;31m-b\x1b[0m (esc)
112 \x1b[0;32m+dd\x1b[0m (esc)
112 \x1b[0;32m+dd\x1b[0m (esc)
113 a
113 a
114 a
114 a
115
115
116 diffstat
116 diffstat
117
117
118 $ hg diff --stat
118 $ hg diff --stat
119 a | 2 \x1b[0;32m+\x1b[0m\x1b[0;31m-\x1b[0m (esc)
119 a | 2 \x1b[0;32m+\x1b[0m\x1b[0;31m-\x1b[0m (esc)
120 1 files changed, 1 insertions(+), 1 deletions(-)
120 1 files changed, 1 insertions(+), 1 deletions(-)
121 $ cat <<EOF >> $HGRCPATH
121 $ cat <<EOF >> $HGRCPATH
122 > [extensions]
122 > [extensions]
123 > record =
123 > record =
124 > [ui]
124 > [ui]
125 > interactive = true
125 > interactive = true
126 > [diff]
126 > [diff]
127 > git = True
127 > git = True
128 > EOF
128 > EOF
129
129
130 #if execbit
130 #if execbit
131
131
132 record
132 record
133
133
134 $ chmod +x a
134 $ chmod +x a
135 $ hg record -m moda a <<EOF
135 $ hg record -m moda a <<EOF
136 > y
136 > y
137 > y
137 > y
138 > EOF
138 > EOF
139 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
139 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
140 \x1b[0;36;1mold mode 100644\x1b[0m (esc)
140 \x1b[0;36;1mold mode 100644\x1b[0m (esc)
141 \x1b[0;36;1mnew mode 100755\x1b[0m (esc)
141 \x1b[0;36;1mnew mode 100755\x1b[0m (esc)
142 1 hunks, 1 lines changed
142 1 hunks, 1 lines changed
143 \x1b[0;33mexamine changes to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
143 \x1b[0;33mexamine changes to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
144
144
145 \x1b[0;35m@@ -2,7 +2,7 @@ c\x1b[0m (esc)
145 \x1b[0;35m@@ -2,7 +2,7 @@ c\x1b[0m (esc)
146 c
146 c
147 a
147 a
148 a
148 a
149 \x1b[0;31m-b\x1b[0m (esc)
149 \x1b[0;31m-b\x1b[0m (esc)
150 \x1b[0;32m+dd\x1b[0m (esc)
150 \x1b[0;32m+dd\x1b[0m (esc)
151 a
151 a
152 a
152 a
153 c
153 c
154 \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
154 \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
155
155
156
156
157 $ echo "[extensions]" >> $HGRCPATH
157 $ echo "[extensions]" >> $HGRCPATH
158 $ echo "mq=" >> $HGRCPATH
158 $ echo "mq=" >> $HGRCPATH
159 $ hg rollback
159 $ hg rollback
160 repository tip rolled back to revision 0 (undo commit)
160 repository tip rolled back to revision 0 (undo commit)
161 working directory now based on revision 0
161 working directory now based on revision 0
162
162
163 qrecord
163 qrecord
164
164
165 $ hg qrecord -m moda patch <<EOF
165 $ hg qrecord -m moda patch <<EOF
166 > y
166 > y
167 > y
167 > y
168 > EOF
168 > EOF
169 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
169 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
170 \x1b[0;36;1mold mode 100644\x1b[0m (esc)
170 \x1b[0;36;1mold mode 100644\x1b[0m (esc)
171 \x1b[0;36;1mnew mode 100755\x1b[0m (esc)
171 \x1b[0;36;1mnew mode 100755\x1b[0m (esc)
172 1 hunks, 1 lines changed
172 1 hunks, 1 lines changed
173 \x1b[0;33mexamine changes to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
173 \x1b[0;33mexamine changes to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
174
174
175 \x1b[0;35m@@ -2,7 +2,7 @@ c\x1b[0m (esc)
175 \x1b[0;35m@@ -2,7 +2,7 @@ c\x1b[0m (esc)
176 c
176 c
177 a
177 a
178 a
178 a
179 \x1b[0;31m-b\x1b[0m (esc)
179 \x1b[0;31m-b\x1b[0m (esc)
180 \x1b[0;32m+dd\x1b[0m (esc)
180 \x1b[0;32m+dd\x1b[0m (esc)
181 a
181 a
182 a
182 a
183 c
183 c
184 \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
184 \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
185
185
186
186
187 $ hg qpop -a
187 $ hg qpop -a
188 popping patch
188 popping patch
189 patch queue now empty
189 patch queue now empty
190
190
191 #endif
191 #endif
192
192
193 issue3712: test colorization of subrepo diff
193 issue3712: test colorization of subrepo diff
194
194
195 $ hg init sub
195 $ hg init sub
196 $ echo b > sub/b
196 $ echo b > sub/b
197 $ hg -R sub commit -Am 'create sub'
197 $ hg -R sub commit -Am 'create sub'
198 adding b
198 adding b
199 $ echo 'sub = sub' > .hgsub
199 $ echo 'sub = sub' > .hgsub
200 $ hg add .hgsub
200 $ hg add .hgsub
201 $ hg commit -m 'add subrepo sub'
201 $ hg commit -m 'add subrepo sub'
202 $ echo aa >> a
202 $ echo aa >> a
203 $ echo bb >> sub/b
203 $ echo bb >> sub/b
204
204
205 $ hg diff -S
205 $ hg diff -S
206 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
206 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
207 \x1b[0;31;1m--- a/a\x1b[0m (esc)
207 \x1b[0;31;1m--- a/a\x1b[0m (esc)
208 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
208 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
209 \x1b[0;35m@@ -7,3 +7,4 @@\x1b[0m (esc)
209 \x1b[0;35m@@ -7,3 +7,4 @@\x1b[0m (esc)
210 a
210 a
211 c
211 c
212 c
212 c
213 \x1b[0;32m+aa\x1b[0m (esc)
213 \x1b[0;32m+aa\x1b[0m (esc)
214 \x1b[0;1mdiff --git a/sub/b b/sub/b\x1b[0m (esc)
214 \x1b[0;1mdiff --git a/sub/b b/sub/b\x1b[0m (esc)
215 \x1b[0;31;1m--- a/sub/b\x1b[0m (esc)
215 \x1b[0;31;1m--- a/sub/b\x1b[0m (esc)
216 \x1b[0;32;1m+++ b/sub/b\x1b[0m (esc)
216 \x1b[0;32;1m+++ b/sub/b\x1b[0m (esc)
217 \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
217 \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
218 b
218 b
219 \x1b[0;32m+bb\x1b[0m (esc)
219 \x1b[0;32m+bb\x1b[0m (esc)
220
220
221 test tabs
221 test tabs
222
222
223 $ cat >> a <<EOF
223 $ cat >> a <<EOF
224 > one tab
224 > one tab
225 > two tabs
225 > two tabs
226 > end tab
226 > end tab
227 > mid tab
227 > mid tab
228 > all tabs
228 > all tabs
229 > EOF
229 > EOF
230 $ hg diff --nodates
230 $ hg diff --nodates
231 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
231 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
232 \x1b[0;31;1m--- a/a\x1b[0m (esc)
232 \x1b[0;31;1m--- a/a\x1b[0m (esc)
233 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
233 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
234 \x1b[0;35m@@ -7,3 +7,9 @@\x1b[0m (esc)
234 \x1b[0;35m@@ -7,3 +7,9 @@\x1b[0m (esc)
235 a
235 a
236 c
236 c
237 c
237 c
238 \x1b[0;32m+aa\x1b[0m (esc)
238 \x1b[0;32m+aa\x1b[0m (esc)
239 \x1b[0;32m+\x1b[0m \x1b[0;32mone tab\x1b[0m (esc)
239 \x1b[0;32m+\x1b[0m \x1b[0;32mone tab\x1b[0m (esc)
240 \x1b[0;32m+\x1b[0m \x1b[0;32mtwo tabs\x1b[0m (esc)
240 \x1b[0;32m+\x1b[0m \x1b[0;32mtwo tabs\x1b[0m (esc)
241 \x1b[0;32m+end tab\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
241 \x1b[0;32m+end tab\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
242 \x1b[0;32m+mid\x1b[0m \x1b[0;32mtab\x1b[0m (esc)
242 \x1b[0;32m+mid\x1b[0m \x1b[0;32mtab\x1b[0m (esc)
243 \x1b[0;32m+\x1b[0m \x1b[0;32mall\x1b[0m \x1b[0;32mtabs\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
243 \x1b[0;32m+\x1b[0m \x1b[0;32mall\x1b[0m \x1b[0;32mtabs\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
244 $ echo "[color]" >> $HGRCPATH
244 $ echo "[color]" >> $HGRCPATH
245 $ echo "diff.tab = bold magenta" >> $HGRCPATH
245 $ echo "diff.tab = bold magenta" >> $HGRCPATH
246 $ hg diff --nodates
246 $ hg diff --nodates
247 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
247 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
248 \x1b[0;31;1m--- a/a\x1b[0m (esc)
248 \x1b[0;31;1m--- a/a\x1b[0m (esc)
249 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
249 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
250 \x1b[0;35m@@ -7,3 +7,9 @@\x1b[0m (esc)
250 \x1b[0;35m@@ -7,3 +7,9 @@\x1b[0m (esc)
251 a
251 a
252 c
252 c
253 c
253 c
254 \x1b[0;32m+aa\x1b[0m (esc)
254 \x1b[0;32m+aa\x1b[0m (esc)
255 \x1b[0;32m+\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mone tab\x1b[0m (esc)
255 \x1b[0;32m+\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mone tab\x1b[0m (esc)
256 \x1b[0;32m+\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mtwo tabs\x1b[0m (esc)
256 \x1b[0;32m+\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mtwo tabs\x1b[0m (esc)
257 \x1b[0;32m+end tab\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
257 \x1b[0;32m+end tab\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
258 \x1b[0;32m+mid\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mtab\x1b[0m (esc)
258 \x1b[0;32m+mid\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mtab\x1b[0m (esc)
259 \x1b[0;32m+\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mall\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mtabs\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
259 \x1b[0;32m+\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mall\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mtabs\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
260
260
261 $ cd ..
261 $ cd ..
262
262
263 test inline color diff
263 test inline color diff
264
264
265 $ hg init inline
265 $ hg init inline
266 $ cd inline
266 $ cd inline
267 $ cat > file1 << EOF
267 $ cat > file1 << EOF
268 > this is the first line
268 > this is the first line
269 > this is the second line
269 > this is the second line
270 > third line starts with space
270 > third line starts with space
271 > + starts with a plus sign
271 > + starts with a plus sign
272 > this one with one tab
272 > this one with one tab
273 > now with full two tabs
273 > now with full two tabs
274 > now tabs everywhere, much fun
274 > now tabs everywhere, much fun
275 >
275 >
276 > this line won't change
276 > this line won't change
277 >
277 >
278 > two lines are going to
278 > two lines are going to
279 > be changed into three!
279 > be changed into three!
280 >
280 >
281 > three of those lines will
281 > three of those lines will
282 > collapse onto one
282 > collapse onto one
283 > (to see if it works)
283 > (to see if it works)
284 > EOF
284 > EOF
285 $ hg add file1
285 $ hg add file1
286 $ hg ci -m 'commit'
286 $ hg ci -m 'commit'
287
287
288 $ cat > file1 << EOF
288 $ cat > file1 << EOF
289 > that is the first paragraph
289 > that is the first paragraph
290 > this is the second line
290 > this is the second line
291 > third line starts with space
291 > third line starts with space
292 > - starts with a minus sign
292 > - starts with a minus sign
293 > this one with two tab
293 > this one with two tab
294 > now with full three tabs
294 > now with full three tabs
295 > now there are tabs everywhere, much fun
295 > now there are tabs everywhere, much fun
296 >
296 >
297 > this line won't change
297 > this line won't change
298 >
298 >
299 > two lines are going to
299 > two lines are going to
300 > (entirely magically,
300 > (entirely magically,
301 > assuming this works)
301 > assuming this works)
302 > be changed into four!
302 > be changed into four!
303 >
303 >
304 > three of those lines have
304 > three of those lines have
305 > collapsed onto one
305 > collapsed onto one
306 > EOF
306 > EOF
307 $ hg diff --config experimental.worddiff=False --color=debug
307 $ hg diff --config diff.word-diff=False --color=debug
308 [diff.diffline|diff --git a/file1 b/file1]
308 [diff.diffline|diff --git a/file1 b/file1]
309 [diff.file_a|--- a/file1]
309 [diff.file_a|--- a/file1]
310 [diff.file_b|+++ b/file1]
310 [diff.file_b|+++ b/file1]
311 [diff.hunk|@@ -1,16 +1,17 @@]
311 [diff.hunk|@@ -1,16 +1,17 @@]
312 [diff.deleted|-this is the first line]
312 [diff.deleted|-this is the first line]
313 [diff.deleted|-this is the second line]
313 [diff.deleted|-this is the second line]
314 [diff.deleted|- third line starts with space]
314 [diff.deleted|- third line starts with space]
315 [diff.deleted|-+ starts with a plus sign]
315 [diff.deleted|-+ starts with a plus sign]
316 [diff.deleted|-][diff.tab| ][diff.deleted|this one with one tab]
316 [diff.deleted|-][diff.tab| ][diff.deleted|this one with one tab]
317 [diff.deleted|-][diff.tab| ][diff.deleted|now with full two tabs]
317 [diff.deleted|-][diff.tab| ][diff.deleted|now with full two tabs]
318 [diff.deleted|-][diff.tab| ][diff.deleted|now tabs][diff.tab| ][diff.deleted|everywhere, much fun]
318 [diff.deleted|-][diff.tab| ][diff.deleted|now tabs][diff.tab| ][diff.deleted|everywhere, much fun]
319 [diff.inserted|+that is the first paragraph]
319 [diff.inserted|+that is the first paragraph]
320 [diff.inserted|+ this is the second line]
320 [diff.inserted|+ this is the second line]
321 [diff.inserted|+third line starts with space]
321 [diff.inserted|+third line starts with space]
322 [diff.inserted|+- starts with a minus sign]
322 [diff.inserted|+- starts with a minus sign]
323 [diff.inserted|+][diff.tab| ][diff.inserted|this one with two tab]
323 [diff.inserted|+][diff.tab| ][diff.inserted|this one with two tab]
324 [diff.inserted|+][diff.tab| ][diff.inserted|now with full three tabs]
324 [diff.inserted|+][diff.tab| ][diff.inserted|now with full three tabs]
325 [diff.inserted|+][diff.tab| ][diff.inserted|now there are tabs][diff.tab| ][diff.inserted|everywhere, much fun]
325 [diff.inserted|+][diff.tab| ][diff.inserted|now there are tabs][diff.tab| ][diff.inserted|everywhere, much fun]
326
326
327 this line won't change
327 this line won't change
328
328
329 two lines are going to
329 two lines are going to
330 [diff.deleted|-be changed into three!]
330 [diff.deleted|-be changed into three!]
331 [diff.inserted|+(entirely magically,]
331 [diff.inserted|+(entirely magically,]
332 [diff.inserted|+ assuming this works)]
332 [diff.inserted|+ assuming this works)]
333 [diff.inserted|+be changed into four!]
333 [diff.inserted|+be changed into four!]
334
334
335 [diff.deleted|-three of those lines will]
335 [diff.deleted|-three of those lines will]
336 [diff.deleted|-collapse onto one]
336 [diff.deleted|-collapse onto one]
337 [diff.deleted|-(to see if it works)]
337 [diff.deleted|-(to see if it works)]
338 [diff.inserted|+three of those lines have]
338 [diff.inserted|+three of those lines have]
339 [diff.inserted|+collapsed onto one]
339 [diff.inserted|+collapsed onto one]
340 $ hg diff --config experimental.worddiff=True --color=debug
340 $ hg diff --config diff.word-diff=True --color=debug
341 [diff.diffline|diff --git a/file1 b/file1]
341 [diff.diffline|diff --git a/file1 b/file1]
342 [diff.file_a|--- a/file1]
342 [diff.file_a|--- a/file1]
343 [diff.file_b|+++ b/file1]
343 [diff.file_b|+++ b/file1]
344 [diff.hunk|@@ -1,16 +1,17 @@]
344 [diff.hunk|@@ -1,16 +1,17 @@]
345 [diff.deleted|-][diff.deleted.changed|this][diff.deleted.unchanged| is the first ][diff.deleted.changed|line]
345 [diff.deleted|-][diff.deleted.changed|this][diff.deleted.unchanged| is the first ][diff.deleted.changed|line]
346 [diff.deleted|-][diff.deleted.unchanged|this is the second line]
346 [diff.deleted|-][diff.deleted.unchanged|this is the second line]
347 [diff.deleted|-][diff.deleted.changed| ][diff.deleted.unchanged|third line starts with space]
347 [diff.deleted|-][diff.deleted.changed| ][diff.deleted.unchanged|third line starts with space]
348 [diff.deleted|-][diff.deleted.changed|+][diff.deleted.unchanged| starts with a ][diff.deleted.changed|plus][diff.deleted.unchanged| sign]
348 [diff.deleted|-][diff.deleted.changed|+][diff.deleted.unchanged| starts with a ][diff.deleted.changed|plus][diff.deleted.unchanged| sign]
349 [diff.deleted|-][diff.tab| ][diff.deleted.unchanged|this one with ][diff.deleted.changed|one][diff.deleted.unchanged| tab]
349 [diff.deleted|-][diff.tab| ][diff.deleted.unchanged|this one with ][diff.deleted.changed|one][diff.deleted.unchanged| tab]
350 [diff.deleted|-][diff.tab| ][diff.deleted.unchanged|now with full ][diff.deleted.changed|two][diff.deleted.unchanged| tabs]
350 [diff.deleted|-][diff.tab| ][diff.deleted.unchanged|now with full ][diff.deleted.changed|two][diff.deleted.unchanged| tabs]
351 [diff.deleted|-][diff.tab| ][diff.deleted.unchanged|now ][diff.deleted.unchanged|tabs][diff.tab| ][diff.deleted.unchanged|everywhere, much fun]
351 [diff.deleted|-][diff.tab| ][diff.deleted.unchanged|now ][diff.deleted.unchanged|tabs][diff.tab| ][diff.deleted.unchanged|everywhere, much fun]
352 [diff.inserted|+][diff.inserted.changed|that][diff.inserted.unchanged| is the first ][diff.inserted.changed|paragraph]
352 [diff.inserted|+][diff.inserted.changed|that][diff.inserted.unchanged| is the first ][diff.inserted.changed|paragraph]
353 [diff.inserted|+][diff.inserted.changed| ][diff.inserted.unchanged|this is the second line]
353 [diff.inserted|+][diff.inserted.changed| ][diff.inserted.unchanged|this is the second line]
354 [diff.inserted|+][diff.inserted.unchanged|third line starts with space]
354 [diff.inserted|+][diff.inserted.unchanged|third line starts with space]
355 [diff.inserted|+][diff.inserted.changed|-][diff.inserted.unchanged| starts with a ][diff.inserted.changed|minus][diff.inserted.unchanged| sign]
355 [diff.inserted|+][diff.inserted.changed|-][diff.inserted.unchanged| starts with a ][diff.inserted.changed|minus][diff.inserted.unchanged| sign]
356 [diff.inserted|+][diff.tab| ][diff.inserted.unchanged|this one with ][diff.inserted.changed|two][diff.inserted.unchanged| tab]
356 [diff.inserted|+][diff.tab| ][diff.inserted.unchanged|this one with ][diff.inserted.changed|two][diff.inserted.unchanged| tab]
357 [diff.inserted|+][diff.tab| ][diff.inserted.unchanged|now with full ][diff.inserted.changed|three][diff.inserted.unchanged| tabs]
357 [diff.inserted|+][diff.tab| ][diff.inserted.unchanged|now with full ][diff.inserted.changed|three][diff.inserted.unchanged| tabs]
358 [diff.inserted|+][diff.tab| ][diff.inserted.unchanged|now ][diff.inserted.changed|there are ][diff.inserted.unchanged|tabs][diff.tab| ][diff.inserted.unchanged|everywhere, much fun]
358 [diff.inserted|+][diff.tab| ][diff.inserted.unchanged|now ][diff.inserted.changed|there are ][diff.inserted.unchanged|tabs][diff.tab| ][diff.inserted.unchanged|everywhere, much fun]
359
359
360 this line won't change
360 this line won't change
361
361
362 two lines are going to
362 two lines are going to
363 [diff.deleted|-][diff.deleted.unchanged|be changed into ][diff.deleted.changed|three][diff.deleted.unchanged|!]
363 [diff.deleted|-][diff.deleted.unchanged|be changed into ][diff.deleted.changed|three][diff.deleted.unchanged|!]
364 [diff.inserted|+][diff.inserted.changed|(entirely magically,]
364 [diff.inserted|+][diff.inserted.changed|(entirely magically,]
365 [diff.inserted|+][diff.inserted.changed| assuming this works)]
365 [diff.inserted|+][diff.inserted.changed| assuming this works)]
366 [diff.inserted|+][diff.inserted.unchanged|be changed into ][diff.inserted.changed|four][diff.inserted.unchanged|!]
366 [diff.inserted|+][diff.inserted.unchanged|be changed into ][diff.inserted.changed|four][diff.inserted.unchanged|!]
367
367
368 [diff.deleted|-][diff.deleted.unchanged|three of those lines ][diff.deleted.changed|will]
368 [diff.deleted|-][diff.deleted.unchanged|three of those lines ][diff.deleted.changed|will]
369 [diff.deleted|-][diff.deleted.changed|collapse][diff.deleted.unchanged| onto one]
369 [diff.deleted|-][diff.deleted.changed|collapse][diff.deleted.unchanged| onto one]
370 [diff.deleted|-][diff.deleted.changed|(to see if it works)]
370 [diff.deleted|-][diff.deleted.changed|(to see if it works)]
371 [diff.inserted|+][diff.inserted.unchanged|three of those lines ][diff.inserted.changed|have]
371 [diff.inserted|+][diff.inserted.unchanged|three of those lines ][diff.inserted.changed|have]
372 [diff.inserted|+][diff.inserted.changed|collapsed][diff.inserted.unchanged| onto one]
372 [diff.inserted|+][diff.inserted.changed|collapsed][diff.inserted.unchanged| onto one]
373
373
374 multibyte character shouldn't be broken up in word diff:
374 multibyte character shouldn't be broken up in word diff:
375
375
376 $ $PYTHON <<'EOF'
376 $ $PYTHON <<'EOF'
377 > with open("utf8", "wb") as f:
377 > with open("utf8", "wb") as f:
378 > f.write(b"blah \xe3\x82\xa2 blah\n")
378 > f.write(b"blah \xe3\x82\xa2 blah\n")
379 > EOF
379 > EOF
380 $ hg ci -Am 'add utf8 char' utf8
380 $ hg ci -Am 'add utf8 char' utf8
381 $ $PYTHON <<'EOF'
381 $ $PYTHON <<'EOF'
382 > with open("utf8", "wb") as f:
382 > with open("utf8", "wb") as f:
383 > f.write(b"blah \xe3\x82\xa4 blah\n")
383 > f.write(b"blah \xe3\x82\xa4 blah\n")
384 > EOF
384 > EOF
385 $ hg ci -m 'slightly change utf8 char' utf8
385 $ hg ci -m 'slightly change utf8 char' utf8
386
386
387 $ hg diff --config experimental.worddiff=True --color=debug -c.
387 $ hg diff --config diff.word-diff=True --color=debug -c.
388 [diff.diffline|diff --git a/utf8 b/utf8]
388 [diff.diffline|diff --git a/utf8 b/utf8]
389 [diff.file_a|--- a/utf8]
389 [diff.file_a|--- a/utf8]
390 [diff.file_b|+++ b/utf8]
390 [diff.file_b|+++ b/utf8]
391 [diff.hunk|@@ -1,1 +1,1 @@]
391 [diff.hunk|@@ -1,1 +1,1 @@]
392 [diff.deleted|-][diff.deleted.unchanged|blah ][diff.deleted.changed|\xe3\x82\xa2][diff.deleted.unchanged| blah] (esc)
392 [diff.deleted|-][diff.deleted.unchanged|blah ][diff.deleted.changed|\xe3\x82\xa2][diff.deleted.unchanged| blah] (esc)
393 [diff.inserted|+][diff.inserted.unchanged|blah ][diff.inserted.changed|\xe3\x82\xa4][diff.inserted.unchanged| blah] (esc)
393 [diff.inserted|+][diff.inserted.unchanged|blah ][diff.inserted.changed|\xe3\x82\xa4][diff.inserted.unchanged| blah] (esc)
General Comments 0
You need to be logged in to leave comments. Login now