##// END OF EJS Templates
cmdserver: document message-encodings and channel output options...
Yuya Nishihara -
r45603:f43bc4ce default
parent child Browse files
Show More
@@ -1,775 +1,771 b''
1 # commandserver.py - communicate with Mercurial's API over a pipe
1 # commandserver.py - communicate with Mercurial's API over a pipe
2 #
2 #
3 # Copyright Matt Mackall <mpm@selenic.com>
3 # Copyright Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import errno
10 import errno
11 import gc
11 import gc
12 import os
12 import os
13 import random
13 import random
14 import signal
14 import signal
15 import socket
15 import socket
16 import struct
16 import struct
17 import traceback
17 import traceback
18
18
19 try:
19 try:
20 import selectors
20 import selectors
21
21
22 selectors.BaseSelector
22 selectors.BaseSelector
23 except ImportError:
23 except ImportError:
24 from .thirdparty import selectors2 as selectors
24 from .thirdparty import selectors2 as selectors
25
25
26 from .i18n import _
26 from .i18n import _
27 from .pycompat import getattr
27 from .pycompat import getattr
28 from . import (
28 from . import (
29 encoding,
29 encoding,
30 error,
30 error,
31 loggingutil,
31 loggingutil,
32 pycompat,
32 pycompat,
33 repocache,
33 repocache,
34 util,
34 util,
35 vfs as vfsmod,
35 vfs as vfsmod,
36 )
36 )
37 from .utils import (
37 from .utils import (
38 cborutil,
38 cborutil,
39 procutil,
39 procutil,
40 )
40 )
41
41
42
42
43 class channeledoutput(object):
43 class channeledoutput(object):
44 """
44 """
45 Write data to out in the following format:
45 Write data to out in the following format:
46
46
47 data length (unsigned int),
47 data length (unsigned int),
48 data
48 data
49 """
49 """
50
50
51 def __init__(self, out, channel):
51 def __init__(self, out, channel):
52 self.out = out
52 self.out = out
53 self.channel = channel
53 self.channel = channel
54
54
55 @property
55 @property
56 def name(self):
56 def name(self):
57 return b'<%c-channel>' % self.channel
57 return b'<%c-channel>' % self.channel
58
58
59 def write(self, data):
59 def write(self, data):
60 if not data:
60 if not data:
61 return
61 return
62 # single write() to guarantee the same atomicity as the underlying file
62 # single write() to guarantee the same atomicity as the underlying file
63 self.out.write(struct.pack(b'>cI', self.channel, len(data)) + data)
63 self.out.write(struct.pack(b'>cI', self.channel, len(data)) + data)
64 self.out.flush()
64 self.out.flush()
65
65
66 def __getattr__(self, attr):
66 def __getattr__(self, attr):
67 if attr in ('isatty', 'fileno', 'tell', 'seek'):
67 if attr in ('isatty', 'fileno', 'tell', 'seek'):
68 raise AttributeError(attr)
68 raise AttributeError(attr)
69 return getattr(self.out, attr)
69 return getattr(self.out, attr)
70
70
71
71
72 class channeledmessage(object):
72 class channeledmessage(object):
73 """
73 """
74 Write encoded message and metadata to out in the following format:
74 Write encoded message and metadata to out in the following format:
75
75
76 data length (unsigned int),
76 data length (unsigned int),
77 encoded message and metadata, as a flat key-value dict.
77 encoded message and metadata, as a flat key-value dict.
78
78
79 Each message should have 'type' attribute. Messages of unknown type
79 Each message should have 'type' attribute. Messages of unknown type
80 should be ignored.
80 should be ignored.
81 """
81 """
82
82
83 # teach ui that write() can take **opts
83 # teach ui that write() can take **opts
84 structured = True
84 structured = True
85
85
86 def __init__(self, out, channel, encodename, encodefn):
86 def __init__(self, out, channel, encodename, encodefn):
87 self._cout = channeledoutput(out, channel)
87 self._cout = channeledoutput(out, channel)
88 self.encoding = encodename
88 self.encoding = encodename
89 self._encodefn = encodefn
89 self._encodefn = encodefn
90
90
91 def write(self, data, **opts):
91 def write(self, data, **opts):
92 opts = pycompat.byteskwargs(opts)
92 opts = pycompat.byteskwargs(opts)
93 if data is not None:
93 if data is not None:
94 opts[b'data'] = data
94 opts[b'data'] = data
95 self._cout.write(self._encodefn(opts))
95 self._cout.write(self._encodefn(opts))
96
96
97 def __getattr__(self, attr):
97 def __getattr__(self, attr):
98 return getattr(self._cout, attr)
98 return getattr(self._cout, attr)
99
99
100
100
101 class channeledinput(object):
101 class channeledinput(object):
102 """
102 """
103 Read data from in_.
103 Read data from in_.
104
104
105 Requests for input are written to out in the following format:
105 Requests for input are written to out in the following format:
106 channel identifier - 'I' for plain input, 'L' line based (1 byte)
106 channel identifier - 'I' for plain input, 'L' line based (1 byte)
107 how many bytes to send at most (unsigned int),
107 how many bytes to send at most (unsigned int),
108
108
109 The client replies with:
109 The client replies with:
110 data length (unsigned int), 0 meaning EOF
110 data length (unsigned int), 0 meaning EOF
111 data
111 data
112 """
112 """
113
113
114 maxchunksize = 4 * 1024
114 maxchunksize = 4 * 1024
115
115
116 def __init__(self, in_, out, channel):
116 def __init__(self, in_, out, channel):
117 self.in_ = in_
117 self.in_ = in_
118 self.out = out
118 self.out = out
119 self.channel = channel
119 self.channel = channel
120
120
121 @property
121 @property
122 def name(self):
122 def name(self):
123 return b'<%c-channel>' % self.channel
123 return b'<%c-channel>' % self.channel
124
124
125 def read(self, size=-1):
125 def read(self, size=-1):
126 if size < 0:
126 if size < 0:
127 # if we need to consume all the clients input, ask for 4k chunks
127 # if we need to consume all the clients input, ask for 4k chunks
128 # so the pipe doesn't fill up risking a deadlock
128 # so the pipe doesn't fill up risking a deadlock
129 size = self.maxchunksize
129 size = self.maxchunksize
130 s = self._read(size, self.channel)
130 s = self._read(size, self.channel)
131 buf = s
131 buf = s
132 while s:
132 while s:
133 s = self._read(size, self.channel)
133 s = self._read(size, self.channel)
134 buf += s
134 buf += s
135
135
136 return buf
136 return buf
137 else:
137 else:
138 return self._read(size, self.channel)
138 return self._read(size, self.channel)
139
139
140 def _read(self, size, channel):
140 def _read(self, size, channel):
141 if not size:
141 if not size:
142 return b''
142 return b''
143 assert size > 0
143 assert size > 0
144
144
145 # tell the client we need at most size bytes
145 # tell the client we need at most size bytes
146 self.out.write(struct.pack(b'>cI', channel, size))
146 self.out.write(struct.pack(b'>cI', channel, size))
147 self.out.flush()
147 self.out.flush()
148
148
149 length = self.in_.read(4)
149 length = self.in_.read(4)
150 length = struct.unpack(b'>I', length)[0]
150 length = struct.unpack(b'>I', length)[0]
151 if not length:
151 if not length:
152 return b''
152 return b''
153 else:
153 else:
154 return self.in_.read(length)
154 return self.in_.read(length)
155
155
156 def readline(self, size=-1):
156 def readline(self, size=-1):
157 if size < 0:
157 if size < 0:
158 size = self.maxchunksize
158 size = self.maxchunksize
159 s = self._read(size, b'L')
159 s = self._read(size, b'L')
160 buf = s
160 buf = s
161 # keep asking for more until there's either no more or
161 # keep asking for more until there's either no more or
162 # we got a full line
162 # we got a full line
163 while s and not s.endswith(b'\n'):
163 while s and not s.endswith(b'\n'):
164 s = self._read(size, b'L')
164 s = self._read(size, b'L')
165 buf += s
165 buf += s
166
166
167 return buf
167 return buf
168 else:
168 else:
169 return self._read(size, b'L')
169 return self._read(size, b'L')
170
170
171 def __iter__(self):
171 def __iter__(self):
172 return self
172 return self
173
173
174 def next(self):
174 def next(self):
175 l = self.readline()
175 l = self.readline()
176 if not l:
176 if not l:
177 raise StopIteration
177 raise StopIteration
178 return l
178 return l
179
179
180 __next__ = next
180 __next__ = next
181
181
182 def __getattr__(self, attr):
182 def __getattr__(self, attr):
183 if attr in ('isatty', 'fileno', 'tell', 'seek'):
183 if attr in ('isatty', 'fileno', 'tell', 'seek'):
184 raise AttributeError(attr)
184 raise AttributeError(attr)
185 return getattr(self.in_, attr)
185 return getattr(self.in_, attr)
186
186
187
187
188 _messageencoders = {
188 _messageencoders = {
189 b'cbor': lambda v: b''.join(cborutil.streamencode(v)),
189 b'cbor': lambda v: b''.join(cborutil.streamencode(v)),
190 }
190 }
191
191
192
192
193 def _selectmessageencoder(ui):
193 def _selectmessageencoder(ui):
194 # experimental config: cmdserver.message-encodings
195 encnames = ui.configlist(b'cmdserver', b'message-encodings')
194 encnames = ui.configlist(b'cmdserver', b'message-encodings')
196 for n in encnames:
195 for n in encnames:
197 f = _messageencoders.get(n)
196 f = _messageencoders.get(n)
198 if f:
197 if f:
199 return n, f
198 return n, f
200 raise error.Abort(
199 raise error.Abort(
201 b'no supported message encodings: %s' % b' '.join(encnames)
200 b'no supported message encodings: %s' % b' '.join(encnames)
202 )
201 )
203
202
204
203
205 class server(object):
204 class server(object):
206 """
205 """
207 Listens for commands on fin, runs them and writes the output on a channel
206 Listens for commands on fin, runs them and writes the output on a channel
208 based stream to fout.
207 based stream to fout.
209 """
208 """
210
209
211 def __init__(self, ui, repo, fin, fout, prereposetups=None):
210 def __init__(self, ui, repo, fin, fout, prereposetups=None):
212 self.cwd = encoding.getcwd()
211 self.cwd = encoding.getcwd()
213
212
214 if repo:
213 if repo:
215 # the ui here is really the repo ui so take its baseui so we don't
214 # the ui here is really the repo ui so take its baseui so we don't
216 # end up with its local configuration
215 # end up with its local configuration
217 self.ui = repo.baseui
216 self.ui = repo.baseui
218 self.repo = repo
217 self.repo = repo
219 self.repoui = repo.ui
218 self.repoui = repo.ui
220 else:
219 else:
221 self.ui = ui
220 self.ui = ui
222 self.repo = self.repoui = None
221 self.repo = self.repoui = None
223 self._prereposetups = prereposetups
222 self._prereposetups = prereposetups
224
223
225 self.cdebug = channeledoutput(fout, b'd')
224 self.cdebug = channeledoutput(fout, b'd')
226 self.cerr = channeledoutput(fout, b'e')
225 self.cerr = channeledoutput(fout, b'e')
227 self.cout = channeledoutput(fout, b'o')
226 self.cout = channeledoutput(fout, b'o')
228 self.cin = channeledinput(fin, fout, b'I')
227 self.cin = channeledinput(fin, fout, b'I')
229 self.cresult = channeledoutput(fout, b'r')
228 self.cresult = channeledoutput(fout, b'r')
230
229
231 if self.ui.config(b'cmdserver', b'log') == b'-':
230 if self.ui.config(b'cmdserver', b'log') == b'-':
232 # switch log stream of server's ui to the 'd' (debug) channel
231 # switch log stream of server's ui to the 'd' (debug) channel
233 # (don't touch repo.ui as its lifetime is longer than the server)
232 # (don't touch repo.ui as its lifetime is longer than the server)
234 self.ui = self.ui.copy()
233 self.ui = self.ui.copy()
235 setuplogging(self.ui, repo=None, fp=self.cdebug)
234 setuplogging(self.ui, repo=None, fp=self.cdebug)
236
235
237 # TODO: add this to help/config.txt when stabilized
238 # ``channel``
239 # Use separate channel for structured output. (Command-server only)
240 self.cmsg = None
236 self.cmsg = None
241 if ui.config(b'ui', b'message-output') == b'channel':
237 if ui.config(b'ui', b'message-output') == b'channel':
242 encname, encfn = _selectmessageencoder(ui)
238 encname, encfn = _selectmessageencoder(ui)
243 self.cmsg = channeledmessage(fout, b'm', encname, encfn)
239 self.cmsg = channeledmessage(fout, b'm', encname, encfn)
244
240
245 self.client = fin
241 self.client = fin
246
242
247 # If shutdown-on-interrupt is off, the default SIGINT handler is
243 # If shutdown-on-interrupt is off, the default SIGINT handler is
248 # removed so that client-server communication wouldn't be interrupted.
244 # removed so that client-server communication wouldn't be interrupted.
249 # For example, 'runcommand' handler will issue three short read()s.
245 # For example, 'runcommand' handler will issue three short read()s.
250 # If one of the first two read()s were interrupted, the communication
246 # If one of the first two read()s were interrupted, the communication
251 # channel would be left at dirty state and the subsequent request
247 # channel would be left at dirty state and the subsequent request
252 # wouldn't be parsed. So catching KeyboardInterrupt isn't enough.
248 # wouldn't be parsed. So catching KeyboardInterrupt isn't enough.
253 self._shutdown_on_interrupt = ui.configbool(
249 self._shutdown_on_interrupt = ui.configbool(
254 b'cmdserver', b'shutdown-on-interrupt'
250 b'cmdserver', b'shutdown-on-interrupt'
255 )
251 )
256 self._old_inthandler = None
252 self._old_inthandler = None
257 if not self._shutdown_on_interrupt:
253 if not self._shutdown_on_interrupt:
258 self._old_inthandler = signal.signal(signal.SIGINT, signal.SIG_IGN)
254 self._old_inthandler = signal.signal(signal.SIGINT, signal.SIG_IGN)
259
255
260 def cleanup(self):
256 def cleanup(self):
261 """release and restore resources taken during server session"""
257 """release and restore resources taken during server session"""
262 if not self._shutdown_on_interrupt:
258 if not self._shutdown_on_interrupt:
263 signal.signal(signal.SIGINT, self._old_inthandler)
259 signal.signal(signal.SIGINT, self._old_inthandler)
264
260
265 def _read(self, size):
261 def _read(self, size):
266 if not size:
262 if not size:
267 return b''
263 return b''
268
264
269 data = self.client.read(size)
265 data = self.client.read(size)
270
266
271 # is the other end closed?
267 # is the other end closed?
272 if not data:
268 if not data:
273 raise EOFError
269 raise EOFError
274
270
275 return data
271 return data
276
272
277 def _readstr(self):
273 def _readstr(self):
278 """read a string from the channel
274 """read a string from the channel
279
275
280 format:
276 format:
281 data length (uint32), data
277 data length (uint32), data
282 """
278 """
283 length = struct.unpack(b'>I', self._read(4))[0]
279 length = struct.unpack(b'>I', self._read(4))[0]
284 if not length:
280 if not length:
285 return b''
281 return b''
286 return self._read(length)
282 return self._read(length)
287
283
288 def _readlist(self):
284 def _readlist(self):
289 """read a list of NULL separated strings from the channel"""
285 """read a list of NULL separated strings from the channel"""
290 s = self._readstr()
286 s = self._readstr()
291 if s:
287 if s:
292 return s.split(b'\0')
288 return s.split(b'\0')
293 else:
289 else:
294 return []
290 return []
295
291
296 def _dispatchcommand(self, req):
292 def _dispatchcommand(self, req):
297 from . import dispatch # avoid cycle
293 from . import dispatch # avoid cycle
298
294
299 if self._shutdown_on_interrupt:
295 if self._shutdown_on_interrupt:
300 # no need to restore SIGINT handler as it is unmodified.
296 # no need to restore SIGINT handler as it is unmodified.
301 return dispatch.dispatch(req)
297 return dispatch.dispatch(req)
302
298
303 try:
299 try:
304 signal.signal(signal.SIGINT, self._old_inthandler)
300 signal.signal(signal.SIGINT, self._old_inthandler)
305 return dispatch.dispatch(req)
301 return dispatch.dispatch(req)
306 except error.SignalInterrupt:
302 except error.SignalInterrupt:
307 # propagate SIGBREAK, SIGHUP, or SIGTERM.
303 # propagate SIGBREAK, SIGHUP, or SIGTERM.
308 raise
304 raise
309 except KeyboardInterrupt:
305 except KeyboardInterrupt:
310 # SIGINT may be received out of the try-except block of dispatch(),
306 # SIGINT may be received out of the try-except block of dispatch(),
311 # so catch it as last ditch. Another KeyboardInterrupt may be
307 # so catch it as last ditch. Another KeyboardInterrupt may be
312 # raised while handling exceptions here, but there's no way to
308 # raised while handling exceptions here, but there's no way to
313 # avoid that except for doing everything in C.
309 # avoid that except for doing everything in C.
314 pass
310 pass
315 finally:
311 finally:
316 signal.signal(signal.SIGINT, signal.SIG_IGN)
312 signal.signal(signal.SIGINT, signal.SIG_IGN)
317 # On KeyboardInterrupt, print error message and exit *after* SIGINT
313 # On KeyboardInterrupt, print error message and exit *after* SIGINT
318 # handler removed.
314 # handler removed.
319 req.ui.error(_(b'interrupted!\n'))
315 req.ui.error(_(b'interrupted!\n'))
320 return -1
316 return -1
321
317
322 def runcommand(self):
318 def runcommand(self):
323 """ reads a list of \0 terminated arguments, executes
319 """ reads a list of \0 terminated arguments, executes
324 and writes the return code to the result channel """
320 and writes the return code to the result channel """
325 from . import dispatch # avoid cycle
321 from . import dispatch # avoid cycle
326
322
327 args = self._readlist()
323 args = self._readlist()
328
324
329 # copy the uis so changes (e.g. --config or --verbose) don't
325 # copy the uis so changes (e.g. --config or --verbose) don't
330 # persist between requests
326 # persist between requests
331 copiedui = self.ui.copy()
327 copiedui = self.ui.copy()
332 uis = [copiedui]
328 uis = [copiedui]
333 if self.repo:
329 if self.repo:
334 self.repo.baseui = copiedui
330 self.repo.baseui = copiedui
335 # clone ui without using ui.copy because this is protected
331 # clone ui without using ui.copy because this is protected
336 repoui = self.repoui.__class__(self.repoui)
332 repoui = self.repoui.__class__(self.repoui)
337 repoui.copy = copiedui.copy # redo copy protection
333 repoui.copy = copiedui.copy # redo copy protection
338 uis.append(repoui)
334 uis.append(repoui)
339 self.repo.ui = self.repo.dirstate._ui = repoui
335 self.repo.ui = self.repo.dirstate._ui = repoui
340 self.repo.invalidateall()
336 self.repo.invalidateall()
341
337
342 for ui in uis:
338 for ui in uis:
343 ui.resetstate()
339 ui.resetstate()
344 # any kind of interaction must use server channels, but chg may
340 # any kind of interaction must use server channels, but chg may
345 # replace channels by fully functional tty files. so nontty is
341 # replace channels by fully functional tty files. so nontty is
346 # enforced only if cin is a channel.
342 # enforced only if cin is a channel.
347 if not util.safehasattr(self.cin, b'fileno'):
343 if not util.safehasattr(self.cin, b'fileno'):
348 ui.setconfig(b'ui', b'nontty', b'true', b'commandserver')
344 ui.setconfig(b'ui', b'nontty', b'true', b'commandserver')
349
345
350 req = dispatch.request(
346 req = dispatch.request(
351 args[:],
347 args[:],
352 copiedui,
348 copiedui,
353 self.repo,
349 self.repo,
354 self.cin,
350 self.cin,
355 self.cout,
351 self.cout,
356 self.cerr,
352 self.cerr,
357 self.cmsg,
353 self.cmsg,
358 prereposetups=self._prereposetups,
354 prereposetups=self._prereposetups,
359 )
355 )
360
356
361 try:
357 try:
362 ret = self._dispatchcommand(req) & 255
358 ret = self._dispatchcommand(req) & 255
363 # If shutdown-on-interrupt is off, it's important to write the
359 # If shutdown-on-interrupt is off, it's important to write the
364 # result code *after* SIGINT handler removed. If the result code
360 # result code *after* SIGINT handler removed. If the result code
365 # were lost, the client wouldn't be able to continue processing.
361 # were lost, the client wouldn't be able to continue processing.
366 self.cresult.write(struct.pack(b'>i', int(ret)))
362 self.cresult.write(struct.pack(b'>i', int(ret)))
367 finally:
363 finally:
368 # restore old cwd
364 # restore old cwd
369 if b'--cwd' in args:
365 if b'--cwd' in args:
370 os.chdir(self.cwd)
366 os.chdir(self.cwd)
371
367
372 def getencoding(self):
368 def getencoding(self):
373 """ writes the current encoding to the result channel """
369 """ writes the current encoding to the result channel """
374 self.cresult.write(encoding.encoding)
370 self.cresult.write(encoding.encoding)
375
371
376 def serveone(self):
372 def serveone(self):
377 cmd = self.client.readline()[:-1]
373 cmd = self.client.readline()[:-1]
378 if cmd:
374 if cmd:
379 handler = self.capabilities.get(cmd)
375 handler = self.capabilities.get(cmd)
380 if handler:
376 if handler:
381 handler(self)
377 handler(self)
382 else:
378 else:
383 # clients are expected to check what commands are supported by
379 # clients are expected to check what commands are supported by
384 # looking at the servers capabilities
380 # looking at the servers capabilities
385 raise error.Abort(_(b'unknown command %s') % cmd)
381 raise error.Abort(_(b'unknown command %s') % cmd)
386
382
387 return cmd != b''
383 return cmd != b''
388
384
389 capabilities = {b'runcommand': runcommand, b'getencoding': getencoding}
385 capabilities = {b'runcommand': runcommand, b'getencoding': getencoding}
390
386
391 def serve(self):
387 def serve(self):
392 hellomsg = b'capabilities: ' + b' '.join(sorted(self.capabilities))
388 hellomsg = b'capabilities: ' + b' '.join(sorted(self.capabilities))
393 hellomsg += b'\n'
389 hellomsg += b'\n'
394 hellomsg += b'encoding: ' + encoding.encoding
390 hellomsg += b'encoding: ' + encoding.encoding
395 hellomsg += b'\n'
391 hellomsg += b'\n'
396 if self.cmsg:
392 if self.cmsg:
397 hellomsg += b'message-encoding: %s\n' % self.cmsg.encoding
393 hellomsg += b'message-encoding: %s\n' % self.cmsg.encoding
398 hellomsg += b'pid: %d' % procutil.getpid()
394 hellomsg += b'pid: %d' % procutil.getpid()
399 if util.safehasattr(os, b'getpgid'):
395 if util.safehasattr(os, b'getpgid'):
400 hellomsg += b'\n'
396 hellomsg += b'\n'
401 hellomsg += b'pgid: %d' % os.getpgid(0)
397 hellomsg += b'pgid: %d' % os.getpgid(0)
402
398
403 # write the hello msg in -one- chunk
399 # write the hello msg in -one- chunk
404 self.cout.write(hellomsg)
400 self.cout.write(hellomsg)
405
401
406 try:
402 try:
407 while self.serveone():
403 while self.serveone():
408 pass
404 pass
409 except EOFError:
405 except EOFError:
410 # we'll get here if the client disconnected while we were reading
406 # we'll get here if the client disconnected while we were reading
411 # its request
407 # its request
412 return 1
408 return 1
413
409
414 return 0
410 return 0
415
411
416
412
417 def setuplogging(ui, repo=None, fp=None):
413 def setuplogging(ui, repo=None, fp=None):
418 """Set up server logging facility
414 """Set up server logging facility
419
415
420 If cmdserver.log is '-', log messages will be sent to the given fp.
416 If cmdserver.log is '-', log messages will be sent to the given fp.
421 It should be the 'd' channel while a client is connected, and otherwise
417 It should be the 'd' channel while a client is connected, and otherwise
422 is the stderr of the server process.
418 is the stderr of the server process.
423 """
419 """
424 # developer config: cmdserver.log
420 # developer config: cmdserver.log
425 logpath = ui.config(b'cmdserver', b'log')
421 logpath = ui.config(b'cmdserver', b'log')
426 if not logpath:
422 if not logpath:
427 return
423 return
428 # developer config: cmdserver.track-log
424 # developer config: cmdserver.track-log
429 tracked = set(ui.configlist(b'cmdserver', b'track-log'))
425 tracked = set(ui.configlist(b'cmdserver', b'track-log'))
430
426
431 if logpath == b'-' and fp:
427 if logpath == b'-' and fp:
432 logger = loggingutil.fileobjectlogger(fp, tracked)
428 logger = loggingutil.fileobjectlogger(fp, tracked)
433 elif logpath == b'-':
429 elif logpath == b'-':
434 logger = loggingutil.fileobjectlogger(ui.ferr, tracked)
430 logger = loggingutil.fileobjectlogger(ui.ferr, tracked)
435 else:
431 else:
436 logpath = os.path.abspath(util.expandpath(logpath))
432 logpath = os.path.abspath(util.expandpath(logpath))
437 # developer config: cmdserver.max-log-files
433 # developer config: cmdserver.max-log-files
438 maxfiles = ui.configint(b'cmdserver', b'max-log-files')
434 maxfiles = ui.configint(b'cmdserver', b'max-log-files')
439 # developer config: cmdserver.max-log-size
435 # developer config: cmdserver.max-log-size
440 maxsize = ui.configbytes(b'cmdserver', b'max-log-size')
436 maxsize = ui.configbytes(b'cmdserver', b'max-log-size')
441 vfs = vfsmod.vfs(os.path.dirname(logpath))
437 vfs = vfsmod.vfs(os.path.dirname(logpath))
442 logger = loggingutil.filelogger(
438 logger = loggingutil.filelogger(
443 vfs,
439 vfs,
444 os.path.basename(logpath),
440 os.path.basename(logpath),
445 tracked,
441 tracked,
446 maxfiles=maxfiles,
442 maxfiles=maxfiles,
447 maxsize=maxsize,
443 maxsize=maxsize,
448 )
444 )
449
445
450 targetuis = {ui}
446 targetuis = {ui}
451 if repo:
447 if repo:
452 targetuis.add(repo.baseui)
448 targetuis.add(repo.baseui)
453 targetuis.add(repo.ui)
449 targetuis.add(repo.ui)
454 for u in targetuis:
450 for u in targetuis:
455 u.setlogger(b'cmdserver', logger)
451 u.setlogger(b'cmdserver', logger)
456
452
457
453
458 class pipeservice(object):
454 class pipeservice(object):
459 def __init__(self, ui, repo, opts):
455 def __init__(self, ui, repo, opts):
460 self.ui = ui
456 self.ui = ui
461 self.repo = repo
457 self.repo = repo
462
458
463 def init(self):
459 def init(self):
464 pass
460 pass
465
461
466 def run(self):
462 def run(self):
467 ui = self.ui
463 ui = self.ui
468 # redirect stdio to null device so that broken extensions or in-process
464 # redirect stdio to null device so that broken extensions or in-process
469 # hooks will never cause corruption of channel protocol.
465 # hooks will never cause corruption of channel protocol.
470 with ui.protectedfinout() as (fin, fout):
466 with ui.protectedfinout() as (fin, fout):
471 sv = server(ui, self.repo, fin, fout)
467 sv = server(ui, self.repo, fin, fout)
472 try:
468 try:
473 return sv.serve()
469 return sv.serve()
474 finally:
470 finally:
475 sv.cleanup()
471 sv.cleanup()
476
472
477
473
478 def _initworkerprocess():
474 def _initworkerprocess():
479 # use a different process group from the master process, in order to:
475 # use a different process group from the master process, in order to:
480 # 1. make the current process group no longer "orphaned" (because the
476 # 1. make the current process group no longer "orphaned" (because the
481 # parent of this process is in a different process group while
477 # parent of this process is in a different process group while
482 # remains in a same session)
478 # remains in a same session)
483 # according to POSIX 2.2.2.52, orphaned process group will ignore
479 # according to POSIX 2.2.2.52, orphaned process group will ignore
484 # terminal-generated stop signals like SIGTSTP (Ctrl+Z), which will
480 # terminal-generated stop signals like SIGTSTP (Ctrl+Z), which will
485 # cause trouble for things like ncurses.
481 # cause trouble for things like ncurses.
486 # 2. the client can use kill(-pgid, sig) to simulate terminal-generated
482 # 2. the client can use kill(-pgid, sig) to simulate terminal-generated
487 # SIGINT (Ctrl+C) and process-exit-generated SIGHUP. our child
483 # SIGINT (Ctrl+C) and process-exit-generated SIGHUP. our child
488 # processes like ssh will be killed properly, without affecting
484 # processes like ssh will be killed properly, without affecting
489 # unrelated processes.
485 # unrelated processes.
490 os.setpgid(0, 0)
486 os.setpgid(0, 0)
491 # change random state otherwise forked request handlers would have a
487 # change random state otherwise forked request handlers would have a
492 # same state inherited from parent.
488 # same state inherited from parent.
493 random.seed()
489 random.seed()
494
490
495
491
496 def _serverequest(ui, repo, conn, createcmdserver, prereposetups):
492 def _serverequest(ui, repo, conn, createcmdserver, prereposetups):
497 fin = conn.makefile('rb')
493 fin = conn.makefile('rb')
498 fout = conn.makefile('wb')
494 fout = conn.makefile('wb')
499 sv = None
495 sv = None
500 try:
496 try:
501 sv = createcmdserver(repo, conn, fin, fout, prereposetups)
497 sv = createcmdserver(repo, conn, fin, fout, prereposetups)
502 try:
498 try:
503 sv.serve()
499 sv.serve()
504 # handle exceptions that may be raised by command server. most of
500 # handle exceptions that may be raised by command server. most of
505 # known exceptions are caught by dispatch.
501 # known exceptions are caught by dispatch.
506 except error.Abort as inst:
502 except error.Abort as inst:
507 ui.error(_(b'abort: %s\n') % inst)
503 ui.error(_(b'abort: %s\n') % inst)
508 except IOError as inst:
504 except IOError as inst:
509 if inst.errno != errno.EPIPE:
505 if inst.errno != errno.EPIPE:
510 raise
506 raise
511 except KeyboardInterrupt:
507 except KeyboardInterrupt:
512 pass
508 pass
513 finally:
509 finally:
514 sv.cleanup()
510 sv.cleanup()
515 except: # re-raises
511 except: # re-raises
516 # also write traceback to error channel. otherwise client cannot
512 # also write traceback to error channel. otherwise client cannot
517 # see it because it is written to server's stderr by default.
513 # see it because it is written to server's stderr by default.
518 if sv:
514 if sv:
519 cerr = sv.cerr
515 cerr = sv.cerr
520 else:
516 else:
521 cerr = channeledoutput(fout, b'e')
517 cerr = channeledoutput(fout, b'e')
522 cerr.write(encoding.strtolocal(traceback.format_exc()))
518 cerr.write(encoding.strtolocal(traceback.format_exc()))
523 raise
519 raise
524 finally:
520 finally:
525 fin.close()
521 fin.close()
526 try:
522 try:
527 fout.close() # implicit flush() may cause another EPIPE
523 fout.close() # implicit flush() may cause another EPIPE
528 except IOError as inst:
524 except IOError as inst:
529 if inst.errno != errno.EPIPE:
525 if inst.errno != errno.EPIPE:
530 raise
526 raise
531
527
532
528
533 class unixservicehandler(object):
529 class unixservicehandler(object):
534 """Set of pluggable operations for unix-mode services
530 """Set of pluggable operations for unix-mode services
535
531
536 Almost all methods except for createcmdserver() are called in the main
532 Almost all methods except for createcmdserver() are called in the main
537 process. You can't pass mutable resource back from createcmdserver().
533 process. You can't pass mutable resource back from createcmdserver().
538 """
534 """
539
535
540 pollinterval = None
536 pollinterval = None
541
537
542 def __init__(self, ui):
538 def __init__(self, ui):
543 self.ui = ui
539 self.ui = ui
544
540
545 def bindsocket(self, sock, address):
541 def bindsocket(self, sock, address):
546 util.bindunixsocket(sock, address)
542 util.bindunixsocket(sock, address)
547 sock.listen(socket.SOMAXCONN)
543 sock.listen(socket.SOMAXCONN)
548 self.ui.status(_(b'listening at %s\n') % address)
544 self.ui.status(_(b'listening at %s\n') % address)
549 self.ui.flush() # avoid buffering of status message
545 self.ui.flush() # avoid buffering of status message
550
546
551 def unlinksocket(self, address):
547 def unlinksocket(self, address):
552 os.unlink(address)
548 os.unlink(address)
553
549
554 def shouldexit(self):
550 def shouldexit(self):
555 """True if server should shut down; checked per pollinterval"""
551 """True if server should shut down; checked per pollinterval"""
556 return False
552 return False
557
553
558 def newconnection(self):
554 def newconnection(self):
559 """Called when main process notices new connection"""
555 """Called when main process notices new connection"""
560
556
561 def createcmdserver(self, repo, conn, fin, fout, prereposetups):
557 def createcmdserver(self, repo, conn, fin, fout, prereposetups):
562 """Create new command server instance; called in the process that
558 """Create new command server instance; called in the process that
563 serves for the current connection"""
559 serves for the current connection"""
564 return server(self.ui, repo, fin, fout, prereposetups)
560 return server(self.ui, repo, fin, fout, prereposetups)
565
561
566
562
567 class unixforkingservice(object):
563 class unixforkingservice(object):
568 """
564 """
569 Listens on unix domain socket and forks server per connection
565 Listens on unix domain socket and forks server per connection
570 """
566 """
571
567
572 def __init__(self, ui, repo, opts, handler=None):
568 def __init__(self, ui, repo, opts, handler=None):
573 self.ui = ui
569 self.ui = ui
574 self.repo = repo
570 self.repo = repo
575 self.address = opts[b'address']
571 self.address = opts[b'address']
576 if not util.safehasattr(socket, b'AF_UNIX'):
572 if not util.safehasattr(socket, b'AF_UNIX'):
577 raise error.Abort(_(b'unsupported platform'))
573 raise error.Abort(_(b'unsupported platform'))
578 if not self.address:
574 if not self.address:
579 raise error.Abort(_(b'no socket path specified with --address'))
575 raise error.Abort(_(b'no socket path specified with --address'))
580 self._servicehandler = handler or unixservicehandler(ui)
576 self._servicehandler = handler or unixservicehandler(ui)
581 self._sock = None
577 self._sock = None
582 self._mainipc = None
578 self._mainipc = None
583 self._workeripc = None
579 self._workeripc = None
584 self._oldsigchldhandler = None
580 self._oldsigchldhandler = None
585 self._workerpids = set() # updated by signal handler; do not iterate
581 self._workerpids = set() # updated by signal handler; do not iterate
586 self._socketunlinked = None
582 self._socketunlinked = None
587 # experimental config: cmdserver.max-repo-cache
583 # experimental config: cmdserver.max-repo-cache
588 maxlen = ui.configint(b'cmdserver', b'max-repo-cache')
584 maxlen = ui.configint(b'cmdserver', b'max-repo-cache')
589 if maxlen < 0:
585 if maxlen < 0:
590 raise error.Abort(_(b'negative max-repo-cache size not allowed'))
586 raise error.Abort(_(b'negative max-repo-cache size not allowed'))
591 self._repoloader = repocache.repoloader(ui, maxlen)
587 self._repoloader = repocache.repoloader(ui, maxlen)
592 # attempt to avoid crash in CoreFoundation when using chg after fix in
588 # attempt to avoid crash in CoreFoundation when using chg after fix in
593 # a89381e04c58
589 # a89381e04c58
594 if pycompat.isdarwin:
590 if pycompat.isdarwin:
595 procutil.gui()
591 procutil.gui()
596
592
597 def init(self):
593 def init(self):
598 self._sock = socket.socket(socket.AF_UNIX)
594 self._sock = socket.socket(socket.AF_UNIX)
599 # IPC channel from many workers to one main process; this is actually
595 # IPC channel from many workers to one main process; this is actually
600 # a uni-directional pipe, but is backed by a DGRAM socket so each
596 # a uni-directional pipe, but is backed by a DGRAM socket so each
601 # message can be easily separated.
597 # message can be easily separated.
602 o = socket.socketpair(socket.AF_UNIX, socket.SOCK_DGRAM)
598 o = socket.socketpair(socket.AF_UNIX, socket.SOCK_DGRAM)
603 self._mainipc, self._workeripc = o
599 self._mainipc, self._workeripc = o
604 self._servicehandler.bindsocket(self._sock, self.address)
600 self._servicehandler.bindsocket(self._sock, self.address)
605 if util.safehasattr(procutil, b'unblocksignal'):
601 if util.safehasattr(procutil, b'unblocksignal'):
606 procutil.unblocksignal(signal.SIGCHLD)
602 procutil.unblocksignal(signal.SIGCHLD)
607 o = signal.signal(signal.SIGCHLD, self._sigchldhandler)
603 o = signal.signal(signal.SIGCHLD, self._sigchldhandler)
608 self._oldsigchldhandler = o
604 self._oldsigchldhandler = o
609 self._socketunlinked = False
605 self._socketunlinked = False
610 self._repoloader.start()
606 self._repoloader.start()
611
607
612 def _unlinksocket(self):
608 def _unlinksocket(self):
613 if not self._socketunlinked:
609 if not self._socketunlinked:
614 self._servicehandler.unlinksocket(self.address)
610 self._servicehandler.unlinksocket(self.address)
615 self._socketunlinked = True
611 self._socketunlinked = True
616
612
617 def _cleanup(self):
613 def _cleanup(self):
618 signal.signal(signal.SIGCHLD, self._oldsigchldhandler)
614 signal.signal(signal.SIGCHLD, self._oldsigchldhandler)
619 self._sock.close()
615 self._sock.close()
620 self._mainipc.close()
616 self._mainipc.close()
621 self._workeripc.close()
617 self._workeripc.close()
622 self._unlinksocket()
618 self._unlinksocket()
623 self._repoloader.stop()
619 self._repoloader.stop()
624 # don't kill child processes as they have active clients, just wait
620 # don't kill child processes as they have active clients, just wait
625 self._reapworkers(0)
621 self._reapworkers(0)
626
622
627 def run(self):
623 def run(self):
628 try:
624 try:
629 self._mainloop()
625 self._mainloop()
630 finally:
626 finally:
631 self._cleanup()
627 self._cleanup()
632
628
633 def _mainloop(self):
629 def _mainloop(self):
634 exiting = False
630 exiting = False
635 h = self._servicehandler
631 h = self._servicehandler
636 selector = selectors.DefaultSelector()
632 selector = selectors.DefaultSelector()
637 selector.register(
633 selector.register(
638 self._sock, selectors.EVENT_READ, self._acceptnewconnection
634 self._sock, selectors.EVENT_READ, self._acceptnewconnection
639 )
635 )
640 selector.register(
636 selector.register(
641 self._mainipc, selectors.EVENT_READ, self._handlemainipc
637 self._mainipc, selectors.EVENT_READ, self._handlemainipc
642 )
638 )
643 while True:
639 while True:
644 if not exiting and h.shouldexit():
640 if not exiting and h.shouldexit():
645 # clients can no longer connect() to the domain socket, so
641 # clients can no longer connect() to the domain socket, so
646 # we stop queuing new requests.
642 # we stop queuing new requests.
647 # for requests that are queued (connect()-ed, but haven't been
643 # for requests that are queued (connect()-ed, but haven't been
648 # accept()-ed), handle them before exit. otherwise, clients
644 # accept()-ed), handle them before exit. otherwise, clients
649 # waiting for recv() will receive ECONNRESET.
645 # waiting for recv() will receive ECONNRESET.
650 self._unlinksocket()
646 self._unlinksocket()
651 exiting = True
647 exiting = True
652 try:
648 try:
653 events = selector.select(timeout=h.pollinterval)
649 events = selector.select(timeout=h.pollinterval)
654 except OSError as inst:
650 except OSError as inst:
655 # selectors2 raises ETIMEDOUT if timeout exceeded while
651 # selectors2 raises ETIMEDOUT if timeout exceeded while
656 # handling signal interrupt. That's probably wrong, but
652 # handling signal interrupt. That's probably wrong, but
657 # we can easily get around it.
653 # we can easily get around it.
658 if inst.errno != errno.ETIMEDOUT:
654 if inst.errno != errno.ETIMEDOUT:
659 raise
655 raise
660 events = []
656 events = []
661 if not events:
657 if not events:
662 # only exit if we completed all queued requests
658 # only exit if we completed all queued requests
663 if exiting:
659 if exiting:
664 break
660 break
665 continue
661 continue
666 for key, _mask in events:
662 for key, _mask in events:
667 key.data(key.fileobj, selector)
663 key.data(key.fileobj, selector)
668 selector.close()
664 selector.close()
669
665
670 def _acceptnewconnection(self, sock, selector):
666 def _acceptnewconnection(self, sock, selector):
671 h = self._servicehandler
667 h = self._servicehandler
672 try:
668 try:
673 conn, _addr = sock.accept()
669 conn, _addr = sock.accept()
674 except socket.error as inst:
670 except socket.error as inst:
675 if inst.args[0] == errno.EINTR:
671 if inst.args[0] == errno.EINTR:
676 return
672 return
677 raise
673 raise
678
674
679 # Future improvement: On Python 3.7, maybe gc.freeze() can be used
675 # Future improvement: On Python 3.7, maybe gc.freeze() can be used
680 # to prevent COW memory from being touched by GC.
676 # to prevent COW memory from being touched by GC.
681 # https://instagram-engineering.com/
677 # https://instagram-engineering.com/
682 # copy-on-write-friendly-python-garbage-collection-ad6ed5233ddf
678 # copy-on-write-friendly-python-garbage-collection-ad6ed5233ddf
683 pid = os.fork()
679 pid = os.fork()
684 if pid:
680 if pid:
685 try:
681 try:
686 self.ui.log(
682 self.ui.log(
687 b'cmdserver', b'forked worker process (pid=%d)\n', pid
683 b'cmdserver', b'forked worker process (pid=%d)\n', pid
688 )
684 )
689 self._workerpids.add(pid)
685 self._workerpids.add(pid)
690 h.newconnection()
686 h.newconnection()
691 finally:
687 finally:
692 conn.close() # release handle in parent process
688 conn.close() # release handle in parent process
693 else:
689 else:
694 try:
690 try:
695 selector.close()
691 selector.close()
696 sock.close()
692 sock.close()
697 self._mainipc.close()
693 self._mainipc.close()
698 self._runworker(conn)
694 self._runworker(conn)
699 conn.close()
695 conn.close()
700 self._workeripc.close()
696 self._workeripc.close()
701 os._exit(0)
697 os._exit(0)
702 except: # never return, hence no re-raises
698 except: # never return, hence no re-raises
703 try:
699 try:
704 self.ui.traceback(force=True)
700 self.ui.traceback(force=True)
705 finally:
701 finally:
706 os._exit(255)
702 os._exit(255)
707
703
708 def _handlemainipc(self, sock, selector):
704 def _handlemainipc(self, sock, selector):
709 """Process messages sent from a worker"""
705 """Process messages sent from a worker"""
710 try:
706 try:
711 path = sock.recv(32768) # large enough to receive path
707 path = sock.recv(32768) # large enough to receive path
712 except socket.error as inst:
708 except socket.error as inst:
713 if inst.args[0] == errno.EINTR:
709 if inst.args[0] == errno.EINTR:
714 return
710 return
715 raise
711 raise
716 self._repoloader.load(path)
712 self._repoloader.load(path)
717
713
718 def _sigchldhandler(self, signal, frame):
714 def _sigchldhandler(self, signal, frame):
719 self._reapworkers(os.WNOHANG)
715 self._reapworkers(os.WNOHANG)
720
716
721 def _reapworkers(self, options):
717 def _reapworkers(self, options):
722 while self._workerpids:
718 while self._workerpids:
723 try:
719 try:
724 pid, _status = os.waitpid(-1, options)
720 pid, _status = os.waitpid(-1, options)
725 except OSError as inst:
721 except OSError as inst:
726 if inst.errno == errno.EINTR:
722 if inst.errno == errno.EINTR:
727 continue
723 continue
728 if inst.errno != errno.ECHILD:
724 if inst.errno != errno.ECHILD:
729 raise
725 raise
730 # no child processes at all (reaped by other waitpid()?)
726 # no child processes at all (reaped by other waitpid()?)
731 self._workerpids.clear()
727 self._workerpids.clear()
732 return
728 return
733 if pid == 0:
729 if pid == 0:
734 # no waitable child processes
730 # no waitable child processes
735 return
731 return
736 self.ui.log(b'cmdserver', b'worker process exited (pid=%d)\n', pid)
732 self.ui.log(b'cmdserver', b'worker process exited (pid=%d)\n', pid)
737 self._workerpids.discard(pid)
733 self._workerpids.discard(pid)
738
734
739 def _runworker(self, conn):
735 def _runworker(self, conn):
740 signal.signal(signal.SIGCHLD, self._oldsigchldhandler)
736 signal.signal(signal.SIGCHLD, self._oldsigchldhandler)
741 _initworkerprocess()
737 _initworkerprocess()
742 h = self._servicehandler
738 h = self._servicehandler
743 try:
739 try:
744 _serverequest(
740 _serverequest(
745 self.ui,
741 self.ui,
746 self.repo,
742 self.repo,
747 conn,
743 conn,
748 h.createcmdserver,
744 h.createcmdserver,
749 prereposetups=[self._reposetup],
745 prereposetups=[self._reposetup],
750 )
746 )
751 finally:
747 finally:
752 gc.collect() # trigger __del__ since worker process uses os._exit
748 gc.collect() # trigger __del__ since worker process uses os._exit
753
749
754 def _reposetup(self, ui, repo):
750 def _reposetup(self, ui, repo):
755 if not repo.local():
751 if not repo.local():
756 return
752 return
757
753
758 class unixcmdserverrepo(repo.__class__):
754 class unixcmdserverrepo(repo.__class__):
759 def close(self):
755 def close(self):
760 super(unixcmdserverrepo, self).close()
756 super(unixcmdserverrepo, self).close()
761 try:
757 try:
762 self._cmdserveripc.send(self.root)
758 self._cmdserveripc.send(self.root)
763 except socket.error:
759 except socket.error:
764 self.ui.log(
760 self.ui.log(
765 b'cmdserver', b'failed to send repo root to master\n'
761 b'cmdserver', b'failed to send repo root to master\n'
766 )
762 )
767
763
768 repo.__class__ = unixcmdserverrepo
764 repo.__class__ = unixcmdserverrepo
769 repo._cmdserveripc = self._workeripc
765 repo._cmdserveripc = self._workeripc
770
766
771 cachedrepo = self._repoloader.get(repo.root)
767 cachedrepo = self._repoloader.get(repo.root)
772 if cachedrepo is None:
768 if cachedrepo is None:
773 return
769 return
774 repo.ui.log(b'repocache', b'repo from cache: %s\n', repo.root)
770 repo.ui.log(b'repocache', b'repo from cache: %s\n', repo.root)
775 repocache.copycache(cachedrepo, repo)
771 repocache.copycache(cachedrepo, repo)
@@ -1,1578 +1,1578 b''
1 # configitems.py - centralized declaration of configuration option
1 # configitems.py - centralized declaration of configuration option
2 #
2 #
3 # Copyright 2017 Pierre-Yves David <pierre-yves.david@octobus.net>
3 # Copyright 2017 Pierre-Yves David <pierre-yves.david@octobus.net>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import functools
10 import functools
11 import re
11 import re
12
12
13 from . import (
13 from . import (
14 encoding,
14 encoding,
15 error,
15 error,
16 )
16 )
17
17
18
18
19 def loadconfigtable(ui, extname, configtable):
19 def loadconfigtable(ui, extname, configtable):
20 """update config item known to the ui with the extension ones"""
20 """update config item known to the ui with the extension ones"""
21 for section, items in sorted(configtable.items()):
21 for section, items in sorted(configtable.items()):
22 knownitems = ui._knownconfig.setdefault(section, itemregister())
22 knownitems = ui._knownconfig.setdefault(section, itemregister())
23 knownkeys = set(knownitems)
23 knownkeys = set(knownitems)
24 newkeys = set(items)
24 newkeys = set(items)
25 for key in sorted(knownkeys & newkeys):
25 for key in sorted(knownkeys & newkeys):
26 msg = b"extension '%s' overwrite config item '%s.%s'"
26 msg = b"extension '%s' overwrite config item '%s.%s'"
27 msg %= (extname, section, key)
27 msg %= (extname, section, key)
28 ui.develwarn(msg, config=b'warn-config')
28 ui.develwarn(msg, config=b'warn-config')
29
29
30 knownitems.update(items)
30 knownitems.update(items)
31
31
32
32
33 class configitem(object):
33 class configitem(object):
34 """represent a known config item
34 """represent a known config item
35
35
36 :section: the official config section where to find this item,
36 :section: the official config section where to find this item,
37 :name: the official name within the section,
37 :name: the official name within the section,
38 :default: default value for this item,
38 :default: default value for this item,
39 :alias: optional list of tuples as alternatives,
39 :alias: optional list of tuples as alternatives,
40 :generic: this is a generic definition, match name using regular expression.
40 :generic: this is a generic definition, match name using regular expression.
41 """
41 """
42
42
43 def __init__(
43 def __init__(
44 self,
44 self,
45 section,
45 section,
46 name,
46 name,
47 default=None,
47 default=None,
48 alias=(),
48 alias=(),
49 generic=False,
49 generic=False,
50 priority=0,
50 priority=0,
51 experimental=False,
51 experimental=False,
52 ):
52 ):
53 self.section = section
53 self.section = section
54 self.name = name
54 self.name = name
55 self.default = default
55 self.default = default
56 self.alias = list(alias)
56 self.alias = list(alias)
57 self.generic = generic
57 self.generic = generic
58 self.priority = priority
58 self.priority = priority
59 self.experimental = experimental
59 self.experimental = experimental
60 self._re = None
60 self._re = None
61 if generic:
61 if generic:
62 self._re = re.compile(self.name)
62 self._re = re.compile(self.name)
63
63
64
64
65 class itemregister(dict):
65 class itemregister(dict):
66 """A specialized dictionary that can handle wild-card selection"""
66 """A specialized dictionary that can handle wild-card selection"""
67
67
68 def __init__(self):
68 def __init__(self):
69 super(itemregister, self).__init__()
69 super(itemregister, self).__init__()
70 self._generics = set()
70 self._generics = set()
71
71
72 def update(self, other):
72 def update(self, other):
73 super(itemregister, self).update(other)
73 super(itemregister, self).update(other)
74 self._generics.update(other._generics)
74 self._generics.update(other._generics)
75
75
76 def __setitem__(self, key, item):
76 def __setitem__(self, key, item):
77 super(itemregister, self).__setitem__(key, item)
77 super(itemregister, self).__setitem__(key, item)
78 if item.generic:
78 if item.generic:
79 self._generics.add(item)
79 self._generics.add(item)
80
80
81 def get(self, key):
81 def get(self, key):
82 baseitem = super(itemregister, self).get(key)
82 baseitem = super(itemregister, self).get(key)
83 if baseitem is not None and not baseitem.generic:
83 if baseitem is not None and not baseitem.generic:
84 return baseitem
84 return baseitem
85
85
86 # search for a matching generic item
86 # search for a matching generic item
87 generics = sorted(self._generics, key=(lambda x: (x.priority, x.name)))
87 generics = sorted(self._generics, key=(lambda x: (x.priority, x.name)))
88 for item in generics:
88 for item in generics:
89 # we use 'match' instead of 'search' to make the matching simpler
89 # we use 'match' instead of 'search' to make the matching simpler
90 # for people unfamiliar with regular expression. Having the match
90 # for people unfamiliar with regular expression. Having the match
91 # rooted to the start of the string will produce less surprising
91 # rooted to the start of the string will produce less surprising
92 # result for user writing simple regex for sub-attribute.
92 # result for user writing simple regex for sub-attribute.
93 #
93 #
94 # For example using "color\..*" match produces an unsurprising
94 # For example using "color\..*" match produces an unsurprising
95 # result, while using search could suddenly match apparently
95 # result, while using search could suddenly match apparently
96 # unrelated configuration that happens to contains "color."
96 # unrelated configuration that happens to contains "color."
97 # anywhere. This is a tradeoff where we favor requiring ".*" on
97 # anywhere. This is a tradeoff where we favor requiring ".*" on
98 # some match to avoid the need to prefix most pattern with "^".
98 # some match to avoid the need to prefix most pattern with "^".
99 # The "^" seems more error prone.
99 # The "^" seems more error prone.
100 if item._re.match(key):
100 if item._re.match(key):
101 return item
101 return item
102
102
103 return None
103 return None
104
104
105
105
106 coreitems = {}
106 coreitems = {}
107
107
108
108
109 def _register(configtable, *args, **kwargs):
109 def _register(configtable, *args, **kwargs):
110 item = configitem(*args, **kwargs)
110 item = configitem(*args, **kwargs)
111 section = configtable.setdefault(item.section, itemregister())
111 section = configtable.setdefault(item.section, itemregister())
112 if item.name in section:
112 if item.name in section:
113 msg = b"duplicated config item registration for '%s.%s'"
113 msg = b"duplicated config item registration for '%s.%s'"
114 raise error.ProgrammingError(msg % (item.section, item.name))
114 raise error.ProgrammingError(msg % (item.section, item.name))
115 section[item.name] = item
115 section[item.name] = item
116
116
117
117
118 # special value for case where the default is derived from other values
118 # special value for case where the default is derived from other values
119 dynamicdefault = object()
119 dynamicdefault = object()
120
120
121 # Registering actual config items
121 # Registering actual config items
122
122
123
123
124 def getitemregister(configtable):
124 def getitemregister(configtable):
125 f = functools.partial(_register, configtable)
125 f = functools.partial(_register, configtable)
126 # export pseudo enum as configitem.*
126 # export pseudo enum as configitem.*
127 f.dynamicdefault = dynamicdefault
127 f.dynamicdefault = dynamicdefault
128 return f
128 return f
129
129
130
130
131 coreconfigitem = getitemregister(coreitems)
131 coreconfigitem = getitemregister(coreitems)
132
132
133
133
134 def _registerdiffopts(section, configprefix=b''):
134 def _registerdiffopts(section, configprefix=b''):
135 coreconfigitem(
135 coreconfigitem(
136 section, configprefix + b'nodates', default=False,
136 section, configprefix + b'nodates', default=False,
137 )
137 )
138 coreconfigitem(
138 coreconfigitem(
139 section, configprefix + b'showfunc', default=False,
139 section, configprefix + b'showfunc', default=False,
140 )
140 )
141 coreconfigitem(
141 coreconfigitem(
142 section, configprefix + b'unified', default=None,
142 section, configprefix + b'unified', default=None,
143 )
143 )
144 coreconfigitem(
144 coreconfigitem(
145 section, configprefix + b'git', default=False,
145 section, configprefix + b'git', default=False,
146 )
146 )
147 coreconfigitem(
147 coreconfigitem(
148 section, configprefix + b'ignorews', default=False,
148 section, configprefix + b'ignorews', default=False,
149 )
149 )
150 coreconfigitem(
150 coreconfigitem(
151 section, configprefix + b'ignorewsamount', default=False,
151 section, configprefix + b'ignorewsamount', default=False,
152 )
152 )
153 coreconfigitem(
153 coreconfigitem(
154 section, configprefix + b'ignoreblanklines', default=False,
154 section, configprefix + b'ignoreblanklines', default=False,
155 )
155 )
156 coreconfigitem(
156 coreconfigitem(
157 section, configprefix + b'ignorewseol', default=False,
157 section, configprefix + b'ignorewseol', default=False,
158 )
158 )
159 coreconfigitem(
159 coreconfigitem(
160 section, configprefix + b'nobinary', default=False,
160 section, configprefix + b'nobinary', default=False,
161 )
161 )
162 coreconfigitem(
162 coreconfigitem(
163 section, configprefix + b'noprefix', default=False,
163 section, configprefix + b'noprefix', default=False,
164 )
164 )
165 coreconfigitem(
165 coreconfigitem(
166 section, configprefix + b'word-diff', default=False,
166 section, configprefix + b'word-diff', default=False,
167 )
167 )
168
168
169
169
170 coreconfigitem(
170 coreconfigitem(
171 b'alias', b'.*', default=dynamicdefault, generic=True,
171 b'alias', b'.*', default=dynamicdefault, generic=True,
172 )
172 )
173 coreconfigitem(
173 coreconfigitem(
174 b'auth', b'cookiefile', default=None,
174 b'auth', b'cookiefile', default=None,
175 )
175 )
176 _registerdiffopts(section=b'annotate')
176 _registerdiffopts(section=b'annotate')
177 # bookmarks.pushing: internal hack for discovery
177 # bookmarks.pushing: internal hack for discovery
178 coreconfigitem(
178 coreconfigitem(
179 b'bookmarks', b'pushing', default=list,
179 b'bookmarks', b'pushing', default=list,
180 )
180 )
181 # bundle.mainreporoot: internal hack for bundlerepo
181 # bundle.mainreporoot: internal hack for bundlerepo
182 coreconfigitem(
182 coreconfigitem(
183 b'bundle', b'mainreporoot', default=b'',
183 b'bundle', b'mainreporoot', default=b'',
184 )
184 )
185 coreconfigitem(
185 coreconfigitem(
186 b'censor', b'policy', default=b'abort', experimental=True,
186 b'censor', b'policy', default=b'abort', experimental=True,
187 )
187 )
188 coreconfigitem(
188 coreconfigitem(
189 b'chgserver', b'idletimeout', default=3600,
189 b'chgserver', b'idletimeout', default=3600,
190 )
190 )
191 coreconfigitem(
191 coreconfigitem(
192 b'chgserver', b'skiphash', default=False,
192 b'chgserver', b'skiphash', default=False,
193 )
193 )
194 coreconfigitem(
194 coreconfigitem(
195 b'cmdserver', b'log', default=None,
195 b'cmdserver', b'log', default=None,
196 )
196 )
197 coreconfigitem(
197 coreconfigitem(
198 b'cmdserver', b'max-log-files', default=7,
198 b'cmdserver', b'max-log-files', default=7,
199 )
199 )
200 coreconfigitem(
200 coreconfigitem(
201 b'cmdserver', b'max-log-size', default=b'1 MB',
201 b'cmdserver', b'max-log-size', default=b'1 MB',
202 )
202 )
203 coreconfigitem(
203 coreconfigitem(
204 b'cmdserver', b'max-repo-cache', default=0, experimental=True,
204 b'cmdserver', b'max-repo-cache', default=0, experimental=True,
205 )
205 )
206 coreconfigitem(
206 coreconfigitem(
207 b'cmdserver', b'message-encodings', default=list, experimental=True,
207 b'cmdserver', b'message-encodings', default=list,
208 )
208 )
209 coreconfigitem(
209 coreconfigitem(
210 b'cmdserver',
210 b'cmdserver',
211 b'track-log',
211 b'track-log',
212 default=lambda: [b'chgserver', b'cmdserver', b'repocache'],
212 default=lambda: [b'chgserver', b'cmdserver', b'repocache'],
213 )
213 )
214 coreconfigitem(
214 coreconfigitem(
215 b'cmdserver', b'shutdown-on-interrupt', default=True,
215 b'cmdserver', b'shutdown-on-interrupt', default=True,
216 )
216 )
217 coreconfigitem(
217 coreconfigitem(
218 b'color', b'.*', default=None, generic=True,
218 b'color', b'.*', default=None, generic=True,
219 )
219 )
220 coreconfigitem(
220 coreconfigitem(
221 b'color', b'mode', default=b'auto',
221 b'color', b'mode', default=b'auto',
222 )
222 )
223 coreconfigitem(
223 coreconfigitem(
224 b'color', b'pagermode', default=dynamicdefault,
224 b'color', b'pagermode', default=dynamicdefault,
225 )
225 )
226 _registerdiffopts(section=b'commands', configprefix=b'commit.interactive.')
226 _registerdiffopts(section=b'commands', configprefix=b'commit.interactive.')
227 coreconfigitem(
227 coreconfigitem(
228 b'commands', b'commit.post-status', default=False,
228 b'commands', b'commit.post-status', default=False,
229 )
229 )
230 coreconfigitem(
230 coreconfigitem(
231 b'commands', b'grep.all-files', default=False, experimental=True,
231 b'commands', b'grep.all-files', default=False, experimental=True,
232 )
232 )
233 coreconfigitem(
233 coreconfigitem(
234 b'commands', b'merge.require-rev', default=False,
234 b'commands', b'merge.require-rev', default=False,
235 )
235 )
236 coreconfigitem(
236 coreconfigitem(
237 b'commands', b'push.require-revs', default=False,
237 b'commands', b'push.require-revs', default=False,
238 )
238 )
239 coreconfigitem(
239 coreconfigitem(
240 b'commands', b'resolve.confirm', default=False,
240 b'commands', b'resolve.confirm', default=False,
241 )
241 )
242 coreconfigitem(
242 coreconfigitem(
243 b'commands', b'resolve.explicit-re-merge', default=False,
243 b'commands', b'resolve.explicit-re-merge', default=False,
244 )
244 )
245 coreconfigitem(
245 coreconfigitem(
246 b'commands', b'resolve.mark-check', default=b'none',
246 b'commands', b'resolve.mark-check', default=b'none',
247 )
247 )
248 _registerdiffopts(section=b'commands', configprefix=b'revert.interactive.')
248 _registerdiffopts(section=b'commands', configprefix=b'revert.interactive.')
249 coreconfigitem(
249 coreconfigitem(
250 b'commands', b'show.aliasprefix', default=list,
250 b'commands', b'show.aliasprefix', default=list,
251 )
251 )
252 coreconfigitem(
252 coreconfigitem(
253 b'commands', b'status.relative', default=False,
253 b'commands', b'status.relative', default=False,
254 )
254 )
255 coreconfigitem(
255 coreconfigitem(
256 b'commands', b'status.skipstates', default=[], experimental=True,
256 b'commands', b'status.skipstates', default=[], experimental=True,
257 )
257 )
258 coreconfigitem(
258 coreconfigitem(
259 b'commands', b'status.terse', default=b'',
259 b'commands', b'status.terse', default=b'',
260 )
260 )
261 coreconfigitem(
261 coreconfigitem(
262 b'commands', b'status.verbose', default=False,
262 b'commands', b'status.verbose', default=False,
263 )
263 )
264 coreconfigitem(
264 coreconfigitem(
265 b'commands', b'update.check', default=None,
265 b'commands', b'update.check', default=None,
266 )
266 )
267 coreconfigitem(
267 coreconfigitem(
268 b'commands', b'update.requiredest', default=False,
268 b'commands', b'update.requiredest', default=False,
269 )
269 )
270 coreconfigitem(
270 coreconfigitem(
271 b'committemplate', b'.*', default=None, generic=True,
271 b'committemplate', b'.*', default=None, generic=True,
272 )
272 )
273 coreconfigitem(
273 coreconfigitem(
274 b'convert', b'bzr.saverev', default=True,
274 b'convert', b'bzr.saverev', default=True,
275 )
275 )
276 coreconfigitem(
276 coreconfigitem(
277 b'convert', b'cvsps.cache', default=True,
277 b'convert', b'cvsps.cache', default=True,
278 )
278 )
279 coreconfigitem(
279 coreconfigitem(
280 b'convert', b'cvsps.fuzz', default=60,
280 b'convert', b'cvsps.fuzz', default=60,
281 )
281 )
282 coreconfigitem(
282 coreconfigitem(
283 b'convert', b'cvsps.logencoding', default=None,
283 b'convert', b'cvsps.logencoding', default=None,
284 )
284 )
285 coreconfigitem(
285 coreconfigitem(
286 b'convert', b'cvsps.mergefrom', default=None,
286 b'convert', b'cvsps.mergefrom', default=None,
287 )
287 )
288 coreconfigitem(
288 coreconfigitem(
289 b'convert', b'cvsps.mergeto', default=None,
289 b'convert', b'cvsps.mergeto', default=None,
290 )
290 )
291 coreconfigitem(
291 coreconfigitem(
292 b'convert', b'git.committeractions', default=lambda: [b'messagedifferent'],
292 b'convert', b'git.committeractions', default=lambda: [b'messagedifferent'],
293 )
293 )
294 coreconfigitem(
294 coreconfigitem(
295 b'convert', b'git.extrakeys', default=list,
295 b'convert', b'git.extrakeys', default=list,
296 )
296 )
297 coreconfigitem(
297 coreconfigitem(
298 b'convert', b'git.findcopiesharder', default=False,
298 b'convert', b'git.findcopiesharder', default=False,
299 )
299 )
300 coreconfigitem(
300 coreconfigitem(
301 b'convert', b'git.remoteprefix', default=b'remote',
301 b'convert', b'git.remoteprefix', default=b'remote',
302 )
302 )
303 coreconfigitem(
303 coreconfigitem(
304 b'convert', b'git.renamelimit', default=400,
304 b'convert', b'git.renamelimit', default=400,
305 )
305 )
306 coreconfigitem(
306 coreconfigitem(
307 b'convert', b'git.saverev', default=True,
307 b'convert', b'git.saverev', default=True,
308 )
308 )
309 coreconfigitem(
309 coreconfigitem(
310 b'convert', b'git.similarity', default=50,
310 b'convert', b'git.similarity', default=50,
311 )
311 )
312 coreconfigitem(
312 coreconfigitem(
313 b'convert', b'git.skipsubmodules', default=False,
313 b'convert', b'git.skipsubmodules', default=False,
314 )
314 )
315 coreconfigitem(
315 coreconfigitem(
316 b'convert', b'hg.clonebranches', default=False,
316 b'convert', b'hg.clonebranches', default=False,
317 )
317 )
318 coreconfigitem(
318 coreconfigitem(
319 b'convert', b'hg.ignoreerrors', default=False,
319 b'convert', b'hg.ignoreerrors', default=False,
320 )
320 )
321 coreconfigitem(
321 coreconfigitem(
322 b'convert', b'hg.preserve-hash', default=False,
322 b'convert', b'hg.preserve-hash', default=False,
323 )
323 )
324 coreconfigitem(
324 coreconfigitem(
325 b'convert', b'hg.revs', default=None,
325 b'convert', b'hg.revs', default=None,
326 )
326 )
327 coreconfigitem(
327 coreconfigitem(
328 b'convert', b'hg.saverev', default=False,
328 b'convert', b'hg.saverev', default=False,
329 )
329 )
330 coreconfigitem(
330 coreconfigitem(
331 b'convert', b'hg.sourcename', default=None,
331 b'convert', b'hg.sourcename', default=None,
332 )
332 )
333 coreconfigitem(
333 coreconfigitem(
334 b'convert', b'hg.startrev', default=None,
334 b'convert', b'hg.startrev', default=None,
335 )
335 )
336 coreconfigitem(
336 coreconfigitem(
337 b'convert', b'hg.tagsbranch', default=b'default',
337 b'convert', b'hg.tagsbranch', default=b'default',
338 )
338 )
339 coreconfigitem(
339 coreconfigitem(
340 b'convert', b'hg.usebranchnames', default=True,
340 b'convert', b'hg.usebranchnames', default=True,
341 )
341 )
342 coreconfigitem(
342 coreconfigitem(
343 b'convert', b'ignoreancestorcheck', default=False, experimental=True,
343 b'convert', b'ignoreancestorcheck', default=False, experimental=True,
344 )
344 )
345 coreconfigitem(
345 coreconfigitem(
346 b'convert', b'localtimezone', default=False,
346 b'convert', b'localtimezone', default=False,
347 )
347 )
348 coreconfigitem(
348 coreconfigitem(
349 b'convert', b'p4.encoding', default=dynamicdefault,
349 b'convert', b'p4.encoding', default=dynamicdefault,
350 )
350 )
351 coreconfigitem(
351 coreconfigitem(
352 b'convert', b'p4.startrev', default=0,
352 b'convert', b'p4.startrev', default=0,
353 )
353 )
354 coreconfigitem(
354 coreconfigitem(
355 b'convert', b'skiptags', default=False,
355 b'convert', b'skiptags', default=False,
356 )
356 )
357 coreconfigitem(
357 coreconfigitem(
358 b'convert', b'svn.debugsvnlog', default=True,
358 b'convert', b'svn.debugsvnlog', default=True,
359 )
359 )
360 coreconfigitem(
360 coreconfigitem(
361 b'convert', b'svn.trunk', default=None,
361 b'convert', b'svn.trunk', default=None,
362 )
362 )
363 coreconfigitem(
363 coreconfigitem(
364 b'convert', b'svn.tags', default=None,
364 b'convert', b'svn.tags', default=None,
365 )
365 )
366 coreconfigitem(
366 coreconfigitem(
367 b'convert', b'svn.branches', default=None,
367 b'convert', b'svn.branches', default=None,
368 )
368 )
369 coreconfigitem(
369 coreconfigitem(
370 b'convert', b'svn.startrev', default=0,
370 b'convert', b'svn.startrev', default=0,
371 )
371 )
372 coreconfigitem(
372 coreconfigitem(
373 b'debug', b'dirstate.delaywrite', default=0,
373 b'debug', b'dirstate.delaywrite', default=0,
374 )
374 )
375 coreconfigitem(
375 coreconfigitem(
376 b'defaults', b'.*', default=None, generic=True,
376 b'defaults', b'.*', default=None, generic=True,
377 )
377 )
378 coreconfigitem(
378 coreconfigitem(
379 b'devel', b'all-warnings', default=False,
379 b'devel', b'all-warnings', default=False,
380 )
380 )
381 coreconfigitem(
381 coreconfigitem(
382 b'devel', b'bundle2.debug', default=False,
382 b'devel', b'bundle2.debug', default=False,
383 )
383 )
384 coreconfigitem(
384 coreconfigitem(
385 b'devel', b'bundle.delta', default=b'',
385 b'devel', b'bundle.delta', default=b'',
386 )
386 )
387 coreconfigitem(
387 coreconfigitem(
388 b'devel', b'cache-vfs', default=None,
388 b'devel', b'cache-vfs', default=None,
389 )
389 )
390 coreconfigitem(
390 coreconfigitem(
391 b'devel', b'check-locks', default=False,
391 b'devel', b'check-locks', default=False,
392 )
392 )
393 coreconfigitem(
393 coreconfigitem(
394 b'devel', b'check-relroot', default=False,
394 b'devel', b'check-relroot', default=False,
395 )
395 )
396 coreconfigitem(
396 coreconfigitem(
397 b'devel', b'default-date', default=None,
397 b'devel', b'default-date', default=None,
398 )
398 )
399 coreconfigitem(
399 coreconfigitem(
400 b'devel', b'deprec-warn', default=False,
400 b'devel', b'deprec-warn', default=False,
401 )
401 )
402 coreconfigitem(
402 coreconfigitem(
403 b'devel', b'disableloaddefaultcerts', default=False,
403 b'devel', b'disableloaddefaultcerts', default=False,
404 )
404 )
405 coreconfigitem(
405 coreconfigitem(
406 b'devel', b'warn-empty-changegroup', default=False,
406 b'devel', b'warn-empty-changegroup', default=False,
407 )
407 )
408 coreconfigitem(
408 coreconfigitem(
409 b'devel', b'legacy.exchange', default=list,
409 b'devel', b'legacy.exchange', default=list,
410 )
410 )
411 coreconfigitem(
411 coreconfigitem(
412 b'devel', b'persistent-nodemap', default=False,
412 b'devel', b'persistent-nodemap', default=False,
413 )
413 )
414 coreconfigitem(
414 coreconfigitem(
415 b'devel', b'servercafile', default=b'',
415 b'devel', b'servercafile', default=b'',
416 )
416 )
417 coreconfigitem(
417 coreconfigitem(
418 b'devel', b'serverexactprotocol', default=b'',
418 b'devel', b'serverexactprotocol', default=b'',
419 )
419 )
420 coreconfigitem(
420 coreconfigitem(
421 b'devel', b'serverrequirecert', default=False,
421 b'devel', b'serverrequirecert', default=False,
422 )
422 )
423 coreconfigitem(
423 coreconfigitem(
424 b'devel', b'strip-obsmarkers', default=True,
424 b'devel', b'strip-obsmarkers', default=True,
425 )
425 )
426 coreconfigitem(
426 coreconfigitem(
427 b'devel', b'warn-config', default=None,
427 b'devel', b'warn-config', default=None,
428 )
428 )
429 coreconfigitem(
429 coreconfigitem(
430 b'devel', b'warn-config-default', default=None,
430 b'devel', b'warn-config-default', default=None,
431 )
431 )
432 coreconfigitem(
432 coreconfigitem(
433 b'devel', b'user.obsmarker', default=None,
433 b'devel', b'user.obsmarker', default=None,
434 )
434 )
435 coreconfigitem(
435 coreconfigitem(
436 b'devel', b'warn-config-unknown', default=None,
436 b'devel', b'warn-config-unknown', default=None,
437 )
437 )
438 coreconfigitem(
438 coreconfigitem(
439 b'devel', b'debug.copies', default=False,
439 b'devel', b'debug.copies', default=False,
440 )
440 )
441 coreconfigitem(
441 coreconfigitem(
442 b'devel', b'debug.extensions', default=False,
442 b'devel', b'debug.extensions', default=False,
443 )
443 )
444 coreconfigitem(
444 coreconfigitem(
445 b'devel', b'debug.repo-filters', default=False,
445 b'devel', b'debug.repo-filters', default=False,
446 )
446 )
447 coreconfigitem(
447 coreconfigitem(
448 b'devel', b'debug.peer-request', default=False,
448 b'devel', b'debug.peer-request', default=False,
449 )
449 )
450 coreconfigitem(
450 coreconfigitem(
451 b'devel', b'discovery.randomize', default=True,
451 b'devel', b'discovery.randomize', default=True,
452 )
452 )
453 _registerdiffopts(section=b'diff')
453 _registerdiffopts(section=b'diff')
454 coreconfigitem(
454 coreconfigitem(
455 b'email', b'bcc', default=None,
455 b'email', b'bcc', default=None,
456 )
456 )
457 coreconfigitem(
457 coreconfigitem(
458 b'email', b'cc', default=None,
458 b'email', b'cc', default=None,
459 )
459 )
460 coreconfigitem(
460 coreconfigitem(
461 b'email', b'charsets', default=list,
461 b'email', b'charsets', default=list,
462 )
462 )
463 coreconfigitem(
463 coreconfigitem(
464 b'email', b'from', default=None,
464 b'email', b'from', default=None,
465 )
465 )
466 coreconfigitem(
466 coreconfigitem(
467 b'email', b'method', default=b'smtp',
467 b'email', b'method', default=b'smtp',
468 )
468 )
469 coreconfigitem(
469 coreconfigitem(
470 b'email', b'reply-to', default=None,
470 b'email', b'reply-to', default=None,
471 )
471 )
472 coreconfigitem(
472 coreconfigitem(
473 b'email', b'to', default=None,
473 b'email', b'to', default=None,
474 )
474 )
475 coreconfigitem(
475 coreconfigitem(
476 b'experimental', b'archivemetatemplate', default=dynamicdefault,
476 b'experimental', b'archivemetatemplate', default=dynamicdefault,
477 )
477 )
478 coreconfigitem(
478 coreconfigitem(
479 b'experimental', b'auto-publish', default=b'publish',
479 b'experimental', b'auto-publish', default=b'publish',
480 )
480 )
481 coreconfigitem(
481 coreconfigitem(
482 b'experimental', b'bundle-phases', default=False,
482 b'experimental', b'bundle-phases', default=False,
483 )
483 )
484 coreconfigitem(
484 coreconfigitem(
485 b'experimental', b'bundle2-advertise', default=True,
485 b'experimental', b'bundle2-advertise', default=True,
486 )
486 )
487 coreconfigitem(
487 coreconfigitem(
488 b'experimental', b'bundle2-output-capture', default=False,
488 b'experimental', b'bundle2-output-capture', default=False,
489 )
489 )
490 coreconfigitem(
490 coreconfigitem(
491 b'experimental', b'bundle2.pushback', default=False,
491 b'experimental', b'bundle2.pushback', default=False,
492 )
492 )
493 coreconfigitem(
493 coreconfigitem(
494 b'experimental', b'bundle2lazylocking', default=False,
494 b'experimental', b'bundle2lazylocking', default=False,
495 )
495 )
496 coreconfigitem(
496 coreconfigitem(
497 b'experimental', b'bundlecomplevel', default=None,
497 b'experimental', b'bundlecomplevel', default=None,
498 )
498 )
499 coreconfigitem(
499 coreconfigitem(
500 b'experimental', b'bundlecomplevel.bzip2', default=None,
500 b'experimental', b'bundlecomplevel.bzip2', default=None,
501 )
501 )
502 coreconfigitem(
502 coreconfigitem(
503 b'experimental', b'bundlecomplevel.gzip', default=None,
503 b'experimental', b'bundlecomplevel.gzip', default=None,
504 )
504 )
505 coreconfigitem(
505 coreconfigitem(
506 b'experimental', b'bundlecomplevel.none', default=None,
506 b'experimental', b'bundlecomplevel.none', default=None,
507 )
507 )
508 coreconfigitem(
508 coreconfigitem(
509 b'experimental', b'bundlecomplevel.zstd', default=None,
509 b'experimental', b'bundlecomplevel.zstd', default=None,
510 )
510 )
511 coreconfigitem(
511 coreconfigitem(
512 b'experimental', b'changegroup3', default=False,
512 b'experimental', b'changegroup3', default=False,
513 )
513 )
514 coreconfigitem(
514 coreconfigitem(
515 b'experimental', b'cleanup-as-archived', default=False,
515 b'experimental', b'cleanup-as-archived', default=False,
516 )
516 )
517 coreconfigitem(
517 coreconfigitem(
518 b'experimental', b'clientcompressionengines', default=list,
518 b'experimental', b'clientcompressionengines', default=list,
519 )
519 )
520 coreconfigitem(
520 coreconfigitem(
521 b'experimental', b'copytrace', default=b'on',
521 b'experimental', b'copytrace', default=b'on',
522 )
522 )
523 coreconfigitem(
523 coreconfigitem(
524 b'experimental', b'copytrace.movecandidateslimit', default=100,
524 b'experimental', b'copytrace.movecandidateslimit', default=100,
525 )
525 )
526 coreconfigitem(
526 coreconfigitem(
527 b'experimental', b'copytrace.sourcecommitlimit', default=100,
527 b'experimental', b'copytrace.sourcecommitlimit', default=100,
528 )
528 )
529 coreconfigitem(
529 coreconfigitem(
530 b'experimental', b'copies.read-from', default=b"filelog-only",
530 b'experimental', b'copies.read-from', default=b"filelog-only",
531 )
531 )
532 coreconfigitem(
532 coreconfigitem(
533 b'experimental', b'copies.write-to', default=b'filelog-only',
533 b'experimental', b'copies.write-to', default=b'filelog-only',
534 )
534 )
535 coreconfigitem(
535 coreconfigitem(
536 b'experimental', b'crecordtest', default=None,
536 b'experimental', b'crecordtest', default=None,
537 )
537 )
538 coreconfigitem(
538 coreconfigitem(
539 b'experimental', b'directaccess', default=False,
539 b'experimental', b'directaccess', default=False,
540 )
540 )
541 coreconfigitem(
541 coreconfigitem(
542 b'experimental', b'directaccess.revnums', default=False,
542 b'experimental', b'directaccess.revnums', default=False,
543 )
543 )
544 coreconfigitem(
544 coreconfigitem(
545 b'experimental', b'editortmpinhg', default=False,
545 b'experimental', b'editortmpinhg', default=False,
546 )
546 )
547 coreconfigitem(
547 coreconfigitem(
548 b'experimental', b'evolution', default=list,
548 b'experimental', b'evolution', default=list,
549 )
549 )
550 coreconfigitem(
550 coreconfigitem(
551 b'experimental',
551 b'experimental',
552 b'evolution.allowdivergence',
552 b'evolution.allowdivergence',
553 default=False,
553 default=False,
554 alias=[(b'experimental', b'allowdivergence')],
554 alias=[(b'experimental', b'allowdivergence')],
555 )
555 )
556 coreconfigitem(
556 coreconfigitem(
557 b'experimental', b'evolution.allowunstable', default=None,
557 b'experimental', b'evolution.allowunstable', default=None,
558 )
558 )
559 coreconfigitem(
559 coreconfigitem(
560 b'experimental', b'evolution.createmarkers', default=None,
560 b'experimental', b'evolution.createmarkers', default=None,
561 )
561 )
562 coreconfigitem(
562 coreconfigitem(
563 b'experimental',
563 b'experimental',
564 b'evolution.effect-flags',
564 b'evolution.effect-flags',
565 default=True,
565 default=True,
566 alias=[(b'experimental', b'effect-flags')],
566 alias=[(b'experimental', b'effect-flags')],
567 )
567 )
568 coreconfigitem(
568 coreconfigitem(
569 b'experimental', b'evolution.exchange', default=None,
569 b'experimental', b'evolution.exchange', default=None,
570 )
570 )
571 coreconfigitem(
571 coreconfigitem(
572 b'experimental', b'evolution.bundle-obsmarker', default=False,
572 b'experimental', b'evolution.bundle-obsmarker', default=False,
573 )
573 )
574 coreconfigitem(
574 coreconfigitem(
575 b'experimental', b'log.topo', default=False,
575 b'experimental', b'log.topo', default=False,
576 )
576 )
577 coreconfigitem(
577 coreconfigitem(
578 b'experimental', b'evolution.report-instabilities', default=True,
578 b'experimental', b'evolution.report-instabilities', default=True,
579 )
579 )
580 coreconfigitem(
580 coreconfigitem(
581 b'experimental', b'evolution.track-operation', default=True,
581 b'experimental', b'evolution.track-operation', default=True,
582 )
582 )
583 # repo-level config to exclude a revset visibility
583 # repo-level config to exclude a revset visibility
584 #
584 #
585 # The target use case is to use `share` to expose different subset of the same
585 # The target use case is to use `share` to expose different subset of the same
586 # repository, especially server side. See also `server.view`.
586 # repository, especially server side. See also `server.view`.
587 coreconfigitem(
587 coreconfigitem(
588 b'experimental', b'extra-filter-revs', default=None,
588 b'experimental', b'extra-filter-revs', default=None,
589 )
589 )
590 coreconfigitem(
590 coreconfigitem(
591 b'experimental', b'maxdeltachainspan', default=-1,
591 b'experimental', b'maxdeltachainspan', default=-1,
592 )
592 )
593 coreconfigitem(
593 coreconfigitem(
594 b'experimental', b'mergetempdirprefix', default=None,
594 b'experimental', b'mergetempdirprefix', default=None,
595 )
595 )
596 coreconfigitem(
596 coreconfigitem(
597 b'experimental', b'mmapindexthreshold', default=None,
597 b'experimental', b'mmapindexthreshold', default=None,
598 )
598 )
599 coreconfigitem(
599 coreconfigitem(
600 b'experimental', b'narrow', default=False,
600 b'experimental', b'narrow', default=False,
601 )
601 )
602 coreconfigitem(
602 coreconfigitem(
603 b'experimental', b'nonnormalparanoidcheck', default=False,
603 b'experimental', b'nonnormalparanoidcheck', default=False,
604 )
604 )
605 coreconfigitem(
605 coreconfigitem(
606 b'experimental', b'exportableenviron', default=list,
606 b'experimental', b'exportableenviron', default=list,
607 )
607 )
608 coreconfigitem(
608 coreconfigitem(
609 b'experimental', b'extendedheader.index', default=None,
609 b'experimental', b'extendedheader.index', default=None,
610 )
610 )
611 coreconfigitem(
611 coreconfigitem(
612 b'experimental', b'extendedheader.similarity', default=False,
612 b'experimental', b'extendedheader.similarity', default=False,
613 )
613 )
614 coreconfigitem(
614 coreconfigitem(
615 b'experimental', b'graphshorten', default=False,
615 b'experimental', b'graphshorten', default=False,
616 )
616 )
617 coreconfigitem(
617 coreconfigitem(
618 b'experimental', b'graphstyle.parent', default=dynamicdefault,
618 b'experimental', b'graphstyle.parent', default=dynamicdefault,
619 )
619 )
620 coreconfigitem(
620 coreconfigitem(
621 b'experimental', b'graphstyle.missing', default=dynamicdefault,
621 b'experimental', b'graphstyle.missing', default=dynamicdefault,
622 )
622 )
623 coreconfigitem(
623 coreconfigitem(
624 b'experimental', b'graphstyle.grandparent', default=dynamicdefault,
624 b'experimental', b'graphstyle.grandparent', default=dynamicdefault,
625 )
625 )
626 coreconfigitem(
626 coreconfigitem(
627 b'experimental', b'hook-track-tags', default=False,
627 b'experimental', b'hook-track-tags', default=False,
628 )
628 )
629 coreconfigitem(
629 coreconfigitem(
630 b'experimental', b'httppeer.advertise-v2', default=False,
630 b'experimental', b'httppeer.advertise-v2', default=False,
631 )
631 )
632 coreconfigitem(
632 coreconfigitem(
633 b'experimental', b'httppeer.v2-encoder-order', default=None,
633 b'experimental', b'httppeer.v2-encoder-order', default=None,
634 )
634 )
635 coreconfigitem(
635 coreconfigitem(
636 b'experimental', b'httppostargs', default=False,
636 b'experimental', b'httppostargs', default=False,
637 )
637 )
638 coreconfigitem(
638 coreconfigitem(
639 b'experimental', b'mergedriver', default=None,
639 b'experimental', b'mergedriver', default=None,
640 )
640 )
641 coreconfigitem(b'experimental', b'nointerrupt', default=False)
641 coreconfigitem(b'experimental', b'nointerrupt', default=False)
642 coreconfigitem(b'experimental', b'nointerrupt-interactiveonly', default=True)
642 coreconfigitem(b'experimental', b'nointerrupt-interactiveonly', default=True)
643
643
644 coreconfigitem(
644 coreconfigitem(
645 b'experimental', b'obsmarkers-exchange-debug', default=False,
645 b'experimental', b'obsmarkers-exchange-debug', default=False,
646 )
646 )
647 coreconfigitem(
647 coreconfigitem(
648 b'experimental', b'remotenames', default=False,
648 b'experimental', b'remotenames', default=False,
649 )
649 )
650 coreconfigitem(
650 coreconfigitem(
651 b'experimental', b'removeemptydirs', default=True,
651 b'experimental', b'removeemptydirs', default=True,
652 )
652 )
653 coreconfigitem(
653 coreconfigitem(
654 b'experimental', b'revert.interactive.select-to-keep', default=False,
654 b'experimental', b'revert.interactive.select-to-keep', default=False,
655 )
655 )
656 coreconfigitem(
656 coreconfigitem(
657 b'experimental', b'revisions.prefixhexnode', default=False,
657 b'experimental', b'revisions.prefixhexnode', default=False,
658 )
658 )
659 coreconfigitem(
659 coreconfigitem(
660 b'experimental', b'revlogv2', default=None,
660 b'experimental', b'revlogv2', default=None,
661 )
661 )
662 coreconfigitem(
662 coreconfigitem(
663 b'experimental', b'revisions.disambiguatewithin', default=None,
663 b'experimental', b'revisions.disambiguatewithin', default=None,
664 )
664 )
665 coreconfigitem(
665 coreconfigitem(
666 b'experimental', b'rust.index', default=False,
666 b'experimental', b'rust.index', default=False,
667 )
667 )
668 coreconfigitem(
668 coreconfigitem(
669 b'experimental', b'server.filesdata.recommended-batch-size', default=50000,
669 b'experimental', b'server.filesdata.recommended-batch-size', default=50000,
670 )
670 )
671 coreconfigitem(
671 coreconfigitem(
672 b'experimental',
672 b'experimental',
673 b'server.manifestdata.recommended-batch-size',
673 b'server.manifestdata.recommended-batch-size',
674 default=100000,
674 default=100000,
675 )
675 )
676 coreconfigitem(
676 coreconfigitem(
677 b'experimental', b'server.stream-narrow-clones', default=False,
677 b'experimental', b'server.stream-narrow-clones', default=False,
678 )
678 )
679 coreconfigitem(
679 coreconfigitem(
680 b'experimental', b'single-head-per-branch', default=False,
680 b'experimental', b'single-head-per-branch', default=False,
681 )
681 )
682 coreconfigitem(
682 coreconfigitem(
683 b'experimental',
683 b'experimental',
684 b'single-head-per-branch:account-closed-heads',
684 b'single-head-per-branch:account-closed-heads',
685 default=False,
685 default=False,
686 )
686 )
687 coreconfigitem(
687 coreconfigitem(
688 b'experimental', b'sshserver.support-v2', default=False,
688 b'experimental', b'sshserver.support-v2', default=False,
689 )
689 )
690 coreconfigitem(
690 coreconfigitem(
691 b'experimental', b'sparse-read', default=False,
691 b'experimental', b'sparse-read', default=False,
692 )
692 )
693 coreconfigitem(
693 coreconfigitem(
694 b'experimental', b'sparse-read.density-threshold', default=0.50,
694 b'experimental', b'sparse-read.density-threshold', default=0.50,
695 )
695 )
696 coreconfigitem(
696 coreconfigitem(
697 b'experimental', b'sparse-read.min-gap-size', default=b'65K',
697 b'experimental', b'sparse-read.min-gap-size', default=b'65K',
698 )
698 )
699 coreconfigitem(
699 coreconfigitem(
700 b'experimental', b'treemanifest', default=False,
700 b'experimental', b'treemanifest', default=False,
701 )
701 )
702 coreconfigitem(
702 coreconfigitem(
703 b'experimental', b'update.atomic-file', default=False,
703 b'experimental', b'update.atomic-file', default=False,
704 )
704 )
705 coreconfigitem(
705 coreconfigitem(
706 b'experimental', b'sshpeer.advertise-v2', default=False,
706 b'experimental', b'sshpeer.advertise-v2', default=False,
707 )
707 )
708 coreconfigitem(
708 coreconfigitem(
709 b'experimental', b'web.apiserver', default=False,
709 b'experimental', b'web.apiserver', default=False,
710 )
710 )
711 coreconfigitem(
711 coreconfigitem(
712 b'experimental', b'web.api.http-v2', default=False,
712 b'experimental', b'web.api.http-v2', default=False,
713 )
713 )
714 coreconfigitem(
714 coreconfigitem(
715 b'experimental', b'web.api.debugreflect', default=False,
715 b'experimental', b'web.api.debugreflect', default=False,
716 )
716 )
717 coreconfigitem(
717 coreconfigitem(
718 b'experimental', b'worker.wdir-get-thread-safe', default=False,
718 b'experimental', b'worker.wdir-get-thread-safe', default=False,
719 )
719 )
720 coreconfigitem(
720 coreconfigitem(
721 b'experimental', b'worker.repository-upgrade', default=False,
721 b'experimental', b'worker.repository-upgrade', default=False,
722 )
722 )
723 coreconfigitem(
723 coreconfigitem(
724 b'experimental', b'xdiff', default=False,
724 b'experimental', b'xdiff', default=False,
725 )
725 )
726 coreconfigitem(
726 coreconfigitem(
727 b'extensions', b'.*', default=None, generic=True,
727 b'extensions', b'.*', default=None, generic=True,
728 )
728 )
729 coreconfigitem(
729 coreconfigitem(
730 b'extdata', b'.*', default=None, generic=True,
730 b'extdata', b'.*', default=None, generic=True,
731 )
731 )
732 coreconfigitem(
732 coreconfigitem(
733 b'format', b'bookmarks-in-store', default=False,
733 b'format', b'bookmarks-in-store', default=False,
734 )
734 )
735 coreconfigitem(
735 coreconfigitem(
736 b'format', b'chunkcachesize', default=None, experimental=True,
736 b'format', b'chunkcachesize', default=None, experimental=True,
737 )
737 )
738 coreconfigitem(
738 coreconfigitem(
739 b'format', b'dotencode', default=True,
739 b'format', b'dotencode', default=True,
740 )
740 )
741 coreconfigitem(
741 coreconfigitem(
742 b'format', b'generaldelta', default=False, experimental=True,
742 b'format', b'generaldelta', default=False, experimental=True,
743 )
743 )
744 coreconfigitem(
744 coreconfigitem(
745 b'format', b'manifestcachesize', default=None, experimental=True,
745 b'format', b'manifestcachesize', default=None, experimental=True,
746 )
746 )
747 coreconfigitem(
747 coreconfigitem(
748 b'format', b'maxchainlen', default=dynamicdefault, experimental=True,
748 b'format', b'maxchainlen', default=dynamicdefault, experimental=True,
749 )
749 )
750 coreconfigitem(
750 coreconfigitem(
751 b'format', b'obsstore-version', default=None,
751 b'format', b'obsstore-version', default=None,
752 )
752 )
753 coreconfigitem(
753 coreconfigitem(
754 b'format', b'sparse-revlog', default=True,
754 b'format', b'sparse-revlog', default=True,
755 )
755 )
756 coreconfigitem(
756 coreconfigitem(
757 b'format',
757 b'format',
758 b'revlog-compression',
758 b'revlog-compression',
759 default=lambda: [b'zlib'],
759 default=lambda: [b'zlib'],
760 alias=[(b'experimental', b'format.compression')],
760 alias=[(b'experimental', b'format.compression')],
761 )
761 )
762 coreconfigitem(
762 coreconfigitem(
763 b'format', b'usefncache', default=True,
763 b'format', b'usefncache', default=True,
764 )
764 )
765 coreconfigitem(
765 coreconfigitem(
766 b'format', b'usegeneraldelta', default=True,
766 b'format', b'usegeneraldelta', default=True,
767 )
767 )
768 coreconfigitem(
768 coreconfigitem(
769 b'format', b'usestore', default=True,
769 b'format', b'usestore', default=True,
770 )
770 )
771 # Right now, the only efficient implement of the nodemap logic is in Rust, so
771 # Right now, the only efficient implement of the nodemap logic is in Rust, so
772 # the persistent nodemap feature needs to stay experimental as long as the Rust
772 # the persistent nodemap feature needs to stay experimental as long as the Rust
773 # extensions are an experimental feature.
773 # extensions are an experimental feature.
774 coreconfigitem(
774 coreconfigitem(
775 b'format', b'use-persistent-nodemap', default=False, experimental=True
775 b'format', b'use-persistent-nodemap', default=False, experimental=True
776 )
776 )
777 coreconfigitem(
777 coreconfigitem(
778 b'format',
778 b'format',
779 b'exp-use-copies-side-data-changeset',
779 b'exp-use-copies-side-data-changeset',
780 default=False,
780 default=False,
781 experimental=True,
781 experimental=True,
782 )
782 )
783 coreconfigitem(
783 coreconfigitem(
784 b'format', b'exp-use-side-data', default=False, experimental=True,
784 b'format', b'exp-use-side-data', default=False, experimental=True,
785 )
785 )
786 coreconfigitem(
786 coreconfigitem(
787 b'format', b'internal-phase', default=False, experimental=True,
787 b'format', b'internal-phase', default=False, experimental=True,
788 )
788 )
789 coreconfigitem(
789 coreconfigitem(
790 b'fsmonitor', b'warn_when_unused', default=True,
790 b'fsmonitor', b'warn_when_unused', default=True,
791 )
791 )
792 coreconfigitem(
792 coreconfigitem(
793 b'fsmonitor', b'warn_update_file_count', default=50000,
793 b'fsmonitor', b'warn_update_file_count', default=50000,
794 )
794 )
795 coreconfigitem(
795 coreconfigitem(
796 b'help', br'hidden-command\..*', default=False, generic=True,
796 b'help', br'hidden-command\..*', default=False, generic=True,
797 )
797 )
798 coreconfigitem(
798 coreconfigitem(
799 b'help', br'hidden-topic\..*', default=False, generic=True,
799 b'help', br'hidden-topic\..*', default=False, generic=True,
800 )
800 )
801 coreconfigitem(
801 coreconfigitem(
802 b'hooks', b'.*', default=dynamicdefault, generic=True,
802 b'hooks', b'.*', default=dynamicdefault, generic=True,
803 )
803 )
804 coreconfigitem(
804 coreconfigitem(
805 b'hgweb-paths', b'.*', default=list, generic=True,
805 b'hgweb-paths', b'.*', default=list, generic=True,
806 )
806 )
807 coreconfigitem(
807 coreconfigitem(
808 b'hostfingerprints', b'.*', default=list, generic=True,
808 b'hostfingerprints', b'.*', default=list, generic=True,
809 )
809 )
810 coreconfigitem(
810 coreconfigitem(
811 b'hostsecurity', b'ciphers', default=None,
811 b'hostsecurity', b'ciphers', default=None,
812 )
812 )
813 coreconfigitem(
813 coreconfigitem(
814 b'hostsecurity', b'minimumprotocol', default=dynamicdefault,
814 b'hostsecurity', b'minimumprotocol', default=dynamicdefault,
815 )
815 )
816 coreconfigitem(
816 coreconfigitem(
817 b'hostsecurity',
817 b'hostsecurity',
818 b'.*:minimumprotocol$',
818 b'.*:minimumprotocol$',
819 default=dynamicdefault,
819 default=dynamicdefault,
820 generic=True,
820 generic=True,
821 )
821 )
822 coreconfigitem(
822 coreconfigitem(
823 b'hostsecurity', b'.*:ciphers$', default=dynamicdefault, generic=True,
823 b'hostsecurity', b'.*:ciphers$', default=dynamicdefault, generic=True,
824 )
824 )
825 coreconfigitem(
825 coreconfigitem(
826 b'hostsecurity', b'.*:fingerprints$', default=list, generic=True,
826 b'hostsecurity', b'.*:fingerprints$', default=list, generic=True,
827 )
827 )
828 coreconfigitem(
828 coreconfigitem(
829 b'hostsecurity', b'.*:verifycertsfile$', default=None, generic=True,
829 b'hostsecurity', b'.*:verifycertsfile$', default=None, generic=True,
830 )
830 )
831
831
832 coreconfigitem(
832 coreconfigitem(
833 b'http_proxy', b'always', default=False,
833 b'http_proxy', b'always', default=False,
834 )
834 )
835 coreconfigitem(
835 coreconfigitem(
836 b'http_proxy', b'host', default=None,
836 b'http_proxy', b'host', default=None,
837 )
837 )
838 coreconfigitem(
838 coreconfigitem(
839 b'http_proxy', b'no', default=list,
839 b'http_proxy', b'no', default=list,
840 )
840 )
841 coreconfigitem(
841 coreconfigitem(
842 b'http_proxy', b'passwd', default=None,
842 b'http_proxy', b'passwd', default=None,
843 )
843 )
844 coreconfigitem(
844 coreconfigitem(
845 b'http_proxy', b'user', default=None,
845 b'http_proxy', b'user', default=None,
846 )
846 )
847
847
848 coreconfigitem(
848 coreconfigitem(
849 b'http', b'timeout', default=None,
849 b'http', b'timeout', default=None,
850 )
850 )
851
851
852 coreconfigitem(
852 coreconfigitem(
853 b'logtoprocess', b'commandexception', default=None,
853 b'logtoprocess', b'commandexception', default=None,
854 )
854 )
855 coreconfigitem(
855 coreconfigitem(
856 b'logtoprocess', b'commandfinish', default=None,
856 b'logtoprocess', b'commandfinish', default=None,
857 )
857 )
858 coreconfigitem(
858 coreconfigitem(
859 b'logtoprocess', b'command', default=None,
859 b'logtoprocess', b'command', default=None,
860 )
860 )
861 coreconfigitem(
861 coreconfigitem(
862 b'logtoprocess', b'develwarn', default=None,
862 b'logtoprocess', b'develwarn', default=None,
863 )
863 )
864 coreconfigitem(
864 coreconfigitem(
865 b'logtoprocess', b'uiblocked', default=None,
865 b'logtoprocess', b'uiblocked', default=None,
866 )
866 )
867 coreconfigitem(
867 coreconfigitem(
868 b'merge', b'checkunknown', default=b'abort',
868 b'merge', b'checkunknown', default=b'abort',
869 )
869 )
870 coreconfigitem(
870 coreconfigitem(
871 b'merge', b'checkignored', default=b'abort',
871 b'merge', b'checkignored', default=b'abort',
872 )
872 )
873 coreconfigitem(
873 coreconfigitem(
874 b'experimental', b'merge.checkpathconflicts', default=False,
874 b'experimental', b'merge.checkpathconflicts', default=False,
875 )
875 )
876 coreconfigitem(
876 coreconfigitem(
877 b'merge', b'followcopies', default=True,
877 b'merge', b'followcopies', default=True,
878 )
878 )
879 coreconfigitem(
879 coreconfigitem(
880 b'merge', b'on-failure', default=b'continue',
880 b'merge', b'on-failure', default=b'continue',
881 )
881 )
882 coreconfigitem(
882 coreconfigitem(
883 b'merge', b'preferancestor', default=lambda: [b'*'], experimental=True,
883 b'merge', b'preferancestor', default=lambda: [b'*'], experimental=True,
884 )
884 )
885 coreconfigitem(
885 coreconfigitem(
886 b'merge', b'strict-capability-check', default=False,
886 b'merge', b'strict-capability-check', default=False,
887 )
887 )
888 coreconfigitem(
888 coreconfigitem(
889 b'merge-tools', b'.*', default=None, generic=True,
889 b'merge-tools', b'.*', default=None, generic=True,
890 )
890 )
891 coreconfigitem(
891 coreconfigitem(
892 b'merge-tools',
892 b'merge-tools',
893 br'.*\.args$',
893 br'.*\.args$',
894 default=b"$local $base $other",
894 default=b"$local $base $other",
895 generic=True,
895 generic=True,
896 priority=-1,
896 priority=-1,
897 )
897 )
898 coreconfigitem(
898 coreconfigitem(
899 b'merge-tools', br'.*\.binary$', default=False, generic=True, priority=-1,
899 b'merge-tools', br'.*\.binary$', default=False, generic=True, priority=-1,
900 )
900 )
901 coreconfigitem(
901 coreconfigitem(
902 b'merge-tools', br'.*\.check$', default=list, generic=True, priority=-1,
902 b'merge-tools', br'.*\.check$', default=list, generic=True, priority=-1,
903 )
903 )
904 coreconfigitem(
904 coreconfigitem(
905 b'merge-tools',
905 b'merge-tools',
906 br'.*\.checkchanged$',
906 br'.*\.checkchanged$',
907 default=False,
907 default=False,
908 generic=True,
908 generic=True,
909 priority=-1,
909 priority=-1,
910 )
910 )
911 coreconfigitem(
911 coreconfigitem(
912 b'merge-tools',
912 b'merge-tools',
913 br'.*\.executable$',
913 br'.*\.executable$',
914 default=dynamicdefault,
914 default=dynamicdefault,
915 generic=True,
915 generic=True,
916 priority=-1,
916 priority=-1,
917 )
917 )
918 coreconfigitem(
918 coreconfigitem(
919 b'merge-tools', br'.*\.fixeol$', default=False, generic=True, priority=-1,
919 b'merge-tools', br'.*\.fixeol$', default=False, generic=True, priority=-1,
920 )
920 )
921 coreconfigitem(
921 coreconfigitem(
922 b'merge-tools', br'.*\.gui$', default=False, generic=True, priority=-1,
922 b'merge-tools', br'.*\.gui$', default=False, generic=True, priority=-1,
923 )
923 )
924 coreconfigitem(
924 coreconfigitem(
925 b'merge-tools',
925 b'merge-tools',
926 br'.*\.mergemarkers$',
926 br'.*\.mergemarkers$',
927 default=b'basic',
927 default=b'basic',
928 generic=True,
928 generic=True,
929 priority=-1,
929 priority=-1,
930 )
930 )
931 coreconfigitem(
931 coreconfigitem(
932 b'merge-tools',
932 b'merge-tools',
933 br'.*\.mergemarkertemplate$',
933 br'.*\.mergemarkertemplate$',
934 default=dynamicdefault, # take from ui.mergemarkertemplate
934 default=dynamicdefault, # take from ui.mergemarkertemplate
935 generic=True,
935 generic=True,
936 priority=-1,
936 priority=-1,
937 )
937 )
938 coreconfigitem(
938 coreconfigitem(
939 b'merge-tools', br'.*\.priority$', default=0, generic=True, priority=-1,
939 b'merge-tools', br'.*\.priority$', default=0, generic=True, priority=-1,
940 )
940 )
941 coreconfigitem(
941 coreconfigitem(
942 b'merge-tools',
942 b'merge-tools',
943 br'.*\.premerge$',
943 br'.*\.premerge$',
944 default=dynamicdefault,
944 default=dynamicdefault,
945 generic=True,
945 generic=True,
946 priority=-1,
946 priority=-1,
947 )
947 )
948 coreconfigitem(
948 coreconfigitem(
949 b'merge-tools', br'.*\.symlink$', default=False, generic=True, priority=-1,
949 b'merge-tools', br'.*\.symlink$', default=False, generic=True, priority=-1,
950 )
950 )
951 coreconfigitem(
951 coreconfigitem(
952 b'pager', b'attend-.*', default=dynamicdefault, generic=True,
952 b'pager', b'attend-.*', default=dynamicdefault, generic=True,
953 )
953 )
954 coreconfigitem(
954 coreconfigitem(
955 b'pager', b'ignore', default=list,
955 b'pager', b'ignore', default=list,
956 )
956 )
957 coreconfigitem(
957 coreconfigitem(
958 b'pager', b'pager', default=dynamicdefault,
958 b'pager', b'pager', default=dynamicdefault,
959 )
959 )
960 coreconfigitem(
960 coreconfigitem(
961 b'patch', b'eol', default=b'strict',
961 b'patch', b'eol', default=b'strict',
962 )
962 )
963 coreconfigitem(
963 coreconfigitem(
964 b'patch', b'fuzz', default=2,
964 b'patch', b'fuzz', default=2,
965 )
965 )
966 coreconfigitem(
966 coreconfigitem(
967 b'paths', b'default', default=None,
967 b'paths', b'default', default=None,
968 )
968 )
969 coreconfigitem(
969 coreconfigitem(
970 b'paths', b'default-push', default=None,
970 b'paths', b'default-push', default=None,
971 )
971 )
972 coreconfigitem(
972 coreconfigitem(
973 b'paths', b'.*', default=None, generic=True,
973 b'paths', b'.*', default=None, generic=True,
974 )
974 )
975 coreconfigitem(
975 coreconfigitem(
976 b'phases', b'checksubrepos', default=b'follow',
976 b'phases', b'checksubrepos', default=b'follow',
977 )
977 )
978 coreconfigitem(
978 coreconfigitem(
979 b'phases', b'new-commit', default=b'draft',
979 b'phases', b'new-commit', default=b'draft',
980 )
980 )
981 coreconfigitem(
981 coreconfigitem(
982 b'phases', b'publish', default=True,
982 b'phases', b'publish', default=True,
983 )
983 )
984 coreconfigitem(
984 coreconfigitem(
985 b'profiling', b'enabled', default=False,
985 b'profiling', b'enabled', default=False,
986 )
986 )
987 coreconfigitem(
987 coreconfigitem(
988 b'profiling', b'format', default=b'text',
988 b'profiling', b'format', default=b'text',
989 )
989 )
990 coreconfigitem(
990 coreconfigitem(
991 b'profiling', b'freq', default=1000,
991 b'profiling', b'freq', default=1000,
992 )
992 )
993 coreconfigitem(
993 coreconfigitem(
994 b'profiling', b'limit', default=30,
994 b'profiling', b'limit', default=30,
995 )
995 )
996 coreconfigitem(
996 coreconfigitem(
997 b'profiling', b'nested', default=0,
997 b'profiling', b'nested', default=0,
998 )
998 )
999 coreconfigitem(
999 coreconfigitem(
1000 b'profiling', b'output', default=None,
1000 b'profiling', b'output', default=None,
1001 )
1001 )
1002 coreconfigitem(
1002 coreconfigitem(
1003 b'profiling', b'showmax', default=0.999,
1003 b'profiling', b'showmax', default=0.999,
1004 )
1004 )
1005 coreconfigitem(
1005 coreconfigitem(
1006 b'profiling', b'showmin', default=dynamicdefault,
1006 b'profiling', b'showmin', default=dynamicdefault,
1007 )
1007 )
1008 coreconfigitem(
1008 coreconfigitem(
1009 b'profiling', b'showtime', default=True,
1009 b'profiling', b'showtime', default=True,
1010 )
1010 )
1011 coreconfigitem(
1011 coreconfigitem(
1012 b'profiling', b'sort', default=b'inlinetime',
1012 b'profiling', b'sort', default=b'inlinetime',
1013 )
1013 )
1014 coreconfigitem(
1014 coreconfigitem(
1015 b'profiling', b'statformat', default=b'hotpath',
1015 b'profiling', b'statformat', default=b'hotpath',
1016 )
1016 )
1017 coreconfigitem(
1017 coreconfigitem(
1018 b'profiling', b'time-track', default=dynamicdefault,
1018 b'profiling', b'time-track', default=dynamicdefault,
1019 )
1019 )
1020 coreconfigitem(
1020 coreconfigitem(
1021 b'profiling', b'type', default=b'stat',
1021 b'profiling', b'type', default=b'stat',
1022 )
1022 )
1023 coreconfigitem(
1023 coreconfigitem(
1024 b'progress', b'assume-tty', default=False,
1024 b'progress', b'assume-tty', default=False,
1025 )
1025 )
1026 coreconfigitem(
1026 coreconfigitem(
1027 b'progress', b'changedelay', default=1,
1027 b'progress', b'changedelay', default=1,
1028 )
1028 )
1029 coreconfigitem(
1029 coreconfigitem(
1030 b'progress', b'clear-complete', default=True,
1030 b'progress', b'clear-complete', default=True,
1031 )
1031 )
1032 coreconfigitem(
1032 coreconfigitem(
1033 b'progress', b'debug', default=False,
1033 b'progress', b'debug', default=False,
1034 )
1034 )
1035 coreconfigitem(
1035 coreconfigitem(
1036 b'progress', b'delay', default=3,
1036 b'progress', b'delay', default=3,
1037 )
1037 )
1038 coreconfigitem(
1038 coreconfigitem(
1039 b'progress', b'disable', default=False,
1039 b'progress', b'disable', default=False,
1040 )
1040 )
1041 coreconfigitem(
1041 coreconfigitem(
1042 b'progress', b'estimateinterval', default=60.0,
1042 b'progress', b'estimateinterval', default=60.0,
1043 )
1043 )
1044 coreconfigitem(
1044 coreconfigitem(
1045 b'progress',
1045 b'progress',
1046 b'format',
1046 b'format',
1047 default=lambda: [b'topic', b'bar', b'number', b'estimate'],
1047 default=lambda: [b'topic', b'bar', b'number', b'estimate'],
1048 )
1048 )
1049 coreconfigitem(
1049 coreconfigitem(
1050 b'progress', b'refresh', default=0.1,
1050 b'progress', b'refresh', default=0.1,
1051 )
1051 )
1052 coreconfigitem(
1052 coreconfigitem(
1053 b'progress', b'width', default=dynamicdefault,
1053 b'progress', b'width', default=dynamicdefault,
1054 )
1054 )
1055 coreconfigitem(
1055 coreconfigitem(
1056 b'pull', b'confirm', default=False,
1056 b'pull', b'confirm', default=False,
1057 )
1057 )
1058 coreconfigitem(
1058 coreconfigitem(
1059 b'push', b'pushvars.server', default=False,
1059 b'push', b'pushvars.server', default=False,
1060 )
1060 )
1061 coreconfigitem(
1061 coreconfigitem(
1062 b'rewrite',
1062 b'rewrite',
1063 b'backup-bundle',
1063 b'backup-bundle',
1064 default=True,
1064 default=True,
1065 alias=[(b'ui', b'history-editing-backup')],
1065 alias=[(b'ui', b'history-editing-backup')],
1066 )
1066 )
1067 coreconfigitem(
1067 coreconfigitem(
1068 b'rewrite', b'update-timestamp', default=False,
1068 b'rewrite', b'update-timestamp', default=False,
1069 )
1069 )
1070 coreconfigitem(
1070 coreconfigitem(
1071 b'storage', b'new-repo-backend', default=b'revlogv1', experimental=True,
1071 b'storage', b'new-repo-backend', default=b'revlogv1', experimental=True,
1072 )
1072 )
1073 coreconfigitem(
1073 coreconfigitem(
1074 b'storage',
1074 b'storage',
1075 b'revlog.optimize-delta-parent-choice',
1075 b'revlog.optimize-delta-parent-choice',
1076 default=True,
1076 default=True,
1077 alias=[(b'format', b'aggressivemergedeltas')],
1077 alias=[(b'format', b'aggressivemergedeltas')],
1078 )
1078 )
1079 # experimental as long as rust is experimental (or a C version is implemented)
1079 # experimental as long as rust is experimental (or a C version is implemented)
1080 coreconfigitem(
1080 coreconfigitem(
1081 b'storage', b'revlog.nodemap.mmap', default=True, experimental=True
1081 b'storage', b'revlog.nodemap.mmap', default=True, experimental=True
1082 )
1082 )
1083 # experimental as long as format.use-persistent-nodemap is.
1083 # experimental as long as format.use-persistent-nodemap is.
1084 coreconfigitem(
1084 coreconfigitem(
1085 b'storage', b'revlog.nodemap.mode', default=b'compat', experimental=True
1085 b'storage', b'revlog.nodemap.mode', default=b'compat', experimental=True
1086 )
1086 )
1087 coreconfigitem(
1087 coreconfigitem(
1088 b'storage', b'revlog.reuse-external-delta', default=True,
1088 b'storage', b'revlog.reuse-external-delta', default=True,
1089 )
1089 )
1090 coreconfigitem(
1090 coreconfigitem(
1091 b'storage', b'revlog.reuse-external-delta-parent', default=None,
1091 b'storage', b'revlog.reuse-external-delta-parent', default=None,
1092 )
1092 )
1093 coreconfigitem(
1093 coreconfigitem(
1094 b'storage', b'revlog.zlib.level', default=None,
1094 b'storage', b'revlog.zlib.level', default=None,
1095 )
1095 )
1096 coreconfigitem(
1096 coreconfigitem(
1097 b'storage', b'revlog.zstd.level', default=None,
1097 b'storage', b'revlog.zstd.level', default=None,
1098 )
1098 )
1099 coreconfigitem(
1099 coreconfigitem(
1100 b'server', b'bookmarks-pushkey-compat', default=True,
1100 b'server', b'bookmarks-pushkey-compat', default=True,
1101 )
1101 )
1102 coreconfigitem(
1102 coreconfigitem(
1103 b'server', b'bundle1', default=True,
1103 b'server', b'bundle1', default=True,
1104 )
1104 )
1105 coreconfigitem(
1105 coreconfigitem(
1106 b'server', b'bundle1gd', default=None,
1106 b'server', b'bundle1gd', default=None,
1107 )
1107 )
1108 coreconfigitem(
1108 coreconfigitem(
1109 b'server', b'bundle1.pull', default=None,
1109 b'server', b'bundle1.pull', default=None,
1110 )
1110 )
1111 coreconfigitem(
1111 coreconfigitem(
1112 b'server', b'bundle1gd.pull', default=None,
1112 b'server', b'bundle1gd.pull', default=None,
1113 )
1113 )
1114 coreconfigitem(
1114 coreconfigitem(
1115 b'server', b'bundle1.push', default=None,
1115 b'server', b'bundle1.push', default=None,
1116 )
1116 )
1117 coreconfigitem(
1117 coreconfigitem(
1118 b'server', b'bundle1gd.push', default=None,
1118 b'server', b'bundle1gd.push', default=None,
1119 )
1119 )
1120 coreconfigitem(
1120 coreconfigitem(
1121 b'server',
1121 b'server',
1122 b'bundle2.stream',
1122 b'bundle2.stream',
1123 default=True,
1123 default=True,
1124 alias=[(b'experimental', b'bundle2.stream')],
1124 alias=[(b'experimental', b'bundle2.stream')],
1125 )
1125 )
1126 coreconfigitem(
1126 coreconfigitem(
1127 b'server', b'compressionengines', default=list,
1127 b'server', b'compressionengines', default=list,
1128 )
1128 )
1129 coreconfigitem(
1129 coreconfigitem(
1130 b'server', b'concurrent-push-mode', default=b'check-related',
1130 b'server', b'concurrent-push-mode', default=b'check-related',
1131 )
1131 )
1132 coreconfigitem(
1132 coreconfigitem(
1133 b'server', b'disablefullbundle', default=False,
1133 b'server', b'disablefullbundle', default=False,
1134 )
1134 )
1135 coreconfigitem(
1135 coreconfigitem(
1136 b'server', b'maxhttpheaderlen', default=1024,
1136 b'server', b'maxhttpheaderlen', default=1024,
1137 )
1137 )
1138 coreconfigitem(
1138 coreconfigitem(
1139 b'server', b'pullbundle', default=False,
1139 b'server', b'pullbundle', default=False,
1140 )
1140 )
1141 coreconfigitem(
1141 coreconfigitem(
1142 b'server', b'preferuncompressed', default=False,
1142 b'server', b'preferuncompressed', default=False,
1143 )
1143 )
1144 coreconfigitem(
1144 coreconfigitem(
1145 b'server', b'streamunbundle', default=False,
1145 b'server', b'streamunbundle', default=False,
1146 )
1146 )
1147 coreconfigitem(
1147 coreconfigitem(
1148 b'server', b'uncompressed', default=True,
1148 b'server', b'uncompressed', default=True,
1149 )
1149 )
1150 coreconfigitem(
1150 coreconfigitem(
1151 b'server', b'uncompressedallowsecret', default=False,
1151 b'server', b'uncompressedallowsecret', default=False,
1152 )
1152 )
1153 coreconfigitem(
1153 coreconfigitem(
1154 b'server', b'view', default=b'served',
1154 b'server', b'view', default=b'served',
1155 )
1155 )
1156 coreconfigitem(
1156 coreconfigitem(
1157 b'server', b'validate', default=False,
1157 b'server', b'validate', default=False,
1158 )
1158 )
1159 coreconfigitem(
1159 coreconfigitem(
1160 b'server', b'zliblevel', default=-1,
1160 b'server', b'zliblevel', default=-1,
1161 )
1161 )
1162 coreconfigitem(
1162 coreconfigitem(
1163 b'server', b'zstdlevel', default=3,
1163 b'server', b'zstdlevel', default=3,
1164 )
1164 )
1165 coreconfigitem(
1165 coreconfigitem(
1166 b'share', b'pool', default=None,
1166 b'share', b'pool', default=None,
1167 )
1167 )
1168 coreconfigitem(
1168 coreconfigitem(
1169 b'share', b'poolnaming', default=b'identity',
1169 b'share', b'poolnaming', default=b'identity',
1170 )
1170 )
1171 coreconfigitem(
1171 coreconfigitem(
1172 b'shelve', b'maxbackups', default=10,
1172 b'shelve', b'maxbackups', default=10,
1173 )
1173 )
1174 coreconfigitem(
1174 coreconfigitem(
1175 b'smtp', b'host', default=None,
1175 b'smtp', b'host', default=None,
1176 )
1176 )
1177 coreconfigitem(
1177 coreconfigitem(
1178 b'smtp', b'local_hostname', default=None,
1178 b'smtp', b'local_hostname', default=None,
1179 )
1179 )
1180 coreconfigitem(
1180 coreconfigitem(
1181 b'smtp', b'password', default=None,
1181 b'smtp', b'password', default=None,
1182 )
1182 )
1183 coreconfigitem(
1183 coreconfigitem(
1184 b'smtp', b'port', default=dynamicdefault,
1184 b'smtp', b'port', default=dynamicdefault,
1185 )
1185 )
1186 coreconfigitem(
1186 coreconfigitem(
1187 b'smtp', b'tls', default=b'none',
1187 b'smtp', b'tls', default=b'none',
1188 )
1188 )
1189 coreconfigitem(
1189 coreconfigitem(
1190 b'smtp', b'username', default=None,
1190 b'smtp', b'username', default=None,
1191 )
1191 )
1192 coreconfigitem(
1192 coreconfigitem(
1193 b'sparse', b'missingwarning', default=True, experimental=True,
1193 b'sparse', b'missingwarning', default=True, experimental=True,
1194 )
1194 )
1195 coreconfigitem(
1195 coreconfigitem(
1196 b'subrepos',
1196 b'subrepos',
1197 b'allowed',
1197 b'allowed',
1198 default=dynamicdefault, # to make backporting simpler
1198 default=dynamicdefault, # to make backporting simpler
1199 )
1199 )
1200 coreconfigitem(
1200 coreconfigitem(
1201 b'subrepos', b'hg:allowed', default=dynamicdefault,
1201 b'subrepos', b'hg:allowed', default=dynamicdefault,
1202 )
1202 )
1203 coreconfigitem(
1203 coreconfigitem(
1204 b'subrepos', b'git:allowed', default=dynamicdefault,
1204 b'subrepos', b'git:allowed', default=dynamicdefault,
1205 )
1205 )
1206 coreconfigitem(
1206 coreconfigitem(
1207 b'subrepos', b'svn:allowed', default=dynamicdefault,
1207 b'subrepos', b'svn:allowed', default=dynamicdefault,
1208 )
1208 )
1209 coreconfigitem(
1209 coreconfigitem(
1210 b'templates', b'.*', default=None, generic=True,
1210 b'templates', b'.*', default=None, generic=True,
1211 )
1211 )
1212 coreconfigitem(
1212 coreconfigitem(
1213 b'templateconfig', b'.*', default=dynamicdefault, generic=True,
1213 b'templateconfig', b'.*', default=dynamicdefault, generic=True,
1214 )
1214 )
1215 coreconfigitem(
1215 coreconfigitem(
1216 b'trusted', b'groups', default=list,
1216 b'trusted', b'groups', default=list,
1217 )
1217 )
1218 coreconfigitem(
1218 coreconfigitem(
1219 b'trusted', b'users', default=list,
1219 b'trusted', b'users', default=list,
1220 )
1220 )
1221 coreconfigitem(
1221 coreconfigitem(
1222 b'ui', b'_usedassubrepo', default=False,
1222 b'ui', b'_usedassubrepo', default=False,
1223 )
1223 )
1224 coreconfigitem(
1224 coreconfigitem(
1225 b'ui', b'allowemptycommit', default=False,
1225 b'ui', b'allowemptycommit', default=False,
1226 )
1226 )
1227 coreconfigitem(
1227 coreconfigitem(
1228 b'ui', b'archivemeta', default=True,
1228 b'ui', b'archivemeta', default=True,
1229 )
1229 )
1230 coreconfigitem(
1230 coreconfigitem(
1231 b'ui', b'askusername', default=False,
1231 b'ui', b'askusername', default=False,
1232 )
1232 )
1233 coreconfigitem(
1233 coreconfigitem(
1234 b'ui', b'clonebundlefallback', default=False,
1234 b'ui', b'clonebundlefallback', default=False,
1235 )
1235 )
1236 coreconfigitem(
1236 coreconfigitem(
1237 b'ui', b'clonebundleprefers', default=list,
1237 b'ui', b'clonebundleprefers', default=list,
1238 )
1238 )
1239 coreconfigitem(
1239 coreconfigitem(
1240 b'ui', b'clonebundles', default=True,
1240 b'ui', b'clonebundles', default=True,
1241 )
1241 )
1242 coreconfigitem(
1242 coreconfigitem(
1243 b'ui', b'color', default=b'auto',
1243 b'ui', b'color', default=b'auto',
1244 )
1244 )
1245 coreconfigitem(
1245 coreconfigitem(
1246 b'ui', b'commitsubrepos', default=False,
1246 b'ui', b'commitsubrepos', default=False,
1247 )
1247 )
1248 coreconfigitem(
1248 coreconfigitem(
1249 b'ui', b'debug', default=False,
1249 b'ui', b'debug', default=False,
1250 )
1250 )
1251 coreconfigitem(
1251 coreconfigitem(
1252 b'ui', b'debugger', default=None,
1252 b'ui', b'debugger', default=None,
1253 )
1253 )
1254 coreconfigitem(
1254 coreconfigitem(
1255 b'ui', b'editor', default=dynamicdefault,
1255 b'ui', b'editor', default=dynamicdefault,
1256 )
1256 )
1257 coreconfigitem(
1257 coreconfigitem(
1258 b'ui', b'fallbackencoding', default=None,
1258 b'ui', b'fallbackencoding', default=None,
1259 )
1259 )
1260 coreconfigitem(
1260 coreconfigitem(
1261 b'ui', b'forcecwd', default=None,
1261 b'ui', b'forcecwd', default=None,
1262 )
1262 )
1263 coreconfigitem(
1263 coreconfigitem(
1264 b'ui', b'forcemerge', default=None,
1264 b'ui', b'forcemerge', default=None,
1265 )
1265 )
1266 coreconfigitem(
1266 coreconfigitem(
1267 b'ui', b'formatdebug', default=False,
1267 b'ui', b'formatdebug', default=False,
1268 )
1268 )
1269 coreconfigitem(
1269 coreconfigitem(
1270 b'ui', b'formatjson', default=False,
1270 b'ui', b'formatjson', default=False,
1271 )
1271 )
1272 coreconfigitem(
1272 coreconfigitem(
1273 b'ui', b'formatted', default=None,
1273 b'ui', b'formatted', default=None,
1274 )
1274 )
1275 coreconfigitem(
1275 coreconfigitem(
1276 b'ui', b'graphnodetemplate', default=None,
1276 b'ui', b'graphnodetemplate', default=None,
1277 )
1277 )
1278 coreconfigitem(
1278 coreconfigitem(
1279 b'ui', b'interactive', default=None,
1279 b'ui', b'interactive', default=None,
1280 )
1280 )
1281 coreconfigitem(
1281 coreconfigitem(
1282 b'ui', b'interface', default=None,
1282 b'ui', b'interface', default=None,
1283 )
1283 )
1284 coreconfigitem(
1284 coreconfigitem(
1285 b'ui', b'interface.chunkselector', default=None,
1285 b'ui', b'interface.chunkselector', default=None,
1286 )
1286 )
1287 coreconfigitem(
1287 coreconfigitem(
1288 b'ui', b'large-file-limit', default=10000000,
1288 b'ui', b'large-file-limit', default=10000000,
1289 )
1289 )
1290 coreconfigitem(
1290 coreconfigitem(
1291 b'ui', b'logblockedtimes', default=False,
1291 b'ui', b'logblockedtimes', default=False,
1292 )
1292 )
1293 coreconfigitem(
1293 coreconfigitem(
1294 b'ui', b'logtemplate', default=None,
1294 b'ui', b'logtemplate', default=None,
1295 )
1295 )
1296 coreconfigitem(
1296 coreconfigitem(
1297 b'ui', b'merge', default=None,
1297 b'ui', b'merge', default=None,
1298 )
1298 )
1299 coreconfigitem(
1299 coreconfigitem(
1300 b'ui', b'mergemarkers', default=b'basic',
1300 b'ui', b'mergemarkers', default=b'basic',
1301 )
1301 )
1302 coreconfigitem(
1302 coreconfigitem(
1303 b'ui',
1303 b'ui',
1304 b'mergemarkertemplate',
1304 b'mergemarkertemplate',
1305 default=(
1305 default=(
1306 b'{node|short} '
1306 b'{node|short} '
1307 b'{ifeq(tags, "tip", "", '
1307 b'{ifeq(tags, "tip", "", '
1308 b'ifeq(tags, "", "", "{tags} "))}'
1308 b'ifeq(tags, "", "", "{tags} "))}'
1309 b'{if(bookmarks, "{bookmarks} ")}'
1309 b'{if(bookmarks, "{bookmarks} ")}'
1310 b'{ifeq(branch, "default", "", "{branch} ")}'
1310 b'{ifeq(branch, "default", "", "{branch} ")}'
1311 b'- {author|user}: {desc|firstline}'
1311 b'- {author|user}: {desc|firstline}'
1312 ),
1312 ),
1313 )
1313 )
1314 coreconfigitem(
1314 coreconfigitem(
1315 b'ui', b'message-output', default=b'stdio',
1315 b'ui', b'message-output', default=b'stdio',
1316 )
1316 )
1317 coreconfigitem(
1317 coreconfigitem(
1318 b'ui', b'nontty', default=False,
1318 b'ui', b'nontty', default=False,
1319 )
1319 )
1320 coreconfigitem(
1320 coreconfigitem(
1321 b'ui', b'origbackuppath', default=None,
1321 b'ui', b'origbackuppath', default=None,
1322 )
1322 )
1323 coreconfigitem(
1323 coreconfigitem(
1324 b'ui', b'paginate', default=True,
1324 b'ui', b'paginate', default=True,
1325 )
1325 )
1326 coreconfigitem(
1326 coreconfigitem(
1327 b'ui', b'patch', default=None,
1327 b'ui', b'patch', default=None,
1328 )
1328 )
1329 coreconfigitem(
1329 coreconfigitem(
1330 b'ui', b'pre-merge-tool-output-template', default=None,
1330 b'ui', b'pre-merge-tool-output-template', default=None,
1331 )
1331 )
1332 coreconfigitem(
1332 coreconfigitem(
1333 b'ui', b'portablefilenames', default=b'warn',
1333 b'ui', b'portablefilenames', default=b'warn',
1334 )
1334 )
1335 coreconfigitem(
1335 coreconfigitem(
1336 b'ui', b'promptecho', default=False,
1336 b'ui', b'promptecho', default=False,
1337 )
1337 )
1338 coreconfigitem(
1338 coreconfigitem(
1339 b'ui', b'quiet', default=False,
1339 b'ui', b'quiet', default=False,
1340 )
1340 )
1341 coreconfigitem(
1341 coreconfigitem(
1342 b'ui', b'quietbookmarkmove', default=False,
1342 b'ui', b'quietbookmarkmove', default=False,
1343 )
1343 )
1344 coreconfigitem(
1344 coreconfigitem(
1345 b'ui', b'relative-paths', default=b'legacy',
1345 b'ui', b'relative-paths', default=b'legacy',
1346 )
1346 )
1347 coreconfigitem(
1347 coreconfigitem(
1348 b'ui', b'remotecmd', default=b'hg',
1348 b'ui', b'remotecmd', default=b'hg',
1349 )
1349 )
1350 coreconfigitem(
1350 coreconfigitem(
1351 b'ui', b'report_untrusted', default=True,
1351 b'ui', b'report_untrusted', default=True,
1352 )
1352 )
1353 coreconfigitem(
1353 coreconfigitem(
1354 b'ui', b'rollback', default=True,
1354 b'ui', b'rollback', default=True,
1355 )
1355 )
1356 coreconfigitem(
1356 coreconfigitem(
1357 b'ui', b'signal-safe-lock', default=True,
1357 b'ui', b'signal-safe-lock', default=True,
1358 )
1358 )
1359 coreconfigitem(
1359 coreconfigitem(
1360 b'ui', b'slash', default=False,
1360 b'ui', b'slash', default=False,
1361 )
1361 )
1362 coreconfigitem(
1362 coreconfigitem(
1363 b'ui', b'ssh', default=b'ssh',
1363 b'ui', b'ssh', default=b'ssh',
1364 )
1364 )
1365 coreconfigitem(
1365 coreconfigitem(
1366 b'ui', b'ssherrorhint', default=None,
1366 b'ui', b'ssherrorhint', default=None,
1367 )
1367 )
1368 coreconfigitem(
1368 coreconfigitem(
1369 b'ui', b'statuscopies', default=False,
1369 b'ui', b'statuscopies', default=False,
1370 )
1370 )
1371 coreconfigitem(
1371 coreconfigitem(
1372 b'ui', b'strict', default=False,
1372 b'ui', b'strict', default=False,
1373 )
1373 )
1374 coreconfigitem(
1374 coreconfigitem(
1375 b'ui', b'style', default=b'',
1375 b'ui', b'style', default=b'',
1376 )
1376 )
1377 coreconfigitem(
1377 coreconfigitem(
1378 b'ui', b'supportcontact', default=None,
1378 b'ui', b'supportcontact', default=None,
1379 )
1379 )
1380 coreconfigitem(
1380 coreconfigitem(
1381 b'ui', b'textwidth', default=78,
1381 b'ui', b'textwidth', default=78,
1382 )
1382 )
1383 coreconfigitem(
1383 coreconfigitem(
1384 b'ui', b'timeout', default=b'600',
1384 b'ui', b'timeout', default=b'600',
1385 )
1385 )
1386 coreconfigitem(
1386 coreconfigitem(
1387 b'ui', b'timeout.warn', default=0,
1387 b'ui', b'timeout.warn', default=0,
1388 )
1388 )
1389 coreconfigitem(
1389 coreconfigitem(
1390 b'ui', b'timestamp-output', default=False,
1390 b'ui', b'timestamp-output', default=False,
1391 )
1391 )
1392 coreconfigitem(
1392 coreconfigitem(
1393 b'ui', b'traceback', default=False,
1393 b'ui', b'traceback', default=False,
1394 )
1394 )
1395 coreconfigitem(
1395 coreconfigitem(
1396 b'ui', b'tweakdefaults', default=False,
1396 b'ui', b'tweakdefaults', default=False,
1397 )
1397 )
1398 coreconfigitem(b'ui', b'username', alias=[(b'ui', b'user')])
1398 coreconfigitem(b'ui', b'username', alias=[(b'ui', b'user')])
1399 coreconfigitem(
1399 coreconfigitem(
1400 b'ui', b'verbose', default=False,
1400 b'ui', b'verbose', default=False,
1401 )
1401 )
1402 coreconfigitem(
1402 coreconfigitem(
1403 b'verify', b'skipflags', default=None,
1403 b'verify', b'skipflags', default=None,
1404 )
1404 )
1405 coreconfigitem(
1405 coreconfigitem(
1406 b'web', b'allowbz2', default=False,
1406 b'web', b'allowbz2', default=False,
1407 )
1407 )
1408 coreconfigitem(
1408 coreconfigitem(
1409 b'web', b'allowgz', default=False,
1409 b'web', b'allowgz', default=False,
1410 )
1410 )
1411 coreconfigitem(
1411 coreconfigitem(
1412 b'web', b'allow-pull', alias=[(b'web', b'allowpull')], default=True,
1412 b'web', b'allow-pull', alias=[(b'web', b'allowpull')], default=True,
1413 )
1413 )
1414 coreconfigitem(
1414 coreconfigitem(
1415 b'web', b'allow-push', alias=[(b'web', b'allow_push')], default=list,
1415 b'web', b'allow-push', alias=[(b'web', b'allow_push')], default=list,
1416 )
1416 )
1417 coreconfigitem(
1417 coreconfigitem(
1418 b'web', b'allowzip', default=False,
1418 b'web', b'allowzip', default=False,
1419 )
1419 )
1420 coreconfigitem(
1420 coreconfigitem(
1421 b'web', b'archivesubrepos', default=False,
1421 b'web', b'archivesubrepos', default=False,
1422 )
1422 )
1423 coreconfigitem(
1423 coreconfigitem(
1424 b'web', b'cache', default=True,
1424 b'web', b'cache', default=True,
1425 )
1425 )
1426 coreconfigitem(
1426 coreconfigitem(
1427 b'web', b'comparisoncontext', default=5,
1427 b'web', b'comparisoncontext', default=5,
1428 )
1428 )
1429 coreconfigitem(
1429 coreconfigitem(
1430 b'web', b'contact', default=None,
1430 b'web', b'contact', default=None,
1431 )
1431 )
1432 coreconfigitem(
1432 coreconfigitem(
1433 b'web', b'deny_push', default=list,
1433 b'web', b'deny_push', default=list,
1434 )
1434 )
1435 coreconfigitem(
1435 coreconfigitem(
1436 b'web', b'guessmime', default=False,
1436 b'web', b'guessmime', default=False,
1437 )
1437 )
1438 coreconfigitem(
1438 coreconfigitem(
1439 b'web', b'hidden', default=False,
1439 b'web', b'hidden', default=False,
1440 )
1440 )
1441 coreconfigitem(
1441 coreconfigitem(
1442 b'web', b'labels', default=list,
1442 b'web', b'labels', default=list,
1443 )
1443 )
1444 coreconfigitem(
1444 coreconfigitem(
1445 b'web', b'logoimg', default=b'hglogo.png',
1445 b'web', b'logoimg', default=b'hglogo.png',
1446 )
1446 )
1447 coreconfigitem(
1447 coreconfigitem(
1448 b'web', b'logourl', default=b'https://mercurial-scm.org/',
1448 b'web', b'logourl', default=b'https://mercurial-scm.org/',
1449 )
1449 )
1450 coreconfigitem(
1450 coreconfigitem(
1451 b'web', b'accesslog', default=b'-',
1451 b'web', b'accesslog', default=b'-',
1452 )
1452 )
1453 coreconfigitem(
1453 coreconfigitem(
1454 b'web', b'address', default=b'',
1454 b'web', b'address', default=b'',
1455 )
1455 )
1456 coreconfigitem(
1456 coreconfigitem(
1457 b'web', b'allow-archive', alias=[(b'web', b'allow_archive')], default=list,
1457 b'web', b'allow-archive', alias=[(b'web', b'allow_archive')], default=list,
1458 )
1458 )
1459 coreconfigitem(
1459 coreconfigitem(
1460 b'web', b'allow_read', default=list,
1460 b'web', b'allow_read', default=list,
1461 )
1461 )
1462 coreconfigitem(
1462 coreconfigitem(
1463 b'web', b'baseurl', default=None,
1463 b'web', b'baseurl', default=None,
1464 )
1464 )
1465 coreconfigitem(
1465 coreconfigitem(
1466 b'web', b'cacerts', default=None,
1466 b'web', b'cacerts', default=None,
1467 )
1467 )
1468 coreconfigitem(
1468 coreconfigitem(
1469 b'web', b'certificate', default=None,
1469 b'web', b'certificate', default=None,
1470 )
1470 )
1471 coreconfigitem(
1471 coreconfigitem(
1472 b'web', b'collapse', default=False,
1472 b'web', b'collapse', default=False,
1473 )
1473 )
1474 coreconfigitem(
1474 coreconfigitem(
1475 b'web', b'csp', default=None,
1475 b'web', b'csp', default=None,
1476 )
1476 )
1477 coreconfigitem(
1477 coreconfigitem(
1478 b'web', b'deny_read', default=list,
1478 b'web', b'deny_read', default=list,
1479 )
1479 )
1480 coreconfigitem(
1480 coreconfigitem(
1481 b'web', b'descend', default=True,
1481 b'web', b'descend', default=True,
1482 )
1482 )
1483 coreconfigitem(
1483 coreconfigitem(
1484 b'web', b'description', default=b"",
1484 b'web', b'description', default=b"",
1485 )
1485 )
1486 coreconfigitem(
1486 coreconfigitem(
1487 b'web', b'encoding', default=lambda: encoding.encoding,
1487 b'web', b'encoding', default=lambda: encoding.encoding,
1488 )
1488 )
1489 coreconfigitem(
1489 coreconfigitem(
1490 b'web', b'errorlog', default=b'-',
1490 b'web', b'errorlog', default=b'-',
1491 )
1491 )
1492 coreconfigitem(
1492 coreconfigitem(
1493 b'web', b'ipv6', default=False,
1493 b'web', b'ipv6', default=False,
1494 )
1494 )
1495 coreconfigitem(
1495 coreconfigitem(
1496 b'web', b'maxchanges', default=10,
1496 b'web', b'maxchanges', default=10,
1497 )
1497 )
1498 coreconfigitem(
1498 coreconfigitem(
1499 b'web', b'maxfiles', default=10,
1499 b'web', b'maxfiles', default=10,
1500 )
1500 )
1501 coreconfigitem(
1501 coreconfigitem(
1502 b'web', b'maxshortchanges', default=60,
1502 b'web', b'maxshortchanges', default=60,
1503 )
1503 )
1504 coreconfigitem(
1504 coreconfigitem(
1505 b'web', b'motd', default=b'',
1505 b'web', b'motd', default=b'',
1506 )
1506 )
1507 coreconfigitem(
1507 coreconfigitem(
1508 b'web', b'name', default=dynamicdefault,
1508 b'web', b'name', default=dynamicdefault,
1509 )
1509 )
1510 coreconfigitem(
1510 coreconfigitem(
1511 b'web', b'port', default=8000,
1511 b'web', b'port', default=8000,
1512 )
1512 )
1513 coreconfigitem(
1513 coreconfigitem(
1514 b'web', b'prefix', default=b'',
1514 b'web', b'prefix', default=b'',
1515 )
1515 )
1516 coreconfigitem(
1516 coreconfigitem(
1517 b'web', b'push_ssl', default=True,
1517 b'web', b'push_ssl', default=True,
1518 )
1518 )
1519 coreconfigitem(
1519 coreconfigitem(
1520 b'web', b'refreshinterval', default=20,
1520 b'web', b'refreshinterval', default=20,
1521 )
1521 )
1522 coreconfigitem(
1522 coreconfigitem(
1523 b'web', b'server-header', default=None,
1523 b'web', b'server-header', default=None,
1524 )
1524 )
1525 coreconfigitem(
1525 coreconfigitem(
1526 b'web', b'static', default=None,
1526 b'web', b'static', default=None,
1527 )
1527 )
1528 coreconfigitem(
1528 coreconfigitem(
1529 b'web', b'staticurl', default=None,
1529 b'web', b'staticurl', default=None,
1530 )
1530 )
1531 coreconfigitem(
1531 coreconfigitem(
1532 b'web', b'stripes', default=1,
1532 b'web', b'stripes', default=1,
1533 )
1533 )
1534 coreconfigitem(
1534 coreconfigitem(
1535 b'web', b'style', default=b'paper',
1535 b'web', b'style', default=b'paper',
1536 )
1536 )
1537 coreconfigitem(
1537 coreconfigitem(
1538 b'web', b'templates', default=None,
1538 b'web', b'templates', default=None,
1539 )
1539 )
1540 coreconfigitem(
1540 coreconfigitem(
1541 b'web', b'view', default=b'served', experimental=True,
1541 b'web', b'view', default=b'served', experimental=True,
1542 )
1542 )
1543 coreconfigitem(
1543 coreconfigitem(
1544 b'worker', b'backgroundclose', default=dynamicdefault,
1544 b'worker', b'backgroundclose', default=dynamicdefault,
1545 )
1545 )
1546 # Windows defaults to a limit of 512 open files. A buffer of 128
1546 # Windows defaults to a limit of 512 open files. A buffer of 128
1547 # should give us enough headway.
1547 # should give us enough headway.
1548 coreconfigitem(
1548 coreconfigitem(
1549 b'worker', b'backgroundclosemaxqueue', default=384,
1549 b'worker', b'backgroundclosemaxqueue', default=384,
1550 )
1550 )
1551 coreconfigitem(
1551 coreconfigitem(
1552 b'worker', b'backgroundcloseminfilecount', default=2048,
1552 b'worker', b'backgroundcloseminfilecount', default=2048,
1553 )
1553 )
1554 coreconfigitem(
1554 coreconfigitem(
1555 b'worker', b'backgroundclosethreadcount', default=4,
1555 b'worker', b'backgroundclosethreadcount', default=4,
1556 )
1556 )
1557 coreconfigitem(
1557 coreconfigitem(
1558 b'worker', b'enabled', default=True,
1558 b'worker', b'enabled', default=True,
1559 )
1559 )
1560 coreconfigitem(
1560 coreconfigitem(
1561 b'worker', b'numcpus', default=None,
1561 b'worker', b'numcpus', default=None,
1562 )
1562 )
1563
1563
1564 # Rebase related configuration moved to core because other extension are doing
1564 # Rebase related configuration moved to core because other extension are doing
1565 # strange things. For example, shelve import the extensions to reuse some bit
1565 # strange things. For example, shelve import the extensions to reuse some bit
1566 # without formally loading it.
1566 # without formally loading it.
1567 coreconfigitem(
1567 coreconfigitem(
1568 b'commands', b'rebase.requiredest', default=False,
1568 b'commands', b'rebase.requiredest', default=False,
1569 )
1569 )
1570 coreconfigitem(
1570 coreconfigitem(
1571 b'experimental', b'rebaseskipobsolete', default=True,
1571 b'experimental', b'rebaseskipobsolete', default=True,
1572 )
1572 )
1573 coreconfigitem(
1573 coreconfigitem(
1574 b'rebase', b'singletransaction', default=False,
1574 b'rebase', b'singletransaction', default=False,
1575 )
1575 )
1576 coreconfigitem(
1576 coreconfigitem(
1577 b'rebase', b'experimental.inmemory', default=False,
1577 b'rebase', b'experimental.inmemory', default=False,
1578 )
1578 )
@@ -1,2890 +1,2898 b''
1 The Mercurial system uses a set of configuration files to control
1 The Mercurial system uses a set of configuration files to control
2 aspects of its behavior.
2 aspects of its behavior.
3
3
4 Troubleshooting
4 Troubleshooting
5 ===============
5 ===============
6
6
7 If you're having problems with your configuration,
7 If you're having problems with your configuration,
8 :hg:`config --debug` can help you understand what is introducing
8 :hg:`config --debug` can help you understand what is introducing
9 a setting into your environment.
9 a setting into your environment.
10
10
11 See :hg:`help config.syntax` and :hg:`help config.files`
11 See :hg:`help config.syntax` and :hg:`help config.files`
12 for information about how and where to override things.
12 for information about how and where to override things.
13
13
14 Structure
14 Structure
15 =========
15 =========
16
16
17 The configuration files use a simple ini-file format. A configuration
17 The configuration files use a simple ini-file format. A configuration
18 file consists of sections, led by a ``[section]`` header and followed
18 file consists of sections, led by a ``[section]`` header and followed
19 by ``name = value`` entries::
19 by ``name = value`` entries::
20
20
21 [ui]
21 [ui]
22 username = Firstname Lastname <firstname.lastname@example.net>
22 username = Firstname Lastname <firstname.lastname@example.net>
23 verbose = True
23 verbose = True
24
24
25 The above entries will be referred to as ``ui.username`` and
25 The above entries will be referred to as ``ui.username`` and
26 ``ui.verbose``, respectively. See :hg:`help config.syntax`.
26 ``ui.verbose``, respectively. See :hg:`help config.syntax`.
27
27
28 Files
28 Files
29 =====
29 =====
30
30
31 Mercurial reads configuration data from several files, if they exist.
31 Mercurial reads configuration data from several files, if they exist.
32 These files do not exist by default and you will have to create the
32 These files do not exist by default and you will have to create the
33 appropriate configuration files yourself:
33 appropriate configuration files yourself:
34
34
35 Local configuration is put into the per-repository ``<repo>/.hg/hgrc`` file.
35 Local configuration is put into the per-repository ``<repo>/.hg/hgrc`` file.
36
36
37 Global configuration like the username setting is typically put into:
37 Global configuration like the username setting is typically put into:
38
38
39 .. container:: windows
39 .. container:: windows
40
40
41 - ``%USERPROFILE%\mercurial.ini`` (on Windows)
41 - ``%USERPROFILE%\mercurial.ini`` (on Windows)
42
42
43 .. container:: unix.plan9
43 .. container:: unix.plan9
44
44
45 - ``$HOME/.hgrc`` (on Unix, Plan9)
45 - ``$HOME/.hgrc`` (on Unix, Plan9)
46
46
47 The names of these files depend on the system on which Mercurial is
47 The names of these files depend on the system on which Mercurial is
48 installed. ``*.rc`` files from a single directory are read in
48 installed. ``*.rc`` files from a single directory are read in
49 alphabetical order, later ones overriding earlier ones. Where multiple
49 alphabetical order, later ones overriding earlier ones. Where multiple
50 paths are given below, settings from earlier paths override later
50 paths are given below, settings from earlier paths override later
51 ones.
51 ones.
52
52
53 .. container:: verbose.unix
53 .. container:: verbose.unix
54
54
55 On Unix, the following files are consulted:
55 On Unix, the following files are consulted:
56
56
57 - ``<repo>/.hg/hgrc`` (per-repository)
57 - ``<repo>/.hg/hgrc`` (per-repository)
58 - ``$HOME/.hgrc`` (per-user)
58 - ``$HOME/.hgrc`` (per-user)
59 - ``${XDG_CONFIG_HOME:-$HOME/.config}/hg/hgrc`` (per-user)
59 - ``${XDG_CONFIG_HOME:-$HOME/.config}/hg/hgrc`` (per-user)
60 - ``<install-root>/etc/mercurial/hgrc`` (per-installation)
60 - ``<install-root>/etc/mercurial/hgrc`` (per-installation)
61 - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation)
61 - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation)
62 - ``/etc/mercurial/hgrc`` (per-system)
62 - ``/etc/mercurial/hgrc`` (per-system)
63 - ``/etc/mercurial/hgrc.d/*.rc`` (per-system)
63 - ``/etc/mercurial/hgrc.d/*.rc`` (per-system)
64 - ``<internal>/*.rc`` (defaults)
64 - ``<internal>/*.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-system)
75 - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-system)
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 - ``%PROGRAMDATA%\Mercurial\hgrc`` (per-system)
78 - ``%PROGRAMDATA%\Mercurial\hgrc`` (per-system)
79 - ``%PROGRAMDATA%\Mercurial\Mercurial.ini`` (per-system)
79 - ``%PROGRAMDATA%\Mercurial\Mercurial.ini`` (per-system)
80 - ``%PROGRAMDATA%\Mercurial\hgrc.d\*.rc`` (per-system)
80 - ``%PROGRAMDATA%\Mercurial\hgrc.d\*.rc`` (per-system)
81 - ``<internal>/*.rc`` (defaults)
81 - ``<internal>/*.rc`` (defaults)
82
82
83 .. note::
83 .. note::
84
84
85 The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial``
85 The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial``
86 is used when running 32-bit Python on 64-bit Windows.
86 is used when running 32-bit Python on 64-bit Windows.
87
87
88 .. container:: verbose.plan9
88 .. container:: verbose.plan9
89
89
90 On Plan9, the following files are consulted:
90 On Plan9, the following files are consulted:
91
91
92 - ``<repo>/.hg/hgrc`` (per-repository)
92 - ``<repo>/.hg/hgrc`` (per-repository)
93 - ``$home/lib/hgrc`` (per-user)
93 - ``$home/lib/hgrc`` (per-user)
94 - ``<install-root>/lib/mercurial/hgrc`` (per-installation)
94 - ``<install-root>/lib/mercurial/hgrc`` (per-installation)
95 - ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation)
95 - ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation)
96 - ``/lib/mercurial/hgrc`` (per-system)
96 - ``/lib/mercurial/hgrc`` (per-system)
97 - ``/lib/mercurial/hgrc.d/*.rc`` (per-system)
97 - ``/lib/mercurial/hgrc.d/*.rc`` (per-system)
98 - ``<internal>/*.rc`` (defaults)
98 - ``<internal>/*.rc`` (defaults)
99
99
100 Per-repository configuration options only apply in a
100 Per-repository configuration options only apply in a
101 particular repository. This file is not version-controlled, and
101 particular repository. This file is not version-controlled, and
102 will not get transferred during a "clone" operation. Options in
102 will not get transferred during a "clone" operation. Options in
103 this file override options in all other configuration files.
103 this file override options in all other configuration files.
104
104
105 .. container:: unix.plan9
105 .. container:: unix.plan9
106
106
107 On Plan 9 and Unix, most of this file will be ignored if it doesn't
107 On Plan 9 and Unix, most of this file will be ignored if it doesn't
108 belong to a trusted user or to a trusted group. See
108 belong to a trusted user or to a trusted group. See
109 :hg:`help config.trusted` for more details.
109 :hg:`help config.trusted` for more details.
110
110
111 Per-user configuration file(s) are for the user running Mercurial. Options
111 Per-user configuration file(s) are for the user running Mercurial. Options
112 in these files apply to all Mercurial commands executed by this user in any
112 in these files apply to all Mercurial commands executed by this user in any
113 directory. Options in these files override per-system and per-installation
113 directory. Options in these files override per-system and per-installation
114 options.
114 options.
115
115
116 Per-installation configuration files are searched for in the
116 Per-installation configuration files are searched for in the
117 directory where Mercurial is installed. ``<install-root>`` is the
117 directory where Mercurial is installed. ``<install-root>`` is the
118 parent directory of the **hg** executable (or symlink) being run.
118 parent directory of the **hg** executable (or symlink) being run.
119
119
120 .. container:: unix.plan9
120 .. container:: unix.plan9
121
121
122 For example, if installed in ``/shared/tools/bin/hg``, Mercurial
122 For example, if installed in ``/shared/tools/bin/hg``, Mercurial
123 will look in ``/shared/tools/etc/mercurial/hgrc``. Options in these
123 will look in ``/shared/tools/etc/mercurial/hgrc``. Options in these
124 files apply to all Mercurial commands executed by any user in any
124 files apply to all Mercurial commands executed by any user in any
125 directory.
125 directory.
126
126
127 Per-installation configuration files are for the system on
127 Per-installation configuration files are for the system on
128 which Mercurial is running. Options in these files apply to all
128 which Mercurial is running. Options in these files apply to all
129 Mercurial commands executed by any user in any directory. Registry
129 Mercurial commands executed by any user in any directory. Registry
130 keys contain PATH-like strings, every part of which must reference
130 keys contain PATH-like strings, every part of which must reference
131 a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will
131 a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will
132 be read. Mercurial checks each of these locations in the specified
132 be read. Mercurial checks each of these locations in the specified
133 order until one or more configuration files are detected.
133 order until one or more configuration files are detected.
134
134
135 Per-system configuration files are for the system on which Mercurial
135 Per-system configuration files are for the system on which Mercurial
136 is running. Options in these files apply to all Mercurial commands
136 is running. Options in these files apply to all Mercurial commands
137 executed by any user in any directory. Options in these files
137 executed by any user in any directory. Options in these files
138 override per-installation options.
138 override per-installation options.
139
139
140 Mercurial comes with some default configuration. The default configuration
140 Mercurial comes with some default configuration. The default configuration
141 files are installed with Mercurial and will be overwritten on upgrades. Default
141 files are installed with Mercurial and will be overwritten on upgrades. Default
142 configuration files should never be edited by users or administrators but can
142 configuration files should never be edited by users or administrators but can
143 be overridden in other configuration files. So far the directory only contains
143 be overridden in other configuration files. So far the directory only contains
144 merge tool configuration but packagers can also put other default configuration
144 merge tool configuration but packagers can also put other default configuration
145 there.
145 there.
146
146
147 Syntax
147 Syntax
148 ======
148 ======
149
149
150 A configuration file consists of sections, led by a ``[section]`` header
150 A configuration file consists of sections, led by a ``[section]`` header
151 and followed by ``name = value`` entries (sometimes called
151 and followed by ``name = value`` entries (sometimes called
152 ``configuration keys``)::
152 ``configuration keys``)::
153
153
154 [spam]
154 [spam]
155 eggs=ham
155 eggs=ham
156 green=
156 green=
157 eggs
157 eggs
158
158
159 Each line contains one entry. If the lines that follow are indented,
159 Each line contains one entry. If the lines that follow are indented,
160 they are treated as continuations of that entry. Leading whitespace is
160 they are treated as continuations of that entry. Leading whitespace is
161 removed from values. Empty lines are skipped. Lines beginning with
161 removed from values. Empty lines are skipped. Lines beginning with
162 ``#`` or ``;`` are ignored and may be used to provide comments.
162 ``#`` or ``;`` are ignored and may be used to provide comments.
163
163
164 Configuration keys can be set multiple times, in which case Mercurial
164 Configuration keys can be set multiple times, in which case Mercurial
165 will use the value that was configured last. As an example::
165 will use the value that was configured last. As an example::
166
166
167 [spam]
167 [spam]
168 eggs=large
168 eggs=large
169 ham=serrano
169 ham=serrano
170 eggs=small
170 eggs=small
171
171
172 This would set the configuration key named ``eggs`` to ``small``.
172 This would set the configuration key named ``eggs`` to ``small``.
173
173
174 It is also possible to define a section multiple times. A section can
174 It is also possible to define a section multiple times. A section can
175 be redefined on the same and/or on different configuration files. For
175 be redefined on the same and/or on different configuration files. For
176 example::
176 example::
177
177
178 [foo]
178 [foo]
179 eggs=large
179 eggs=large
180 ham=serrano
180 ham=serrano
181 eggs=small
181 eggs=small
182
182
183 [bar]
183 [bar]
184 eggs=ham
184 eggs=ham
185 green=
185 green=
186 eggs
186 eggs
187
187
188 [foo]
188 [foo]
189 ham=prosciutto
189 ham=prosciutto
190 eggs=medium
190 eggs=medium
191 bread=toasted
191 bread=toasted
192
192
193 This would set the ``eggs``, ``ham``, and ``bread`` configuration keys
193 This would set the ``eggs``, ``ham``, and ``bread`` configuration keys
194 of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``,
194 of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``,
195 respectively. As you can see there only thing that matters is the last
195 respectively. As you can see there only thing that matters is the last
196 value that was set for each of the configuration keys.
196 value that was set for each of the configuration keys.
197
197
198 If a configuration key is set multiple times in different
198 If a configuration key is set multiple times in different
199 configuration files the final value will depend on the order in which
199 configuration files the final value will depend on the order in which
200 the different configuration files are read, with settings from earlier
200 the different configuration files are read, with settings from earlier
201 paths overriding later ones as described on the ``Files`` section
201 paths overriding later ones as described on the ``Files`` section
202 above.
202 above.
203
203
204 A line of the form ``%include file`` will include ``file`` into the
204 A line of the form ``%include file`` will include ``file`` into the
205 current configuration file. The inclusion is recursive, which means
205 current configuration file. The inclusion is recursive, which means
206 that included files can include other files. Filenames are relative to
206 that included files can include other files. Filenames are relative to
207 the configuration file in which the ``%include`` directive is found.
207 the configuration file in which the ``%include`` directive is found.
208 Environment variables and ``~user`` constructs are expanded in
208 Environment variables and ``~user`` constructs are expanded in
209 ``file``. This lets you do something like::
209 ``file``. This lets you do something like::
210
210
211 %include ~/.hgrc.d/$HOST.rc
211 %include ~/.hgrc.d/$HOST.rc
212
212
213 to include a different configuration file on each computer you use.
213 to include a different configuration file on each computer you use.
214
214
215 A line with ``%unset name`` will remove ``name`` from the current
215 A line with ``%unset name`` will remove ``name`` from the current
216 section, if it has been set previously.
216 section, if it has been set previously.
217
217
218 The values are either free-form text strings, lists of text strings,
218 The values are either free-form text strings, lists of text strings,
219 or Boolean values. Boolean values can be set to true using any of "1",
219 or Boolean values. Boolean values can be set to true using any of "1",
220 "yes", "true", or "on" and to false using "0", "no", "false", or "off"
220 "yes", "true", or "on" and to false using "0", "no", "false", or "off"
221 (all case insensitive).
221 (all case insensitive).
222
222
223 List values are separated by whitespace or comma, except when values are
223 List values are separated by whitespace or comma, except when values are
224 placed in double quotation marks::
224 placed in double quotation marks::
225
225
226 allow_read = "John Doe, PhD", brian, betty
226 allow_read = "John Doe, PhD", brian, betty
227
227
228 Quotation marks can be escaped by prefixing them with a backslash. Only
228 Quotation marks can be escaped by prefixing them with a backslash. Only
229 quotation marks at the beginning of a word is counted as a quotation
229 quotation marks at the beginning of a word is counted as a quotation
230 (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``).
230 (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``).
231
231
232 Sections
232 Sections
233 ========
233 ========
234
234
235 This section describes the different sections that may appear in a
235 This section describes the different sections that may appear in a
236 Mercurial configuration file, the purpose of each section, its possible
236 Mercurial configuration file, the purpose of each section, its possible
237 keys, and their possible values.
237 keys, and their possible values.
238
238
239 ``alias``
239 ``alias``
240 ---------
240 ---------
241
241
242 Defines command aliases.
242 Defines command aliases.
243
243
244 Aliases allow you to define your own commands in terms of other
244 Aliases allow you to define your own commands in terms of other
245 commands (or aliases), optionally including arguments. Positional
245 commands (or aliases), optionally including arguments. Positional
246 arguments in the form of ``$1``, ``$2``, etc. in the alias definition
246 arguments in the form of ``$1``, ``$2``, etc. in the alias definition
247 are expanded by Mercurial before execution. Positional arguments not
247 are expanded by Mercurial before execution. Positional arguments not
248 already used by ``$N`` in the definition are put at the end of the
248 already used by ``$N`` in the definition are put at the end of the
249 command to be executed.
249 command to be executed.
250
250
251 Alias definitions consist of lines of the form::
251 Alias definitions consist of lines of the form::
252
252
253 <alias> = <command> [<argument>]...
253 <alias> = <command> [<argument>]...
254
254
255 For example, this definition::
255 For example, this definition::
256
256
257 latest = log --limit 5
257 latest = log --limit 5
258
258
259 creates a new command ``latest`` that shows only the five most recent
259 creates a new command ``latest`` that shows only the five most recent
260 changesets. You can define subsequent aliases using earlier ones::
260 changesets. You can define subsequent aliases using earlier ones::
261
261
262 stable5 = latest -b stable
262 stable5 = latest -b stable
263
263
264 .. note::
264 .. note::
265
265
266 It is possible to create aliases with the same names as
266 It is possible to create aliases with the same names as
267 existing commands, which will then override the original
267 existing commands, which will then override the original
268 definitions. This is almost always a bad idea!
268 definitions. This is almost always a bad idea!
269
269
270 An alias can start with an exclamation point (``!``) to make it a
270 An alias can start with an exclamation point (``!``) to make it a
271 shell alias. A shell alias is executed with the shell and will let you
271 shell alias. A shell alias is executed with the shell and will let you
272 run arbitrary commands. As an example, ::
272 run arbitrary commands. As an example, ::
273
273
274 echo = !echo $@
274 echo = !echo $@
275
275
276 will let you do ``hg echo foo`` to have ``foo`` printed in your
276 will let you do ``hg echo foo`` to have ``foo`` printed in your
277 terminal. A better example might be::
277 terminal. A better example might be::
278
278
279 purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm -f
279 purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm -f
280
280
281 which will make ``hg purge`` delete all unknown files in the
281 which will make ``hg purge`` delete all unknown files in the
282 repository in the same manner as the purge extension.
282 repository in the same manner as the purge extension.
283
283
284 Positional arguments like ``$1``, ``$2``, etc. in the alias definition
284 Positional arguments like ``$1``, ``$2``, etc. in the alias definition
285 expand to the command arguments. Unmatched arguments are
285 expand to the command arguments. Unmatched arguments are
286 removed. ``$0`` expands to the alias name and ``$@`` expands to all
286 removed. ``$0`` expands to the alias name and ``$@`` expands to all
287 arguments separated by a space. ``"$@"`` (with quotes) expands to all
287 arguments separated by a space. ``"$@"`` (with quotes) expands to all
288 arguments quoted individually and separated by a space. These expansions
288 arguments quoted individually and separated by a space. These expansions
289 happen before the command is passed to the shell.
289 happen before the command is passed to the shell.
290
290
291 Shell aliases are executed in an environment where ``$HG`` expands to
291 Shell aliases are executed in an environment where ``$HG`` expands to
292 the path of the Mercurial that was used to execute the alias. This is
292 the path of the Mercurial that was used to execute the alias. This is
293 useful when you want to call further Mercurial commands in a shell
293 useful when you want to call further Mercurial commands in a shell
294 alias, as was done above for the purge alias. In addition,
294 alias, as was done above for the purge alias. In addition,
295 ``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg
295 ``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg
296 echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``.
296 echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``.
297
297
298 .. note::
298 .. note::
299
299
300 Some global configuration options such as ``-R`` are
300 Some global configuration options such as ``-R`` are
301 processed before shell aliases and will thus not be passed to
301 processed before shell aliases and will thus not be passed to
302 aliases.
302 aliases.
303
303
304
304
305 ``annotate``
305 ``annotate``
306 ------------
306 ------------
307
307
308 Settings used when displaying file annotations. All values are
308 Settings used when displaying file annotations. All values are
309 Booleans and default to False. See :hg:`help config.diff` for
309 Booleans and default to False. See :hg:`help config.diff` for
310 related options for the diff command.
310 related options for the diff command.
311
311
312 ``ignorews``
312 ``ignorews``
313 Ignore white space when comparing lines.
313 Ignore white space when comparing lines.
314
314
315 ``ignorewseol``
315 ``ignorewseol``
316 Ignore white space at the end of a line when comparing lines.
316 Ignore white space at the end of a line when comparing lines.
317
317
318 ``ignorewsamount``
318 ``ignorewsamount``
319 Ignore changes in the amount of white space.
319 Ignore changes in the amount of white space.
320
320
321 ``ignoreblanklines``
321 ``ignoreblanklines``
322 Ignore changes whose lines are all blank.
322 Ignore changes whose lines are all blank.
323
323
324
324
325 ``auth``
325 ``auth``
326 --------
326 --------
327
327
328 Authentication credentials and other authentication-like configuration
328 Authentication credentials and other authentication-like configuration
329 for HTTP connections. This section allows you to store usernames and
329 for HTTP connections. This section allows you to store usernames and
330 passwords for use when logging *into* HTTP servers. See
330 passwords for use when logging *into* HTTP servers. See
331 :hg:`help config.web` if you want to configure *who* can login to
331 :hg:`help config.web` if you want to configure *who* can login to
332 your HTTP server.
332 your HTTP server.
333
333
334 The following options apply to all hosts.
334 The following options apply to all hosts.
335
335
336 ``cookiefile``
336 ``cookiefile``
337 Path to a file containing HTTP cookie lines. Cookies matching a
337 Path to a file containing HTTP cookie lines. Cookies matching a
338 host will be sent automatically.
338 host will be sent automatically.
339
339
340 The file format uses the Mozilla cookies.txt format, which defines cookies
340 The file format uses the Mozilla cookies.txt format, which defines cookies
341 on their own lines. Each line contains 7 fields delimited by the tab
341 on their own lines. Each line contains 7 fields delimited by the tab
342 character (domain, is_domain_cookie, path, is_secure, expires, name,
342 character (domain, is_domain_cookie, path, is_secure, expires, name,
343 value). For more info, do an Internet search for "Netscape cookies.txt
343 value). For more info, do an Internet search for "Netscape cookies.txt
344 format."
344 format."
345
345
346 Note: the cookies parser does not handle port numbers on domains. You
346 Note: the cookies parser does not handle port numbers on domains. You
347 will need to remove ports from the domain for the cookie to be recognized.
347 will need to remove ports from the domain for the cookie to be recognized.
348 This could result in a cookie being disclosed to an unwanted server.
348 This could result in a cookie being disclosed to an unwanted server.
349
349
350 The cookies file is read-only.
350 The cookies file is read-only.
351
351
352 Other options in this section are grouped by name and have the following
352 Other options in this section are grouped by name and have the following
353 format::
353 format::
354
354
355 <name>.<argument> = <value>
355 <name>.<argument> = <value>
356
356
357 where ``<name>`` is used to group arguments into authentication
357 where ``<name>`` is used to group arguments into authentication
358 entries. Example::
358 entries. Example::
359
359
360 foo.prefix = hg.intevation.de/mercurial
360 foo.prefix = hg.intevation.de/mercurial
361 foo.username = foo
361 foo.username = foo
362 foo.password = bar
362 foo.password = bar
363 foo.schemes = http https
363 foo.schemes = http https
364
364
365 bar.prefix = secure.example.org
365 bar.prefix = secure.example.org
366 bar.key = path/to/file.key
366 bar.key = path/to/file.key
367 bar.cert = path/to/file.cert
367 bar.cert = path/to/file.cert
368 bar.schemes = https
368 bar.schemes = https
369
369
370 Supported arguments:
370 Supported arguments:
371
371
372 ``prefix``
372 ``prefix``
373 Either ``*`` or a URI prefix with or without the scheme part.
373 Either ``*`` or a URI prefix with or without the scheme part.
374 The authentication entry with the longest matching prefix is used
374 The authentication entry with the longest matching prefix is used
375 (where ``*`` matches everything and counts as a match of length
375 (where ``*`` matches everything and counts as a match of length
376 1). If the prefix doesn't include a scheme, the match is performed
376 1). If the prefix doesn't include a scheme, the match is performed
377 against the URI with its scheme stripped as well, and the schemes
377 against the URI with its scheme stripped as well, and the schemes
378 argument, q.v., is then subsequently consulted.
378 argument, q.v., is then subsequently consulted.
379
379
380 ``username``
380 ``username``
381 Optional. Username to authenticate with. If not given, and the
381 Optional. Username to authenticate with. If not given, and the
382 remote site requires basic or digest authentication, the user will
382 remote site requires basic or digest authentication, the user will
383 be prompted for it. Environment variables are expanded in the
383 be prompted for it. Environment variables are expanded in the
384 username letting you do ``foo.username = $USER``. If the URI
384 username letting you do ``foo.username = $USER``. If the URI
385 includes a username, only ``[auth]`` entries with a matching
385 includes a username, only ``[auth]`` entries with a matching
386 username or without a username will be considered.
386 username or without a username will be considered.
387
387
388 ``password``
388 ``password``
389 Optional. Password to authenticate with. If not given, and the
389 Optional. Password to authenticate with. If not given, and the
390 remote site requires basic or digest authentication, the user
390 remote site requires basic or digest authentication, the user
391 will be prompted for it.
391 will be prompted for it.
392
392
393 ``key``
393 ``key``
394 Optional. PEM encoded client certificate key file. Environment
394 Optional. PEM encoded client certificate key file. Environment
395 variables are expanded in the filename.
395 variables are expanded in the filename.
396
396
397 ``cert``
397 ``cert``
398 Optional. PEM encoded client certificate chain file. Environment
398 Optional. PEM encoded client certificate chain file. Environment
399 variables are expanded in the filename.
399 variables are expanded in the filename.
400
400
401 ``schemes``
401 ``schemes``
402 Optional. Space separated list of URI schemes to use this
402 Optional. Space separated list of URI schemes to use this
403 authentication entry with. Only used if the prefix doesn't include
403 authentication entry with. Only used if the prefix doesn't include
404 a scheme. Supported schemes are http and https. They will match
404 a scheme. Supported schemes are http and https. They will match
405 static-http and static-https respectively, as well.
405 static-http and static-https respectively, as well.
406 (default: https)
406 (default: https)
407
407
408 If no suitable authentication entry is found, the user is prompted
408 If no suitable authentication entry is found, the user is prompted
409 for credentials as usual if required by the remote.
409 for credentials as usual if required by the remote.
410
410
411 ``cmdserver``
411 ``cmdserver``
412 -------------
412 -------------
413
413
414 Controls command server settings. (ADVANCED)
414 Controls command server settings. (ADVANCED)
415
415
416 ``message-encodings``
417 List of encodings for the ``m`` (message) channel. The first encoding
418 supported by the server will be selected and advertised in the hello
419 message. This is useful only when ``ui.message-output`` is set to
420 ``channel``. Supported encodings are ``cbor``.
421
416 ``shutdown-on-interrupt``
422 ``shutdown-on-interrupt``
417 If set to false, the server's main loop will continue running after
423 If set to false, the server's main loop will continue running after
418 SIGINT received. ``runcommand`` requests can still be interrupted by
424 SIGINT received. ``runcommand`` requests can still be interrupted by
419 SIGINT. Close the write end of the pipe to shut down the server
425 SIGINT. Close the write end of the pipe to shut down the server
420 process gracefully.
426 process gracefully.
421 (default: True)
427 (default: True)
422
428
423 ``color``
429 ``color``
424 ---------
430 ---------
425
431
426 Configure the Mercurial color mode. For details about how to define your custom
432 Configure the Mercurial color mode. For details about how to define your custom
427 effect and style see :hg:`help color`.
433 effect and style see :hg:`help color`.
428
434
429 ``mode``
435 ``mode``
430 String: control the method used to output color. One of ``auto``, ``ansi``,
436 String: control the method used to output color. One of ``auto``, ``ansi``,
431 ``win32``, ``terminfo`` or ``debug``. In auto mode, Mercurial will
437 ``win32``, ``terminfo`` or ``debug``. In auto mode, Mercurial will
432 use ANSI mode by default (or win32 mode prior to Windows 10) if it detects a
438 use ANSI mode by default (or win32 mode prior to Windows 10) if it detects a
433 terminal. Any invalid value will disable color.
439 terminal. Any invalid value will disable color.
434
440
435 ``pagermode``
441 ``pagermode``
436 String: optional override of ``color.mode`` used with pager.
442 String: optional override of ``color.mode`` used with pager.
437
443
438 On some systems, terminfo mode may cause problems when using
444 On some systems, terminfo mode may cause problems when using
439 color with ``less -R`` as a pager program. less with the -R option
445 color with ``less -R`` as a pager program. less with the -R option
440 will only display ECMA-48 color codes, and terminfo mode may sometimes
446 will only display ECMA-48 color codes, and terminfo mode may sometimes
441 emit codes that less doesn't understand. You can work around this by
447 emit codes that less doesn't understand. You can work around this by
442 either using ansi mode (or auto mode), or by using less -r (which will
448 either using ansi mode (or auto mode), or by using less -r (which will
443 pass through all terminal control codes, not just color control
449 pass through all terminal control codes, not just color control
444 codes).
450 codes).
445
451
446 On some systems (such as MSYS in Windows), the terminal may support
452 On some systems (such as MSYS in Windows), the terminal may support
447 a different color mode than the pager program.
453 a different color mode than the pager program.
448
454
449 ``commands``
455 ``commands``
450 ------------
456 ------------
451
457
452 ``commit.post-status``
458 ``commit.post-status``
453 Show status of files in the working directory after successful commit.
459 Show status of files in the working directory after successful commit.
454 (default: False)
460 (default: False)
455
461
456 ``merge.require-rev``
462 ``merge.require-rev``
457 Require that the revision to merge the current commit with be specified on
463 Require that the revision to merge the current commit with be specified on
458 the command line. If this is enabled and a revision is not specified, the
464 the command line. If this is enabled and a revision is not specified, the
459 command aborts.
465 command aborts.
460 (default: False)
466 (default: False)
461
467
462 ``push.require-revs``
468 ``push.require-revs``
463 Require revisions to push be specified using one or more mechanisms such as
469 Require revisions to push be specified using one or more mechanisms such as
464 specifying them positionally on the command line, using ``-r``, ``-b``,
470 specifying them positionally on the command line, using ``-r``, ``-b``,
465 and/or ``-B`` on the command line, or using ``paths.<path>:pushrev`` in the
471 and/or ``-B`` on the command line, or using ``paths.<path>:pushrev`` in the
466 configuration. If this is enabled and revisions are not specified, the
472 configuration. If this is enabled and revisions are not specified, the
467 command aborts.
473 command aborts.
468 (default: False)
474 (default: False)
469
475
470 ``resolve.confirm``
476 ``resolve.confirm``
471 Confirm before performing action if no filename is passed.
477 Confirm before performing action if no filename is passed.
472 (default: False)
478 (default: False)
473
479
474 ``resolve.explicit-re-merge``
480 ``resolve.explicit-re-merge``
475 Require uses of ``hg resolve`` to specify which action it should perform,
481 Require uses of ``hg resolve`` to specify which action it should perform,
476 instead of re-merging files by default.
482 instead of re-merging files by default.
477 (default: False)
483 (default: False)
478
484
479 ``resolve.mark-check``
485 ``resolve.mark-check``
480 Determines what level of checking :hg:`resolve --mark` will perform before
486 Determines what level of checking :hg:`resolve --mark` will perform before
481 marking files as resolved. Valid values are ``none`, ``warn``, and
487 marking files as resolved. Valid values are ``none`, ``warn``, and
482 ``abort``. ``warn`` will output a warning listing the file(s) that still
488 ``abort``. ``warn`` will output a warning listing the file(s) that still
483 have conflict markers in them, but will still mark everything resolved.
489 have conflict markers in them, but will still mark everything resolved.
484 ``abort`` will output the same warning but will not mark things as resolved.
490 ``abort`` will output the same warning but will not mark things as resolved.
485 If --all is passed and this is set to ``abort``, only a warning will be
491 If --all is passed and this is set to ``abort``, only a warning will be
486 shown (an error will not be raised).
492 shown (an error will not be raised).
487 (default: ``none``)
493 (default: ``none``)
488
494
489 ``status.relative``
495 ``status.relative``
490 Make paths in :hg:`status` output relative to the current directory.
496 Make paths in :hg:`status` output relative to the current directory.
491 (default: False)
497 (default: False)
492
498
493 ``status.terse``
499 ``status.terse``
494 Default value for the --terse flag, which condenses status output.
500 Default value for the --terse flag, which condenses status output.
495 (default: empty)
501 (default: empty)
496
502
497 ``update.check``
503 ``update.check``
498 Determines what level of checking :hg:`update` will perform before moving
504 Determines what level of checking :hg:`update` will perform before moving
499 to a destination revision. Valid values are ``abort``, ``none``,
505 to a destination revision. Valid values are ``abort``, ``none``,
500 ``linear``, and ``noconflict``. ``abort`` always fails if the working
506 ``linear``, and ``noconflict``. ``abort`` always fails if the working
501 directory has uncommitted changes. ``none`` performs no checking, and may
507 directory has uncommitted changes. ``none`` performs no checking, and may
502 result in a merge with uncommitted changes. ``linear`` allows any update
508 result in a merge with uncommitted changes. ``linear`` allows any update
503 as long as it follows a straight line in the revision history, and may
509 as long as it follows a straight line in the revision history, and may
504 trigger a merge with uncommitted changes. ``noconflict`` will allow any
510 trigger a merge with uncommitted changes. ``noconflict`` will allow any
505 update which would not trigger a merge with uncommitted changes, if any
511 update which would not trigger a merge with uncommitted changes, if any
506 are present.
512 are present.
507 (default: ``linear``)
513 (default: ``linear``)
508
514
509 ``update.requiredest``
515 ``update.requiredest``
510 Require that the user pass a destination when running :hg:`update`.
516 Require that the user pass a destination when running :hg:`update`.
511 For example, :hg:`update .::` will be allowed, but a plain :hg:`update`
517 For example, :hg:`update .::` will be allowed, but a plain :hg:`update`
512 will be disallowed.
518 will be disallowed.
513 (default: False)
519 (default: False)
514
520
515 ``committemplate``
521 ``committemplate``
516 ------------------
522 ------------------
517
523
518 ``changeset``
524 ``changeset``
519 String: configuration in this section is used as the template to
525 String: configuration in this section is used as the template to
520 customize the text shown in the editor when committing.
526 customize the text shown in the editor when committing.
521
527
522 In addition to pre-defined template keywords, commit log specific one
528 In addition to pre-defined template keywords, commit log specific one
523 below can be used for customization:
529 below can be used for customization:
524
530
525 ``extramsg``
531 ``extramsg``
526 String: Extra message (typically 'Leave message empty to abort
532 String: Extra message (typically 'Leave message empty to abort
527 commit.'). This may be changed by some commands or extensions.
533 commit.'). This may be changed by some commands or extensions.
528
534
529 For example, the template configuration below shows as same text as
535 For example, the template configuration below shows as same text as
530 one shown by default::
536 one shown by default::
531
537
532 [committemplate]
538 [committemplate]
533 changeset = {desc}\n\n
539 changeset = {desc}\n\n
534 HG: Enter commit message. Lines beginning with 'HG:' are removed.
540 HG: Enter commit message. Lines beginning with 'HG:' are removed.
535 HG: {extramsg}
541 HG: {extramsg}
536 HG: --
542 HG: --
537 HG: user: {author}\n{ifeq(p2rev, "-1", "",
543 HG: user: {author}\n{ifeq(p2rev, "-1", "",
538 "HG: branch merge\n")
544 "HG: branch merge\n")
539 }HG: branch '{branch}'\n{if(activebookmark,
545 }HG: branch '{branch}'\n{if(activebookmark,
540 "HG: bookmark '{activebookmark}'\n") }{subrepos %
546 "HG: bookmark '{activebookmark}'\n") }{subrepos %
541 "HG: subrepo {subrepo}\n" }{file_adds %
547 "HG: subrepo {subrepo}\n" }{file_adds %
542 "HG: added {file}\n" }{file_mods %
548 "HG: added {file}\n" }{file_mods %
543 "HG: changed {file}\n" }{file_dels %
549 "HG: changed {file}\n" }{file_dels %
544 "HG: removed {file}\n" }{if(files, "",
550 "HG: removed {file}\n" }{if(files, "",
545 "HG: no files changed\n")}
551 "HG: no files changed\n")}
546
552
547 ``diff()``
553 ``diff()``
548 String: show the diff (see :hg:`help templates` for detail)
554 String: show the diff (see :hg:`help templates` for detail)
549
555
550 Sometimes it is helpful to show the diff of the changeset in the editor without
556 Sometimes it is helpful to show the diff of the changeset in the editor without
551 having to prefix 'HG: ' to each line so that highlighting works correctly. For
557 having to prefix 'HG: ' to each line so that highlighting works correctly. For
552 this, Mercurial provides a special string which will ignore everything below
558 this, Mercurial provides a special string which will ignore everything below
553 it::
559 it::
554
560
555 HG: ------------------------ >8 ------------------------
561 HG: ------------------------ >8 ------------------------
556
562
557 For example, the template configuration below will show the diff below the
563 For example, the template configuration below will show the diff below the
558 extra message::
564 extra message::
559
565
560 [committemplate]
566 [committemplate]
561 changeset = {desc}\n\n
567 changeset = {desc}\n\n
562 HG: Enter commit message. Lines beginning with 'HG:' are removed.
568 HG: Enter commit message. Lines beginning with 'HG:' are removed.
563 HG: {extramsg}
569 HG: {extramsg}
564 HG: ------------------------ >8 ------------------------
570 HG: ------------------------ >8 ------------------------
565 HG: Do not touch the line above.
571 HG: Do not touch the line above.
566 HG: Everything below will be removed.
572 HG: Everything below will be removed.
567 {diff()}
573 {diff()}
568
574
569 .. note::
575 .. note::
570
576
571 For some problematic encodings (see :hg:`help win32mbcs` for
577 For some problematic encodings (see :hg:`help win32mbcs` for
572 detail), this customization should be configured carefully, to
578 detail), this customization should be configured carefully, to
573 avoid showing broken characters.
579 avoid showing broken characters.
574
580
575 For example, if a multibyte character ending with backslash (0x5c) is
581 For example, if a multibyte character ending with backslash (0x5c) is
576 followed by the ASCII character 'n' in the customized template,
582 followed by the ASCII character 'n' in the customized template,
577 the sequence of backslash and 'n' is treated as line-feed unexpectedly
583 the sequence of backslash and 'n' is treated as line-feed unexpectedly
578 (and the multibyte character is broken, too).
584 (and the multibyte character is broken, too).
579
585
580 Customized template is used for commands below (``--edit`` may be
586 Customized template is used for commands below (``--edit`` may be
581 required):
587 required):
582
588
583 - :hg:`backout`
589 - :hg:`backout`
584 - :hg:`commit`
590 - :hg:`commit`
585 - :hg:`fetch` (for merge commit only)
591 - :hg:`fetch` (for merge commit only)
586 - :hg:`graft`
592 - :hg:`graft`
587 - :hg:`histedit`
593 - :hg:`histedit`
588 - :hg:`import`
594 - :hg:`import`
589 - :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh`
595 - :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh`
590 - :hg:`rebase`
596 - :hg:`rebase`
591 - :hg:`shelve`
597 - :hg:`shelve`
592 - :hg:`sign`
598 - :hg:`sign`
593 - :hg:`tag`
599 - :hg:`tag`
594 - :hg:`transplant`
600 - :hg:`transplant`
595
601
596 Configuring items below instead of ``changeset`` allows showing
602 Configuring items below instead of ``changeset`` allows showing
597 customized message only for specific actions, or showing different
603 customized message only for specific actions, or showing different
598 messages for each action.
604 messages for each action.
599
605
600 - ``changeset.backout`` for :hg:`backout`
606 - ``changeset.backout`` for :hg:`backout`
601 - ``changeset.commit.amend.merge`` for :hg:`commit --amend` on merges
607 - ``changeset.commit.amend.merge`` for :hg:`commit --amend` on merges
602 - ``changeset.commit.amend.normal`` for :hg:`commit --amend` on other
608 - ``changeset.commit.amend.normal`` for :hg:`commit --amend` on other
603 - ``changeset.commit.normal.merge`` for :hg:`commit` on merges
609 - ``changeset.commit.normal.merge`` for :hg:`commit` on merges
604 - ``changeset.commit.normal.normal`` for :hg:`commit` on other
610 - ``changeset.commit.normal.normal`` for :hg:`commit` on other
605 - ``changeset.fetch`` for :hg:`fetch` (impling merge commit)
611 - ``changeset.fetch`` for :hg:`fetch` (impling merge commit)
606 - ``changeset.gpg.sign`` for :hg:`sign`
612 - ``changeset.gpg.sign`` for :hg:`sign`
607 - ``changeset.graft`` for :hg:`graft`
613 - ``changeset.graft`` for :hg:`graft`
608 - ``changeset.histedit.edit`` for ``edit`` of :hg:`histedit`
614 - ``changeset.histedit.edit`` for ``edit`` of :hg:`histedit`
609 - ``changeset.histedit.fold`` for ``fold`` of :hg:`histedit`
615 - ``changeset.histedit.fold`` for ``fold`` of :hg:`histedit`
610 - ``changeset.histedit.mess`` for ``mess`` of :hg:`histedit`
616 - ``changeset.histedit.mess`` for ``mess`` of :hg:`histedit`
611 - ``changeset.histedit.pick`` for ``pick`` of :hg:`histedit`
617 - ``changeset.histedit.pick`` for ``pick`` of :hg:`histedit`
612 - ``changeset.import.bypass`` for :hg:`import --bypass`
618 - ``changeset.import.bypass`` for :hg:`import --bypass`
613 - ``changeset.import.normal.merge`` for :hg:`import` on merges
619 - ``changeset.import.normal.merge`` for :hg:`import` on merges
614 - ``changeset.import.normal.normal`` for :hg:`import` on other
620 - ``changeset.import.normal.normal`` for :hg:`import` on other
615 - ``changeset.mq.qnew`` for :hg:`qnew`
621 - ``changeset.mq.qnew`` for :hg:`qnew`
616 - ``changeset.mq.qfold`` for :hg:`qfold`
622 - ``changeset.mq.qfold`` for :hg:`qfold`
617 - ``changeset.mq.qrefresh`` for :hg:`qrefresh`
623 - ``changeset.mq.qrefresh`` for :hg:`qrefresh`
618 - ``changeset.rebase.collapse`` for :hg:`rebase --collapse`
624 - ``changeset.rebase.collapse`` for :hg:`rebase --collapse`
619 - ``changeset.rebase.merge`` for :hg:`rebase` on merges
625 - ``changeset.rebase.merge`` for :hg:`rebase` on merges
620 - ``changeset.rebase.normal`` for :hg:`rebase` on other
626 - ``changeset.rebase.normal`` for :hg:`rebase` on other
621 - ``changeset.shelve.shelve`` for :hg:`shelve`
627 - ``changeset.shelve.shelve`` for :hg:`shelve`
622 - ``changeset.tag.add`` for :hg:`tag` without ``--remove``
628 - ``changeset.tag.add`` for :hg:`tag` without ``--remove``
623 - ``changeset.tag.remove`` for :hg:`tag --remove`
629 - ``changeset.tag.remove`` for :hg:`tag --remove`
624 - ``changeset.transplant.merge`` for :hg:`transplant` on merges
630 - ``changeset.transplant.merge`` for :hg:`transplant` on merges
625 - ``changeset.transplant.normal`` for :hg:`transplant` on other
631 - ``changeset.transplant.normal`` for :hg:`transplant` on other
626
632
627 These dot-separated lists of names are treated as hierarchical ones.
633 These dot-separated lists of names are treated as hierarchical ones.
628 For example, ``changeset.tag.remove`` customizes the commit message
634 For example, ``changeset.tag.remove`` customizes the commit message
629 only for :hg:`tag --remove`, but ``changeset.tag`` customizes the
635 only for :hg:`tag --remove`, but ``changeset.tag`` customizes the
630 commit message for :hg:`tag` regardless of ``--remove`` option.
636 commit message for :hg:`tag` regardless of ``--remove`` option.
631
637
632 When the external editor is invoked for a commit, the corresponding
638 When the external editor is invoked for a commit, the corresponding
633 dot-separated list of names without the ``changeset.`` prefix
639 dot-separated list of names without the ``changeset.`` prefix
634 (e.g. ``commit.normal.normal``) is in the ``HGEDITFORM`` environment
640 (e.g. ``commit.normal.normal``) is in the ``HGEDITFORM`` environment
635 variable.
641 variable.
636
642
637 In this section, items other than ``changeset`` can be referred from
643 In this section, items other than ``changeset`` can be referred from
638 others. For example, the configuration to list committed files up
644 others. For example, the configuration to list committed files up
639 below can be referred as ``{listupfiles}``::
645 below can be referred as ``{listupfiles}``::
640
646
641 [committemplate]
647 [committemplate]
642 listupfiles = {file_adds %
648 listupfiles = {file_adds %
643 "HG: added {file}\n" }{file_mods %
649 "HG: added {file}\n" }{file_mods %
644 "HG: changed {file}\n" }{file_dels %
650 "HG: changed {file}\n" }{file_dels %
645 "HG: removed {file}\n" }{if(files, "",
651 "HG: removed {file}\n" }{if(files, "",
646 "HG: no files changed\n")}
652 "HG: no files changed\n")}
647
653
648 ``decode/encode``
654 ``decode/encode``
649 -----------------
655 -----------------
650
656
651 Filters for transforming files on checkout/checkin. This would
657 Filters for transforming files on checkout/checkin. This would
652 typically be used for newline processing or other
658 typically be used for newline processing or other
653 localization/canonicalization of files.
659 localization/canonicalization of files.
654
660
655 Filters consist of a filter pattern followed by a filter command.
661 Filters consist of a filter pattern followed by a filter command.
656 Filter patterns are globs by default, rooted at the repository root.
662 Filter patterns are globs by default, rooted at the repository root.
657 For example, to match any file ending in ``.txt`` in the root
663 For example, to match any file ending in ``.txt`` in the root
658 directory only, use the pattern ``*.txt``. To match any file ending
664 directory only, use the pattern ``*.txt``. To match any file ending
659 in ``.c`` anywhere in the repository, use the pattern ``**.c``.
665 in ``.c`` anywhere in the repository, use the pattern ``**.c``.
660 For each file only the first matching filter applies.
666 For each file only the first matching filter applies.
661
667
662 The filter command can start with a specifier, either ``pipe:`` or
668 The filter command can start with a specifier, either ``pipe:`` or
663 ``tempfile:``. If no specifier is given, ``pipe:`` is used by default.
669 ``tempfile:``. If no specifier is given, ``pipe:`` is used by default.
664
670
665 A ``pipe:`` command must accept data on stdin and return the transformed
671 A ``pipe:`` command must accept data on stdin and return the transformed
666 data on stdout.
672 data on stdout.
667
673
668 Pipe example::
674 Pipe example::
669
675
670 [encode]
676 [encode]
671 # uncompress gzip files on checkin to improve delta compression
677 # uncompress gzip files on checkin to improve delta compression
672 # note: not necessarily a good idea, just an example
678 # note: not necessarily a good idea, just an example
673 *.gz = pipe: gunzip
679 *.gz = pipe: gunzip
674
680
675 [decode]
681 [decode]
676 # recompress gzip files when writing them to the working dir (we
682 # recompress gzip files when writing them to the working dir (we
677 # can safely omit "pipe:", because it's the default)
683 # can safely omit "pipe:", because it's the default)
678 *.gz = gzip
684 *.gz = gzip
679
685
680 A ``tempfile:`` command is a template. The string ``INFILE`` is replaced
686 A ``tempfile:`` command is a template. The string ``INFILE`` is replaced
681 with the name of a temporary file that contains the data to be
687 with the name of a temporary file that contains the data to be
682 filtered by the command. The string ``OUTFILE`` is replaced with the name
688 filtered by the command. The string ``OUTFILE`` is replaced with the name
683 of an empty temporary file, where the filtered data must be written by
689 of an empty temporary file, where the filtered data must be written by
684 the command.
690 the command.
685
691
686 .. container:: windows
692 .. container:: windows
687
693
688 .. note::
694 .. note::
689
695
690 The tempfile mechanism is recommended for Windows systems,
696 The tempfile mechanism is recommended for Windows systems,
691 where the standard shell I/O redirection operators often have
697 where the standard shell I/O redirection operators often have
692 strange effects and may corrupt the contents of your files.
698 strange effects and may corrupt the contents of your files.
693
699
694 This filter mechanism is used internally by the ``eol`` extension to
700 This filter mechanism is used internally by the ``eol`` extension to
695 translate line ending characters between Windows (CRLF) and Unix (LF)
701 translate line ending characters between Windows (CRLF) and Unix (LF)
696 format. We suggest you use the ``eol`` extension for convenience.
702 format. We suggest you use the ``eol`` extension for convenience.
697
703
698
704
699 ``defaults``
705 ``defaults``
700 ------------
706 ------------
701
707
702 (defaults are deprecated. Don't use them. Use aliases instead.)
708 (defaults are deprecated. Don't use them. Use aliases instead.)
703
709
704 Use the ``[defaults]`` section to define command defaults, i.e. the
710 Use the ``[defaults]`` section to define command defaults, i.e. the
705 default options/arguments to pass to the specified commands.
711 default options/arguments to pass to the specified commands.
706
712
707 The following example makes :hg:`log` run in verbose mode, and
713 The following example makes :hg:`log` run in verbose mode, and
708 :hg:`status` show only the modified files, by default::
714 :hg:`status` show only the modified files, by default::
709
715
710 [defaults]
716 [defaults]
711 log = -v
717 log = -v
712 status = -m
718 status = -m
713
719
714 The actual commands, instead of their aliases, must be used when
720 The actual commands, instead of their aliases, must be used when
715 defining command defaults. The command defaults will also be applied
721 defining command defaults. The command defaults will also be applied
716 to the aliases of the commands defined.
722 to the aliases of the commands defined.
717
723
718
724
719 ``diff``
725 ``diff``
720 --------
726 --------
721
727
722 Settings used when displaying diffs. Everything except for ``unified``
728 Settings used when displaying diffs. Everything except for ``unified``
723 is a Boolean and defaults to False. See :hg:`help config.annotate`
729 is a Boolean and defaults to False. See :hg:`help config.annotate`
724 for related options for the annotate command.
730 for related options for the annotate command.
725
731
726 ``git``
732 ``git``
727 Use git extended diff format.
733 Use git extended diff format.
728
734
729 ``nobinary``
735 ``nobinary``
730 Omit git binary patches.
736 Omit git binary patches.
731
737
732 ``nodates``
738 ``nodates``
733 Don't include dates in diff headers.
739 Don't include dates in diff headers.
734
740
735 ``noprefix``
741 ``noprefix``
736 Omit 'a/' and 'b/' prefixes from filenames. Ignored in plain mode.
742 Omit 'a/' and 'b/' prefixes from filenames. Ignored in plain mode.
737
743
738 ``showfunc``
744 ``showfunc``
739 Show which function each change is in.
745 Show which function each change is in.
740
746
741 ``ignorews``
747 ``ignorews``
742 Ignore white space when comparing lines.
748 Ignore white space when comparing lines.
743
749
744 ``ignorewsamount``
750 ``ignorewsamount``
745 Ignore changes in the amount of white space.
751 Ignore changes in the amount of white space.
746
752
747 ``ignoreblanklines``
753 ``ignoreblanklines``
748 Ignore changes whose lines are all blank.
754 Ignore changes whose lines are all blank.
749
755
750 ``unified``
756 ``unified``
751 Number of lines of context to show.
757 Number of lines of context to show.
752
758
753 ``word-diff``
759 ``word-diff``
754 Highlight changed words.
760 Highlight changed words.
755
761
756 ``email``
762 ``email``
757 ---------
763 ---------
758
764
759 Settings for extensions that send email messages.
765 Settings for extensions that send email messages.
760
766
761 ``from``
767 ``from``
762 Optional. Email address to use in "From" header and SMTP envelope
768 Optional. Email address to use in "From" header and SMTP envelope
763 of outgoing messages.
769 of outgoing messages.
764
770
765 ``to``
771 ``to``
766 Optional. Comma-separated list of recipients' email addresses.
772 Optional. Comma-separated list of recipients' email addresses.
767
773
768 ``cc``
774 ``cc``
769 Optional. Comma-separated list of carbon copy recipients'
775 Optional. Comma-separated list of carbon copy recipients'
770 email addresses.
776 email addresses.
771
777
772 ``bcc``
778 ``bcc``
773 Optional. Comma-separated list of blind carbon copy recipients'
779 Optional. Comma-separated list of blind carbon copy recipients'
774 email addresses.
780 email addresses.
775
781
776 ``method``
782 ``method``
777 Optional. Method to use to send email messages. If value is ``smtp``
783 Optional. Method to use to send email messages. If value is ``smtp``
778 (default), use SMTP (see the ``[smtp]`` section for configuration).
784 (default), use SMTP (see the ``[smtp]`` section for configuration).
779 Otherwise, use as name of program to run that acts like sendmail
785 Otherwise, use as name of program to run that acts like sendmail
780 (takes ``-f`` option for sender, list of recipients on command line,
786 (takes ``-f`` option for sender, list of recipients on command line,
781 message on stdin). Normally, setting this to ``sendmail`` or
787 message on stdin). Normally, setting this to ``sendmail`` or
782 ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
788 ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
783
789
784 ``charsets``
790 ``charsets``
785 Optional. Comma-separated list of character sets considered
791 Optional. Comma-separated list of character sets considered
786 convenient for recipients. Addresses, headers, and parts not
792 convenient for recipients. Addresses, headers, and parts not
787 containing patches of outgoing messages will be encoded in the
793 containing patches of outgoing messages will be encoded in the
788 first character set to which conversion from local encoding
794 first character set to which conversion from local encoding
789 (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
795 (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
790 conversion fails, the text in question is sent as is.
796 conversion fails, the text in question is sent as is.
791 (default: '')
797 (default: '')
792
798
793 Order of outgoing email character sets:
799 Order of outgoing email character sets:
794
800
795 1. ``us-ascii``: always first, regardless of settings
801 1. ``us-ascii``: always first, regardless of settings
796 2. ``email.charsets``: in order given by user
802 2. ``email.charsets``: in order given by user
797 3. ``ui.fallbackencoding``: if not in email.charsets
803 3. ``ui.fallbackencoding``: if not in email.charsets
798 4. ``$HGENCODING``: if not in email.charsets
804 4. ``$HGENCODING``: if not in email.charsets
799 5. ``utf-8``: always last, regardless of settings
805 5. ``utf-8``: always last, regardless of settings
800
806
801 Email example::
807 Email example::
802
808
803 [email]
809 [email]
804 from = Joseph User <joe.user@example.com>
810 from = Joseph User <joe.user@example.com>
805 method = /usr/sbin/sendmail
811 method = /usr/sbin/sendmail
806 # charsets for western Europeans
812 # charsets for western Europeans
807 # us-ascii, utf-8 omitted, as they are tried first and last
813 # us-ascii, utf-8 omitted, as they are tried first and last
808 charsets = iso-8859-1, iso-8859-15, windows-1252
814 charsets = iso-8859-1, iso-8859-15, windows-1252
809
815
810
816
811 ``extensions``
817 ``extensions``
812 --------------
818 --------------
813
819
814 Mercurial has an extension mechanism for adding new features. To
820 Mercurial has an extension mechanism for adding new features. To
815 enable an extension, create an entry for it in this section.
821 enable an extension, create an entry for it in this section.
816
822
817 If you know that the extension is already in Python's search path,
823 If you know that the extension is already in Python's search path,
818 you can give the name of the module, followed by ``=``, with nothing
824 you can give the name of the module, followed by ``=``, with nothing
819 after the ``=``.
825 after the ``=``.
820
826
821 Otherwise, give a name that you choose, followed by ``=``, followed by
827 Otherwise, give a name that you choose, followed by ``=``, followed by
822 the path to the ``.py`` file (including the file name extension) that
828 the path to the ``.py`` file (including the file name extension) that
823 defines the extension.
829 defines the extension.
824
830
825 To explicitly disable an extension that is enabled in an hgrc of
831 To explicitly disable an extension that is enabled in an hgrc of
826 broader scope, prepend its path with ``!``, as in ``foo = !/ext/path``
832 broader scope, prepend its path with ``!``, as in ``foo = !/ext/path``
827 or ``foo = !`` when path is not supplied.
833 or ``foo = !`` when path is not supplied.
828
834
829 Example for ``~/.hgrc``::
835 Example for ``~/.hgrc``::
830
836
831 [extensions]
837 [extensions]
832 # (the churn extension will get loaded from Mercurial's path)
838 # (the churn extension will get loaded from Mercurial's path)
833 churn =
839 churn =
834 # (this extension will get loaded from the file specified)
840 # (this extension will get loaded from the file specified)
835 myfeature = ~/.hgext/myfeature.py
841 myfeature = ~/.hgext/myfeature.py
836
842
837
843
838 ``format``
844 ``format``
839 ----------
845 ----------
840
846
841 Configuration that controls the repository format. Newer format options are more
847 Configuration that controls the repository format. Newer format options are more
842 powerful, but incompatible with some older versions of Mercurial. Format options
848 powerful, but incompatible with some older versions of Mercurial. Format options
843 are considered at repository initialization only. You need to make a new clone
849 are considered at repository initialization only. You need to make a new clone
844 for config changes to be taken into account.
850 for config changes to be taken into account.
845
851
846 For more details about repository format and version compatibility, see
852 For more details about repository format and version compatibility, see
847 https://www.mercurial-scm.org/wiki/MissingRequirement
853 https://www.mercurial-scm.org/wiki/MissingRequirement
848
854
849 ``usegeneraldelta``
855 ``usegeneraldelta``
850 Enable or disable the "generaldelta" repository format which improves
856 Enable or disable the "generaldelta" repository format which improves
851 repository compression by allowing "revlog" to store deltas against
857 repository compression by allowing "revlog" to store deltas against
852 arbitrary revisions instead of the previously stored one. This provides
858 arbitrary revisions instead of the previously stored one. This provides
853 significant improvement for repositories with branches.
859 significant improvement for repositories with branches.
854
860
855 Repositories with this on-disk format require Mercurial version 1.9.
861 Repositories with this on-disk format require Mercurial version 1.9.
856
862
857 Enabled by default.
863 Enabled by default.
858
864
859 ``dotencode``
865 ``dotencode``
860 Enable or disable the "dotencode" repository format which enhances
866 Enable or disable the "dotencode" repository format which enhances
861 the "fncache" repository format (which has to be enabled to use
867 the "fncache" repository format (which has to be enabled to use
862 dotencode) to avoid issues with filenames starting with "._" on
868 dotencode) to avoid issues with filenames starting with "._" on
863 Mac OS X and spaces on Windows.
869 Mac OS X and spaces on Windows.
864
870
865 Repositories with this on-disk format require Mercurial version 1.7.
871 Repositories with this on-disk format require Mercurial version 1.7.
866
872
867 Enabled by default.
873 Enabled by default.
868
874
869 ``usefncache``
875 ``usefncache``
870 Enable or disable the "fncache" repository format which enhances
876 Enable or disable the "fncache" repository format which enhances
871 the "store" repository format (which has to be enabled to use
877 the "store" repository format (which has to be enabled to use
872 fncache) to allow longer filenames and avoids using Windows
878 fncache) to allow longer filenames and avoids using Windows
873 reserved names, e.g. "nul".
879 reserved names, e.g. "nul".
874
880
875 Repositories with this on-disk format require Mercurial version 1.1.
881 Repositories with this on-disk format require Mercurial version 1.1.
876
882
877 Enabled by default.
883 Enabled by default.
878
884
879 ``usestore``
885 ``usestore``
880 Enable or disable the "store" repository format which improves
886 Enable or disable the "store" repository format which improves
881 compatibility with systems that fold case or otherwise mangle
887 compatibility with systems that fold case or otherwise mangle
882 filenames. Disabling this option will allow you to store longer filenames
888 filenames. Disabling this option will allow you to store longer filenames
883 in some situations at the expense of compatibility.
889 in some situations at the expense of compatibility.
884
890
885 Repositories with this on-disk format require Mercurial version 0.9.4.
891 Repositories with this on-disk format require Mercurial version 0.9.4.
886
892
887 Enabled by default.
893 Enabled by default.
888
894
889 ``sparse-revlog``
895 ``sparse-revlog``
890 Enable or disable the ``sparse-revlog`` delta strategy. This format improves
896 Enable or disable the ``sparse-revlog`` delta strategy. This format improves
891 delta re-use inside revlog. For very branchy repositories, it results in a
897 delta re-use inside revlog. For very branchy repositories, it results in a
892 smaller store. For repositories with many revisions, it also helps
898 smaller store. For repositories with many revisions, it also helps
893 performance (by using shortened delta chains.)
899 performance (by using shortened delta chains.)
894
900
895 Repositories with this on-disk format require Mercurial version 4.7
901 Repositories with this on-disk format require Mercurial version 4.7
896
902
897 Enabled by default.
903 Enabled by default.
898
904
899 ``revlog-compression``
905 ``revlog-compression``
900 Compression algorithm used by revlog. Supported values are `zlib` and
906 Compression algorithm used by revlog. Supported values are `zlib` and
901 `zstd`. The `zlib` engine is the historical default of Mercurial. `zstd` is
907 `zstd`. The `zlib` engine is the historical default of Mercurial. `zstd` is
902 a newer format that is usually a net win over `zlib`, operating faster at
908 a newer format that is usually a net win over `zlib`, operating faster at
903 better compression rates. Use `zstd` to reduce CPU usage. Multiple values
909 better compression rates. Use `zstd` to reduce CPU usage. Multiple values
904 can be specified, the first available one will be used.
910 can be specified, the first available one will be used.
905
911
906 On some systems, the Mercurial installation may lack `zstd` support.
912 On some systems, the Mercurial installation may lack `zstd` support.
907
913
908 Default is `zlib`.
914 Default is `zlib`.
909
915
910 ``bookmarks-in-store``
916 ``bookmarks-in-store``
911 Store bookmarks in .hg/store/. This means that bookmarks are shared when
917 Store bookmarks in .hg/store/. This means that bookmarks are shared when
912 using `hg share` regardless of the `-B` option.
918 using `hg share` regardless of the `-B` option.
913
919
914 Repositories with this on-disk format require Mercurial version 5.1.
920 Repositories with this on-disk format require Mercurial version 5.1.
915
921
916 Disabled by default.
922 Disabled by default.
917
923
918
924
919 ``graph``
925 ``graph``
920 ---------
926 ---------
921
927
922 Web graph view configuration. This section let you change graph
928 Web graph view configuration. This section let you change graph
923 elements display properties by branches, for instance to make the
929 elements display properties by branches, for instance to make the
924 ``default`` branch stand out.
930 ``default`` branch stand out.
925
931
926 Each line has the following format::
932 Each line has the following format::
927
933
928 <branch>.<argument> = <value>
934 <branch>.<argument> = <value>
929
935
930 where ``<branch>`` is the name of the branch being
936 where ``<branch>`` is the name of the branch being
931 customized. Example::
937 customized. Example::
932
938
933 [graph]
939 [graph]
934 # 2px width
940 # 2px width
935 default.width = 2
941 default.width = 2
936 # red color
942 # red color
937 default.color = FF0000
943 default.color = FF0000
938
944
939 Supported arguments:
945 Supported arguments:
940
946
941 ``width``
947 ``width``
942 Set branch edges width in pixels.
948 Set branch edges width in pixels.
943
949
944 ``color``
950 ``color``
945 Set branch edges color in hexadecimal RGB notation.
951 Set branch edges color in hexadecimal RGB notation.
946
952
947 ``hooks``
953 ``hooks``
948 ---------
954 ---------
949
955
950 Commands or Python functions that get automatically executed by
956 Commands or Python functions that get automatically executed by
951 various actions such as starting or finishing a commit. Multiple
957 various actions such as starting or finishing a commit. Multiple
952 hooks can be run for the same action by appending a suffix to the
958 hooks can be run for the same action by appending a suffix to the
953 action. Overriding a site-wide hook can be done by changing its
959 action. Overriding a site-wide hook can be done by changing its
954 value or setting it to an empty string. Hooks can be prioritized
960 value or setting it to an empty string. Hooks can be prioritized
955 by adding a prefix of ``priority.`` to the hook name on a new line
961 by adding a prefix of ``priority.`` to the hook name on a new line
956 and setting the priority. The default priority is 0.
962 and setting the priority. The default priority is 0.
957
963
958 Example ``.hg/hgrc``::
964 Example ``.hg/hgrc``::
959
965
960 [hooks]
966 [hooks]
961 # update working directory after adding changesets
967 # update working directory after adding changesets
962 changegroup.update = hg update
968 changegroup.update = hg update
963 # do not use the site-wide hook
969 # do not use the site-wide hook
964 incoming =
970 incoming =
965 incoming.email = /my/email/hook
971 incoming.email = /my/email/hook
966 incoming.autobuild = /my/build/hook
972 incoming.autobuild = /my/build/hook
967 # force autobuild hook to run before other incoming hooks
973 # force autobuild hook to run before other incoming hooks
968 priority.incoming.autobuild = 1
974 priority.incoming.autobuild = 1
969
975
970 Most hooks are run with environment variables set that give useful
976 Most hooks are run with environment variables set that give useful
971 additional information. For each hook below, the environment variables
977 additional information. For each hook below, the environment variables
972 it is passed are listed with names in the form ``$HG_foo``. The
978 it is passed are listed with names in the form ``$HG_foo``. The
973 ``$HG_HOOKTYPE`` and ``$HG_HOOKNAME`` variables are set for all hooks.
979 ``$HG_HOOKTYPE`` and ``$HG_HOOKNAME`` variables are set for all hooks.
974 They contain the type of hook which triggered the run and the full name
980 They contain the type of hook which triggered the run and the full name
975 of the hook in the config, respectively. In the example above, this will
981 of the hook in the config, respectively. In the example above, this will
976 be ``$HG_HOOKTYPE=incoming`` and ``$HG_HOOKNAME=incoming.email``.
982 be ``$HG_HOOKTYPE=incoming`` and ``$HG_HOOKNAME=incoming.email``.
977
983
978 .. container:: windows
984 .. container:: windows
979
985
980 Some basic Unix syntax can be enabled for portability, including ``$VAR``
986 Some basic Unix syntax can be enabled for portability, including ``$VAR``
981 and ``${VAR}`` style variables. A ``~`` followed by ``\`` or ``/`` will
987 and ``${VAR}`` style variables. A ``~`` followed by ``\`` or ``/`` will
982 be expanded to ``%USERPROFILE%`` to simulate a subset of tilde expansion
988 be expanded to ``%USERPROFILE%`` to simulate a subset of tilde expansion
983 on Unix. To use a literal ``$`` or ``~``, it must be escaped with a back
989 on Unix. To use a literal ``$`` or ``~``, it must be escaped with a back
984 slash or inside of a strong quote. Strong quotes will be replaced by
990 slash or inside of a strong quote. Strong quotes will be replaced by
985 double quotes after processing.
991 double quotes after processing.
986
992
987 This feature is enabled by adding a prefix of ``tonative.`` to the hook
993 This feature is enabled by adding a prefix of ``tonative.`` to the hook
988 name on a new line, and setting it to ``True``. For example::
994 name on a new line, and setting it to ``True``. For example::
989
995
990 [hooks]
996 [hooks]
991 incoming.autobuild = /my/build/hook
997 incoming.autobuild = /my/build/hook
992 # enable translation to cmd.exe syntax for autobuild hook
998 # enable translation to cmd.exe syntax for autobuild hook
993 tonative.incoming.autobuild = True
999 tonative.incoming.autobuild = True
994
1000
995 ``changegroup``
1001 ``changegroup``
996 Run after a changegroup has been added via push, pull or unbundle. The ID of
1002 Run after a changegroup has been added via push, pull or unbundle. The ID of
997 the first new changeset is in ``$HG_NODE`` and last is in ``$HG_NODE_LAST``.
1003 the first new changeset is in ``$HG_NODE`` and last is in ``$HG_NODE_LAST``.
998 The URL from which changes came is in ``$HG_URL``.
1004 The URL from which changes came is in ``$HG_URL``.
999
1005
1000 ``commit``
1006 ``commit``
1001 Run after a changeset has been created in the local repository. The ID
1007 Run after a changeset has been created in the local repository. The ID
1002 of the newly created changeset is in ``$HG_NODE``. Parent changeset
1008 of the newly created changeset is in ``$HG_NODE``. Parent changeset
1003 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1009 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1004
1010
1005 ``incoming``
1011 ``incoming``
1006 Run after a changeset has been pulled, pushed, or unbundled into
1012 Run after a changeset has been pulled, pushed, or unbundled into
1007 the local repository. The ID of the newly arrived changeset is in
1013 the local repository. The ID of the newly arrived changeset is in
1008 ``$HG_NODE``. The URL that was source of the changes is in ``$HG_URL``.
1014 ``$HG_NODE``. The URL that was source of the changes is in ``$HG_URL``.
1009
1015
1010 ``outgoing``
1016 ``outgoing``
1011 Run after sending changes from the local repository to another. The ID of
1017 Run after sending changes from the local repository to another. The ID of
1012 first changeset sent is in ``$HG_NODE``. The source of operation is in
1018 first changeset sent is in ``$HG_NODE``. The source of operation is in
1013 ``$HG_SOURCE``. Also see :hg:`help config.hooks.preoutgoing`.
1019 ``$HG_SOURCE``. Also see :hg:`help config.hooks.preoutgoing`.
1014
1020
1015 ``post-<command>``
1021 ``post-<command>``
1016 Run after successful invocations of the associated command. The
1022 Run after successful invocations of the associated command. The
1017 contents of the command line are passed as ``$HG_ARGS`` and the result
1023 contents of the command line are passed as ``$HG_ARGS`` and the result
1018 code in ``$HG_RESULT``. Parsed command line arguments are passed as
1024 code in ``$HG_RESULT``. Parsed command line arguments are passed as
1019 ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of
1025 ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of
1020 the python data internally passed to <command>. ``$HG_OPTS`` is a
1026 the python data internally passed to <command>. ``$HG_OPTS`` is a
1021 dictionary of options (with unspecified options set to their defaults).
1027 dictionary of options (with unspecified options set to their defaults).
1022 ``$HG_PATS`` is a list of arguments. Hook failure is ignored.
1028 ``$HG_PATS`` is a list of arguments. Hook failure is ignored.
1023
1029
1024 ``fail-<command>``
1030 ``fail-<command>``
1025 Run after a failed invocation of an associated command. The contents
1031 Run after a failed invocation of an associated command. The contents
1026 of the command line are passed as ``$HG_ARGS``. Parsed command line
1032 of the command line are passed as ``$HG_ARGS``. Parsed command line
1027 arguments are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain
1033 arguments are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain
1028 string representations of the python data internally passed to
1034 string representations of the python data internally passed to
1029 <command>. ``$HG_OPTS`` is a dictionary of options (with unspecified
1035 <command>. ``$HG_OPTS`` is a dictionary of options (with unspecified
1030 options set to their defaults). ``$HG_PATS`` is a list of arguments.
1036 options set to their defaults). ``$HG_PATS`` is a list of arguments.
1031 Hook failure is ignored.
1037 Hook failure is ignored.
1032
1038
1033 ``pre-<command>``
1039 ``pre-<command>``
1034 Run before executing the associated command. The contents of the
1040 Run before executing the associated command. The contents of the
1035 command line are passed as ``$HG_ARGS``. Parsed command line arguments
1041 command line are passed as ``$HG_ARGS``. Parsed command line arguments
1036 are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string
1042 are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string
1037 representations of the data internally passed to <command>. ``$HG_OPTS``
1043 representations of the data internally passed to <command>. ``$HG_OPTS``
1038 is a dictionary of options (with unspecified options set to their
1044 is a dictionary of options (with unspecified options set to their
1039 defaults). ``$HG_PATS`` is a list of arguments. If the hook returns
1045 defaults). ``$HG_PATS`` is a list of arguments. If the hook returns
1040 failure, the command doesn't execute and Mercurial returns the failure
1046 failure, the command doesn't execute and Mercurial returns the failure
1041 code.
1047 code.
1042
1048
1043 ``prechangegroup``
1049 ``prechangegroup``
1044 Run before a changegroup is added via push, pull or unbundle. Exit
1050 Run before a changegroup is added via push, pull or unbundle. Exit
1045 status 0 allows the changegroup to proceed. A non-zero status will
1051 status 0 allows the changegroup to proceed. A non-zero status will
1046 cause the push, pull or unbundle to fail. The URL from which changes
1052 cause the push, pull or unbundle to fail. The URL from which changes
1047 will come is in ``$HG_URL``.
1053 will come is in ``$HG_URL``.
1048
1054
1049 ``precommit``
1055 ``precommit``
1050 Run before starting a local commit. Exit status 0 allows the
1056 Run before starting a local commit. Exit status 0 allows the
1051 commit to proceed. A non-zero status will cause the commit to fail.
1057 commit to proceed. A non-zero status will cause the commit to fail.
1052 Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1058 Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1053
1059
1054 ``prelistkeys``
1060 ``prelistkeys``
1055 Run before listing pushkeys (like bookmarks) in the
1061 Run before listing pushkeys (like bookmarks) in the
1056 repository. A non-zero status will cause failure. The key namespace is
1062 repository. A non-zero status will cause failure. The key namespace is
1057 in ``$HG_NAMESPACE``.
1063 in ``$HG_NAMESPACE``.
1058
1064
1059 ``preoutgoing``
1065 ``preoutgoing``
1060 Run before collecting changes to send from the local repository to
1066 Run before collecting changes to send from the local repository to
1061 another. A non-zero status will cause failure. This lets you prevent
1067 another. A non-zero status will cause failure. This lets you prevent
1062 pull over HTTP or SSH. It can also prevent propagating commits (via
1068 pull over HTTP or SSH. It can also prevent propagating commits (via
1063 local pull, push (outbound) or bundle commands), but not completely,
1069 local pull, push (outbound) or bundle commands), but not completely,
1064 since you can just copy files instead. The source of operation is in
1070 since you can just copy files instead. The source of operation is in
1065 ``$HG_SOURCE``. If "serve", the operation is happening on behalf of a remote
1071 ``$HG_SOURCE``. If "serve", the operation is happening on behalf of a remote
1066 SSH or HTTP repository. If "push", "pull" or "bundle", the operation
1072 SSH or HTTP repository. If "push", "pull" or "bundle", the operation
1067 is happening on behalf of a repository on same system.
1073 is happening on behalf of a repository on same system.
1068
1074
1069 ``prepushkey``
1075 ``prepushkey``
1070 Run before a pushkey (like a bookmark) is added to the
1076 Run before a pushkey (like a bookmark) is added to the
1071 repository. A non-zero status will cause the key to be rejected. The
1077 repository. A non-zero status will cause the key to be rejected. The
1072 key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``,
1078 key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``,
1073 the old value (if any) is in ``$HG_OLD``, and the new value is in
1079 the old value (if any) is in ``$HG_OLD``, and the new value is in
1074 ``$HG_NEW``.
1080 ``$HG_NEW``.
1075
1081
1076 ``pretag``
1082 ``pretag``
1077 Run before creating a tag. Exit status 0 allows the tag to be
1083 Run before creating a tag. Exit status 0 allows the tag to be
1078 created. A non-zero status will cause the tag to fail. The ID of the
1084 created. A non-zero status will cause the tag to fail. The ID of the
1079 changeset to tag is in ``$HG_NODE``. The name of tag is in ``$HG_TAG``. The
1085 changeset to tag is in ``$HG_NODE``. The name of tag is in ``$HG_TAG``. The
1080 tag is local if ``$HG_LOCAL=1``, or in the repository if ``$HG_LOCAL=0``.
1086 tag is local if ``$HG_LOCAL=1``, or in the repository if ``$HG_LOCAL=0``.
1081
1087
1082 ``pretxnopen``
1088 ``pretxnopen``
1083 Run before any new repository transaction is open. The reason for the
1089 Run before any new repository transaction is open. The reason for the
1084 transaction will be in ``$HG_TXNNAME``, and a unique identifier for the
1090 transaction will be in ``$HG_TXNNAME``, and a unique identifier for the
1085 transaction will be in ``HG_TXNID``. A non-zero status will prevent the
1091 transaction will be in ``HG_TXNID``. A non-zero status will prevent the
1086 transaction from being opened.
1092 transaction from being opened.
1087
1093
1088 ``pretxnclose``
1094 ``pretxnclose``
1089 Run right before the transaction is actually finalized. Any repository change
1095 Run right before the transaction is actually finalized. Any repository change
1090 will be visible to the hook program. This lets you validate the transaction
1096 will be visible to the hook program. This lets you validate the transaction
1091 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1097 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1092 status will cause the transaction to be rolled back. The reason for the
1098 status will cause the transaction to be rolled back. The reason for the
1093 transaction opening will be in ``$HG_TXNNAME``, and a unique identifier for
1099 transaction opening will be in ``$HG_TXNNAME``, and a unique identifier for
1094 the transaction will be in ``HG_TXNID``. The rest of the available data will
1100 the transaction will be in ``HG_TXNID``. The rest of the available data will
1095 vary according the transaction type. New changesets will add ``$HG_NODE``
1101 vary according the transaction type. New changesets will add ``$HG_NODE``
1096 (the ID of the first added changeset), ``$HG_NODE_LAST`` (the ID of the last
1102 (the ID of the first added changeset), ``$HG_NODE_LAST`` (the ID of the last
1097 added changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables. Bookmark and
1103 added changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables. Bookmark and
1098 phase changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1``
1104 phase changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1``
1099 respectively, etc.
1105 respectively, etc.
1100
1106
1101 ``pretxnclose-bookmark``
1107 ``pretxnclose-bookmark``
1102 Run right before a bookmark change is actually finalized. Any repository
1108 Run right before a bookmark change is actually finalized. Any repository
1103 change will be visible to the hook program. This lets you validate the
1109 change will be visible to the hook program. This lets you validate the
1104 transaction content or change it. Exit status 0 allows the commit to
1110 transaction content or change it. Exit status 0 allows the commit to
1105 proceed. A non-zero status will cause the transaction to be rolled back.
1111 proceed. A non-zero status will cause the transaction to be rolled back.
1106 The name of the bookmark will be available in ``$HG_BOOKMARK``, the new
1112 The name of the bookmark will be available in ``$HG_BOOKMARK``, the new
1107 bookmark location will be available in ``$HG_NODE`` while the previous
1113 bookmark location will be available in ``$HG_NODE`` while the previous
1108 location will be available in ``$HG_OLDNODE``. In case of a bookmark
1114 location will be available in ``$HG_OLDNODE``. In case of a bookmark
1109 creation ``$HG_OLDNODE`` will be empty. In case of deletion ``$HG_NODE``
1115 creation ``$HG_OLDNODE`` will be empty. In case of deletion ``$HG_NODE``
1110 will be empty.
1116 will be empty.
1111 In addition, the reason for the transaction opening will be in
1117 In addition, the reason for the transaction opening will be in
1112 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1118 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1113 ``HG_TXNID``.
1119 ``HG_TXNID``.
1114
1120
1115 ``pretxnclose-phase``
1121 ``pretxnclose-phase``
1116 Run right before a phase change is actually finalized. Any repository change
1122 Run right before a phase change is actually finalized. Any repository change
1117 will be visible to the hook program. This lets you validate the transaction
1123 will be visible to the hook program. This lets you validate the transaction
1118 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1124 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1119 status will cause the transaction to be rolled back. The hook is called
1125 status will cause the transaction to be rolled back. The hook is called
1120 multiple times, once for each revision affected by a phase change.
1126 multiple times, once for each revision affected by a phase change.
1121 The affected node is available in ``$HG_NODE``, the phase in ``$HG_PHASE``
1127 The affected node is available in ``$HG_NODE``, the phase in ``$HG_PHASE``
1122 while the previous ``$HG_OLDPHASE``. In case of new node, ``$HG_OLDPHASE``
1128 while the previous ``$HG_OLDPHASE``. In case of new node, ``$HG_OLDPHASE``
1123 will be empty. In addition, the reason for the transaction opening will be in
1129 will be empty. In addition, the reason for the transaction opening will be in
1124 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1130 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1125 ``HG_TXNID``. The hook is also run for newly added revisions. In this case
1131 ``HG_TXNID``. The hook is also run for newly added revisions. In this case
1126 the ``$HG_OLDPHASE`` entry will be empty.
1132 the ``$HG_OLDPHASE`` entry will be empty.
1127
1133
1128 ``txnclose``
1134 ``txnclose``
1129 Run after any repository transaction has been committed. At this
1135 Run after any repository transaction has been committed. At this
1130 point, the transaction can no longer be rolled back. The hook will run
1136 point, the transaction can no longer be rolled back. The hook will run
1131 after the lock is released. See :hg:`help config.hooks.pretxnclose` for
1137 after the lock is released. See :hg:`help config.hooks.pretxnclose` for
1132 details about available variables.
1138 details about available variables.
1133
1139
1134 ``txnclose-bookmark``
1140 ``txnclose-bookmark``
1135 Run after any bookmark change has been committed. At this point, the
1141 Run after any bookmark change has been committed. At this point, the
1136 transaction can no longer be rolled back. The hook will run after the lock
1142 transaction can no longer be rolled back. The hook will run after the lock
1137 is released. See :hg:`help config.hooks.pretxnclose-bookmark` for details
1143 is released. See :hg:`help config.hooks.pretxnclose-bookmark` for details
1138 about available variables.
1144 about available variables.
1139
1145
1140 ``txnclose-phase``
1146 ``txnclose-phase``
1141 Run after any phase change has been committed. At this point, the
1147 Run after any phase change has been committed. At this point, the
1142 transaction can no longer be rolled back. The hook will run after the lock
1148 transaction can no longer be rolled back. The hook will run after the lock
1143 is released. See :hg:`help config.hooks.pretxnclose-phase` for details about
1149 is released. See :hg:`help config.hooks.pretxnclose-phase` for details about
1144 available variables.
1150 available variables.
1145
1151
1146 ``txnabort``
1152 ``txnabort``
1147 Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose`
1153 Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose`
1148 for details about available variables.
1154 for details about available variables.
1149
1155
1150 ``pretxnchangegroup``
1156 ``pretxnchangegroup``
1151 Run after a changegroup has been added via push, pull or unbundle, but before
1157 Run after a changegroup has been added via push, pull or unbundle, but before
1152 the transaction has been committed. The changegroup is visible to the hook
1158 the transaction has been committed. The changegroup is visible to the hook
1153 program. This allows validation of incoming changes before accepting them.
1159 program. This allows validation of incoming changes before accepting them.
1154 The ID of the first new changeset is in ``$HG_NODE`` and last is in
1160 The ID of the first new changeset is in ``$HG_NODE`` and last is in
1155 ``$HG_NODE_LAST``. Exit status 0 allows the transaction to commit. A non-zero
1161 ``$HG_NODE_LAST``. Exit status 0 allows the transaction to commit. A non-zero
1156 status will cause the transaction to be rolled back, and the push, pull or
1162 status will cause the transaction to be rolled back, and the push, pull or
1157 unbundle will fail. The URL that was the source of changes is in ``$HG_URL``.
1163 unbundle will fail. The URL that was the source of changes is in ``$HG_URL``.
1158
1164
1159 ``pretxncommit``
1165 ``pretxncommit``
1160 Run after a changeset has been created, but before the transaction is
1166 Run after a changeset has been created, but before the transaction is
1161 committed. The changeset is visible to the hook program. This allows
1167 committed. The changeset is visible to the hook program. This allows
1162 validation of the commit message and changes. Exit status 0 allows the
1168 validation of the commit message and changes. Exit status 0 allows the
1163 commit to proceed. A non-zero status will cause the transaction to
1169 commit to proceed. A non-zero status will cause the transaction to
1164 be rolled back. The ID of the new changeset is in ``$HG_NODE``. The parent
1170 be rolled back. The ID of the new changeset is in ``$HG_NODE``. The parent
1165 changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1171 changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1166
1172
1167 ``preupdate``
1173 ``preupdate``
1168 Run before updating the working directory. Exit status 0 allows
1174 Run before updating the working directory. Exit status 0 allows
1169 the update to proceed. A non-zero status will prevent the update.
1175 the update to proceed. A non-zero status will prevent the update.
1170 The changeset ID of first new parent is in ``$HG_PARENT1``. If updating to a
1176 The changeset ID of first new parent is in ``$HG_PARENT1``. If updating to a
1171 merge, the ID of second new parent is in ``$HG_PARENT2``.
1177 merge, the ID of second new parent is in ``$HG_PARENT2``.
1172
1178
1173 ``listkeys``
1179 ``listkeys``
1174 Run after listing pushkeys (like bookmarks) in the repository. The
1180 Run after listing pushkeys (like bookmarks) in the repository. The
1175 key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a
1181 key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a
1176 dictionary containing the keys and values.
1182 dictionary containing the keys and values.
1177
1183
1178 ``pushkey``
1184 ``pushkey``
1179 Run after a pushkey (like a bookmark) is added to the
1185 Run after a pushkey (like a bookmark) is added to the
1180 repository. The key namespace is in ``$HG_NAMESPACE``, the key is in
1186 repository. The key namespace is in ``$HG_NAMESPACE``, the key is in
1181 ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new
1187 ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new
1182 value is in ``$HG_NEW``.
1188 value is in ``$HG_NEW``.
1183
1189
1184 ``tag``
1190 ``tag``
1185 Run after a tag is created. The ID of the tagged changeset is in ``$HG_NODE``.
1191 Run after a tag is created. The ID of the tagged changeset is in ``$HG_NODE``.
1186 The name of tag is in ``$HG_TAG``. The tag is local if ``$HG_LOCAL=1``, or in
1192 The name of tag is in ``$HG_TAG``. The tag is local if ``$HG_LOCAL=1``, or in
1187 the repository if ``$HG_LOCAL=0``.
1193 the repository if ``$HG_LOCAL=0``.
1188
1194
1189 ``update``
1195 ``update``
1190 Run after updating the working directory. The changeset ID of first
1196 Run after updating the working directory. The changeset ID of first
1191 new parent is in ``$HG_PARENT1``. If updating to a merge, the ID of second new
1197 new parent is in ``$HG_PARENT1``. If updating to a merge, the ID of second new
1192 parent is in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
1198 parent is in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
1193 update failed (e.g. because conflicts were not resolved), ``$HG_ERROR=1``.
1199 update failed (e.g. because conflicts were not resolved), ``$HG_ERROR=1``.
1194
1200
1195 .. note::
1201 .. note::
1196
1202
1197 It is generally better to use standard hooks rather than the
1203 It is generally better to use standard hooks rather than the
1198 generic pre- and post- command hooks, as they are guaranteed to be
1204 generic pre- and post- command hooks, as they are guaranteed to be
1199 called in the appropriate contexts for influencing transactions.
1205 called in the appropriate contexts for influencing transactions.
1200 Also, hooks like "commit" will be called in all contexts that
1206 Also, hooks like "commit" will be called in all contexts that
1201 generate a commit (e.g. tag) and not just the commit command.
1207 generate a commit (e.g. tag) and not just the commit command.
1202
1208
1203 .. note::
1209 .. note::
1204
1210
1205 Environment variables with empty values may not be passed to
1211 Environment variables with empty values may not be passed to
1206 hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
1212 hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
1207 will have an empty value under Unix-like platforms for non-merge
1213 will have an empty value under Unix-like platforms for non-merge
1208 changesets, while it will not be available at all under Windows.
1214 changesets, while it will not be available at all under Windows.
1209
1215
1210 The syntax for Python hooks is as follows::
1216 The syntax for Python hooks is as follows::
1211
1217
1212 hookname = python:modulename.submodule.callable
1218 hookname = python:modulename.submodule.callable
1213 hookname = python:/path/to/python/module.py:callable
1219 hookname = python:/path/to/python/module.py:callable
1214
1220
1215 Python hooks are run within the Mercurial process. Each hook is
1221 Python hooks are run within the Mercurial process. Each hook is
1216 called with at least three keyword arguments: a ui object (keyword
1222 called with at least three keyword arguments: a ui object (keyword
1217 ``ui``), a repository object (keyword ``repo``), and a ``hooktype``
1223 ``ui``), a repository object (keyword ``repo``), and a ``hooktype``
1218 keyword that tells what kind of hook is used. Arguments listed as
1224 keyword that tells what kind of hook is used. Arguments listed as
1219 environment variables above are passed as keyword arguments, with no
1225 environment variables above are passed as keyword arguments, with no
1220 ``HG_`` prefix, and names in lower case.
1226 ``HG_`` prefix, and names in lower case.
1221
1227
1222 If a Python hook returns a "true" value or raises an exception, this
1228 If a Python hook returns a "true" value or raises an exception, this
1223 is treated as a failure.
1229 is treated as a failure.
1224
1230
1225
1231
1226 ``hostfingerprints``
1232 ``hostfingerprints``
1227 --------------------
1233 --------------------
1228
1234
1229 (Deprecated. Use ``[hostsecurity]``'s ``fingerprints`` options instead.)
1235 (Deprecated. Use ``[hostsecurity]``'s ``fingerprints`` options instead.)
1230
1236
1231 Fingerprints of the certificates of known HTTPS servers.
1237 Fingerprints of the certificates of known HTTPS servers.
1232
1238
1233 A HTTPS connection to a server with a fingerprint configured here will
1239 A HTTPS connection to a server with a fingerprint configured here will
1234 only succeed if the servers certificate matches the fingerprint.
1240 only succeed if the servers certificate matches the fingerprint.
1235 This is very similar to how ssh known hosts works.
1241 This is very similar to how ssh known hosts works.
1236
1242
1237 The fingerprint is the SHA-1 hash value of the DER encoded certificate.
1243 The fingerprint is the SHA-1 hash value of the DER encoded certificate.
1238 Multiple values can be specified (separated by spaces or commas). This can
1244 Multiple values can be specified (separated by spaces or commas). This can
1239 be used to define both old and new fingerprints while a host transitions
1245 be used to define both old and new fingerprints while a host transitions
1240 to a new certificate.
1246 to a new certificate.
1241
1247
1242 The CA chain and web.cacerts is not used for servers with a fingerprint.
1248 The CA chain and web.cacerts is not used for servers with a fingerprint.
1243
1249
1244 For example::
1250 For example::
1245
1251
1246 [hostfingerprints]
1252 [hostfingerprints]
1247 hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1253 hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1248 hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1254 hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1249
1255
1250 ``hostsecurity``
1256 ``hostsecurity``
1251 ----------------
1257 ----------------
1252
1258
1253 Used to specify global and per-host security settings for connecting to
1259 Used to specify global and per-host security settings for connecting to
1254 other machines.
1260 other machines.
1255
1261
1256 The following options control default behavior for all hosts.
1262 The following options control default behavior for all hosts.
1257
1263
1258 ``ciphers``
1264 ``ciphers``
1259 Defines the cryptographic ciphers to use for connections.
1265 Defines the cryptographic ciphers to use for connections.
1260
1266
1261 Value must be a valid OpenSSL Cipher List Format as documented at
1267 Value must be a valid OpenSSL Cipher List Format as documented at
1262 https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT.
1268 https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT.
1263
1269
1264 This setting is for advanced users only. Setting to incorrect values
1270 This setting is for advanced users only. Setting to incorrect values
1265 can significantly lower connection security or decrease performance.
1271 can significantly lower connection security or decrease performance.
1266 You have been warned.
1272 You have been warned.
1267
1273
1268 This option requires Python 2.7.
1274 This option requires Python 2.7.
1269
1275
1270 ``minimumprotocol``
1276 ``minimumprotocol``
1271 Defines the minimum channel encryption protocol to use.
1277 Defines the minimum channel encryption protocol to use.
1272
1278
1273 By default, the highest version of TLS supported by both client and server
1279 By default, the highest version of TLS supported by both client and server
1274 is used.
1280 is used.
1275
1281
1276 Allowed values are: ``tls1.0``, ``tls1.1``, ``tls1.2``.
1282 Allowed values are: ``tls1.0``, ``tls1.1``, ``tls1.2``.
1277
1283
1278 When running on an old Python version, only ``tls1.0`` is allowed since
1284 When running on an old Python version, only ``tls1.0`` is allowed since
1279 old versions of Python only support up to TLS 1.0.
1285 old versions of Python only support up to TLS 1.0.
1280
1286
1281 When running a Python that supports modern TLS versions, the default is
1287 When running a Python that supports modern TLS versions, the default is
1282 ``tls1.1``. ``tls1.0`` can still be used to allow TLS 1.0. However, this
1288 ``tls1.1``. ``tls1.0`` can still be used to allow TLS 1.0. However, this
1283 weakens security and should only be used as a feature of last resort if
1289 weakens security and should only be used as a feature of last resort if
1284 a server does not support TLS 1.1+.
1290 a server does not support TLS 1.1+.
1285
1291
1286 Options in the ``[hostsecurity]`` section can have the form
1292 Options in the ``[hostsecurity]`` section can have the form
1287 ``hostname``:``setting``. This allows multiple settings to be defined on a
1293 ``hostname``:``setting``. This allows multiple settings to be defined on a
1288 per-host basis.
1294 per-host basis.
1289
1295
1290 The following per-host settings can be defined.
1296 The following per-host settings can be defined.
1291
1297
1292 ``ciphers``
1298 ``ciphers``
1293 This behaves like ``ciphers`` as described above except it only applies
1299 This behaves like ``ciphers`` as described above except it only applies
1294 to the host on which it is defined.
1300 to the host on which it is defined.
1295
1301
1296 ``fingerprints``
1302 ``fingerprints``
1297 A list of hashes of the DER encoded peer/remote certificate. Values have
1303 A list of hashes of the DER encoded peer/remote certificate. Values have
1298 the form ``algorithm``:``fingerprint``. e.g.
1304 the form ``algorithm``:``fingerprint``. e.g.
1299 ``sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2``.
1305 ``sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2``.
1300 In addition, colons (``:``) can appear in the fingerprint part.
1306 In addition, colons (``:``) can appear in the fingerprint part.
1301
1307
1302 The following algorithms/prefixes are supported: ``sha1``, ``sha256``,
1308 The following algorithms/prefixes are supported: ``sha1``, ``sha256``,
1303 ``sha512``.
1309 ``sha512``.
1304
1310
1305 Use of ``sha256`` or ``sha512`` is preferred.
1311 Use of ``sha256`` or ``sha512`` is preferred.
1306
1312
1307 If a fingerprint is specified, the CA chain is not validated for this
1313 If a fingerprint is specified, the CA chain is not validated for this
1308 host and Mercurial will require the remote certificate to match one
1314 host and Mercurial will require the remote certificate to match one
1309 of the fingerprints specified. This means if the server updates its
1315 of the fingerprints specified. This means if the server updates its
1310 certificate, Mercurial will abort until a new fingerprint is defined.
1316 certificate, Mercurial will abort until a new fingerprint is defined.
1311 This can provide stronger security than traditional CA-based validation
1317 This can provide stronger security than traditional CA-based validation
1312 at the expense of convenience.
1318 at the expense of convenience.
1313
1319
1314 This option takes precedence over ``verifycertsfile``.
1320 This option takes precedence over ``verifycertsfile``.
1315
1321
1316 ``minimumprotocol``
1322 ``minimumprotocol``
1317 This behaves like ``minimumprotocol`` as described above except it
1323 This behaves like ``minimumprotocol`` as described above except it
1318 only applies to the host on which it is defined.
1324 only applies to the host on which it is defined.
1319
1325
1320 ``verifycertsfile``
1326 ``verifycertsfile``
1321 Path to file a containing a list of PEM encoded certificates used to
1327 Path to file a containing a list of PEM encoded certificates used to
1322 verify the server certificate. Environment variables and ``~user``
1328 verify the server certificate. Environment variables and ``~user``
1323 constructs are expanded in the filename.
1329 constructs are expanded in the filename.
1324
1330
1325 The server certificate or the certificate's certificate authority (CA)
1331 The server certificate or the certificate's certificate authority (CA)
1326 must match a certificate from this file or certificate verification
1332 must match a certificate from this file or certificate verification
1327 will fail and connections to the server will be refused.
1333 will fail and connections to the server will be refused.
1328
1334
1329 If defined, only certificates provided by this file will be used:
1335 If defined, only certificates provided by this file will be used:
1330 ``web.cacerts`` and any system/default certificates will not be
1336 ``web.cacerts`` and any system/default certificates will not be
1331 used.
1337 used.
1332
1338
1333 This option has no effect if the per-host ``fingerprints`` option
1339 This option has no effect if the per-host ``fingerprints`` option
1334 is set.
1340 is set.
1335
1341
1336 The format of the file is as follows::
1342 The format of the file is as follows::
1337
1343
1338 -----BEGIN CERTIFICATE-----
1344 -----BEGIN CERTIFICATE-----
1339 ... (certificate in base64 PEM encoding) ...
1345 ... (certificate in base64 PEM encoding) ...
1340 -----END CERTIFICATE-----
1346 -----END CERTIFICATE-----
1341 -----BEGIN CERTIFICATE-----
1347 -----BEGIN CERTIFICATE-----
1342 ... (certificate in base64 PEM encoding) ...
1348 ... (certificate in base64 PEM encoding) ...
1343 -----END CERTIFICATE-----
1349 -----END CERTIFICATE-----
1344
1350
1345 For example::
1351 For example::
1346
1352
1347 [hostsecurity]
1353 [hostsecurity]
1348 hg.example.com:fingerprints = sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
1354 hg.example.com:fingerprints = sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
1349 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
1355 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
1350 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
1356 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
1351 foo.example.com:verifycertsfile = /etc/ssl/trusted-ca-certs.pem
1357 foo.example.com:verifycertsfile = /etc/ssl/trusted-ca-certs.pem
1352
1358
1353 To change the default minimum protocol version to TLS 1.2 but to allow TLS 1.1
1359 To change the default minimum protocol version to TLS 1.2 but to allow TLS 1.1
1354 when connecting to ``hg.example.com``::
1360 when connecting to ``hg.example.com``::
1355
1361
1356 [hostsecurity]
1362 [hostsecurity]
1357 minimumprotocol = tls1.2
1363 minimumprotocol = tls1.2
1358 hg.example.com:minimumprotocol = tls1.1
1364 hg.example.com:minimumprotocol = tls1.1
1359
1365
1360 ``http_proxy``
1366 ``http_proxy``
1361 --------------
1367 --------------
1362
1368
1363 Used to access web-based Mercurial repositories through a HTTP
1369 Used to access web-based Mercurial repositories through a HTTP
1364 proxy.
1370 proxy.
1365
1371
1366 ``host``
1372 ``host``
1367 Host name and (optional) port of the proxy server, for example
1373 Host name and (optional) port of the proxy server, for example
1368 "myproxy:8000".
1374 "myproxy:8000".
1369
1375
1370 ``no``
1376 ``no``
1371 Optional. Comma-separated list of host names that should bypass
1377 Optional. Comma-separated list of host names that should bypass
1372 the proxy.
1378 the proxy.
1373
1379
1374 ``passwd``
1380 ``passwd``
1375 Optional. Password to authenticate with at the proxy server.
1381 Optional. Password to authenticate with at the proxy server.
1376
1382
1377 ``user``
1383 ``user``
1378 Optional. User name to authenticate with at the proxy server.
1384 Optional. User name to authenticate with at the proxy server.
1379
1385
1380 ``always``
1386 ``always``
1381 Optional. Always use the proxy, even for localhost and any entries
1387 Optional. Always use the proxy, even for localhost and any entries
1382 in ``http_proxy.no``. (default: False)
1388 in ``http_proxy.no``. (default: False)
1383
1389
1384 ``http``
1390 ``http``
1385 ----------
1391 ----------
1386
1392
1387 Used to configure access to Mercurial repositories via HTTP.
1393 Used to configure access to Mercurial repositories via HTTP.
1388
1394
1389 ``timeout``
1395 ``timeout``
1390 If set, blocking operations will timeout after that many seconds.
1396 If set, blocking operations will timeout after that many seconds.
1391 (default: None)
1397 (default: None)
1392
1398
1393 ``merge``
1399 ``merge``
1394 ---------
1400 ---------
1395
1401
1396 This section specifies behavior during merges and updates.
1402 This section specifies behavior during merges and updates.
1397
1403
1398 ``checkignored``
1404 ``checkignored``
1399 Controls behavior when an ignored file on disk has the same name as a tracked
1405 Controls behavior when an ignored file on disk has the same name as a tracked
1400 file in the changeset being merged or updated to, and has different
1406 file in the changeset being merged or updated to, and has different
1401 contents. Options are ``abort``, ``warn`` and ``ignore``. With ``abort``,
1407 contents. Options are ``abort``, ``warn`` and ``ignore``. With ``abort``,
1402 abort on such files. With ``warn``, warn on such files and back them up as
1408 abort on such files. With ``warn``, warn on such files and back them up as
1403 ``.orig``. With ``ignore``, don't print a warning and back them up as
1409 ``.orig``. With ``ignore``, don't print a warning and back them up as
1404 ``.orig``. (default: ``abort``)
1410 ``.orig``. (default: ``abort``)
1405
1411
1406 ``checkunknown``
1412 ``checkunknown``
1407 Controls behavior when an unknown file that isn't ignored has the same name
1413 Controls behavior when an unknown file that isn't ignored has the same name
1408 as a tracked file in the changeset being merged or updated to, and has
1414 as a tracked file in the changeset being merged or updated to, and has
1409 different contents. Similar to ``merge.checkignored``, except for files that
1415 different contents. Similar to ``merge.checkignored``, except for files that
1410 are not ignored. (default: ``abort``)
1416 are not ignored. (default: ``abort``)
1411
1417
1412 ``on-failure``
1418 ``on-failure``
1413 When set to ``continue`` (the default), the merge process attempts to
1419 When set to ``continue`` (the default), the merge process attempts to
1414 merge all unresolved files using the merge chosen tool, regardless of
1420 merge all unresolved files using the merge chosen tool, regardless of
1415 whether previous file merge attempts during the process succeeded or not.
1421 whether previous file merge attempts during the process succeeded or not.
1416 Setting this to ``prompt`` will prompt after any merge failure continue
1422 Setting this to ``prompt`` will prompt after any merge failure continue
1417 or halt the merge process. Setting this to ``halt`` will automatically
1423 or halt the merge process. Setting this to ``halt`` will automatically
1418 halt the merge process on any merge tool failure. The merge process
1424 halt the merge process on any merge tool failure. The merge process
1419 can be restarted by using the ``resolve`` command. When a merge is
1425 can be restarted by using the ``resolve`` command. When a merge is
1420 halted, the repository is left in a normal ``unresolved`` merge state.
1426 halted, the repository is left in a normal ``unresolved`` merge state.
1421 (default: ``continue``)
1427 (default: ``continue``)
1422
1428
1423 ``strict-capability-check``
1429 ``strict-capability-check``
1424 Whether capabilities of internal merge tools are checked strictly
1430 Whether capabilities of internal merge tools are checked strictly
1425 or not, while examining rules to decide merge tool to be used.
1431 or not, while examining rules to decide merge tool to be used.
1426 (default: False)
1432 (default: False)
1427
1433
1428 ``merge-patterns``
1434 ``merge-patterns``
1429 ------------------
1435 ------------------
1430
1436
1431 This section specifies merge tools to associate with particular file
1437 This section specifies merge tools to associate with particular file
1432 patterns. Tools matched here will take precedence over the default
1438 patterns. Tools matched here will take precedence over the default
1433 merge tool. Patterns are globs by default, rooted at the repository
1439 merge tool. Patterns are globs by default, rooted at the repository
1434 root.
1440 root.
1435
1441
1436 Example::
1442 Example::
1437
1443
1438 [merge-patterns]
1444 [merge-patterns]
1439 **.c = kdiff3
1445 **.c = kdiff3
1440 **.jpg = myimgmerge
1446 **.jpg = myimgmerge
1441
1447
1442 ``merge-tools``
1448 ``merge-tools``
1443 ---------------
1449 ---------------
1444
1450
1445 This section configures external merge tools to use for file-level
1451 This section configures external merge tools to use for file-level
1446 merges. This section has likely been preconfigured at install time.
1452 merges. This section has likely been preconfigured at install time.
1447 Use :hg:`config merge-tools` to check the existing configuration.
1453 Use :hg:`config merge-tools` to check the existing configuration.
1448 Also see :hg:`help merge-tools` for more details.
1454 Also see :hg:`help merge-tools` for more details.
1449
1455
1450 Example ``~/.hgrc``::
1456 Example ``~/.hgrc``::
1451
1457
1452 [merge-tools]
1458 [merge-tools]
1453 # Override stock tool location
1459 # Override stock tool location
1454 kdiff3.executable = ~/bin/kdiff3
1460 kdiff3.executable = ~/bin/kdiff3
1455 # Specify command line
1461 # Specify command line
1456 kdiff3.args = $base $local $other -o $output
1462 kdiff3.args = $base $local $other -o $output
1457 # Give higher priority
1463 # Give higher priority
1458 kdiff3.priority = 1
1464 kdiff3.priority = 1
1459
1465
1460 # Changing the priority of preconfigured tool
1466 # Changing the priority of preconfigured tool
1461 meld.priority = 0
1467 meld.priority = 0
1462
1468
1463 # Disable a preconfigured tool
1469 # Disable a preconfigured tool
1464 vimdiff.disabled = yes
1470 vimdiff.disabled = yes
1465
1471
1466 # Define new tool
1472 # Define new tool
1467 myHtmlTool.args = -m $local $other $base $output
1473 myHtmlTool.args = -m $local $other $base $output
1468 myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
1474 myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
1469 myHtmlTool.priority = 1
1475 myHtmlTool.priority = 1
1470
1476
1471 Supported arguments:
1477 Supported arguments:
1472
1478
1473 ``priority``
1479 ``priority``
1474 The priority in which to evaluate this tool.
1480 The priority in which to evaluate this tool.
1475 (default: 0)
1481 (default: 0)
1476
1482
1477 ``executable``
1483 ``executable``
1478 Either just the name of the executable or its pathname.
1484 Either just the name of the executable or its pathname.
1479
1485
1480 .. container:: windows
1486 .. container:: windows
1481
1487
1482 On Windows, the path can use environment variables with ${ProgramFiles}
1488 On Windows, the path can use environment variables with ${ProgramFiles}
1483 syntax.
1489 syntax.
1484
1490
1485 (default: the tool name)
1491 (default: the tool name)
1486
1492
1487 ``args``
1493 ``args``
1488 The arguments to pass to the tool executable. You can refer to the
1494 The arguments to pass to the tool executable. You can refer to the
1489 files being merged as well as the output file through these
1495 files being merged as well as the output file through these
1490 variables: ``$base``, ``$local``, ``$other``, ``$output``.
1496 variables: ``$base``, ``$local``, ``$other``, ``$output``.
1491
1497
1492 The meaning of ``$local`` and ``$other`` can vary depending on which action is
1498 The meaning of ``$local`` and ``$other`` can vary depending on which action is
1493 being performed. During an update or merge, ``$local`` represents the original
1499 being performed. During an update or merge, ``$local`` represents the original
1494 state of the file, while ``$other`` represents the commit you are updating to or
1500 state of the file, while ``$other`` represents the commit you are updating to or
1495 the commit you are merging with. During a rebase, ``$local`` represents the
1501 the commit you are merging with. During a rebase, ``$local`` represents the
1496 destination of the rebase, and ``$other`` represents the commit being rebased.
1502 destination of the rebase, and ``$other`` represents the commit being rebased.
1497
1503
1498 Some operations define custom labels to assist with identifying the revisions,
1504 Some operations define custom labels to assist with identifying the revisions,
1499 accessible via ``$labellocal``, ``$labelother``, and ``$labelbase``. If custom
1505 accessible via ``$labellocal``, ``$labelother``, and ``$labelbase``. If custom
1500 labels are not available, these will be ``local``, ``other``, and ``base``,
1506 labels are not available, these will be ``local``, ``other``, and ``base``,
1501 respectively.
1507 respectively.
1502 (default: ``$local $base $other``)
1508 (default: ``$local $base $other``)
1503
1509
1504 ``premerge``
1510 ``premerge``
1505 Attempt to run internal non-interactive 3-way merge tool before
1511 Attempt to run internal non-interactive 3-way merge tool before
1506 launching external tool. Options are ``true``, ``false``, ``keep`` or
1512 launching external tool. Options are ``true``, ``false``, ``keep`` or
1507 ``keep-merge3``. The ``keep`` option will leave markers in the file if the
1513 ``keep-merge3``. The ``keep`` option will leave markers in the file if the
1508 premerge fails. The ``keep-merge3`` will do the same but include information
1514 premerge fails. The ``keep-merge3`` will do the same but include information
1509 about the base of the merge in the marker (see internal :merge3 in
1515 about the base of the merge in the marker (see internal :merge3 in
1510 :hg:`help merge-tools`).
1516 :hg:`help merge-tools`).
1511 (default: True)
1517 (default: True)
1512
1518
1513 ``binary``
1519 ``binary``
1514 This tool can merge binary files. (default: False, unless tool
1520 This tool can merge binary files. (default: False, unless tool
1515 was selected by file pattern match)
1521 was selected by file pattern match)
1516
1522
1517 ``symlink``
1523 ``symlink``
1518 This tool can merge symlinks. (default: False)
1524 This tool can merge symlinks. (default: False)
1519
1525
1520 ``check``
1526 ``check``
1521 A list of merge success-checking options:
1527 A list of merge success-checking options:
1522
1528
1523 ``changed``
1529 ``changed``
1524 Ask whether merge was successful when the merged file shows no changes.
1530 Ask whether merge was successful when the merged file shows no changes.
1525 ``conflicts``
1531 ``conflicts``
1526 Check whether there are conflicts even though the tool reported success.
1532 Check whether there are conflicts even though the tool reported success.
1527 ``prompt``
1533 ``prompt``
1528 Always prompt for merge success, regardless of success reported by tool.
1534 Always prompt for merge success, regardless of success reported by tool.
1529
1535
1530 ``fixeol``
1536 ``fixeol``
1531 Attempt to fix up EOL changes caused by the merge tool.
1537 Attempt to fix up EOL changes caused by the merge tool.
1532 (default: False)
1538 (default: False)
1533
1539
1534 ``gui``
1540 ``gui``
1535 This tool requires a graphical interface to run. (default: False)
1541 This tool requires a graphical interface to run. (default: False)
1536
1542
1537 ``mergemarkers``
1543 ``mergemarkers``
1538 Controls whether the labels passed via ``$labellocal``, ``$labelother``, and
1544 Controls whether the labels passed via ``$labellocal``, ``$labelother``, and
1539 ``$labelbase`` are ``detailed`` (respecting ``mergemarkertemplate``) or
1545 ``$labelbase`` are ``detailed`` (respecting ``mergemarkertemplate``) or
1540 ``basic``. If ``premerge`` is ``keep`` or ``keep-merge3``, the conflict
1546 ``basic``. If ``premerge`` is ``keep`` or ``keep-merge3``, the conflict
1541 markers generated during premerge will be ``detailed`` if either this option or
1547 markers generated during premerge will be ``detailed`` if either this option or
1542 the corresponding option in the ``[ui]`` section is ``detailed``.
1548 the corresponding option in the ``[ui]`` section is ``detailed``.
1543 (default: ``basic``)
1549 (default: ``basic``)
1544
1550
1545 ``mergemarkertemplate``
1551 ``mergemarkertemplate``
1546 This setting can be used to override ``mergemarkertemplate`` from the ``[ui]``
1552 This setting can be used to override ``mergemarkertemplate`` from the ``[ui]``
1547 section on a per-tool basis; this applies to the ``$label``-prefixed variables
1553 section on a per-tool basis; this applies to the ``$label``-prefixed variables
1548 and to the conflict markers that are generated if ``premerge`` is ``keep` or
1554 and to the conflict markers that are generated if ``premerge`` is ``keep` or
1549 ``keep-merge3``. See the corresponding variable in ``[ui]`` for more
1555 ``keep-merge3``. See the corresponding variable in ``[ui]`` for more
1550 information.
1556 information.
1551
1557
1552 .. container:: windows
1558 .. container:: windows
1553
1559
1554 ``regkey``
1560 ``regkey``
1555 Windows registry key which describes install location of this
1561 Windows registry key which describes install location of this
1556 tool. Mercurial will search for this key first under
1562 tool. Mercurial will search for this key first under
1557 ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
1563 ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
1558 (default: None)
1564 (default: None)
1559
1565
1560 ``regkeyalt``
1566 ``regkeyalt``
1561 An alternate Windows registry key to try if the first key is not
1567 An alternate Windows registry key to try if the first key is not
1562 found. The alternate key uses the same ``regname`` and ``regappend``
1568 found. The alternate key uses the same ``regname`` and ``regappend``
1563 semantics of the primary key. The most common use for this key
1569 semantics of the primary key. The most common use for this key
1564 is to search for 32bit applications on 64bit operating systems.
1570 is to search for 32bit applications on 64bit operating systems.
1565 (default: None)
1571 (default: None)
1566
1572
1567 ``regname``
1573 ``regname``
1568 Name of value to read from specified registry key.
1574 Name of value to read from specified registry key.
1569 (default: the unnamed (default) value)
1575 (default: the unnamed (default) value)
1570
1576
1571 ``regappend``
1577 ``regappend``
1572 String to append to the value read from the registry, typically
1578 String to append to the value read from the registry, typically
1573 the executable name of the tool.
1579 the executable name of the tool.
1574 (default: None)
1580 (default: None)
1575
1581
1576 ``pager``
1582 ``pager``
1577 ---------
1583 ---------
1578
1584
1579 Setting used to control when to paginate and with what external tool. See
1585 Setting used to control when to paginate and with what external tool. See
1580 :hg:`help pager` for details.
1586 :hg:`help pager` for details.
1581
1587
1582 ``pager``
1588 ``pager``
1583 Define the external tool used as pager.
1589 Define the external tool used as pager.
1584
1590
1585 If no pager is set, Mercurial uses the environment variable $PAGER.
1591 If no pager is set, Mercurial uses the environment variable $PAGER.
1586 If neither pager.pager, nor $PAGER is set, a default pager will be
1592 If neither pager.pager, nor $PAGER is set, a default pager will be
1587 used, typically `less` on Unix and `more` on Windows. Example::
1593 used, typically `less` on Unix and `more` on Windows. Example::
1588
1594
1589 [pager]
1595 [pager]
1590 pager = less -FRX
1596 pager = less -FRX
1591
1597
1592 ``ignore``
1598 ``ignore``
1593 List of commands to disable the pager for. Example::
1599 List of commands to disable the pager for. Example::
1594
1600
1595 [pager]
1601 [pager]
1596 ignore = version, help, update
1602 ignore = version, help, update
1597
1603
1598 ``patch``
1604 ``patch``
1599 ---------
1605 ---------
1600
1606
1601 Settings used when applying patches, for instance through the 'import'
1607 Settings used when applying patches, for instance through the 'import'
1602 command or with Mercurial Queues extension.
1608 command or with Mercurial Queues extension.
1603
1609
1604 ``eol``
1610 ``eol``
1605 When set to 'strict' patch content and patched files end of lines
1611 When set to 'strict' patch content and patched files end of lines
1606 are preserved. When set to ``lf`` or ``crlf``, both files end of
1612 are preserved. When set to ``lf`` or ``crlf``, both files end of
1607 lines are ignored when patching and the result line endings are
1613 lines are ignored when patching and the result line endings are
1608 normalized to either LF (Unix) or CRLF (Windows). When set to
1614 normalized to either LF (Unix) or CRLF (Windows). When set to
1609 ``auto``, end of lines are again ignored while patching but line
1615 ``auto``, end of lines are again ignored while patching but line
1610 endings in patched files are normalized to their original setting
1616 endings in patched files are normalized to their original setting
1611 on a per-file basis. If target file does not exist or has no end
1617 on a per-file basis. If target file does not exist or has no end
1612 of line, patch line endings are preserved.
1618 of line, patch line endings are preserved.
1613 (default: strict)
1619 (default: strict)
1614
1620
1615 ``fuzz``
1621 ``fuzz``
1616 The number of lines of 'fuzz' to allow when applying patches. This
1622 The number of lines of 'fuzz' to allow when applying patches. This
1617 controls how much context the patcher is allowed to ignore when
1623 controls how much context the patcher is allowed to ignore when
1618 trying to apply a patch.
1624 trying to apply a patch.
1619 (default: 2)
1625 (default: 2)
1620
1626
1621 ``paths``
1627 ``paths``
1622 ---------
1628 ---------
1623
1629
1624 Assigns symbolic names and behavior to repositories.
1630 Assigns symbolic names and behavior to repositories.
1625
1631
1626 Options are symbolic names defining the URL or directory that is the
1632 Options are symbolic names defining the URL or directory that is the
1627 location of the repository. Example::
1633 location of the repository. Example::
1628
1634
1629 [paths]
1635 [paths]
1630 my_server = https://example.com/my_repo
1636 my_server = https://example.com/my_repo
1631 local_path = /home/me/repo
1637 local_path = /home/me/repo
1632
1638
1633 These symbolic names can be used from the command line. To pull
1639 These symbolic names can be used from the command line. To pull
1634 from ``my_server``: :hg:`pull my_server`. To push to ``local_path``:
1640 from ``my_server``: :hg:`pull my_server`. To push to ``local_path``:
1635 :hg:`push local_path`.
1641 :hg:`push local_path`.
1636
1642
1637 Options containing colons (``:``) denote sub-options that can influence
1643 Options containing colons (``:``) denote sub-options that can influence
1638 behavior for that specific path. Example::
1644 behavior for that specific path. Example::
1639
1645
1640 [paths]
1646 [paths]
1641 my_server = https://example.com/my_path
1647 my_server = https://example.com/my_path
1642 my_server:pushurl = ssh://example.com/my_path
1648 my_server:pushurl = ssh://example.com/my_path
1643
1649
1644 The following sub-options can be defined:
1650 The following sub-options can be defined:
1645
1651
1646 ``pushurl``
1652 ``pushurl``
1647 The URL to use for push operations. If not defined, the location
1653 The URL to use for push operations. If not defined, the location
1648 defined by the path's main entry is used.
1654 defined by the path's main entry is used.
1649
1655
1650 ``pushrev``
1656 ``pushrev``
1651 A revset defining which revisions to push by default.
1657 A revset defining which revisions to push by default.
1652
1658
1653 When :hg:`push` is executed without a ``-r`` argument, the revset
1659 When :hg:`push` is executed without a ``-r`` argument, the revset
1654 defined by this sub-option is evaluated to determine what to push.
1660 defined by this sub-option is evaluated to determine what to push.
1655
1661
1656 For example, a value of ``.`` will push the working directory's
1662 For example, a value of ``.`` will push the working directory's
1657 revision by default.
1663 revision by default.
1658
1664
1659 Revsets specifying bookmarks will not result in the bookmark being
1665 Revsets specifying bookmarks will not result in the bookmark being
1660 pushed.
1666 pushed.
1661
1667
1662 The following special named paths exist:
1668 The following special named paths exist:
1663
1669
1664 ``default``
1670 ``default``
1665 The URL or directory to use when no source or remote is specified.
1671 The URL or directory to use when no source or remote is specified.
1666
1672
1667 :hg:`clone` will automatically define this path to the location the
1673 :hg:`clone` will automatically define this path to the location the
1668 repository was cloned from.
1674 repository was cloned from.
1669
1675
1670 ``default-push``
1676 ``default-push``
1671 (deprecated) The URL or directory for the default :hg:`push` location.
1677 (deprecated) The URL or directory for the default :hg:`push` location.
1672 ``default:pushurl`` should be used instead.
1678 ``default:pushurl`` should be used instead.
1673
1679
1674 ``phases``
1680 ``phases``
1675 ----------
1681 ----------
1676
1682
1677 Specifies default handling of phases. See :hg:`help phases` for more
1683 Specifies default handling of phases. See :hg:`help phases` for more
1678 information about working with phases.
1684 information about working with phases.
1679
1685
1680 ``publish``
1686 ``publish``
1681 Controls draft phase behavior when working as a server. When true,
1687 Controls draft phase behavior when working as a server. When true,
1682 pushed changesets are set to public in both client and server and
1688 pushed changesets are set to public in both client and server and
1683 pulled or cloned changesets are set to public in the client.
1689 pulled or cloned changesets are set to public in the client.
1684 (default: True)
1690 (default: True)
1685
1691
1686 ``new-commit``
1692 ``new-commit``
1687 Phase of newly-created commits.
1693 Phase of newly-created commits.
1688 (default: draft)
1694 (default: draft)
1689
1695
1690 ``checksubrepos``
1696 ``checksubrepos``
1691 Check the phase of the current revision of each subrepository. Allowed
1697 Check the phase of the current revision of each subrepository. Allowed
1692 values are "ignore", "follow" and "abort". For settings other than
1698 values are "ignore", "follow" and "abort". For settings other than
1693 "ignore", the phase of the current revision of each subrepository is
1699 "ignore", the phase of the current revision of each subrepository is
1694 checked before committing the parent repository. If any of those phases is
1700 checked before committing the parent repository. If any of those phases is
1695 greater than the phase of the parent repository (e.g. if a subrepo is in a
1701 greater than the phase of the parent repository (e.g. if a subrepo is in a
1696 "secret" phase while the parent repo is in "draft" phase), the commit is
1702 "secret" phase while the parent repo is in "draft" phase), the commit is
1697 either aborted (if checksubrepos is set to "abort") or the higher phase is
1703 either aborted (if checksubrepos is set to "abort") or the higher phase is
1698 used for the parent repository commit (if set to "follow").
1704 used for the parent repository commit (if set to "follow").
1699 (default: follow)
1705 (default: follow)
1700
1706
1701
1707
1702 ``profiling``
1708 ``profiling``
1703 -------------
1709 -------------
1704
1710
1705 Specifies profiling type, format, and file output. Two profilers are
1711 Specifies profiling type, format, and file output. Two profilers are
1706 supported: an instrumenting profiler (named ``ls``), and a sampling
1712 supported: an instrumenting profiler (named ``ls``), and a sampling
1707 profiler (named ``stat``).
1713 profiler (named ``stat``).
1708
1714
1709 In this section description, 'profiling data' stands for the raw data
1715 In this section description, 'profiling data' stands for the raw data
1710 collected during profiling, while 'profiling report' stands for a
1716 collected during profiling, while 'profiling report' stands for a
1711 statistical text report generated from the profiling data.
1717 statistical text report generated from the profiling data.
1712
1718
1713 ``enabled``
1719 ``enabled``
1714 Enable the profiler.
1720 Enable the profiler.
1715 (default: false)
1721 (default: false)
1716
1722
1717 This is equivalent to passing ``--profile`` on the command line.
1723 This is equivalent to passing ``--profile`` on the command line.
1718
1724
1719 ``type``
1725 ``type``
1720 The type of profiler to use.
1726 The type of profiler to use.
1721 (default: stat)
1727 (default: stat)
1722
1728
1723 ``ls``
1729 ``ls``
1724 Use Python's built-in instrumenting profiler. This profiler
1730 Use Python's built-in instrumenting profiler. This profiler
1725 works on all platforms, but each line number it reports is the
1731 works on all platforms, but each line number it reports is the
1726 first line of a function. This restriction makes it difficult to
1732 first line of a function. This restriction makes it difficult to
1727 identify the expensive parts of a non-trivial function.
1733 identify the expensive parts of a non-trivial function.
1728 ``stat``
1734 ``stat``
1729 Use a statistical profiler, statprof. This profiler is most
1735 Use a statistical profiler, statprof. This profiler is most
1730 useful for profiling commands that run for longer than about 0.1
1736 useful for profiling commands that run for longer than about 0.1
1731 seconds.
1737 seconds.
1732
1738
1733 ``format``
1739 ``format``
1734 Profiling format. Specific to the ``ls`` instrumenting profiler.
1740 Profiling format. Specific to the ``ls`` instrumenting profiler.
1735 (default: text)
1741 (default: text)
1736
1742
1737 ``text``
1743 ``text``
1738 Generate a profiling report. When saving to a file, it should be
1744 Generate a profiling report. When saving to a file, it should be
1739 noted that only the report is saved, and the profiling data is
1745 noted that only the report is saved, and the profiling data is
1740 not kept.
1746 not kept.
1741 ``kcachegrind``
1747 ``kcachegrind``
1742 Format profiling data for kcachegrind use: when saving to a
1748 Format profiling data for kcachegrind use: when saving to a
1743 file, the generated file can directly be loaded into
1749 file, the generated file can directly be loaded into
1744 kcachegrind.
1750 kcachegrind.
1745
1751
1746 ``statformat``
1752 ``statformat``
1747 Profiling format for the ``stat`` profiler.
1753 Profiling format for the ``stat`` profiler.
1748 (default: hotpath)
1754 (default: hotpath)
1749
1755
1750 ``hotpath``
1756 ``hotpath``
1751 Show a tree-based display containing the hot path of execution (where
1757 Show a tree-based display containing the hot path of execution (where
1752 most time was spent).
1758 most time was spent).
1753 ``bymethod``
1759 ``bymethod``
1754 Show a table of methods ordered by how frequently they are active.
1760 Show a table of methods ordered by how frequently they are active.
1755 ``byline``
1761 ``byline``
1756 Show a table of lines in files ordered by how frequently they are active.
1762 Show a table of lines in files ordered by how frequently they are active.
1757 ``json``
1763 ``json``
1758 Render profiling data as JSON.
1764 Render profiling data as JSON.
1759
1765
1760 ``frequency``
1766 ``frequency``
1761 Sampling frequency. Specific to the ``stat`` sampling profiler.
1767 Sampling frequency. Specific to the ``stat`` sampling profiler.
1762 (default: 1000)
1768 (default: 1000)
1763
1769
1764 ``output``
1770 ``output``
1765 File path where profiling data or report should be saved. If the
1771 File path where profiling data or report should be saved. If the
1766 file exists, it is replaced. (default: None, data is printed on
1772 file exists, it is replaced. (default: None, data is printed on
1767 stderr)
1773 stderr)
1768
1774
1769 ``sort``
1775 ``sort``
1770 Sort field. Specific to the ``ls`` instrumenting profiler.
1776 Sort field. Specific to the ``ls`` instrumenting profiler.
1771 One of ``callcount``, ``reccallcount``, ``totaltime`` and
1777 One of ``callcount``, ``reccallcount``, ``totaltime`` and
1772 ``inlinetime``.
1778 ``inlinetime``.
1773 (default: inlinetime)
1779 (default: inlinetime)
1774
1780
1775 ``time-track``
1781 ``time-track``
1776 Control if the stat profiler track ``cpu`` or ``real`` time.
1782 Control if the stat profiler track ``cpu`` or ``real`` time.
1777 (default: ``cpu`` on Windows, otherwise ``real``)
1783 (default: ``cpu`` on Windows, otherwise ``real``)
1778
1784
1779 ``limit``
1785 ``limit``
1780 Number of lines to show. Specific to the ``ls`` instrumenting profiler.
1786 Number of lines to show. Specific to the ``ls`` instrumenting profiler.
1781 (default: 30)
1787 (default: 30)
1782
1788
1783 ``nested``
1789 ``nested``
1784 Show at most this number of lines of drill-down info after each main entry.
1790 Show at most this number of lines of drill-down info after each main entry.
1785 This can help explain the difference between Total and Inline.
1791 This can help explain the difference between Total and Inline.
1786 Specific to the ``ls`` instrumenting profiler.
1792 Specific to the ``ls`` instrumenting profiler.
1787 (default: 0)
1793 (default: 0)
1788
1794
1789 ``showmin``
1795 ``showmin``
1790 Minimum fraction of samples an entry must have for it to be displayed.
1796 Minimum fraction of samples an entry must have for it to be displayed.
1791 Can be specified as a float between ``0.0`` and ``1.0`` or can have a
1797 Can be specified as a float between ``0.0`` and ``1.0`` or can have a
1792 ``%`` afterwards to allow values up to ``100``. e.g. ``5%``.
1798 ``%`` afterwards to allow values up to ``100``. e.g. ``5%``.
1793
1799
1794 Only used by the ``stat`` profiler.
1800 Only used by the ``stat`` profiler.
1795
1801
1796 For the ``hotpath`` format, default is ``0.05``.
1802 For the ``hotpath`` format, default is ``0.05``.
1797 For the ``chrome`` format, default is ``0.005``.
1803 For the ``chrome`` format, default is ``0.005``.
1798
1804
1799 The option is unused on other formats.
1805 The option is unused on other formats.
1800
1806
1801 ``showmax``
1807 ``showmax``
1802 Maximum fraction of samples an entry can have before it is ignored in
1808 Maximum fraction of samples an entry can have before it is ignored in
1803 display. Values format is the same as ``showmin``.
1809 display. Values format is the same as ``showmin``.
1804
1810
1805 Only used by the ``stat`` profiler.
1811 Only used by the ``stat`` profiler.
1806
1812
1807 For the ``chrome`` format, default is ``0.999``.
1813 For the ``chrome`` format, default is ``0.999``.
1808
1814
1809 The option is unused on other formats.
1815 The option is unused on other formats.
1810
1816
1811 ``showtime``
1817 ``showtime``
1812 Show time taken as absolute durations, in addition to percentages.
1818 Show time taken as absolute durations, in addition to percentages.
1813 Only used by the ``hotpath`` format.
1819 Only used by the ``hotpath`` format.
1814 (default: true)
1820 (default: true)
1815
1821
1816 ``progress``
1822 ``progress``
1817 ------------
1823 ------------
1818
1824
1819 Mercurial commands can draw progress bars that are as informative as
1825 Mercurial commands can draw progress bars that are as informative as
1820 possible. Some progress bars only offer indeterminate information, while others
1826 possible. Some progress bars only offer indeterminate information, while others
1821 have a definite end point.
1827 have a definite end point.
1822
1828
1823 ``debug``
1829 ``debug``
1824 Whether to print debug info when updating the progress bar. (default: False)
1830 Whether to print debug info when updating the progress bar. (default: False)
1825
1831
1826 ``delay``
1832 ``delay``
1827 Number of seconds (float) before showing the progress bar. (default: 3)
1833 Number of seconds (float) before showing the progress bar. (default: 3)
1828
1834
1829 ``changedelay``
1835 ``changedelay``
1830 Minimum delay before showing a new topic. When set to less than 3 * refresh,
1836 Minimum delay before showing a new topic. When set to less than 3 * refresh,
1831 that value will be used instead. (default: 1)
1837 that value will be used instead. (default: 1)
1832
1838
1833 ``estimateinterval``
1839 ``estimateinterval``
1834 Maximum sampling interval in seconds for speed and estimated time
1840 Maximum sampling interval in seconds for speed and estimated time
1835 calculation. (default: 60)
1841 calculation. (default: 60)
1836
1842
1837 ``refresh``
1843 ``refresh``
1838 Time in seconds between refreshes of the progress bar. (default: 0.1)
1844 Time in seconds between refreshes of the progress bar. (default: 0.1)
1839
1845
1840 ``format``
1846 ``format``
1841 Format of the progress bar.
1847 Format of the progress bar.
1842
1848
1843 Valid entries for the format field are ``topic``, ``bar``, ``number``,
1849 Valid entries for the format field are ``topic``, ``bar``, ``number``,
1844 ``unit``, ``estimate``, ``speed``, and ``item``. ``item`` defaults to the
1850 ``unit``, ``estimate``, ``speed``, and ``item``. ``item`` defaults to the
1845 last 20 characters of the item, but this can be changed by adding either
1851 last 20 characters of the item, but this can be changed by adding either
1846 ``-<num>`` which would take the last num characters, or ``+<num>`` for the
1852 ``-<num>`` which would take the last num characters, or ``+<num>`` for the
1847 first num characters.
1853 first num characters.
1848
1854
1849 (default: topic bar number estimate)
1855 (default: topic bar number estimate)
1850
1856
1851 ``width``
1857 ``width``
1852 If set, the maximum width of the progress information (that is, min(width,
1858 If set, the maximum width of the progress information (that is, min(width,
1853 term width) will be used).
1859 term width) will be used).
1854
1860
1855 ``clear-complete``
1861 ``clear-complete``
1856 Clear the progress bar after it's done. (default: True)
1862 Clear the progress bar after it's done. (default: True)
1857
1863
1858 ``disable``
1864 ``disable``
1859 If true, don't show a progress bar.
1865 If true, don't show a progress bar.
1860
1866
1861 ``assume-tty``
1867 ``assume-tty``
1862 If true, ALWAYS show a progress bar, unless disable is given.
1868 If true, ALWAYS show a progress bar, unless disable is given.
1863
1869
1864 ``rebase``
1870 ``rebase``
1865 ----------
1871 ----------
1866
1872
1867 ``evolution.allowdivergence``
1873 ``evolution.allowdivergence``
1868 Default to False, when True allow creating divergence when performing
1874 Default to False, when True allow creating divergence when performing
1869 rebase of obsolete changesets.
1875 rebase of obsolete changesets.
1870
1876
1871 ``revsetalias``
1877 ``revsetalias``
1872 ---------------
1878 ---------------
1873
1879
1874 Alias definitions for revsets. See :hg:`help revsets` for details.
1880 Alias definitions for revsets. See :hg:`help revsets` for details.
1875
1881
1876 ``rewrite``
1882 ``rewrite``
1877 -----------
1883 -----------
1878
1884
1879 ``backup-bundle``
1885 ``backup-bundle``
1880 Whether to save stripped changesets to a bundle file. (default: True)
1886 Whether to save stripped changesets to a bundle file. (default: True)
1881
1887
1882 ``update-timestamp``
1888 ``update-timestamp``
1883 If true, updates the date and time of the changeset to current. It is only
1889 If true, updates the date and time of the changeset to current. It is only
1884 applicable for `hg amend`, `hg commit --amend` and `hg uncommit` in the
1890 applicable for `hg amend`, `hg commit --amend` and `hg uncommit` in the
1885 current version.
1891 current version.
1886
1892
1887 ``storage``
1893 ``storage``
1888 -----------
1894 -----------
1889
1895
1890 Control the strategy Mercurial uses internally to store history. Options in this
1896 Control the strategy Mercurial uses internally to store history. Options in this
1891 category impact performance and repository size.
1897 category impact performance and repository size.
1892
1898
1893 ``revlog.optimize-delta-parent-choice``
1899 ``revlog.optimize-delta-parent-choice``
1894 When storing a merge revision, both parents will be equally considered as
1900 When storing a merge revision, both parents will be equally considered as
1895 a possible delta base. This results in better delta selection and improved
1901 a possible delta base. This results in better delta selection and improved
1896 revlog compression. This option is enabled by default.
1902 revlog compression. This option is enabled by default.
1897
1903
1898 Turning this option off can result in large increase of repository size for
1904 Turning this option off can result in large increase of repository size for
1899 repository with many merges.
1905 repository with many merges.
1900
1906
1901 ``revlog.reuse-external-delta-parent``
1907 ``revlog.reuse-external-delta-parent``
1902 Control the order in which delta parents are considered when adding new
1908 Control the order in which delta parents are considered when adding new
1903 revisions from an external source.
1909 revisions from an external source.
1904 (typically: apply bundle from `hg pull` or `hg push`).
1910 (typically: apply bundle from `hg pull` or `hg push`).
1905
1911
1906 New revisions are usually provided as a delta against other revisions. By
1912 New revisions are usually provided as a delta against other revisions. By
1907 default, Mercurial will try to reuse this delta first, therefore using the
1913 default, Mercurial will try to reuse this delta first, therefore using the
1908 same "delta parent" as the source. Directly using delta's from the source
1914 same "delta parent" as the source. Directly using delta's from the source
1909 reduces CPU usage and usually speeds up operation. However, in some case,
1915 reduces CPU usage and usually speeds up operation. However, in some case,
1910 the source might have sub-optimal delta bases and forcing their reevaluation
1916 the source might have sub-optimal delta bases and forcing their reevaluation
1911 is useful. For example, pushes from an old client could have sub-optimal
1917 is useful. For example, pushes from an old client could have sub-optimal
1912 delta's parent that the server want to optimize. (lack of general delta, bad
1918 delta's parent that the server want to optimize. (lack of general delta, bad
1913 parents, choice, lack of sparse-revlog, etc).
1919 parents, choice, lack of sparse-revlog, etc).
1914
1920
1915 This option is enabled by default. Turning it off will ensure bad delta
1921 This option is enabled by default. Turning it off will ensure bad delta
1916 parent choices from older client do not propagate to this repository, at
1922 parent choices from older client do not propagate to this repository, at
1917 the cost of a small increase in CPU consumption.
1923 the cost of a small increase in CPU consumption.
1918
1924
1919 Note: this option only control the order in which delta parents are
1925 Note: this option only control the order in which delta parents are
1920 considered. Even when disabled, the existing delta from the source will be
1926 considered. Even when disabled, the existing delta from the source will be
1921 reused if the same delta parent is selected.
1927 reused if the same delta parent is selected.
1922
1928
1923 ``revlog.reuse-external-delta``
1929 ``revlog.reuse-external-delta``
1924 Control the reuse of delta from external source.
1930 Control the reuse of delta from external source.
1925 (typically: apply bundle from `hg pull` or `hg push`).
1931 (typically: apply bundle from `hg pull` or `hg push`).
1926
1932
1927 New revisions are usually provided as a delta against another revision. By
1933 New revisions are usually provided as a delta against another revision. By
1928 default, Mercurial will not recompute the same delta again, trusting
1934 default, Mercurial will not recompute the same delta again, trusting
1929 externally provided deltas. There have been rare cases of small adjustment
1935 externally provided deltas. There have been rare cases of small adjustment
1930 to the diffing algorithm in the past. So in some rare case, recomputing
1936 to the diffing algorithm in the past. So in some rare case, recomputing
1931 delta provided by ancient clients can provides better results. Disabling
1937 delta provided by ancient clients can provides better results. Disabling
1932 this option means going through a full delta recomputation for all incoming
1938 this option means going through a full delta recomputation for all incoming
1933 revisions. It means a large increase in CPU usage and will slow operations
1939 revisions. It means a large increase in CPU usage and will slow operations
1934 down.
1940 down.
1935
1941
1936 This option is enabled by default. When disabled, it also disables the
1942 This option is enabled by default. When disabled, it also disables the
1937 related ``storage.revlog.reuse-external-delta-parent`` option.
1943 related ``storage.revlog.reuse-external-delta-parent`` option.
1938
1944
1939 ``revlog.zlib.level``
1945 ``revlog.zlib.level``
1940 Zlib compression level used when storing data into the repository. Accepted
1946 Zlib compression level used when storing data into the repository. Accepted
1941 Value range from 1 (lowest compression) to 9 (highest compression). Zlib
1947 Value range from 1 (lowest compression) to 9 (highest compression). Zlib
1942 default value is 6.
1948 default value is 6.
1943
1949
1944
1950
1945 ``revlog.zstd.level``
1951 ``revlog.zstd.level``
1946 zstd compression level used when storing data into the repository. Accepted
1952 zstd compression level used when storing data into the repository. Accepted
1947 Value range from 1 (lowest compression) to 22 (highest compression).
1953 Value range from 1 (lowest compression) to 22 (highest compression).
1948 (default 3)
1954 (default 3)
1949
1955
1950 ``server``
1956 ``server``
1951 ----------
1957 ----------
1952
1958
1953 Controls generic server settings.
1959 Controls generic server settings.
1954
1960
1955 ``bookmarks-pushkey-compat``
1961 ``bookmarks-pushkey-compat``
1956 Trigger pushkey hook when being pushed bookmark updates. This config exist
1962 Trigger pushkey hook when being pushed bookmark updates. This config exist
1957 for compatibility purpose (default to True)
1963 for compatibility purpose (default to True)
1958
1964
1959 If you use ``pushkey`` and ``pre-pushkey`` hooks to control bookmark
1965 If you use ``pushkey`` and ``pre-pushkey`` hooks to control bookmark
1960 movement we recommend you migrate them to ``txnclose-bookmark`` and
1966 movement we recommend you migrate them to ``txnclose-bookmark`` and
1961 ``pretxnclose-bookmark``.
1967 ``pretxnclose-bookmark``.
1962
1968
1963 ``compressionengines``
1969 ``compressionengines``
1964 List of compression engines and their relative priority to advertise
1970 List of compression engines and their relative priority to advertise
1965 to clients.
1971 to clients.
1966
1972
1967 The order of compression engines determines their priority, the first
1973 The order of compression engines determines their priority, the first
1968 having the highest priority. If a compression engine is not listed
1974 having the highest priority. If a compression engine is not listed
1969 here, it won't be advertised to clients.
1975 here, it won't be advertised to clients.
1970
1976
1971 If not set (the default), built-in defaults are used. Run
1977 If not set (the default), built-in defaults are used. Run
1972 :hg:`debuginstall` to list available compression engines and their
1978 :hg:`debuginstall` to list available compression engines and their
1973 default wire protocol priority.
1979 default wire protocol priority.
1974
1980
1975 Older Mercurial clients only support zlib compression and this setting
1981 Older Mercurial clients only support zlib compression and this setting
1976 has no effect for legacy clients.
1982 has no effect for legacy clients.
1977
1983
1978 ``uncompressed``
1984 ``uncompressed``
1979 Whether to allow clients to clone a repository using the
1985 Whether to allow clients to clone a repository using the
1980 uncompressed streaming protocol. This transfers about 40% more
1986 uncompressed streaming protocol. This transfers about 40% more
1981 data than a regular clone, but uses less memory and CPU on both
1987 data than a regular clone, but uses less memory and CPU on both
1982 server and client. Over a LAN (100 Mbps or better) or a very fast
1988 server and client. Over a LAN (100 Mbps or better) or a very fast
1983 WAN, an uncompressed streaming clone is a lot faster (~10x) than a
1989 WAN, an uncompressed streaming clone is a lot faster (~10x) than a
1984 regular clone. Over most WAN connections (anything slower than
1990 regular clone. Over most WAN connections (anything slower than
1985 about 6 Mbps), uncompressed streaming is slower, because of the
1991 about 6 Mbps), uncompressed streaming is slower, because of the
1986 extra data transfer overhead. This mode will also temporarily hold
1992 extra data transfer overhead. This mode will also temporarily hold
1987 the write lock while determining what data to transfer.
1993 the write lock while determining what data to transfer.
1988 (default: True)
1994 (default: True)
1989
1995
1990 ``uncompressedallowsecret``
1996 ``uncompressedallowsecret``
1991 Whether to allow stream clones when the repository contains secret
1997 Whether to allow stream clones when the repository contains secret
1992 changesets. (default: False)
1998 changesets. (default: False)
1993
1999
1994 ``preferuncompressed``
2000 ``preferuncompressed``
1995 When set, clients will try to use the uncompressed streaming
2001 When set, clients will try to use the uncompressed streaming
1996 protocol. (default: False)
2002 protocol. (default: False)
1997
2003
1998 ``disablefullbundle``
2004 ``disablefullbundle``
1999 When set, servers will refuse attempts to do pull-based clones.
2005 When set, servers will refuse attempts to do pull-based clones.
2000 If this option is set, ``preferuncompressed`` and/or clone bundles
2006 If this option is set, ``preferuncompressed`` and/or clone bundles
2001 are highly recommended. Partial clones will still be allowed.
2007 are highly recommended. Partial clones will still be allowed.
2002 (default: False)
2008 (default: False)
2003
2009
2004 ``streamunbundle``
2010 ``streamunbundle``
2005 When set, servers will apply data sent from the client directly,
2011 When set, servers will apply data sent from the client directly,
2006 otherwise it will be written to a temporary file first. This option
2012 otherwise it will be written to a temporary file first. This option
2007 effectively prevents concurrent pushes.
2013 effectively prevents concurrent pushes.
2008
2014
2009 ``pullbundle``
2015 ``pullbundle``
2010 When set, the server will check pullbundle.manifest for bundles
2016 When set, the server will check pullbundle.manifest for bundles
2011 covering the requested heads and common nodes. The first matching
2017 covering the requested heads and common nodes. The first matching
2012 entry will be streamed to the client.
2018 entry will be streamed to the client.
2013
2019
2014 For HTTP transport, the stream will still use zlib compression
2020 For HTTP transport, the stream will still use zlib compression
2015 for older clients.
2021 for older clients.
2016
2022
2017 ``concurrent-push-mode``
2023 ``concurrent-push-mode``
2018 Level of allowed race condition between two pushing clients.
2024 Level of allowed race condition between two pushing clients.
2019
2025
2020 - 'strict': push is abort if another client touched the repository
2026 - 'strict': push is abort if another client touched the repository
2021 while the push was preparing.
2027 while the push was preparing.
2022 - 'check-related': push is only aborted if it affects head that got also
2028 - 'check-related': push is only aborted if it affects head that got also
2023 affected while the push was preparing. (default since 5.4)
2029 affected while the push was preparing. (default since 5.4)
2024
2030
2025 'check-related' only takes effect for compatible clients (version
2031 'check-related' only takes effect for compatible clients (version
2026 4.3 and later). Older clients will use 'strict'.
2032 4.3 and later). Older clients will use 'strict'.
2027
2033
2028 ``validate``
2034 ``validate``
2029 Whether to validate the completeness of pushed changesets by
2035 Whether to validate the completeness of pushed changesets by
2030 checking that all new file revisions specified in manifests are
2036 checking that all new file revisions specified in manifests are
2031 present. (default: False)
2037 present. (default: False)
2032
2038
2033 ``maxhttpheaderlen``
2039 ``maxhttpheaderlen``
2034 Instruct HTTP clients not to send request headers longer than this
2040 Instruct HTTP clients not to send request headers longer than this
2035 many bytes. (default: 1024)
2041 many bytes. (default: 1024)
2036
2042
2037 ``bundle1``
2043 ``bundle1``
2038 Whether to allow clients to push and pull using the legacy bundle1
2044 Whether to allow clients to push and pull using the legacy bundle1
2039 exchange format. (default: True)
2045 exchange format. (default: True)
2040
2046
2041 ``bundle1gd``
2047 ``bundle1gd``
2042 Like ``bundle1`` but only used if the repository is using the
2048 Like ``bundle1`` but only used if the repository is using the
2043 *generaldelta* storage format. (default: True)
2049 *generaldelta* storage format. (default: True)
2044
2050
2045 ``bundle1.push``
2051 ``bundle1.push``
2046 Whether to allow clients to push using the legacy bundle1 exchange
2052 Whether to allow clients to push using the legacy bundle1 exchange
2047 format. (default: True)
2053 format. (default: True)
2048
2054
2049 ``bundle1gd.push``
2055 ``bundle1gd.push``
2050 Like ``bundle1.push`` but only used if the repository is using the
2056 Like ``bundle1.push`` but only used if the repository is using the
2051 *generaldelta* storage format. (default: True)
2057 *generaldelta* storage format. (default: True)
2052
2058
2053 ``bundle1.pull``
2059 ``bundle1.pull``
2054 Whether to allow clients to pull using the legacy bundle1 exchange
2060 Whether to allow clients to pull using the legacy bundle1 exchange
2055 format. (default: True)
2061 format. (default: True)
2056
2062
2057 ``bundle1gd.pull``
2063 ``bundle1gd.pull``
2058 Like ``bundle1.pull`` but only used if the repository is using the
2064 Like ``bundle1.pull`` but only used if the repository is using the
2059 *generaldelta* storage format. (default: True)
2065 *generaldelta* storage format. (default: True)
2060
2066
2061 Large repositories using the *generaldelta* storage format should
2067 Large repositories using the *generaldelta* storage format should
2062 consider setting this option because converting *generaldelta*
2068 consider setting this option because converting *generaldelta*
2063 repositories to the exchange format required by the bundle1 data
2069 repositories to the exchange format required by the bundle1 data
2064 format can consume a lot of CPU.
2070 format can consume a lot of CPU.
2065
2071
2066 ``bundle2.stream``
2072 ``bundle2.stream``
2067 Whether to allow clients to pull using the bundle2 streaming protocol.
2073 Whether to allow clients to pull using the bundle2 streaming protocol.
2068 (default: True)
2074 (default: True)
2069
2075
2070 ``zliblevel``
2076 ``zliblevel``
2071 Integer between ``-1`` and ``9`` that controls the zlib compression level
2077 Integer between ``-1`` and ``9`` that controls the zlib compression level
2072 for wire protocol commands that send zlib compressed output (notably the
2078 for wire protocol commands that send zlib compressed output (notably the
2073 commands that send repository history data).
2079 commands that send repository history data).
2074
2080
2075 The default (``-1``) uses the default zlib compression level, which is
2081 The default (``-1``) uses the default zlib compression level, which is
2076 likely equivalent to ``6``. ``0`` means no compression. ``9`` means
2082 likely equivalent to ``6``. ``0`` means no compression. ``9`` means
2077 maximum compression.
2083 maximum compression.
2078
2084
2079 Setting this option allows server operators to make trade-offs between
2085 Setting this option allows server operators to make trade-offs between
2080 bandwidth and CPU used. Lowering the compression lowers CPU utilization
2086 bandwidth and CPU used. Lowering the compression lowers CPU utilization
2081 but sends more bytes to clients.
2087 but sends more bytes to clients.
2082
2088
2083 This option only impacts the HTTP server.
2089 This option only impacts the HTTP server.
2084
2090
2085 ``zstdlevel``
2091 ``zstdlevel``
2086 Integer between ``1`` and ``22`` that controls the zstd compression level
2092 Integer between ``1`` and ``22`` that controls the zstd compression level
2087 for wire protocol commands. ``1`` is the minimal amount of compression and
2093 for wire protocol commands. ``1`` is the minimal amount of compression and
2088 ``22`` is the highest amount of compression.
2094 ``22`` is the highest amount of compression.
2089
2095
2090 The default (``3``) should be significantly faster than zlib while likely
2096 The default (``3``) should be significantly faster than zlib while likely
2091 delivering better compression ratios.
2097 delivering better compression ratios.
2092
2098
2093 This option only impacts the HTTP server.
2099 This option only impacts the HTTP server.
2094
2100
2095 See also ``server.zliblevel``.
2101 See also ``server.zliblevel``.
2096
2102
2097 ``view``
2103 ``view``
2098 Repository filter used when exchanging revisions with the peer.
2104 Repository filter used when exchanging revisions with the peer.
2099
2105
2100 The default view (``served``) excludes secret and hidden changesets.
2106 The default view (``served``) excludes secret and hidden changesets.
2101 Another useful value is ``immutable`` (no draft, secret or hidden
2107 Another useful value is ``immutable`` (no draft, secret or hidden
2102 changesets). (EXPERIMENTAL)
2108 changesets). (EXPERIMENTAL)
2103
2109
2104 ``smtp``
2110 ``smtp``
2105 --------
2111 --------
2106
2112
2107 Configuration for extensions that need to send email messages.
2113 Configuration for extensions that need to send email messages.
2108
2114
2109 ``host``
2115 ``host``
2110 Host name of mail server, e.g. "mail.example.com".
2116 Host name of mail server, e.g. "mail.example.com".
2111
2117
2112 ``port``
2118 ``port``
2113 Optional. Port to connect to on mail server. (default: 465 if
2119 Optional. Port to connect to on mail server. (default: 465 if
2114 ``tls`` is smtps; 25 otherwise)
2120 ``tls`` is smtps; 25 otherwise)
2115
2121
2116 ``tls``
2122 ``tls``
2117 Optional. Method to enable TLS when connecting to mail server: starttls,
2123 Optional. Method to enable TLS when connecting to mail server: starttls,
2118 smtps or none. (default: none)
2124 smtps or none. (default: none)
2119
2125
2120 ``username``
2126 ``username``
2121 Optional. User name for authenticating with the SMTP server.
2127 Optional. User name for authenticating with the SMTP server.
2122 (default: None)
2128 (default: None)
2123
2129
2124 ``password``
2130 ``password``
2125 Optional. Password for authenticating with the SMTP server. If not
2131 Optional. Password for authenticating with the SMTP server. If not
2126 specified, interactive sessions will prompt the user for a
2132 specified, interactive sessions will prompt the user for a
2127 password; non-interactive sessions will fail. (default: None)
2133 password; non-interactive sessions will fail. (default: None)
2128
2134
2129 ``local_hostname``
2135 ``local_hostname``
2130 Optional. The hostname that the sender can use to identify
2136 Optional. The hostname that the sender can use to identify
2131 itself to the MTA.
2137 itself to the MTA.
2132
2138
2133
2139
2134 ``subpaths``
2140 ``subpaths``
2135 ------------
2141 ------------
2136
2142
2137 Subrepository source URLs can go stale if a remote server changes name
2143 Subrepository source URLs can go stale if a remote server changes name
2138 or becomes temporarily unavailable. This section lets you define
2144 or becomes temporarily unavailable. This section lets you define
2139 rewrite rules of the form::
2145 rewrite rules of the form::
2140
2146
2141 <pattern> = <replacement>
2147 <pattern> = <replacement>
2142
2148
2143 where ``pattern`` is a regular expression matching a subrepository
2149 where ``pattern`` is a regular expression matching a subrepository
2144 source URL and ``replacement`` is the replacement string used to
2150 source URL and ``replacement`` is the replacement string used to
2145 rewrite it. Groups can be matched in ``pattern`` and referenced in
2151 rewrite it. Groups can be matched in ``pattern`` and referenced in
2146 ``replacements``. For instance::
2152 ``replacements``. For instance::
2147
2153
2148 http://server/(.*)-hg/ = http://hg.server/\1/
2154 http://server/(.*)-hg/ = http://hg.server/\1/
2149
2155
2150 rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``.
2156 rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``.
2151
2157
2152 Relative subrepository paths are first made absolute, and the
2158 Relative subrepository paths are first made absolute, and the
2153 rewrite rules are then applied on the full (absolute) path. If ``pattern``
2159 rewrite rules are then applied on the full (absolute) path. If ``pattern``
2154 doesn't match the full path, an attempt is made to apply it on the
2160 doesn't match the full path, an attempt is made to apply it on the
2155 relative path alone. The rules are applied in definition order.
2161 relative path alone. The rules are applied in definition order.
2156
2162
2157 ``subrepos``
2163 ``subrepos``
2158 ------------
2164 ------------
2159
2165
2160 This section contains options that control the behavior of the
2166 This section contains options that control the behavior of the
2161 subrepositories feature. See also :hg:`help subrepos`.
2167 subrepositories feature. See also :hg:`help subrepos`.
2162
2168
2163 Security note: auditing in Mercurial is known to be insufficient to
2169 Security note: auditing in Mercurial is known to be insufficient to
2164 prevent clone-time code execution with carefully constructed Git
2170 prevent clone-time code execution with carefully constructed Git
2165 subrepos. It is unknown if a similar detect is present in Subversion
2171 subrepos. It is unknown if a similar detect is present in Subversion
2166 subrepos. Both Git and Subversion subrepos are disabled by default
2172 subrepos. Both Git and Subversion subrepos are disabled by default
2167 out of security concerns. These subrepo types can be enabled using
2173 out of security concerns. These subrepo types can be enabled using
2168 the respective options below.
2174 the respective options below.
2169
2175
2170 ``allowed``
2176 ``allowed``
2171 Whether subrepositories are allowed in the working directory.
2177 Whether subrepositories are allowed in the working directory.
2172
2178
2173 When false, commands involving subrepositories (like :hg:`update`)
2179 When false, commands involving subrepositories (like :hg:`update`)
2174 will fail for all subrepository types.
2180 will fail for all subrepository types.
2175 (default: true)
2181 (default: true)
2176
2182
2177 ``hg:allowed``
2183 ``hg:allowed``
2178 Whether Mercurial subrepositories are allowed in the working
2184 Whether Mercurial subrepositories are allowed in the working
2179 directory. This option only has an effect if ``subrepos.allowed``
2185 directory. This option only has an effect if ``subrepos.allowed``
2180 is true.
2186 is true.
2181 (default: true)
2187 (default: true)
2182
2188
2183 ``git:allowed``
2189 ``git:allowed``
2184 Whether Git subrepositories are allowed in the working directory.
2190 Whether Git subrepositories are allowed in the working directory.
2185 This option only has an effect if ``subrepos.allowed`` is true.
2191 This option only has an effect if ``subrepos.allowed`` is true.
2186
2192
2187 See the security note above before enabling Git subrepos.
2193 See the security note above before enabling Git subrepos.
2188 (default: false)
2194 (default: false)
2189
2195
2190 ``svn:allowed``
2196 ``svn:allowed``
2191 Whether Subversion subrepositories are allowed in the working
2197 Whether Subversion subrepositories are allowed in the working
2192 directory. This option only has an effect if ``subrepos.allowed``
2198 directory. This option only has an effect if ``subrepos.allowed``
2193 is true.
2199 is true.
2194
2200
2195 See the security note above before enabling Subversion subrepos.
2201 See the security note above before enabling Subversion subrepos.
2196 (default: false)
2202 (default: false)
2197
2203
2198 ``templatealias``
2204 ``templatealias``
2199 -----------------
2205 -----------------
2200
2206
2201 Alias definitions for templates. See :hg:`help templates` for details.
2207 Alias definitions for templates. See :hg:`help templates` for details.
2202
2208
2203 ``templates``
2209 ``templates``
2204 -------------
2210 -------------
2205
2211
2206 Use the ``[templates]`` section to define template strings.
2212 Use the ``[templates]`` section to define template strings.
2207 See :hg:`help templates` for details.
2213 See :hg:`help templates` for details.
2208
2214
2209 ``trusted``
2215 ``trusted``
2210 -----------
2216 -----------
2211
2217
2212 Mercurial will not use the settings in the
2218 Mercurial will not use the settings in the
2213 ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
2219 ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
2214 user or to a trusted group, as various hgrc features allow arbitrary
2220 user or to a trusted group, as various hgrc features allow arbitrary
2215 commands to be run. This issue is often encountered when configuring
2221 commands to be run. This issue is often encountered when configuring
2216 hooks or extensions for shared repositories or servers. However,
2222 hooks or extensions for shared repositories or servers. However,
2217 the web interface will use some safe settings from the ``[web]``
2223 the web interface will use some safe settings from the ``[web]``
2218 section.
2224 section.
2219
2225
2220 This section specifies what users and groups are trusted. The
2226 This section specifies what users and groups are trusted. The
2221 current user is always trusted. To trust everybody, list a user or a
2227 current user is always trusted. To trust everybody, list a user or a
2222 group with name ``*``. These settings must be placed in an
2228 group with name ``*``. These settings must be placed in an
2223 *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the
2229 *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the
2224 user or service running Mercurial.
2230 user or service running Mercurial.
2225
2231
2226 ``users``
2232 ``users``
2227 Comma-separated list of trusted users.
2233 Comma-separated list of trusted users.
2228
2234
2229 ``groups``
2235 ``groups``
2230 Comma-separated list of trusted groups.
2236 Comma-separated list of trusted groups.
2231
2237
2232
2238
2233 ``ui``
2239 ``ui``
2234 ------
2240 ------
2235
2241
2236 User interface controls.
2242 User interface controls.
2237
2243
2238 ``archivemeta``
2244 ``archivemeta``
2239 Whether to include the .hg_archival.txt file containing meta data
2245 Whether to include the .hg_archival.txt file containing meta data
2240 (hashes for the repository base and for tip) in archives created
2246 (hashes for the repository base and for tip) in archives created
2241 by the :hg:`archive` command or downloaded via hgweb.
2247 by the :hg:`archive` command or downloaded via hgweb.
2242 (default: True)
2248 (default: True)
2243
2249
2244 ``askusername``
2250 ``askusername``
2245 Whether to prompt for a username when committing. If True, and
2251 Whether to prompt for a username when committing. If True, and
2246 neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
2252 neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
2247 be prompted to enter a username. If no username is entered, the
2253 be prompted to enter a username. If no username is entered, the
2248 default ``USER@HOST`` is used instead.
2254 default ``USER@HOST`` is used instead.
2249 (default: False)
2255 (default: False)
2250
2256
2251 ``clonebundles``
2257 ``clonebundles``
2252 Whether the "clone bundles" feature is enabled.
2258 Whether the "clone bundles" feature is enabled.
2253
2259
2254 When enabled, :hg:`clone` may download and apply a server-advertised
2260 When enabled, :hg:`clone` may download and apply a server-advertised
2255 bundle file from a URL instead of using the normal exchange mechanism.
2261 bundle file from a URL instead of using the normal exchange mechanism.
2256
2262
2257 This can likely result in faster and more reliable clones.
2263 This can likely result in faster and more reliable clones.
2258
2264
2259 (default: True)
2265 (default: True)
2260
2266
2261 ``clonebundlefallback``
2267 ``clonebundlefallback``
2262 Whether failure to apply an advertised "clone bundle" from a server
2268 Whether failure to apply an advertised "clone bundle" from a server
2263 should result in fallback to a regular clone.
2269 should result in fallback to a regular clone.
2264
2270
2265 This is disabled by default because servers advertising "clone
2271 This is disabled by default because servers advertising "clone
2266 bundles" often do so to reduce server load. If advertised bundles
2272 bundles" often do so to reduce server load. If advertised bundles
2267 start mass failing and clients automatically fall back to a regular
2273 start mass failing and clients automatically fall back to a regular
2268 clone, this would add significant and unexpected load to the server
2274 clone, this would add significant and unexpected load to the server
2269 since the server is expecting clone operations to be offloaded to
2275 since the server is expecting clone operations to be offloaded to
2270 pre-generated bundles. Failing fast (the default behavior) ensures
2276 pre-generated bundles. Failing fast (the default behavior) ensures
2271 clients don't overwhelm the server when "clone bundle" application
2277 clients don't overwhelm the server when "clone bundle" application
2272 fails.
2278 fails.
2273
2279
2274 (default: False)
2280 (default: False)
2275
2281
2276 ``clonebundleprefers``
2282 ``clonebundleprefers``
2277 Defines preferences for which "clone bundles" to use.
2283 Defines preferences for which "clone bundles" to use.
2278
2284
2279 Servers advertising "clone bundles" may advertise multiple available
2285 Servers advertising "clone bundles" may advertise multiple available
2280 bundles. Each bundle may have different attributes, such as the bundle
2286 bundles. Each bundle may have different attributes, such as the bundle
2281 type and compression format. This option is used to prefer a particular
2287 type and compression format. This option is used to prefer a particular
2282 bundle over another.
2288 bundle over another.
2283
2289
2284 The following keys are defined by Mercurial:
2290 The following keys are defined by Mercurial:
2285
2291
2286 BUNDLESPEC
2292 BUNDLESPEC
2287 A bundle type specifier. These are strings passed to :hg:`bundle -t`.
2293 A bundle type specifier. These are strings passed to :hg:`bundle -t`.
2288 e.g. ``gzip-v2`` or ``bzip2-v1``.
2294 e.g. ``gzip-v2`` or ``bzip2-v1``.
2289
2295
2290 COMPRESSION
2296 COMPRESSION
2291 The compression format of the bundle. e.g. ``gzip`` and ``bzip2``.
2297 The compression format of the bundle. e.g. ``gzip`` and ``bzip2``.
2292
2298
2293 Server operators may define custom keys.
2299 Server operators may define custom keys.
2294
2300
2295 Example values: ``COMPRESSION=bzip2``,
2301 Example values: ``COMPRESSION=bzip2``,
2296 ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``.
2302 ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``.
2297
2303
2298 By default, the first bundle advertised by the server is used.
2304 By default, the first bundle advertised by the server is used.
2299
2305
2300 ``color``
2306 ``color``
2301 When to colorize output. Possible value are Boolean ("yes" or "no"), or
2307 When to colorize output. Possible value are Boolean ("yes" or "no"), or
2302 "debug", or "always". (default: "yes"). "yes" will use color whenever it
2308 "debug", or "always". (default: "yes"). "yes" will use color whenever it
2303 seems possible. See :hg:`help color` for details.
2309 seems possible. See :hg:`help color` for details.
2304
2310
2305 ``commitsubrepos``
2311 ``commitsubrepos``
2306 Whether to commit modified subrepositories when committing the
2312 Whether to commit modified subrepositories when committing the
2307 parent repository. If False and one subrepository has uncommitted
2313 parent repository. If False and one subrepository has uncommitted
2308 changes, abort the commit.
2314 changes, abort the commit.
2309 (default: False)
2315 (default: False)
2310
2316
2311 ``debug``
2317 ``debug``
2312 Print debugging information. (default: False)
2318 Print debugging information. (default: False)
2313
2319
2314 ``editor``
2320 ``editor``
2315 The editor to use during a commit. (default: ``$EDITOR`` or ``vi``)
2321 The editor to use during a commit. (default: ``$EDITOR`` or ``vi``)
2316
2322
2317 ``fallbackencoding``
2323 ``fallbackencoding``
2318 Encoding to try if it's not possible to decode the changelog using
2324 Encoding to try if it's not possible to decode the changelog using
2319 UTF-8. (default: ISO-8859-1)
2325 UTF-8. (default: ISO-8859-1)
2320
2326
2321 ``graphnodetemplate``
2327 ``graphnodetemplate``
2322 The template used to print changeset nodes in an ASCII revision graph.
2328 The template used to print changeset nodes in an ASCII revision graph.
2323 (default: ``{graphnode}``)
2329 (default: ``{graphnode}``)
2324
2330
2325 ``ignore``
2331 ``ignore``
2326 A file to read per-user ignore patterns from. This file should be
2332 A file to read per-user ignore patterns from. This file should be
2327 in the same format as a repository-wide .hgignore file. Filenames
2333 in the same format as a repository-wide .hgignore file. Filenames
2328 are relative to the repository root. This option supports hook syntax,
2334 are relative to the repository root. This option supports hook syntax,
2329 so if you want to specify multiple ignore files, you can do so by
2335 so if you want to specify multiple ignore files, you can do so by
2330 setting something like ``ignore.other = ~/.hgignore2``. For details
2336 setting something like ``ignore.other = ~/.hgignore2``. For details
2331 of the ignore file format, see the ``hgignore(5)`` man page.
2337 of the ignore file format, see the ``hgignore(5)`` man page.
2332
2338
2333 ``interactive``
2339 ``interactive``
2334 Allow to prompt the user. (default: True)
2340 Allow to prompt the user. (default: True)
2335
2341
2336 ``interface``
2342 ``interface``
2337 Select the default interface for interactive features (default: text).
2343 Select the default interface for interactive features (default: text).
2338 Possible values are 'text' and 'curses'.
2344 Possible values are 'text' and 'curses'.
2339
2345
2340 ``interface.chunkselector``
2346 ``interface.chunkselector``
2341 Select the interface for change recording (e.g. :hg:`commit -i`).
2347 Select the interface for change recording (e.g. :hg:`commit -i`).
2342 Possible values are 'text' and 'curses'.
2348 Possible values are 'text' and 'curses'.
2343 This config overrides the interface specified by ui.interface.
2349 This config overrides the interface specified by ui.interface.
2344
2350
2345 ``large-file-limit``
2351 ``large-file-limit``
2346 Largest file size that gives no memory use warning.
2352 Largest file size that gives no memory use warning.
2347 Possible values are integers or 0 to disable the check.
2353 Possible values are integers or 0 to disable the check.
2348 (default: 10000000)
2354 (default: 10000000)
2349
2355
2350 ``logtemplate``
2356 ``logtemplate``
2351 Template string for commands that print changesets.
2357 Template string for commands that print changesets.
2352
2358
2353 ``merge``
2359 ``merge``
2354 The conflict resolution program to use during a manual merge.
2360 The conflict resolution program to use during a manual merge.
2355 For more information on merge tools see :hg:`help merge-tools`.
2361 For more information on merge tools see :hg:`help merge-tools`.
2356 For configuring merge tools see the ``[merge-tools]`` section.
2362 For configuring merge tools see the ``[merge-tools]`` section.
2357
2363
2358 ``mergemarkers``
2364 ``mergemarkers``
2359 Sets the merge conflict marker label styling. The ``detailed``
2365 Sets the merge conflict marker label styling. The ``detailed``
2360 style uses the ``mergemarkertemplate`` setting to style the labels.
2366 style uses the ``mergemarkertemplate`` setting to style the labels.
2361 The ``basic`` style just uses 'local' and 'other' as the marker label.
2367 The ``basic`` style just uses 'local' and 'other' as the marker label.
2362 One of ``basic`` or ``detailed``.
2368 One of ``basic`` or ``detailed``.
2363 (default: ``basic``)
2369 (default: ``basic``)
2364
2370
2365 ``mergemarkertemplate``
2371 ``mergemarkertemplate``
2366 The template used to print the commit description next to each conflict
2372 The template used to print the commit description next to each conflict
2367 marker during merge conflicts. See :hg:`help templates` for the template
2373 marker during merge conflicts. See :hg:`help templates` for the template
2368 format.
2374 format.
2369
2375
2370 Defaults to showing the hash, tags, branches, bookmarks, author, and
2376 Defaults to showing the hash, tags, branches, bookmarks, author, and
2371 the first line of the commit description.
2377 the first line of the commit description.
2372
2378
2373 If you use non-ASCII characters in names for tags, branches, bookmarks,
2379 If you use non-ASCII characters in names for tags, branches, bookmarks,
2374 authors, and/or commit descriptions, you must pay attention to encodings of
2380 authors, and/or commit descriptions, you must pay attention to encodings of
2375 managed files. At template expansion, non-ASCII characters use the encoding
2381 managed files. At template expansion, non-ASCII characters use the encoding
2376 specified by the ``--encoding`` global option, ``HGENCODING`` or other
2382 specified by the ``--encoding`` global option, ``HGENCODING`` or other
2377 environment variables that govern your locale. If the encoding of the merge
2383 environment variables that govern your locale. If the encoding of the merge
2378 markers is different from the encoding of the merged files,
2384 markers is different from the encoding of the merged files,
2379 serious problems may occur.
2385 serious problems may occur.
2380
2386
2381 Can be overridden per-merge-tool, see the ``[merge-tools]`` section.
2387 Can be overridden per-merge-tool, see the ``[merge-tools]`` section.
2382
2388
2383 ``message-output``
2389 ``message-output``
2384 Where to write status and error messages. (default: ``stdio``)
2390 Where to write status and error messages. (default: ``stdio``)
2385
2391
2392 ``channel``
2393 Use separate channel for structured output. (Command-server only)
2386 ``stderr``
2394 ``stderr``
2387 Everything to stderr.
2395 Everything to stderr.
2388 ``stdio``
2396 ``stdio``
2389 Status to stdout, and error to stderr.
2397 Status to stdout, and error to stderr.
2390
2398
2391 ``origbackuppath``
2399 ``origbackuppath``
2392 The path to a directory used to store generated .orig files. If the path is
2400 The path to a directory used to store generated .orig files. If the path is
2393 not a directory, one will be created. If set, files stored in this
2401 not a directory, one will be created. If set, files stored in this
2394 directory have the same name as the original file and do not have a .orig
2402 directory have the same name as the original file and do not have a .orig
2395 suffix.
2403 suffix.
2396
2404
2397 ``paginate``
2405 ``paginate``
2398 Control the pagination of command output (default: True). See :hg:`help pager`
2406 Control the pagination of command output (default: True). See :hg:`help pager`
2399 for details.
2407 for details.
2400
2408
2401 ``patch``
2409 ``patch``
2402 An optional external tool that ``hg import`` and some extensions
2410 An optional external tool that ``hg import`` and some extensions
2403 will use for applying patches. By default Mercurial uses an
2411 will use for applying patches. By default Mercurial uses an
2404 internal patch utility. The external tool must work as the common
2412 internal patch utility. The external tool must work as the common
2405 Unix ``patch`` program. In particular, it must accept a ``-p``
2413 Unix ``patch`` program. In particular, it must accept a ``-p``
2406 argument to strip patch headers, a ``-d`` argument to specify the
2414 argument to strip patch headers, a ``-d`` argument to specify the
2407 current directory, a file name to patch, and a patch file to take
2415 current directory, a file name to patch, and a patch file to take
2408 from stdin.
2416 from stdin.
2409
2417
2410 It is possible to specify a patch tool together with extra
2418 It is possible to specify a patch tool together with extra
2411 arguments. For example, setting this option to ``patch --merge``
2419 arguments. For example, setting this option to ``patch --merge``
2412 will use the ``patch`` program with its 2-way merge option.
2420 will use the ``patch`` program with its 2-way merge option.
2413
2421
2414 ``portablefilenames``
2422 ``portablefilenames``
2415 Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``.
2423 Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``.
2416 (default: ``warn``)
2424 (default: ``warn``)
2417
2425
2418 ``warn``
2426 ``warn``
2419 Print a warning message on POSIX platforms, if a file with a non-portable
2427 Print a warning message on POSIX platforms, if a file with a non-portable
2420 filename is added (e.g. a file with a name that can't be created on
2428 filename is added (e.g. a file with a name that can't be created on
2421 Windows because it contains reserved parts like ``AUX``, reserved
2429 Windows because it contains reserved parts like ``AUX``, reserved
2422 characters like ``:``, or would cause a case collision with an existing
2430 characters like ``:``, or would cause a case collision with an existing
2423 file).
2431 file).
2424
2432
2425 ``ignore``
2433 ``ignore``
2426 Don't print a warning.
2434 Don't print a warning.
2427
2435
2428 ``abort``
2436 ``abort``
2429 The command is aborted.
2437 The command is aborted.
2430
2438
2431 ``true``
2439 ``true``
2432 Alias for ``warn``.
2440 Alias for ``warn``.
2433
2441
2434 ``false``
2442 ``false``
2435 Alias for ``ignore``.
2443 Alias for ``ignore``.
2436
2444
2437 .. container:: windows
2445 .. container:: windows
2438
2446
2439 On Windows, this configuration option is ignored and the command aborted.
2447 On Windows, this configuration option is ignored and the command aborted.
2440
2448
2441 ``pre-merge-tool-output-template``
2449 ``pre-merge-tool-output-template``
2442 A template that is printed before executing an external merge tool. This can
2450 A template that is printed before executing an external merge tool. This can
2443 be used to print out additional context that might be useful to have during
2451 be used to print out additional context that might be useful to have during
2444 the conflict resolution, such as the description of the various commits
2452 the conflict resolution, such as the description of the various commits
2445 involved or bookmarks/tags.
2453 involved or bookmarks/tags.
2446
2454
2447 Additional information is available in the ``local`, ``base``, and ``other``
2455 Additional information is available in the ``local`, ``base``, and ``other``
2448 dicts. For example: ``{local.label}``, ``{base.name}``, or
2456 dicts. For example: ``{local.label}``, ``{base.name}``, or
2449 ``{other.islink}``.
2457 ``{other.islink}``.
2450
2458
2451 ``quiet``
2459 ``quiet``
2452 Reduce the amount of output printed.
2460 Reduce the amount of output printed.
2453 (default: False)
2461 (default: False)
2454
2462
2455 ``relative-paths``
2463 ``relative-paths``
2456 Prefer relative paths in the UI.
2464 Prefer relative paths in the UI.
2457
2465
2458 ``remotecmd``
2466 ``remotecmd``
2459 Remote command to use for clone/push/pull operations.
2467 Remote command to use for clone/push/pull operations.
2460 (default: ``hg``)
2468 (default: ``hg``)
2461
2469
2462 ``report_untrusted``
2470 ``report_untrusted``
2463 Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
2471 Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
2464 trusted user or group.
2472 trusted user or group.
2465 (default: True)
2473 (default: True)
2466
2474
2467 ``slash``
2475 ``slash``
2468 (Deprecated. Use ``slashpath`` template filter instead.)
2476 (Deprecated. Use ``slashpath`` template filter instead.)
2469
2477
2470 Display paths using a slash (``/``) as the path separator. This
2478 Display paths using a slash (``/``) as the path separator. This
2471 only makes a difference on systems where the default path
2479 only makes a difference on systems where the default path
2472 separator is not the slash character (e.g. Windows uses the
2480 separator is not the slash character (e.g. Windows uses the
2473 backslash character (``\``)).
2481 backslash character (``\``)).
2474 (default: False)
2482 (default: False)
2475
2483
2476 ``statuscopies``
2484 ``statuscopies``
2477 Display copies in the status command.
2485 Display copies in the status command.
2478
2486
2479 ``ssh``
2487 ``ssh``
2480 Command to use for SSH connections. (default: ``ssh``)
2488 Command to use for SSH connections. (default: ``ssh``)
2481
2489
2482 ``ssherrorhint``
2490 ``ssherrorhint``
2483 A hint shown to the user in the case of SSH error (e.g.
2491 A hint shown to the user in the case of SSH error (e.g.
2484 ``Please see http://company/internalwiki/ssh.html``)
2492 ``Please see http://company/internalwiki/ssh.html``)
2485
2493
2486 ``strict``
2494 ``strict``
2487 Require exact command names, instead of allowing unambiguous
2495 Require exact command names, instead of allowing unambiguous
2488 abbreviations. (default: False)
2496 abbreviations. (default: False)
2489
2497
2490 ``style``
2498 ``style``
2491 Name of style to use for command output.
2499 Name of style to use for command output.
2492
2500
2493 ``supportcontact``
2501 ``supportcontact``
2494 A URL where users should report a Mercurial traceback. Use this if you are a
2502 A URL where users should report a Mercurial traceback. Use this if you are a
2495 large organisation with its own Mercurial deployment process and crash
2503 large organisation with its own Mercurial deployment process and crash
2496 reports should be addressed to your internal support.
2504 reports should be addressed to your internal support.
2497
2505
2498 ``textwidth``
2506 ``textwidth``
2499 Maximum width of help text. A longer line generated by ``hg help`` or
2507 Maximum width of help text. A longer line generated by ``hg help`` or
2500 ``hg subcommand --help`` will be broken after white space to get this
2508 ``hg subcommand --help`` will be broken after white space to get this
2501 width or the terminal width, whichever comes first.
2509 width or the terminal width, whichever comes first.
2502 A non-positive value will disable this and the terminal width will be
2510 A non-positive value will disable this and the terminal width will be
2503 used. (default: 78)
2511 used. (default: 78)
2504
2512
2505 ``timeout``
2513 ``timeout``
2506 The timeout used when a lock is held (in seconds), a negative value
2514 The timeout used when a lock is held (in seconds), a negative value
2507 means no timeout. (default: 600)
2515 means no timeout. (default: 600)
2508
2516
2509 ``timeout.warn``
2517 ``timeout.warn``
2510 Time (in seconds) before a warning is printed about held lock. A negative
2518 Time (in seconds) before a warning is printed about held lock. A negative
2511 value means no warning. (default: 0)
2519 value means no warning. (default: 0)
2512
2520
2513 ``traceback``
2521 ``traceback``
2514 Mercurial always prints a traceback when an unknown exception
2522 Mercurial always prints a traceback when an unknown exception
2515 occurs. Setting this to True will make Mercurial print a traceback
2523 occurs. Setting this to True will make Mercurial print a traceback
2516 on all exceptions, even those recognized by Mercurial (such as
2524 on all exceptions, even those recognized by Mercurial (such as
2517 IOError or MemoryError). (default: False)
2525 IOError or MemoryError). (default: False)
2518
2526
2519 ``tweakdefaults``
2527 ``tweakdefaults``
2520
2528
2521 By default Mercurial's behavior changes very little from release
2529 By default Mercurial's behavior changes very little from release
2522 to release, but over time the recommended config settings
2530 to release, but over time the recommended config settings
2523 shift. Enable this config to opt in to get automatic tweaks to
2531 shift. Enable this config to opt in to get automatic tweaks to
2524 Mercurial's behavior over time. This config setting will have no
2532 Mercurial's behavior over time. This config setting will have no
2525 effect if ``HGPLAIN`` is set or ``HGPLAINEXCEPT`` is set and does
2533 effect if ``HGPLAIN`` is set or ``HGPLAINEXCEPT`` is set and does
2526 not include ``tweakdefaults``. (default: False)
2534 not include ``tweakdefaults``. (default: False)
2527
2535
2528 It currently means::
2536 It currently means::
2529
2537
2530 .. tweakdefaultsmarker
2538 .. tweakdefaultsmarker
2531
2539
2532 ``username``
2540 ``username``
2533 The committer of a changeset created when running "commit".
2541 The committer of a changeset created when running "commit".
2534 Typically a person's name and email address, e.g. ``Fred Widget
2542 Typically a person's name and email address, e.g. ``Fred Widget
2535 <fred@example.com>``. Environment variables in the
2543 <fred@example.com>``. Environment variables in the
2536 username are expanded.
2544 username are expanded.
2537
2545
2538 (default: ``$EMAIL`` or ``username@hostname``. If the username in
2546 (default: ``$EMAIL`` or ``username@hostname``. If the username in
2539 hgrc is empty, e.g. if the system admin set ``username =`` in the
2547 hgrc is empty, e.g. if the system admin set ``username =`` in the
2540 system hgrc, it has to be specified manually or in a different
2548 system hgrc, it has to be specified manually or in a different
2541 hgrc file)
2549 hgrc file)
2542
2550
2543 ``verbose``
2551 ``verbose``
2544 Increase the amount of output printed. (default: False)
2552 Increase the amount of output printed. (default: False)
2545
2553
2546
2554
2547 ``web``
2555 ``web``
2548 -------
2556 -------
2549
2557
2550 Web interface configuration. The settings in this section apply to
2558 Web interface configuration. The settings in this section apply to
2551 both the builtin webserver (started by :hg:`serve`) and the script you
2559 both the builtin webserver (started by :hg:`serve`) and the script you
2552 run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI
2560 run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI
2553 and WSGI).
2561 and WSGI).
2554
2562
2555 The Mercurial webserver does no authentication (it does not prompt for
2563 The Mercurial webserver does no authentication (it does not prompt for
2556 usernames and passwords to validate *who* users are), but it does do
2564 usernames and passwords to validate *who* users are), but it does do
2557 authorization (it grants or denies access for *authenticated users*
2565 authorization (it grants or denies access for *authenticated users*
2558 based on settings in this section). You must either configure your
2566 based on settings in this section). You must either configure your
2559 webserver to do authentication for you, or disable the authorization
2567 webserver to do authentication for you, or disable the authorization
2560 checks.
2568 checks.
2561
2569
2562 For a quick setup in a trusted environment, e.g., a private LAN, where
2570 For a quick setup in a trusted environment, e.g., a private LAN, where
2563 you want it to accept pushes from anybody, you can use the following
2571 you want it to accept pushes from anybody, you can use the following
2564 command line::
2572 command line::
2565
2573
2566 $ hg --config web.allow-push=* --config web.push_ssl=False serve
2574 $ hg --config web.allow-push=* --config web.push_ssl=False serve
2567
2575
2568 Note that this will allow anybody to push anything to the server and
2576 Note that this will allow anybody to push anything to the server and
2569 that this should not be used for public servers.
2577 that this should not be used for public servers.
2570
2578
2571 The full set of options is:
2579 The full set of options is:
2572
2580
2573 ``accesslog``
2581 ``accesslog``
2574 Where to output the access log. (default: stdout)
2582 Where to output the access log. (default: stdout)
2575
2583
2576 ``address``
2584 ``address``
2577 Interface address to bind to. (default: all)
2585 Interface address to bind to. (default: all)
2578
2586
2579 ``allow-archive``
2587 ``allow-archive``
2580 List of archive format (bz2, gz, zip) allowed for downloading.
2588 List of archive format (bz2, gz, zip) allowed for downloading.
2581 (default: empty)
2589 (default: empty)
2582
2590
2583 ``allowbz2``
2591 ``allowbz2``
2584 (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
2592 (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
2585 revisions.
2593 revisions.
2586 (default: False)
2594 (default: False)
2587
2595
2588 ``allowgz``
2596 ``allowgz``
2589 (DEPRECATED) Whether to allow .tar.gz downloading of repository
2597 (DEPRECATED) Whether to allow .tar.gz downloading of repository
2590 revisions.
2598 revisions.
2591 (default: False)
2599 (default: False)
2592
2600
2593 ``allow-pull``
2601 ``allow-pull``
2594 Whether to allow pulling from the repository. (default: True)
2602 Whether to allow pulling from the repository. (default: True)
2595
2603
2596 ``allow-push``
2604 ``allow-push``
2597 Whether to allow pushing to the repository. If empty or not set,
2605 Whether to allow pushing to the repository. If empty or not set,
2598 pushing is not allowed. If the special value ``*``, any remote
2606 pushing is not allowed. If the special value ``*``, any remote
2599 user can push, including unauthenticated users. Otherwise, the
2607 user can push, including unauthenticated users. Otherwise, the
2600 remote user must have been authenticated, and the authenticated
2608 remote user must have been authenticated, and the authenticated
2601 user name must be present in this list. The contents of the
2609 user name must be present in this list. The contents of the
2602 allow-push list are examined after the deny_push list.
2610 allow-push list are examined after the deny_push list.
2603
2611
2604 ``allow_read``
2612 ``allow_read``
2605 If the user has not already been denied repository access due to
2613 If the user has not already been denied repository access due to
2606 the contents of deny_read, this list determines whether to grant
2614 the contents of deny_read, this list determines whether to grant
2607 repository access to the user. If this list is not empty, and the
2615 repository access to the user. If this list is not empty, and the
2608 user is unauthenticated or not present in the list, then access is
2616 user is unauthenticated or not present in the list, then access is
2609 denied for the user. If the list is empty or not set, then access
2617 denied for the user. If the list is empty or not set, then access
2610 is permitted to all users by default. Setting allow_read to the
2618 is permitted to all users by default. Setting allow_read to the
2611 special value ``*`` is equivalent to it not being set (i.e. access
2619 special value ``*`` is equivalent to it not being set (i.e. access
2612 is permitted to all users). The contents of the allow_read list are
2620 is permitted to all users). The contents of the allow_read list are
2613 examined after the deny_read list.
2621 examined after the deny_read list.
2614
2622
2615 ``allowzip``
2623 ``allowzip``
2616 (DEPRECATED) Whether to allow .zip downloading of repository
2624 (DEPRECATED) Whether to allow .zip downloading of repository
2617 revisions. This feature creates temporary files.
2625 revisions. This feature creates temporary files.
2618 (default: False)
2626 (default: False)
2619
2627
2620 ``archivesubrepos``
2628 ``archivesubrepos``
2621 Whether to recurse into subrepositories when archiving.
2629 Whether to recurse into subrepositories when archiving.
2622 (default: False)
2630 (default: False)
2623
2631
2624 ``baseurl``
2632 ``baseurl``
2625 Base URL to use when publishing URLs in other locations, so
2633 Base URL to use when publishing URLs in other locations, so
2626 third-party tools like email notification hooks can construct
2634 third-party tools like email notification hooks can construct
2627 URLs. Example: ``http://hgserver/repos/``.
2635 URLs. Example: ``http://hgserver/repos/``.
2628
2636
2629 ``cacerts``
2637 ``cacerts``
2630 Path to file containing a list of PEM encoded certificate
2638 Path to file containing a list of PEM encoded certificate
2631 authority certificates. Environment variables and ``~user``
2639 authority certificates. Environment variables and ``~user``
2632 constructs are expanded in the filename. If specified on the
2640 constructs are expanded in the filename. If specified on the
2633 client, then it will verify the identity of remote HTTPS servers
2641 client, then it will verify the identity of remote HTTPS servers
2634 with these certificates.
2642 with these certificates.
2635
2643
2636 To disable SSL verification temporarily, specify ``--insecure`` from
2644 To disable SSL verification temporarily, specify ``--insecure`` from
2637 command line.
2645 command line.
2638
2646
2639 You can use OpenSSL's CA certificate file if your platform has
2647 You can use OpenSSL's CA certificate file if your platform has
2640 one. On most Linux systems this will be
2648 one. On most Linux systems this will be
2641 ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to
2649 ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to
2642 generate this file manually. The form must be as follows::
2650 generate this file manually. The form must be as follows::
2643
2651
2644 -----BEGIN CERTIFICATE-----
2652 -----BEGIN CERTIFICATE-----
2645 ... (certificate in base64 PEM encoding) ...
2653 ... (certificate in base64 PEM encoding) ...
2646 -----END CERTIFICATE-----
2654 -----END CERTIFICATE-----
2647 -----BEGIN CERTIFICATE-----
2655 -----BEGIN CERTIFICATE-----
2648 ... (certificate in base64 PEM encoding) ...
2656 ... (certificate in base64 PEM encoding) ...
2649 -----END CERTIFICATE-----
2657 -----END CERTIFICATE-----
2650
2658
2651 ``cache``
2659 ``cache``
2652 Whether to support caching in hgweb. (default: True)
2660 Whether to support caching in hgweb. (default: True)
2653
2661
2654 ``certificate``
2662 ``certificate``
2655 Certificate to use when running :hg:`serve`.
2663 Certificate to use when running :hg:`serve`.
2656
2664
2657 ``collapse``
2665 ``collapse``
2658 With ``descend`` enabled, repositories in subdirectories are shown at
2666 With ``descend`` enabled, repositories in subdirectories are shown at
2659 a single level alongside repositories in the current path. With
2667 a single level alongside repositories in the current path. With
2660 ``collapse`` also enabled, repositories residing at a deeper level than
2668 ``collapse`` also enabled, repositories residing at a deeper level than
2661 the current path are grouped behind navigable directory entries that
2669 the current path are grouped behind navigable directory entries that
2662 lead to the locations of these repositories. In effect, this setting
2670 lead to the locations of these repositories. In effect, this setting
2663 collapses each collection of repositories found within a subdirectory
2671 collapses each collection of repositories found within a subdirectory
2664 into a single entry for that subdirectory. (default: False)
2672 into a single entry for that subdirectory. (default: False)
2665
2673
2666 ``comparisoncontext``
2674 ``comparisoncontext``
2667 Number of lines of context to show in side-by-side file comparison. If
2675 Number of lines of context to show in side-by-side file comparison. If
2668 negative or the value ``full``, whole files are shown. (default: 5)
2676 negative or the value ``full``, whole files are shown. (default: 5)
2669
2677
2670 This setting can be overridden by a ``context`` request parameter to the
2678 This setting can be overridden by a ``context`` request parameter to the
2671 ``comparison`` command, taking the same values.
2679 ``comparison`` command, taking the same values.
2672
2680
2673 ``contact``
2681 ``contact``
2674 Name or email address of the person in charge of the repository.
2682 Name or email address of the person in charge of the repository.
2675 (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty)
2683 (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty)
2676
2684
2677 ``csp``
2685 ``csp``
2678 Send a ``Content-Security-Policy`` HTTP header with this value.
2686 Send a ``Content-Security-Policy`` HTTP header with this value.
2679
2687
2680 The value may contain a special string ``%nonce%``, which will be replaced
2688 The value may contain a special string ``%nonce%``, which will be replaced
2681 by a randomly-generated one-time use value. If the value contains
2689 by a randomly-generated one-time use value. If the value contains
2682 ``%nonce%``, ``web.cache`` will be disabled, as caching undermines the
2690 ``%nonce%``, ``web.cache`` will be disabled, as caching undermines the
2683 one-time property of the nonce. This nonce will also be inserted into
2691 one-time property of the nonce. This nonce will also be inserted into
2684 ``<script>`` elements containing inline JavaScript.
2692 ``<script>`` elements containing inline JavaScript.
2685
2693
2686 Note: lots of HTML content sent by the server is derived from repository
2694 Note: lots of HTML content sent by the server is derived from repository
2687 data. Please consider the potential for malicious repository data to
2695 data. Please consider the potential for malicious repository data to
2688 "inject" itself into generated HTML content as part of your security
2696 "inject" itself into generated HTML content as part of your security
2689 threat model.
2697 threat model.
2690
2698
2691 ``deny_push``
2699 ``deny_push``
2692 Whether to deny pushing to the repository. If empty or not set,
2700 Whether to deny pushing to the repository. If empty or not set,
2693 push is not denied. If the special value ``*``, all remote users are
2701 push is not denied. If the special value ``*``, all remote users are
2694 denied push. Otherwise, unauthenticated users are all denied, and
2702 denied push. Otherwise, unauthenticated users are all denied, and
2695 any authenticated user name present in this list is also denied. The
2703 any authenticated user name present in this list is also denied. The
2696 contents of the deny_push list are examined before the allow-push list.
2704 contents of the deny_push list are examined before the allow-push list.
2697
2705
2698 ``deny_read``
2706 ``deny_read``
2699 Whether to deny reading/viewing of the repository. If this list is
2707 Whether to deny reading/viewing of the repository. If this list is
2700 not empty, unauthenticated users are all denied, and any
2708 not empty, unauthenticated users are all denied, and any
2701 authenticated user name present in this list is also denied access to
2709 authenticated user name present in this list is also denied access to
2702 the repository. If set to the special value ``*``, all remote users
2710 the repository. If set to the special value ``*``, all remote users
2703 are denied access (rarely needed ;). If deny_read is empty or not set,
2711 are denied access (rarely needed ;). If deny_read is empty or not set,
2704 the determination of repository access depends on the presence and
2712 the determination of repository access depends on the presence and
2705 content of the allow_read list (see description). If both
2713 content of the allow_read list (see description). If both
2706 deny_read and allow_read are empty or not set, then access is
2714 deny_read and allow_read are empty or not set, then access is
2707 permitted to all users by default. If the repository is being
2715 permitted to all users by default. If the repository is being
2708 served via hgwebdir, denied users will not be able to see it in
2716 served via hgwebdir, denied users will not be able to see it in
2709 the list of repositories. The contents of the deny_read list have
2717 the list of repositories. The contents of the deny_read list have
2710 priority over (are examined before) the contents of the allow_read
2718 priority over (are examined before) the contents of the allow_read
2711 list.
2719 list.
2712
2720
2713 ``descend``
2721 ``descend``
2714 hgwebdir indexes will not descend into subdirectories. Only repositories
2722 hgwebdir indexes will not descend into subdirectories. Only repositories
2715 directly in the current path will be shown (other repositories are still
2723 directly in the current path will be shown (other repositories are still
2716 available from the index corresponding to their containing path).
2724 available from the index corresponding to their containing path).
2717
2725
2718 ``description``
2726 ``description``
2719 Textual description of the repository's purpose or contents.
2727 Textual description of the repository's purpose or contents.
2720 (default: "unknown")
2728 (default: "unknown")
2721
2729
2722 ``encoding``
2730 ``encoding``
2723 Character encoding name. (default: the current locale charset)
2731 Character encoding name. (default: the current locale charset)
2724 Example: "UTF-8".
2732 Example: "UTF-8".
2725
2733
2726 ``errorlog``
2734 ``errorlog``
2727 Where to output the error log. (default: stderr)
2735 Where to output the error log. (default: stderr)
2728
2736
2729 ``guessmime``
2737 ``guessmime``
2730 Control MIME types for raw download of file content.
2738 Control MIME types for raw download of file content.
2731 Set to True to let hgweb guess the content type from the file
2739 Set to True to let hgweb guess the content type from the file
2732 extension. This will serve HTML files as ``text/html`` and might
2740 extension. This will serve HTML files as ``text/html`` and might
2733 allow cross-site scripting attacks when serving untrusted
2741 allow cross-site scripting attacks when serving untrusted
2734 repositories. (default: False)
2742 repositories. (default: False)
2735
2743
2736 ``hidden``
2744 ``hidden``
2737 Whether to hide the repository in the hgwebdir index.
2745 Whether to hide the repository in the hgwebdir index.
2738 (default: False)
2746 (default: False)
2739
2747
2740 ``ipv6``
2748 ``ipv6``
2741 Whether to use IPv6. (default: False)
2749 Whether to use IPv6. (default: False)
2742
2750
2743 ``labels``
2751 ``labels``
2744 List of string *labels* associated with the repository.
2752 List of string *labels* associated with the repository.
2745
2753
2746 Labels are exposed as a template keyword and can be used to customize
2754 Labels are exposed as a template keyword and can be used to customize
2747 output. e.g. the ``index`` template can group or filter repositories
2755 output. e.g. the ``index`` template can group or filter repositories
2748 by labels and the ``summary`` template can display additional content
2756 by labels and the ``summary`` template can display additional content
2749 if a specific label is present.
2757 if a specific label is present.
2750
2758
2751 ``logoimg``
2759 ``logoimg``
2752 File name of the logo image that some templates display on each page.
2760 File name of the logo image that some templates display on each page.
2753 The file name is relative to ``staticurl``. That is, the full path to
2761 The file name is relative to ``staticurl``. That is, the full path to
2754 the logo image is "staticurl/logoimg".
2762 the logo image is "staticurl/logoimg".
2755 If unset, ``hglogo.png`` will be used.
2763 If unset, ``hglogo.png`` will be used.
2756
2764
2757 ``logourl``
2765 ``logourl``
2758 Base URL to use for logos. If unset, ``https://mercurial-scm.org/``
2766 Base URL to use for logos. If unset, ``https://mercurial-scm.org/``
2759 will be used.
2767 will be used.
2760
2768
2761 ``maxchanges``
2769 ``maxchanges``
2762 Maximum number of changes to list on the changelog. (default: 10)
2770 Maximum number of changes to list on the changelog. (default: 10)
2763
2771
2764 ``maxfiles``
2772 ``maxfiles``
2765 Maximum number of files to list per changeset. (default: 10)
2773 Maximum number of files to list per changeset. (default: 10)
2766
2774
2767 ``maxshortchanges``
2775 ``maxshortchanges``
2768 Maximum number of changes to list on the shortlog, graph or filelog
2776 Maximum number of changes to list on the shortlog, graph or filelog
2769 pages. (default: 60)
2777 pages. (default: 60)
2770
2778
2771 ``name``
2779 ``name``
2772 Repository name to use in the web interface.
2780 Repository name to use in the web interface.
2773 (default: current working directory)
2781 (default: current working directory)
2774
2782
2775 ``port``
2783 ``port``
2776 Port to listen on. (default: 8000)
2784 Port to listen on. (default: 8000)
2777
2785
2778 ``prefix``
2786 ``prefix``
2779 Prefix path to serve from. (default: '' (server root))
2787 Prefix path to serve from. (default: '' (server root))
2780
2788
2781 ``push_ssl``
2789 ``push_ssl``
2782 Whether to require that inbound pushes be transported over SSL to
2790 Whether to require that inbound pushes be transported over SSL to
2783 prevent password sniffing. (default: True)
2791 prevent password sniffing. (default: True)
2784
2792
2785 ``refreshinterval``
2793 ``refreshinterval``
2786 How frequently directory listings re-scan the filesystem for new
2794 How frequently directory listings re-scan the filesystem for new
2787 repositories, in seconds. This is relevant when wildcards are used
2795 repositories, in seconds. This is relevant when wildcards are used
2788 to define paths. Depending on how much filesystem traversal is
2796 to define paths. Depending on how much filesystem traversal is
2789 required, refreshing may negatively impact performance.
2797 required, refreshing may negatively impact performance.
2790
2798
2791 Values less than or equal to 0 always refresh.
2799 Values less than or equal to 0 always refresh.
2792 (default: 20)
2800 (default: 20)
2793
2801
2794 ``server-header``
2802 ``server-header``
2795 Value for HTTP ``Server`` response header.
2803 Value for HTTP ``Server`` response header.
2796
2804
2797 ``static``
2805 ``static``
2798 Directory where static files are served from.
2806 Directory where static files are served from.
2799
2807
2800 ``staticurl``
2808 ``staticurl``
2801 Base URL to use for static files. If unset, static files (e.g. the
2809 Base URL to use for static files. If unset, static files (e.g. the
2802 hgicon.png favicon) will be served by the CGI script itself. Use
2810 hgicon.png favicon) will be served by the CGI script itself. Use
2803 this setting to serve them directly with the HTTP server.
2811 this setting to serve them directly with the HTTP server.
2804 Example: ``http://hgserver/static/``.
2812 Example: ``http://hgserver/static/``.
2805
2813
2806 ``stripes``
2814 ``stripes``
2807 How many lines a "zebra stripe" should span in multi-line output.
2815 How many lines a "zebra stripe" should span in multi-line output.
2808 Set to 0 to disable. (default: 1)
2816 Set to 0 to disable. (default: 1)
2809
2817
2810 ``style``
2818 ``style``
2811 Which template map style to use. The available options are the names of
2819 Which template map style to use. The available options are the names of
2812 subdirectories in the HTML templates path. (default: ``paper``)
2820 subdirectories in the HTML templates path. (default: ``paper``)
2813 Example: ``monoblue``.
2821 Example: ``monoblue``.
2814
2822
2815 ``templates``
2823 ``templates``
2816 Where to find the HTML templates. The default path to the HTML templates
2824 Where to find the HTML templates. The default path to the HTML templates
2817 can be obtained from ``hg debuginstall``.
2825 can be obtained from ``hg debuginstall``.
2818
2826
2819 ``websub``
2827 ``websub``
2820 ----------
2828 ----------
2821
2829
2822 Web substitution filter definition. You can use this section to
2830 Web substitution filter definition. You can use this section to
2823 define a set of regular expression substitution patterns which
2831 define a set of regular expression substitution patterns which
2824 let you automatically modify the hgweb server output.
2832 let you automatically modify the hgweb server output.
2825
2833
2826 The default hgweb templates only apply these substitution patterns
2834 The default hgweb templates only apply these substitution patterns
2827 on the revision description fields. You can apply them anywhere
2835 on the revision description fields. You can apply them anywhere
2828 you want when you create your own templates by adding calls to the
2836 you want when you create your own templates by adding calls to the
2829 "websub" filter (usually after calling the "escape" filter).
2837 "websub" filter (usually after calling the "escape" filter).
2830
2838
2831 This can be used, for example, to convert issue references to links
2839 This can be used, for example, to convert issue references to links
2832 to your issue tracker, or to convert "markdown-like" syntax into
2840 to your issue tracker, or to convert "markdown-like" syntax into
2833 HTML (see the examples below).
2841 HTML (see the examples below).
2834
2842
2835 Each entry in this section names a substitution filter.
2843 Each entry in this section names a substitution filter.
2836 The value of each entry defines the substitution expression itself.
2844 The value of each entry defines the substitution expression itself.
2837 The websub expressions follow the old interhg extension syntax,
2845 The websub expressions follow the old interhg extension syntax,
2838 which in turn imitates the Unix sed replacement syntax::
2846 which in turn imitates the Unix sed replacement syntax::
2839
2847
2840 patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i]
2848 patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i]
2841
2849
2842 You can use any separator other than "/". The final "i" is optional
2850 You can use any separator other than "/". The final "i" is optional
2843 and indicates that the search must be case insensitive.
2851 and indicates that the search must be case insensitive.
2844
2852
2845 Examples::
2853 Examples::
2846
2854
2847 [websub]
2855 [websub]
2848 issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i
2856 issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i
2849 italic = s/\b_(\S+)_\b/<i>\1<\/i>/
2857 italic = s/\b_(\S+)_\b/<i>\1<\/i>/
2850 bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/
2858 bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/
2851
2859
2852 ``worker``
2860 ``worker``
2853 ----------
2861 ----------
2854
2862
2855 Parallel master/worker configuration. We currently perform working
2863 Parallel master/worker configuration. We currently perform working
2856 directory updates in parallel on Unix-like systems, which greatly
2864 directory updates in parallel on Unix-like systems, which greatly
2857 helps performance.
2865 helps performance.
2858
2866
2859 ``enabled``
2867 ``enabled``
2860 Whether to enable workers code to be used.
2868 Whether to enable workers code to be used.
2861 (default: true)
2869 (default: true)
2862
2870
2863 ``numcpus``
2871 ``numcpus``
2864 Number of CPUs to use for parallel operations. A zero or
2872 Number of CPUs to use for parallel operations. A zero or
2865 negative value is treated as ``use the default``.
2873 negative value is treated as ``use the default``.
2866 (default: 4 or the number of CPUs on the system, whichever is larger)
2874 (default: 4 or the number of CPUs on the system, whichever is larger)
2867
2875
2868 ``backgroundclose``
2876 ``backgroundclose``
2869 Whether to enable closing file handles on background threads during certain
2877 Whether to enable closing file handles on background threads during certain
2870 operations. Some platforms aren't very efficient at closing file
2878 operations. Some platforms aren't very efficient at closing file
2871 handles that have been written or appended to. By performing file closing
2879 handles that have been written or appended to. By performing file closing
2872 on background threads, file write rate can increase substantially.
2880 on background threads, file write rate can increase substantially.
2873 (default: true on Windows, false elsewhere)
2881 (default: true on Windows, false elsewhere)
2874
2882
2875 ``backgroundcloseminfilecount``
2883 ``backgroundcloseminfilecount``
2876 Minimum number of files required to trigger background file closing.
2884 Minimum number of files required to trigger background file closing.
2877 Operations not writing this many files won't start background close
2885 Operations not writing this many files won't start background close
2878 threads.
2886 threads.
2879 (default: 2048)
2887 (default: 2048)
2880
2888
2881 ``backgroundclosemaxqueue``
2889 ``backgroundclosemaxqueue``
2882 The maximum number of opened file handles waiting to be closed in the
2890 The maximum number of opened file handles waiting to be closed in the
2883 background. This option only has an effect if ``backgroundclose`` is
2891 background. This option only has an effect if ``backgroundclose`` is
2884 enabled.
2892 enabled.
2885 (default: 384)
2893 (default: 384)
2886
2894
2887 ``backgroundclosethreadcount``
2895 ``backgroundclosethreadcount``
2888 Number of threads to process background file closes. Only relevant if
2896 Number of threads to process background file closes. Only relevant if
2889 ``backgroundclose`` is enabled.
2897 ``backgroundclose`` is enabled.
2890 (default: 4)
2898 (default: 4)
General Comments 0
You need to be logged in to leave comments. Login now