##// END OF EJS Templates
filemerge: add support for the new "mergediff" marker style to premerge...
Martin von Zweigbergk -
r46755:3ca5ca38 default
parent child Browse files
Show More
@@ -1,1293 +1,1298 b''
1 # filemerge.py - file-level merge handling for Mercurial
1 # filemerge.py - file-level merge handling for Mercurial
2 #
2 #
3 # Copyright 2006, 2007, 2008 Matt Mackall <mpm@selenic.com>
3 # Copyright 2006, 2007, 2008 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 contextlib
10 import contextlib
11 import os
11 import os
12 import re
12 import re
13 import shutil
13 import shutil
14
14
15 from .i18n import _
15 from .i18n import _
16 from .node import (
16 from .node import (
17 hex,
17 hex,
18 nullid,
18 nullid,
19 short,
19 short,
20 )
20 )
21 from .pycompat import (
21 from .pycompat import (
22 getattr,
22 getattr,
23 open,
23 open,
24 )
24 )
25
25
26 from . import (
26 from . import (
27 encoding,
27 encoding,
28 error,
28 error,
29 formatter,
29 formatter,
30 match,
30 match,
31 pycompat,
31 pycompat,
32 registrar,
32 registrar,
33 scmutil,
33 scmutil,
34 simplemerge,
34 simplemerge,
35 tagmerge,
35 tagmerge,
36 templatekw,
36 templatekw,
37 templater,
37 templater,
38 templateutil,
38 templateutil,
39 util,
39 util,
40 )
40 )
41
41
42 from .utils import (
42 from .utils import (
43 procutil,
43 procutil,
44 stringutil,
44 stringutil,
45 )
45 )
46
46
47
47
48 def _toolstr(ui, tool, part, *args):
48 def _toolstr(ui, tool, part, *args):
49 return ui.config(b"merge-tools", tool + b"." + part, *args)
49 return ui.config(b"merge-tools", tool + b"." + part, *args)
50
50
51
51
52 def _toolbool(ui, tool, part, *args):
52 def _toolbool(ui, tool, part, *args):
53 return ui.configbool(b"merge-tools", tool + b"." + part, *args)
53 return ui.configbool(b"merge-tools", tool + b"." + part, *args)
54
54
55
55
56 def _toollist(ui, tool, part):
56 def _toollist(ui, tool, part):
57 return ui.configlist(b"merge-tools", tool + b"." + part)
57 return ui.configlist(b"merge-tools", tool + b"." + part)
58
58
59
59
60 internals = {}
60 internals = {}
61 # Merge tools to document.
61 # Merge tools to document.
62 internalsdoc = {}
62 internalsdoc = {}
63
63
64 internaltool = registrar.internalmerge()
64 internaltool = registrar.internalmerge()
65
65
66 # internal tool merge types
66 # internal tool merge types
67 nomerge = internaltool.nomerge
67 nomerge = internaltool.nomerge
68 mergeonly = internaltool.mergeonly # just the full merge, no premerge
68 mergeonly = internaltool.mergeonly # just the full merge, no premerge
69 fullmerge = internaltool.fullmerge # both premerge and merge
69 fullmerge = internaltool.fullmerge # both premerge and merge
70
70
71 # IMPORTANT: keep the last line of this prompt very short ("What do you want to
71 # IMPORTANT: keep the last line of this prompt very short ("What do you want to
72 # do?") because of issue6158, ideally to <40 English characters (to allow other
72 # do?") because of issue6158, ideally to <40 English characters (to allow other
73 # languages that may take more columns to still have a chance to fit in an
73 # languages that may take more columns to still have a chance to fit in an
74 # 80-column screen).
74 # 80-column screen).
75 _localchangedotherdeletedmsg = _(
75 _localchangedotherdeletedmsg = _(
76 b"file '%(fd)s' was deleted in other%(o)s but was modified in local%(l)s.\n"
76 b"file '%(fd)s' was deleted in other%(o)s but was modified in local%(l)s.\n"
77 b"You can use (c)hanged version, (d)elete, or leave (u)nresolved.\n"
77 b"You can use (c)hanged version, (d)elete, or leave (u)nresolved.\n"
78 b"What do you want to do?"
78 b"What do you want to do?"
79 b"$$ &Changed $$ &Delete $$ &Unresolved"
79 b"$$ &Changed $$ &Delete $$ &Unresolved"
80 )
80 )
81
81
82 _otherchangedlocaldeletedmsg = _(
82 _otherchangedlocaldeletedmsg = _(
83 b"file '%(fd)s' was deleted in local%(l)s but was modified in other%(o)s.\n"
83 b"file '%(fd)s' was deleted in local%(l)s but was modified in other%(o)s.\n"
84 b"You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.\n"
84 b"You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.\n"
85 b"What do you want to do?"
85 b"What do you want to do?"
86 b"$$ &Changed $$ &Deleted $$ &Unresolved"
86 b"$$ &Changed $$ &Deleted $$ &Unresolved"
87 )
87 )
88
88
89
89
90 class absentfilectx(object):
90 class absentfilectx(object):
91 """Represents a file that's ostensibly in a context but is actually not
91 """Represents a file that's ostensibly in a context but is actually not
92 present in it.
92 present in it.
93
93
94 This is here because it's very specific to the filemerge code for now --
94 This is here because it's very specific to the filemerge code for now --
95 other code is likely going to break with the values this returns."""
95 other code is likely going to break with the values this returns."""
96
96
97 def __init__(self, ctx, f):
97 def __init__(self, ctx, f):
98 self._ctx = ctx
98 self._ctx = ctx
99 self._f = f
99 self._f = f
100
100
101 def __bytes__(self):
101 def __bytes__(self):
102 return b'absent file %s@%s' % (self._f, self._ctx)
102 return b'absent file %s@%s' % (self._f, self._ctx)
103
103
104 def path(self):
104 def path(self):
105 return self._f
105 return self._f
106
106
107 def size(self):
107 def size(self):
108 return None
108 return None
109
109
110 def data(self):
110 def data(self):
111 return None
111 return None
112
112
113 def filenode(self):
113 def filenode(self):
114 return nullid
114 return nullid
115
115
116 _customcmp = True
116 _customcmp = True
117
117
118 def cmp(self, fctx):
118 def cmp(self, fctx):
119 """compare with other file context
119 """compare with other file context
120
120
121 returns True if different from fctx.
121 returns True if different from fctx.
122 """
122 """
123 return not (
123 return not (
124 fctx.isabsent()
124 fctx.isabsent()
125 and fctx.changectx() == self.changectx()
125 and fctx.changectx() == self.changectx()
126 and fctx.path() == self.path()
126 and fctx.path() == self.path()
127 )
127 )
128
128
129 def flags(self):
129 def flags(self):
130 return b''
130 return b''
131
131
132 def changectx(self):
132 def changectx(self):
133 return self._ctx
133 return self._ctx
134
134
135 def isbinary(self):
135 def isbinary(self):
136 return False
136 return False
137
137
138 def isabsent(self):
138 def isabsent(self):
139 return True
139 return True
140
140
141
141
142 def _findtool(ui, tool):
142 def _findtool(ui, tool):
143 if tool in internals:
143 if tool in internals:
144 return tool
144 return tool
145 cmd = _toolstr(ui, tool, b"executable", tool)
145 cmd = _toolstr(ui, tool, b"executable", tool)
146 if cmd.startswith(b'python:'):
146 if cmd.startswith(b'python:'):
147 return cmd
147 return cmd
148 return findexternaltool(ui, tool)
148 return findexternaltool(ui, tool)
149
149
150
150
151 def _quotetoolpath(cmd):
151 def _quotetoolpath(cmd):
152 if cmd.startswith(b'python:'):
152 if cmd.startswith(b'python:'):
153 return cmd
153 return cmd
154 return procutil.shellquote(cmd)
154 return procutil.shellquote(cmd)
155
155
156
156
157 def findexternaltool(ui, tool):
157 def findexternaltool(ui, tool):
158 for kn in (b"regkey", b"regkeyalt"):
158 for kn in (b"regkey", b"regkeyalt"):
159 k = _toolstr(ui, tool, kn)
159 k = _toolstr(ui, tool, kn)
160 if not k:
160 if not k:
161 continue
161 continue
162 p = util.lookupreg(k, _toolstr(ui, tool, b"regname"))
162 p = util.lookupreg(k, _toolstr(ui, tool, b"regname"))
163 if p:
163 if p:
164 p = procutil.findexe(p + _toolstr(ui, tool, b"regappend", b""))
164 p = procutil.findexe(p + _toolstr(ui, tool, b"regappend", b""))
165 if p:
165 if p:
166 return p
166 return p
167 exe = _toolstr(ui, tool, b"executable", tool)
167 exe = _toolstr(ui, tool, b"executable", tool)
168 return procutil.findexe(util.expandpath(exe))
168 return procutil.findexe(util.expandpath(exe))
169
169
170
170
171 def _picktool(repo, ui, path, binary, symlink, changedelete):
171 def _picktool(repo, ui, path, binary, symlink, changedelete):
172 strictcheck = ui.configbool(b'merge', b'strict-capability-check')
172 strictcheck = ui.configbool(b'merge', b'strict-capability-check')
173
173
174 def hascapability(tool, capability, strict=False):
174 def hascapability(tool, capability, strict=False):
175 if tool in internals:
175 if tool in internals:
176 return strict and internals[tool].capabilities.get(capability)
176 return strict and internals[tool].capabilities.get(capability)
177 return _toolbool(ui, tool, capability)
177 return _toolbool(ui, tool, capability)
178
178
179 def supportscd(tool):
179 def supportscd(tool):
180 return tool in internals and internals[tool].mergetype == nomerge
180 return tool in internals and internals[tool].mergetype == nomerge
181
181
182 def check(tool, pat, symlink, binary, changedelete):
182 def check(tool, pat, symlink, binary, changedelete):
183 tmsg = tool
183 tmsg = tool
184 if pat:
184 if pat:
185 tmsg = _(b"%s (for pattern %s)") % (tool, pat)
185 tmsg = _(b"%s (for pattern %s)") % (tool, pat)
186 if not _findtool(ui, tool):
186 if not _findtool(ui, tool):
187 if pat: # explicitly requested tool deserves a warning
187 if pat: # explicitly requested tool deserves a warning
188 ui.warn(_(b"couldn't find merge tool %s\n") % tmsg)
188 ui.warn(_(b"couldn't find merge tool %s\n") % tmsg)
189 else: # configured but non-existing tools are more silent
189 else: # configured but non-existing tools are more silent
190 ui.note(_(b"couldn't find merge tool %s\n") % tmsg)
190 ui.note(_(b"couldn't find merge tool %s\n") % tmsg)
191 elif symlink and not hascapability(tool, b"symlink", strictcheck):
191 elif symlink and not hascapability(tool, b"symlink", strictcheck):
192 ui.warn(_(b"tool %s can't handle symlinks\n") % tmsg)
192 ui.warn(_(b"tool %s can't handle symlinks\n") % tmsg)
193 elif binary and not hascapability(tool, b"binary", strictcheck):
193 elif binary and not hascapability(tool, b"binary", strictcheck):
194 ui.warn(_(b"tool %s can't handle binary\n") % tmsg)
194 ui.warn(_(b"tool %s can't handle binary\n") % tmsg)
195 elif changedelete and not supportscd(tool):
195 elif changedelete and not supportscd(tool):
196 # the nomerge tools are the only tools that support change/delete
196 # the nomerge tools are the only tools that support change/delete
197 # conflicts
197 # conflicts
198 pass
198 pass
199 elif not procutil.gui() and _toolbool(ui, tool, b"gui"):
199 elif not procutil.gui() and _toolbool(ui, tool, b"gui"):
200 ui.warn(_(b"tool %s requires a GUI\n") % tmsg)
200 ui.warn(_(b"tool %s requires a GUI\n") % tmsg)
201 else:
201 else:
202 return True
202 return True
203 return False
203 return False
204
204
205 # internal config: ui.forcemerge
205 # internal config: ui.forcemerge
206 # forcemerge comes from command line arguments, highest priority
206 # forcemerge comes from command line arguments, highest priority
207 force = ui.config(b'ui', b'forcemerge')
207 force = ui.config(b'ui', b'forcemerge')
208 if force:
208 if force:
209 toolpath = _findtool(ui, force)
209 toolpath = _findtool(ui, force)
210 if changedelete and not supportscd(toolpath):
210 if changedelete and not supportscd(toolpath):
211 return b":prompt", None
211 return b":prompt", None
212 else:
212 else:
213 if toolpath:
213 if toolpath:
214 return (force, _quotetoolpath(toolpath))
214 return (force, _quotetoolpath(toolpath))
215 else:
215 else:
216 # mimic HGMERGE if given tool not found
216 # mimic HGMERGE if given tool not found
217 return (force, force)
217 return (force, force)
218
218
219 # HGMERGE takes next precedence
219 # HGMERGE takes next precedence
220 hgmerge = encoding.environ.get(b"HGMERGE")
220 hgmerge = encoding.environ.get(b"HGMERGE")
221 if hgmerge:
221 if hgmerge:
222 if changedelete and not supportscd(hgmerge):
222 if changedelete and not supportscd(hgmerge):
223 return b":prompt", None
223 return b":prompt", None
224 else:
224 else:
225 return (hgmerge, hgmerge)
225 return (hgmerge, hgmerge)
226
226
227 # then patterns
227 # then patterns
228
228
229 # whether binary capability should be checked strictly
229 # whether binary capability should be checked strictly
230 binarycap = binary and strictcheck
230 binarycap = binary and strictcheck
231
231
232 for pat, tool in ui.configitems(b"merge-patterns"):
232 for pat, tool in ui.configitems(b"merge-patterns"):
233 mf = match.match(repo.root, b'', [pat])
233 mf = match.match(repo.root, b'', [pat])
234 if mf(path) and check(tool, pat, symlink, binarycap, changedelete):
234 if mf(path) and check(tool, pat, symlink, binarycap, changedelete):
235 if binary and not hascapability(tool, b"binary", strict=True):
235 if binary and not hascapability(tool, b"binary", strict=True):
236 ui.warn(
236 ui.warn(
237 _(
237 _(
238 b"warning: check merge-patterns configurations,"
238 b"warning: check merge-patterns configurations,"
239 b" if %r for binary file %r is unintentional\n"
239 b" if %r for binary file %r is unintentional\n"
240 b"(see 'hg help merge-tools'"
240 b"(see 'hg help merge-tools'"
241 b" for binary files capability)\n"
241 b" for binary files capability)\n"
242 )
242 )
243 % (pycompat.bytestr(tool), pycompat.bytestr(path))
243 % (pycompat.bytestr(tool), pycompat.bytestr(path))
244 )
244 )
245 toolpath = _findtool(ui, tool)
245 toolpath = _findtool(ui, tool)
246 return (tool, _quotetoolpath(toolpath))
246 return (tool, _quotetoolpath(toolpath))
247
247
248 # then merge tools
248 # then merge tools
249 tools = {}
249 tools = {}
250 disabled = set()
250 disabled = set()
251 for k, v in ui.configitems(b"merge-tools"):
251 for k, v in ui.configitems(b"merge-tools"):
252 t = k.split(b'.')[0]
252 t = k.split(b'.')[0]
253 if t not in tools:
253 if t not in tools:
254 tools[t] = int(_toolstr(ui, t, b"priority"))
254 tools[t] = int(_toolstr(ui, t, b"priority"))
255 if _toolbool(ui, t, b"disabled"):
255 if _toolbool(ui, t, b"disabled"):
256 disabled.add(t)
256 disabled.add(t)
257 names = tools.keys()
257 names = tools.keys()
258 tools = sorted(
258 tools = sorted(
259 [(-p, tool) for tool, p in tools.items() if tool not in disabled]
259 [(-p, tool) for tool, p in tools.items() if tool not in disabled]
260 )
260 )
261 uimerge = ui.config(b"ui", b"merge")
261 uimerge = ui.config(b"ui", b"merge")
262 if uimerge:
262 if uimerge:
263 # external tools defined in uimerge won't be able to handle
263 # external tools defined in uimerge won't be able to handle
264 # change/delete conflicts
264 # change/delete conflicts
265 if check(uimerge, path, symlink, binary, changedelete):
265 if check(uimerge, path, symlink, binary, changedelete):
266 if uimerge not in names and not changedelete:
266 if uimerge not in names and not changedelete:
267 return (uimerge, uimerge)
267 return (uimerge, uimerge)
268 tools.insert(0, (None, uimerge)) # highest priority
268 tools.insert(0, (None, uimerge)) # highest priority
269 tools.append((None, b"hgmerge")) # the old default, if found
269 tools.append((None, b"hgmerge")) # the old default, if found
270 for p, t in tools:
270 for p, t in tools:
271 if check(t, None, symlink, binary, changedelete):
271 if check(t, None, symlink, binary, changedelete):
272 toolpath = _findtool(ui, t)
272 toolpath = _findtool(ui, t)
273 return (t, _quotetoolpath(toolpath))
273 return (t, _quotetoolpath(toolpath))
274
274
275 # internal merge or prompt as last resort
275 # internal merge or prompt as last resort
276 if symlink or binary or changedelete:
276 if symlink or binary or changedelete:
277 if not changedelete and len(tools):
277 if not changedelete and len(tools):
278 # any tool is rejected by capability for symlink or binary
278 # any tool is rejected by capability for symlink or binary
279 ui.warn(_(b"no tool found to merge %s\n") % path)
279 ui.warn(_(b"no tool found to merge %s\n") % path)
280 return b":prompt", None
280 return b":prompt", None
281 return b":merge", None
281 return b":merge", None
282
282
283
283
284 def _eoltype(data):
284 def _eoltype(data):
285 """Guess the EOL type of a file"""
285 """Guess the EOL type of a file"""
286 if b'\0' in data: # binary
286 if b'\0' in data: # binary
287 return None
287 return None
288 if b'\r\n' in data: # Windows
288 if b'\r\n' in data: # Windows
289 return b'\r\n'
289 return b'\r\n'
290 if b'\r' in data: # Old Mac
290 if b'\r' in data: # Old Mac
291 return b'\r'
291 return b'\r'
292 if b'\n' in data: # UNIX
292 if b'\n' in data: # UNIX
293 return b'\n'
293 return b'\n'
294 return None # unknown
294 return None # unknown
295
295
296
296
297 def _matcheol(file, back):
297 def _matcheol(file, back):
298 """Convert EOL markers in a file to match origfile"""
298 """Convert EOL markers in a file to match origfile"""
299 tostyle = _eoltype(back.data()) # No repo.wread filters?
299 tostyle = _eoltype(back.data()) # No repo.wread filters?
300 if tostyle:
300 if tostyle:
301 data = util.readfile(file)
301 data = util.readfile(file)
302 style = _eoltype(data)
302 style = _eoltype(data)
303 if style:
303 if style:
304 newdata = data.replace(style, tostyle)
304 newdata = data.replace(style, tostyle)
305 if newdata != data:
305 if newdata != data:
306 util.writefile(file, newdata)
306 util.writefile(file, newdata)
307
307
308
308
309 @internaltool(b'prompt', nomerge)
309 @internaltool(b'prompt', nomerge)
310 def _iprompt(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
310 def _iprompt(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
311 """Asks the user which of the local `p1()` or the other `p2()` version to
311 """Asks the user which of the local `p1()` or the other `p2()` version to
312 keep as the merged version."""
312 keep as the merged version."""
313 ui = repo.ui
313 ui = repo.ui
314 fd = fcd.path()
314 fd = fcd.path()
315 uipathfn = scmutil.getuipathfn(repo)
315 uipathfn = scmutil.getuipathfn(repo)
316
316
317 # Avoid prompting during an in-memory merge since it doesn't support merge
317 # Avoid prompting during an in-memory merge since it doesn't support merge
318 # conflicts.
318 # conflicts.
319 if fcd.changectx().isinmemory():
319 if fcd.changectx().isinmemory():
320 raise error.InMemoryMergeConflictsError(
320 raise error.InMemoryMergeConflictsError(
321 b'in-memory merge does not support file conflicts'
321 b'in-memory merge does not support file conflicts'
322 )
322 )
323
323
324 prompts = partextras(labels)
324 prompts = partextras(labels)
325 prompts[b'fd'] = uipathfn(fd)
325 prompts[b'fd'] = uipathfn(fd)
326 try:
326 try:
327 if fco.isabsent():
327 if fco.isabsent():
328 index = ui.promptchoice(_localchangedotherdeletedmsg % prompts, 2)
328 index = ui.promptchoice(_localchangedotherdeletedmsg % prompts, 2)
329 choice = [b'local', b'other', b'unresolved'][index]
329 choice = [b'local', b'other', b'unresolved'][index]
330 elif fcd.isabsent():
330 elif fcd.isabsent():
331 index = ui.promptchoice(_otherchangedlocaldeletedmsg % prompts, 2)
331 index = ui.promptchoice(_otherchangedlocaldeletedmsg % prompts, 2)
332 choice = [b'other', b'local', b'unresolved'][index]
332 choice = [b'other', b'local', b'unresolved'][index]
333 else:
333 else:
334 # IMPORTANT: keep the last line of this prompt ("What do you want to
334 # IMPORTANT: keep the last line of this prompt ("What do you want to
335 # do?") very short, see comment next to _localchangedotherdeletedmsg
335 # do?") very short, see comment next to _localchangedotherdeletedmsg
336 # at the top of the file for details.
336 # at the top of the file for details.
337 index = ui.promptchoice(
337 index = ui.promptchoice(
338 _(
338 _(
339 b"file '%(fd)s' needs to be resolved.\n"
339 b"file '%(fd)s' needs to be resolved.\n"
340 b"You can keep (l)ocal%(l)s, take (o)ther%(o)s, or leave "
340 b"You can keep (l)ocal%(l)s, take (o)ther%(o)s, or leave "
341 b"(u)nresolved.\n"
341 b"(u)nresolved.\n"
342 b"What do you want to do?"
342 b"What do you want to do?"
343 b"$$ &Local $$ &Other $$ &Unresolved"
343 b"$$ &Local $$ &Other $$ &Unresolved"
344 )
344 )
345 % prompts,
345 % prompts,
346 2,
346 2,
347 )
347 )
348 choice = [b'local', b'other', b'unresolved'][index]
348 choice = [b'local', b'other', b'unresolved'][index]
349
349
350 if choice == b'other':
350 if choice == b'other':
351 return _iother(repo, mynode, orig, fcd, fco, fca, toolconf, labels)
351 return _iother(repo, mynode, orig, fcd, fco, fca, toolconf, labels)
352 elif choice == b'local':
352 elif choice == b'local':
353 return _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf, labels)
353 return _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf, labels)
354 elif choice == b'unresolved':
354 elif choice == b'unresolved':
355 return _ifail(repo, mynode, orig, fcd, fco, fca, toolconf, labels)
355 return _ifail(repo, mynode, orig, fcd, fco, fca, toolconf, labels)
356 except error.ResponseExpected:
356 except error.ResponseExpected:
357 ui.write(b"\n")
357 ui.write(b"\n")
358 return _ifail(repo, mynode, orig, fcd, fco, fca, toolconf, labels)
358 return _ifail(repo, mynode, orig, fcd, fco, fca, toolconf, labels)
359
359
360
360
361 @internaltool(b'local', nomerge)
361 @internaltool(b'local', nomerge)
362 def _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
362 def _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
363 """Uses the local `p1()` version of files as the merged version."""
363 """Uses the local `p1()` version of files as the merged version."""
364 return 0, fcd.isabsent()
364 return 0, fcd.isabsent()
365
365
366
366
367 @internaltool(b'other', nomerge)
367 @internaltool(b'other', nomerge)
368 def _iother(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
368 def _iother(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
369 """Uses the other `p2()` version of files as the merged version."""
369 """Uses the other `p2()` version of files as the merged version."""
370 if fco.isabsent():
370 if fco.isabsent():
371 # local changed, remote deleted -- 'deleted' picked
371 # local changed, remote deleted -- 'deleted' picked
372 _underlyingfctxifabsent(fcd).remove()
372 _underlyingfctxifabsent(fcd).remove()
373 deleted = True
373 deleted = True
374 else:
374 else:
375 _underlyingfctxifabsent(fcd).write(fco.data(), fco.flags())
375 _underlyingfctxifabsent(fcd).write(fco.data(), fco.flags())
376 deleted = False
376 deleted = False
377 return 0, deleted
377 return 0, deleted
378
378
379
379
380 @internaltool(b'fail', nomerge)
380 @internaltool(b'fail', nomerge)
381 def _ifail(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
381 def _ifail(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None):
382 """
382 """
383 Rather than attempting to merge files that were modified on both
383 Rather than attempting to merge files that were modified on both
384 branches, it marks them as unresolved. The resolve command must be
384 branches, it marks them as unresolved. The resolve command must be
385 used to resolve these conflicts."""
385 used to resolve these conflicts."""
386 # for change/delete conflicts write out the changed version, then fail
386 # for change/delete conflicts write out the changed version, then fail
387 if fcd.isabsent():
387 if fcd.isabsent():
388 _underlyingfctxifabsent(fcd).write(fco.data(), fco.flags())
388 _underlyingfctxifabsent(fcd).write(fco.data(), fco.flags())
389 return 1, False
389 return 1, False
390
390
391
391
392 def _underlyingfctxifabsent(filectx):
392 def _underlyingfctxifabsent(filectx):
393 """Sometimes when resolving, our fcd is actually an absentfilectx, but
393 """Sometimes when resolving, our fcd is actually an absentfilectx, but
394 we want to write to it (to do the resolve). This helper returns the
394 we want to write to it (to do the resolve). This helper returns the
395 underyling workingfilectx in that case.
395 underyling workingfilectx in that case.
396 """
396 """
397 if filectx.isabsent():
397 if filectx.isabsent():
398 return filectx.changectx()[filectx.path()]
398 return filectx.changectx()[filectx.path()]
399 else:
399 else:
400 return filectx
400 return filectx
401
401
402
402
403 def _premerge(repo, fcd, fco, fca, toolconf, files, labels=None):
403 def _premerge(repo, fcd, fco, fca, toolconf, files, labels=None):
404 tool, toolpath, binary, symlink, scriptfn = toolconf
404 tool, toolpath, binary, symlink, scriptfn = toolconf
405 if symlink or fcd.isabsent() or fco.isabsent():
405 if symlink or fcd.isabsent() or fco.isabsent():
406 return 1
406 return 1
407 unused, unused, unused, back = files
407 unused, unused, unused, back = files
408
408
409 ui = repo.ui
409 ui = repo.ui
410
410
411 validkeep = [b'keep', b'keep-merge3']
411 validkeep = [b'keep', b'keep-merge3', b'keep-mergediff']
412
412
413 # do we attempt to simplemerge first?
413 # do we attempt to simplemerge first?
414 try:
414 try:
415 premerge = _toolbool(ui, tool, b"premerge", not binary)
415 premerge = _toolbool(ui, tool, b"premerge", not binary)
416 except error.ConfigError:
416 except error.ConfigError:
417 premerge = _toolstr(ui, tool, b"premerge", b"").lower()
417 premerge = _toolstr(ui, tool, b"premerge", b"").lower()
418 if premerge not in validkeep:
418 if premerge not in validkeep:
419 _valid = b', '.join([b"'" + v + b"'" for v in validkeep])
419 _valid = b', '.join([b"'" + v + b"'" for v in validkeep])
420 raise error.ConfigError(
420 raise error.ConfigError(
421 _(b"%s.premerge not valid ('%s' is neither boolean nor %s)")
421 _(b"%s.premerge not valid ('%s' is neither boolean nor %s)")
422 % (tool, premerge, _valid)
422 % (tool, premerge, _valid)
423 )
423 )
424
424
425 if premerge:
425 if premerge:
426 if premerge == b'keep-merge3':
426 mode = b'merge'
427 if premerge in {b'keep-merge3', b'keep-mergediff'}:
427 if not labels:
428 if not labels:
428 labels = _defaultconflictlabels
429 labels = _defaultconflictlabels
429 if len(labels) < 3:
430 if len(labels) < 3:
430 labels.append(b'base')
431 labels.append(b'base')
431 r = simplemerge.simplemerge(ui, fcd, fca, fco, quiet=True, label=labels)
432 if premerge == b'keep-mergediff':
433 mode = b'mergediff'
434 r = simplemerge.simplemerge(
435 ui, fcd, fca, fco, quiet=True, label=labels, mode=mode
436 )
432 if not r:
437 if not r:
433 ui.debug(b" premerge successful\n")
438 ui.debug(b" premerge successful\n")
434 return 0
439 return 0
435 if premerge not in validkeep:
440 if premerge not in validkeep:
436 # restore from backup and try again
441 # restore from backup and try again
437 _restorebackup(fcd, back)
442 _restorebackup(fcd, back)
438 return 1 # continue merging
443 return 1 # continue merging
439
444
440
445
441 def _mergecheck(repo, mynode, orig, fcd, fco, fca, toolconf):
446 def _mergecheck(repo, mynode, orig, fcd, fco, fca, toolconf):
442 tool, toolpath, binary, symlink, scriptfn = toolconf
447 tool, toolpath, binary, symlink, scriptfn = toolconf
443 uipathfn = scmutil.getuipathfn(repo)
448 uipathfn = scmutil.getuipathfn(repo)
444 if symlink:
449 if symlink:
445 repo.ui.warn(
450 repo.ui.warn(
446 _(b'warning: internal %s cannot merge symlinks for %s\n')
451 _(b'warning: internal %s cannot merge symlinks for %s\n')
447 % (tool, uipathfn(fcd.path()))
452 % (tool, uipathfn(fcd.path()))
448 )
453 )
449 return False
454 return False
450 if fcd.isabsent() or fco.isabsent():
455 if fcd.isabsent() or fco.isabsent():
451 repo.ui.warn(
456 repo.ui.warn(
452 _(
457 _(
453 b'warning: internal %s cannot merge change/delete '
458 b'warning: internal %s cannot merge change/delete '
454 b'conflict for %s\n'
459 b'conflict for %s\n'
455 )
460 )
456 % (tool, uipathfn(fcd.path()))
461 % (tool, uipathfn(fcd.path()))
457 )
462 )
458 return False
463 return False
459 return True
464 return True
460
465
461
466
462 def _merge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels, mode):
467 def _merge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels, mode):
463 """
468 """
464 Uses the internal non-interactive simple merge algorithm for merging
469 Uses the internal non-interactive simple merge algorithm for merging
465 files. It will fail if there are any conflicts and leave markers in
470 files. It will fail if there are any conflicts and leave markers in
466 the partially merged file. Markers will have two sections, one for each side
471 the partially merged file. Markers will have two sections, one for each side
467 of merge, unless mode equals 'union' which suppresses the markers."""
472 of merge, unless mode equals 'union' which suppresses the markers."""
468 ui = repo.ui
473 ui = repo.ui
469
474
470 r = simplemerge.simplemerge(ui, fcd, fca, fco, label=labels, mode=mode)
475 r = simplemerge.simplemerge(ui, fcd, fca, fco, label=labels, mode=mode)
471 return True, r, False
476 return True, r, False
472
477
473
478
474 @internaltool(
479 @internaltool(
475 b'union',
480 b'union',
476 fullmerge,
481 fullmerge,
477 _(
482 _(
478 b"warning: conflicts while merging %s! "
483 b"warning: conflicts while merging %s! "
479 b"(edit, then use 'hg resolve --mark')\n"
484 b"(edit, then use 'hg resolve --mark')\n"
480 ),
485 ),
481 precheck=_mergecheck,
486 precheck=_mergecheck,
482 )
487 )
483 def _iunion(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
488 def _iunion(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
484 """
489 """
485 Uses the internal non-interactive simple merge algorithm for merging
490 Uses the internal non-interactive simple merge algorithm for merging
486 files. It will use both left and right sides for conflict regions.
491 files. It will use both left and right sides for conflict regions.
487 No markers are inserted."""
492 No markers are inserted."""
488 return _merge(
493 return _merge(
489 repo, mynode, orig, fcd, fco, fca, toolconf, files, labels, b'union'
494 repo, mynode, orig, fcd, fco, fca, toolconf, files, labels, b'union'
490 )
495 )
491
496
492
497
493 @internaltool(
498 @internaltool(
494 b'merge',
499 b'merge',
495 fullmerge,
500 fullmerge,
496 _(
501 _(
497 b"warning: conflicts while merging %s! "
502 b"warning: conflicts while merging %s! "
498 b"(edit, then use 'hg resolve --mark')\n"
503 b"(edit, then use 'hg resolve --mark')\n"
499 ),
504 ),
500 precheck=_mergecheck,
505 precheck=_mergecheck,
501 )
506 )
502 def _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
507 def _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
503 """
508 """
504 Uses the internal non-interactive simple merge algorithm for merging
509 Uses the internal non-interactive simple merge algorithm for merging
505 files. It will fail if there are any conflicts and leave markers in
510 files. It will fail if there are any conflicts and leave markers in
506 the partially merged file. Markers will have two sections, one for each side
511 the partially merged file. Markers will have two sections, one for each side
507 of merge."""
512 of merge."""
508 return _merge(
513 return _merge(
509 repo, mynode, orig, fcd, fco, fca, toolconf, files, labels, b'merge'
514 repo, mynode, orig, fcd, fco, fca, toolconf, files, labels, b'merge'
510 )
515 )
511
516
512
517
513 @internaltool(
518 @internaltool(
514 b'merge3',
519 b'merge3',
515 fullmerge,
520 fullmerge,
516 _(
521 _(
517 b"warning: conflicts while merging %s! "
522 b"warning: conflicts while merging %s! "
518 b"(edit, then use 'hg resolve --mark')\n"
523 b"(edit, then use 'hg resolve --mark')\n"
519 ),
524 ),
520 precheck=_mergecheck,
525 precheck=_mergecheck,
521 )
526 )
522 def _imerge3(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
527 def _imerge3(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
523 """
528 """
524 Uses the internal non-interactive simple merge algorithm for merging
529 Uses the internal non-interactive simple merge algorithm for merging
525 files. It will fail if there are any conflicts and leave markers in
530 files. It will fail if there are any conflicts and leave markers in
526 the partially merged file. Marker will have three sections, one from each
531 the partially merged file. Marker will have three sections, one from each
527 side of the merge and one for the base content."""
532 side of the merge and one for the base content."""
528 if not labels:
533 if not labels:
529 labels = _defaultconflictlabels
534 labels = _defaultconflictlabels
530 if len(labels) < 3:
535 if len(labels) < 3:
531 labels.append(b'base')
536 labels.append(b'base')
532 return _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels)
537 return _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels)
533
538
534
539
535 @internaltool(
540 @internaltool(
536 b'mergediff',
541 b'mergediff',
537 fullmerge,
542 fullmerge,
538 _(
543 _(
539 b"warning: conflicts while merging %s! "
544 b"warning: conflicts while merging %s! "
540 b"(edit, then use 'hg resolve --mark')\n"
545 b"(edit, then use 'hg resolve --mark')\n"
541 ),
546 ),
542 precheck=_mergecheck,
547 precheck=_mergecheck,
543 )
548 )
544 def _imerge_diff(
549 def _imerge_diff(
545 repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None
550 repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None
546 ):
551 ):
547 """
552 """
548 Uses the internal non-interactive simple merge algorithm for merging
553 Uses the internal non-interactive simple merge algorithm for merging
549 files. It will fail if there are any conflicts and leave markers in
554 files. It will fail if there are any conflicts and leave markers in
550 the partially merged file. The marker will have two sections, one with the
555 the partially merged file. The marker will have two sections, one with the
551 content from one side of the merge, and one with a diff from the base
556 content from one side of the merge, and one with a diff from the base
552 content to the content on the other side. (experimental)"""
557 content to the content on the other side. (experimental)"""
553 if not labels:
558 if not labels:
554 labels = _defaultconflictlabels
559 labels = _defaultconflictlabels
555 if len(labels) < 3:
560 if len(labels) < 3:
556 labels.append(b'base')
561 labels.append(b'base')
557 return _merge(
562 return _merge(
558 repo, mynode, orig, fcd, fco, fca, toolconf, files, labels, b'mergediff'
563 repo, mynode, orig, fcd, fco, fca, toolconf, files, labels, b'mergediff'
559 )
564 )
560
565
561
566
562 def _imergeauto(
567 def _imergeauto(
563 repo,
568 repo,
564 mynode,
569 mynode,
565 orig,
570 orig,
566 fcd,
571 fcd,
567 fco,
572 fco,
568 fca,
573 fca,
569 toolconf,
574 toolconf,
570 files,
575 files,
571 labels=None,
576 labels=None,
572 localorother=None,
577 localorother=None,
573 ):
578 ):
574 """
579 """
575 Generic driver for _imergelocal and _imergeother
580 Generic driver for _imergelocal and _imergeother
576 """
581 """
577 assert localorother is not None
582 assert localorother is not None
578 r = simplemerge.simplemerge(
583 r = simplemerge.simplemerge(
579 repo.ui, fcd, fca, fco, label=labels, localorother=localorother
584 repo.ui, fcd, fca, fco, label=labels, localorother=localorother
580 )
585 )
581 return True, r
586 return True, r
582
587
583
588
584 @internaltool(b'merge-local', mergeonly, precheck=_mergecheck)
589 @internaltool(b'merge-local', mergeonly, precheck=_mergecheck)
585 def _imergelocal(*args, **kwargs):
590 def _imergelocal(*args, **kwargs):
586 """
591 """
587 Like :merge, but resolve all conflicts non-interactively in favor
592 Like :merge, but resolve all conflicts non-interactively in favor
588 of the local `p1()` changes."""
593 of the local `p1()` changes."""
589 success, status = _imergeauto(localorother=b'local', *args, **kwargs)
594 success, status = _imergeauto(localorother=b'local', *args, **kwargs)
590 return success, status, False
595 return success, status, False
591
596
592
597
593 @internaltool(b'merge-other', mergeonly, precheck=_mergecheck)
598 @internaltool(b'merge-other', mergeonly, precheck=_mergecheck)
594 def _imergeother(*args, **kwargs):
599 def _imergeother(*args, **kwargs):
595 """
600 """
596 Like :merge, but resolve all conflicts non-interactively in favor
601 Like :merge, but resolve all conflicts non-interactively in favor
597 of the other `p2()` changes."""
602 of the other `p2()` changes."""
598 success, status = _imergeauto(localorother=b'other', *args, **kwargs)
603 success, status = _imergeauto(localorother=b'other', *args, **kwargs)
599 return success, status, False
604 return success, status, False
600
605
601
606
602 @internaltool(
607 @internaltool(
603 b'tagmerge',
608 b'tagmerge',
604 mergeonly,
609 mergeonly,
605 _(
610 _(
606 b"automatic tag merging of %s failed! "
611 b"automatic tag merging of %s failed! "
607 b"(use 'hg resolve --tool :merge' or another merge "
612 b"(use 'hg resolve --tool :merge' or another merge "
608 b"tool of your choice)\n"
613 b"tool of your choice)\n"
609 ),
614 ),
610 )
615 )
611 def _itagmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
616 def _itagmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
612 """
617 """
613 Uses the internal tag merge algorithm (experimental).
618 Uses the internal tag merge algorithm (experimental).
614 """
619 """
615 success, status = tagmerge.merge(repo, fcd, fco, fca)
620 success, status = tagmerge.merge(repo, fcd, fco, fca)
616 return success, status, False
621 return success, status, False
617
622
618
623
619 @internaltool(b'dump', fullmerge, binary=True, symlink=True)
624 @internaltool(b'dump', fullmerge, binary=True, symlink=True)
620 def _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
625 def _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
621 """
626 """
622 Creates three versions of the files to merge, containing the
627 Creates three versions of the files to merge, containing the
623 contents of local, other and base. These files can then be used to
628 contents of local, other and base. These files can then be used to
624 perform a merge manually. If the file to be merged is named
629 perform a merge manually. If the file to be merged is named
625 ``a.txt``, these files will accordingly be named ``a.txt.local``,
630 ``a.txt``, these files will accordingly be named ``a.txt.local``,
626 ``a.txt.other`` and ``a.txt.base`` and they will be placed in the
631 ``a.txt.other`` and ``a.txt.base`` and they will be placed in the
627 same directory as ``a.txt``.
632 same directory as ``a.txt``.
628
633
629 This implies premerge. Therefore, files aren't dumped, if premerge
634 This implies premerge. Therefore, files aren't dumped, if premerge
630 runs successfully. Use :forcedump to forcibly write files out.
635 runs successfully. Use :forcedump to forcibly write files out.
631 """
636 """
632 a = _workingpath(repo, fcd)
637 a = _workingpath(repo, fcd)
633 fd = fcd.path()
638 fd = fcd.path()
634
639
635 from . import context
640 from . import context
636
641
637 if isinstance(fcd, context.overlayworkingfilectx):
642 if isinstance(fcd, context.overlayworkingfilectx):
638 raise error.InMemoryMergeConflictsError(
643 raise error.InMemoryMergeConflictsError(
639 b'in-memory merge does not support the :dump tool.'
644 b'in-memory merge does not support the :dump tool.'
640 )
645 )
641
646
642 util.writefile(a + b".local", fcd.decodeddata())
647 util.writefile(a + b".local", fcd.decodeddata())
643 repo.wwrite(fd + b".other", fco.data(), fco.flags())
648 repo.wwrite(fd + b".other", fco.data(), fco.flags())
644 repo.wwrite(fd + b".base", fca.data(), fca.flags())
649 repo.wwrite(fd + b".base", fca.data(), fca.flags())
645 return False, 1, False
650 return False, 1, False
646
651
647
652
648 @internaltool(b'forcedump', mergeonly, binary=True, symlink=True)
653 @internaltool(b'forcedump', mergeonly, binary=True, symlink=True)
649 def _forcedump(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
654 def _forcedump(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
650 """
655 """
651 Creates three versions of the files as same as :dump, but omits premerge.
656 Creates three versions of the files as same as :dump, but omits premerge.
652 """
657 """
653 return _idump(
658 return _idump(
654 repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=labels
659 repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=labels
655 )
660 )
656
661
657
662
658 def _xmergeimm(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
663 def _xmergeimm(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
659 # In-memory merge simply raises an exception on all external merge tools,
664 # In-memory merge simply raises an exception on all external merge tools,
660 # for now.
665 # for now.
661 #
666 #
662 # It would be possible to run most tools with temporary files, but this
667 # It would be possible to run most tools with temporary files, but this
663 # raises the question of what to do if the user only partially resolves the
668 # raises the question of what to do if the user only partially resolves the
664 # file -- we can't leave a merge state. (Copy to somewhere in the .hg/
669 # file -- we can't leave a merge state. (Copy to somewhere in the .hg/
665 # directory and tell the user how to get it is my best idea, but it's
670 # directory and tell the user how to get it is my best idea, but it's
666 # clunky.)
671 # clunky.)
667 raise error.InMemoryMergeConflictsError(
672 raise error.InMemoryMergeConflictsError(
668 b'in-memory merge does not support external merge tools'
673 b'in-memory merge does not support external merge tools'
669 )
674 )
670
675
671
676
672 def _describemerge(ui, repo, mynode, fcl, fcb, fco, env, toolpath, args):
677 def _describemerge(ui, repo, mynode, fcl, fcb, fco, env, toolpath, args):
673 tmpl = ui.config(b'command-templates', b'pre-merge-tool-output')
678 tmpl = ui.config(b'command-templates', b'pre-merge-tool-output')
674 if not tmpl:
679 if not tmpl:
675 return
680 return
676
681
677 mappingdict = templateutil.mappingdict
682 mappingdict = templateutil.mappingdict
678 props = {
683 props = {
679 b'ctx': fcl.changectx(),
684 b'ctx': fcl.changectx(),
680 b'node': hex(mynode),
685 b'node': hex(mynode),
681 b'path': fcl.path(),
686 b'path': fcl.path(),
682 b'local': mappingdict(
687 b'local': mappingdict(
683 {
688 {
684 b'ctx': fcl.changectx(),
689 b'ctx': fcl.changectx(),
685 b'fctx': fcl,
690 b'fctx': fcl,
686 b'node': hex(mynode),
691 b'node': hex(mynode),
687 b'name': _(b'local'),
692 b'name': _(b'local'),
688 b'islink': b'l' in fcl.flags(),
693 b'islink': b'l' in fcl.flags(),
689 b'label': env[b'HG_MY_LABEL'],
694 b'label': env[b'HG_MY_LABEL'],
690 }
695 }
691 ),
696 ),
692 b'base': mappingdict(
697 b'base': mappingdict(
693 {
698 {
694 b'ctx': fcb.changectx(),
699 b'ctx': fcb.changectx(),
695 b'fctx': fcb,
700 b'fctx': fcb,
696 b'name': _(b'base'),
701 b'name': _(b'base'),
697 b'islink': b'l' in fcb.flags(),
702 b'islink': b'l' in fcb.flags(),
698 b'label': env[b'HG_BASE_LABEL'],
703 b'label': env[b'HG_BASE_LABEL'],
699 }
704 }
700 ),
705 ),
701 b'other': mappingdict(
706 b'other': mappingdict(
702 {
707 {
703 b'ctx': fco.changectx(),
708 b'ctx': fco.changectx(),
704 b'fctx': fco,
709 b'fctx': fco,
705 b'name': _(b'other'),
710 b'name': _(b'other'),
706 b'islink': b'l' in fco.flags(),
711 b'islink': b'l' in fco.flags(),
707 b'label': env[b'HG_OTHER_LABEL'],
712 b'label': env[b'HG_OTHER_LABEL'],
708 }
713 }
709 ),
714 ),
710 b'toolpath': toolpath,
715 b'toolpath': toolpath,
711 b'toolargs': args,
716 b'toolargs': args,
712 }
717 }
713
718
714 # TODO: make all of this something that can be specified on a per-tool basis
719 # TODO: make all of this something that can be specified on a per-tool basis
715 tmpl = templater.unquotestring(tmpl)
720 tmpl = templater.unquotestring(tmpl)
716
721
717 # Not using cmdutil.rendertemplate here since it causes errors importing
722 # Not using cmdutil.rendertemplate here since it causes errors importing
718 # things for us to import cmdutil.
723 # things for us to import cmdutil.
719 tres = formatter.templateresources(ui, repo)
724 tres = formatter.templateresources(ui, repo)
720 t = formatter.maketemplater(
725 t = formatter.maketemplater(
721 ui, tmpl, defaults=templatekw.keywords, resources=tres
726 ui, tmpl, defaults=templatekw.keywords, resources=tres
722 )
727 )
723 ui.status(t.renderdefault(props))
728 ui.status(t.renderdefault(props))
724
729
725
730
726 def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels):
731 def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels):
727 tool, toolpath, binary, symlink, scriptfn = toolconf
732 tool, toolpath, binary, symlink, scriptfn = toolconf
728 uipathfn = scmutil.getuipathfn(repo)
733 uipathfn = scmutil.getuipathfn(repo)
729 if fcd.isabsent() or fco.isabsent():
734 if fcd.isabsent() or fco.isabsent():
730 repo.ui.warn(
735 repo.ui.warn(
731 _(b'warning: %s cannot merge change/delete conflict for %s\n')
736 _(b'warning: %s cannot merge change/delete conflict for %s\n')
732 % (tool, uipathfn(fcd.path()))
737 % (tool, uipathfn(fcd.path()))
733 )
738 )
734 return False, 1, None
739 return False, 1, None
735 unused, unused, unused, back = files
740 unused, unused, unused, back = files
736 localpath = _workingpath(repo, fcd)
741 localpath = _workingpath(repo, fcd)
737 args = _toolstr(repo.ui, tool, b"args")
742 args = _toolstr(repo.ui, tool, b"args")
738
743
739 with _maketempfiles(
744 with _maketempfiles(
740 repo, fco, fca, repo.wvfs.join(back.path()), b"$output" in args
745 repo, fco, fca, repo.wvfs.join(back.path()), b"$output" in args
741 ) as temppaths:
746 ) as temppaths:
742 basepath, otherpath, localoutputpath = temppaths
747 basepath, otherpath, localoutputpath = temppaths
743 outpath = b""
748 outpath = b""
744 mylabel, otherlabel = labels[:2]
749 mylabel, otherlabel = labels[:2]
745 if len(labels) >= 3:
750 if len(labels) >= 3:
746 baselabel = labels[2]
751 baselabel = labels[2]
747 else:
752 else:
748 baselabel = b'base'
753 baselabel = b'base'
749 env = {
754 env = {
750 b'HG_FILE': fcd.path(),
755 b'HG_FILE': fcd.path(),
751 b'HG_MY_NODE': short(mynode),
756 b'HG_MY_NODE': short(mynode),
752 b'HG_OTHER_NODE': short(fco.changectx().node()),
757 b'HG_OTHER_NODE': short(fco.changectx().node()),
753 b'HG_BASE_NODE': short(fca.changectx().node()),
758 b'HG_BASE_NODE': short(fca.changectx().node()),
754 b'HG_MY_ISLINK': b'l' in fcd.flags(),
759 b'HG_MY_ISLINK': b'l' in fcd.flags(),
755 b'HG_OTHER_ISLINK': b'l' in fco.flags(),
760 b'HG_OTHER_ISLINK': b'l' in fco.flags(),
756 b'HG_BASE_ISLINK': b'l' in fca.flags(),
761 b'HG_BASE_ISLINK': b'l' in fca.flags(),
757 b'HG_MY_LABEL': mylabel,
762 b'HG_MY_LABEL': mylabel,
758 b'HG_OTHER_LABEL': otherlabel,
763 b'HG_OTHER_LABEL': otherlabel,
759 b'HG_BASE_LABEL': baselabel,
764 b'HG_BASE_LABEL': baselabel,
760 }
765 }
761 ui = repo.ui
766 ui = repo.ui
762
767
763 if b"$output" in args:
768 if b"$output" in args:
764 # read input from backup, write to original
769 # read input from backup, write to original
765 outpath = localpath
770 outpath = localpath
766 localpath = localoutputpath
771 localpath = localoutputpath
767 replace = {
772 replace = {
768 b'local': localpath,
773 b'local': localpath,
769 b'base': basepath,
774 b'base': basepath,
770 b'other': otherpath,
775 b'other': otherpath,
771 b'output': outpath,
776 b'output': outpath,
772 b'labellocal': mylabel,
777 b'labellocal': mylabel,
773 b'labelother': otherlabel,
778 b'labelother': otherlabel,
774 b'labelbase': baselabel,
779 b'labelbase': baselabel,
775 }
780 }
776 args = util.interpolate(
781 args = util.interpolate(
777 br'\$',
782 br'\$',
778 replace,
783 replace,
779 args,
784 args,
780 lambda s: procutil.shellquote(util.localpath(s)),
785 lambda s: procutil.shellquote(util.localpath(s)),
781 )
786 )
782 if _toolbool(ui, tool, b"gui"):
787 if _toolbool(ui, tool, b"gui"):
783 repo.ui.status(
788 repo.ui.status(
784 _(b'running merge tool %s for file %s\n')
789 _(b'running merge tool %s for file %s\n')
785 % (tool, uipathfn(fcd.path()))
790 % (tool, uipathfn(fcd.path()))
786 )
791 )
787 if scriptfn is None:
792 if scriptfn is None:
788 cmd = toolpath + b' ' + args
793 cmd = toolpath + b' ' + args
789 repo.ui.debug(b'launching merge tool: %s\n' % cmd)
794 repo.ui.debug(b'launching merge tool: %s\n' % cmd)
790 _describemerge(ui, repo, mynode, fcd, fca, fco, env, toolpath, args)
795 _describemerge(ui, repo, mynode, fcd, fca, fco, env, toolpath, args)
791 r = ui.system(
796 r = ui.system(
792 cmd, cwd=repo.root, environ=env, blockedtag=b'mergetool'
797 cmd, cwd=repo.root, environ=env, blockedtag=b'mergetool'
793 )
798 )
794 else:
799 else:
795 repo.ui.debug(
800 repo.ui.debug(
796 b'launching python merge script: %s:%s\n' % (toolpath, scriptfn)
801 b'launching python merge script: %s:%s\n' % (toolpath, scriptfn)
797 )
802 )
798 r = 0
803 r = 0
799 try:
804 try:
800 # avoid cycle cmdutil->merge->filemerge->extensions->cmdutil
805 # avoid cycle cmdutil->merge->filemerge->extensions->cmdutil
801 from . import extensions
806 from . import extensions
802
807
803 mod = extensions.loadpath(toolpath, b'hgmerge.%s' % tool)
808 mod = extensions.loadpath(toolpath, b'hgmerge.%s' % tool)
804 except Exception:
809 except Exception:
805 raise error.Abort(
810 raise error.Abort(
806 _(b"loading python merge script failed: %s") % toolpath
811 _(b"loading python merge script failed: %s") % toolpath
807 )
812 )
808 mergefn = getattr(mod, scriptfn, None)
813 mergefn = getattr(mod, scriptfn, None)
809 if mergefn is None:
814 if mergefn is None:
810 raise error.Abort(
815 raise error.Abort(
811 _(b"%s does not have function: %s") % (toolpath, scriptfn)
816 _(b"%s does not have function: %s") % (toolpath, scriptfn)
812 )
817 )
813 argslist = procutil.shellsplit(args)
818 argslist = procutil.shellsplit(args)
814 # avoid cycle cmdutil->merge->filemerge->hook->extensions->cmdutil
819 # avoid cycle cmdutil->merge->filemerge->hook->extensions->cmdutil
815 from . import hook
820 from . import hook
816
821
817 ret, raised = hook.pythonhook(
822 ret, raised = hook.pythonhook(
818 ui, repo, b"merge", toolpath, mergefn, {b'args': argslist}, True
823 ui, repo, b"merge", toolpath, mergefn, {b'args': argslist}, True
819 )
824 )
820 if raised:
825 if raised:
821 r = 1
826 r = 1
822 repo.ui.debug(b'merge tool returned: %d\n' % r)
827 repo.ui.debug(b'merge tool returned: %d\n' % r)
823 return True, r, False
828 return True, r, False
824
829
825
830
826 def _formatconflictmarker(ctx, template, label, pad):
831 def _formatconflictmarker(ctx, template, label, pad):
827 """Applies the given template to the ctx, prefixed by the label.
832 """Applies the given template to the ctx, prefixed by the label.
828
833
829 Pad is the minimum width of the label prefix, so that multiple markers
834 Pad is the minimum width of the label prefix, so that multiple markers
830 can have aligned templated parts.
835 can have aligned templated parts.
831 """
836 """
832 if ctx.node() is None:
837 if ctx.node() is None:
833 ctx = ctx.p1()
838 ctx = ctx.p1()
834
839
835 props = {b'ctx': ctx}
840 props = {b'ctx': ctx}
836 templateresult = template.renderdefault(props)
841 templateresult = template.renderdefault(props)
837
842
838 label = (b'%s:' % label).ljust(pad + 1)
843 label = (b'%s:' % label).ljust(pad + 1)
839 mark = b'%s %s' % (label, templateresult)
844 mark = b'%s %s' % (label, templateresult)
840
845
841 if mark:
846 if mark:
842 mark = mark.splitlines()[0] # split for safety
847 mark = mark.splitlines()[0] # split for safety
843
848
844 # 8 for the prefix of conflict marker lines (e.g. '<<<<<<< ')
849 # 8 for the prefix of conflict marker lines (e.g. '<<<<<<< ')
845 return stringutil.ellipsis(mark, 80 - 8)
850 return stringutil.ellipsis(mark, 80 - 8)
846
851
847
852
848 _defaultconflictlabels = [b'local', b'other']
853 _defaultconflictlabels = [b'local', b'other']
849
854
850
855
851 def _formatlabels(repo, fcd, fco, fca, labels, tool=None):
856 def _formatlabels(repo, fcd, fco, fca, labels, tool=None):
852 """Formats the given labels using the conflict marker template.
857 """Formats the given labels using the conflict marker template.
853
858
854 Returns a list of formatted labels.
859 Returns a list of formatted labels.
855 """
860 """
856 cd = fcd.changectx()
861 cd = fcd.changectx()
857 co = fco.changectx()
862 co = fco.changectx()
858 ca = fca.changectx()
863 ca = fca.changectx()
859
864
860 ui = repo.ui
865 ui = repo.ui
861 template = ui.config(b'command-templates', b'mergemarker')
866 template = ui.config(b'command-templates', b'mergemarker')
862 if tool is not None:
867 if tool is not None:
863 template = _toolstr(ui, tool, b'mergemarkertemplate', template)
868 template = _toolstr(ui, tool, b'mergemarkertemplate', template)
864 template = templater.unquotestring(template)
869 template = templater.unquotestring(template)
865 tres = formatter.templateresources(ui, repo)
870 tres = formatter.templateresources(ui, repo)
866 tmpl = formatter.maketemplater(
871 tmpl = formatter.maketemplater(
867 ui, template, defaults=templatekw.keywords, resources=tres
872 ui, template, defaults=templatekw.keywords, resources=tres
868 )
873 )
869
874
870 pad = max(len(l) for l in labels)
875 pad = max(len(l) for l in labels)
871
876
872 newlabels = [
877 newlabels = [
873 _formatconflictmarker(cd, tmpl, labels[0], pad),
878 _formatconflictmarker(cd, tmpl, labels[0], pad),
874 _formatconflictmarker(co, tmpl, labels[1], pad),
879 _formatconflictmarker(co, tmpl, labels[1], pad),
875 ]
880 ]
876 if len(labels) > 2:
881 if len(labels) > 2:
877 newlabels.append(_formatconflictmarker(ca, tmpl, labels[2], pad))
882 newlabels.append(_formatconflictmarker(ca, tmpl, labels[2], pad))
878 return newlabels
883 return newlabels
879
884
880
885
881 def partextras(labels):
886 def partextras(labels):
882 """Return a dictionary of extra labels for use in prompts to the user
887 """Return a dictionary of extra labels for use in prompts to the user
883
888
884 Intended use is in strings of the form "(l)ocal%(l)s".
889 Intended use is in strings of the form "(l)ocal%(l)s".
885 """
890 """
886 if labels is None:
891 if labels is None:
887 return {
892 return {
888 b"l": b"",
893 b"l": b"",
889 b"o": b"",
894 b"o": b"",
890 }
895 }
891
896
892 return {
897 return {
893 b"l": b" [%s]" % labels[0],
898 b"l": b" [%s]" % labels[0],
894 b"o": b" [%s]" % labels[1],
899 b"o": b" [%s]" % labels[1],
895 }
900 }
896
901
897
902
898 def _restorebackup(fcd, back):
903 def _restorebackup(fcd, back):
899 # TODO: Add a workingfilectx.write(otherfilectx) path so we can use
904 # TODO: Add a workingfilectx.write(otherfilectx) path so we can use
900 # util.copy here instead.
905 # util.copy here instead.
901 fcd.write(back.data(), fcd.flags())
906 fcd.write(back.data(), fcd.flags())
902
907
903
908
904 def _makebackup(repo, ui, wctx, fcd, premerge):
909 def _makebackup(repo, ui, wctx, fcd, premerge):
905 """Makes and returns a filectx-like object for ``fcd``'s backup file.
910 """Makes and returns a filectx-like object for ``fcd``'s backup file.
906
911
907 In addition to preserving the user's pre-existing modifications to `fcd`
912 In addition to preserving the user's pre-existing modifications to `fcd`
908 (if any), the backup is used to undo certain premerges, confirm whether a
913 (if any), the backup is used to undo certain premerges, confirm whether a
909 merge changed anything, and determine what line endings the new file should
914 merge changed anything, and determine what line endings the new file should
910 have.
915 have.
911
916
912 Backups only need to be written once (right before the premerge) since their
917 Backups only need to be written once (right before the premerge) since their
913 content doesn't change afterwards.
918 content doesn't change afterwards.
914 """
919 """
915 if fcd.isabsent():
920 if fcd.isabsent():
916 return None
921 return None
917 # TODO: Break this import cycle somehow. (filectx -> ctx -> fileset ->
922 # TODO: Break this import cycle somehow. (filectx -> ctx -> fileset ->
918 # merge -> filemerge). (I suspect the fileset import is the weakest link)
923 # merge -> filemerge). (I suspect the fileset import is the weakest link)
919 from . import context
924 from . import context
920
925
921 back = scmutil.backuppath(ui, repo, fcd.path())
926 back = scmutil.backuppath(ui, repo, fcd.path())
922 inworkingdir = back.startswith(repo.wvfs.base) and not back.startswith(
927 inworkingdir = back.startswith(repo.wvfs.base) and not back.startswith(
923 repo.vfs.base
928 repo.vfs.base
924 )
929 )
925 if isinstance(fcd, context.overlayworkingfilectx) and inworkingdir:
930 if isinstance(fcd, context.overlayworkingfilectx) and inworkingdir:
926 # If the backup file is to be in the working directory, and we're
931 # If the backup file is to be in the working directory, and we're
927 # merging in-memory, we must redirect the backup to the memory context
932 # merging in-memory, we must redirect the backup to the memory context
928 # so we don't disturb the working directory.
933 # so we don't disturb the working directory.
929 relpath = back[len(repo.wvfs.base) + 1 :]
934 relpath = back[len(repo.wvfs.base) + 1 :]
930 if premerge:
935 if premerge:
931 wctx[relpath].write(fcd.data(), fcd.flags())
936 wctx[relpath].write(fcd.data(), fcd.flags())
932 return wctx[relpath]
937 return wctx[relpath]
933 else:
938 else:
934 if premerge:
939 if premerge:
935 # Otherwise, write to wherever path the user specified the backups
940 # Otherwise, write to wherever path the user specified the backups
936 # should go. We still need to switch based on whether the source is
941 # should go. We still need to switch based on whether the source is
937 # in-memory so we can use the fast path of ``util.copy`` if both are
942 # in-memory so we can use the fast path of ``util.copy`` if both are
938 # on disk.
943 # on disk.
939 if isinstance(fcd, context.overlayworkingfilectx):
944 if isinstance(fcd, context.overlayworkingfilectx):
940 util.writefile(back, fcd.data())
945 util.writefile(back, fcd.data())
941 else:
946 else:
942 a = _workingpath(repo, fcd)
947 a = _workingpath(repo, fcd)
943 util.copyfile(a, back)
948 util.copyfile(a, back)
944 # A arbitraryfilectx is returned, so we can run the same functions on
949 # A arbitraryfilectx is returned, so we can run the same functions on
945 # the backup context regardless of where it lives.
950 # the backup context regardless of where it lives.
946 return context.arbitraryfilectx(back, repo=repo)
951 return context.arbitraryfilectx(back, repo=repo)
947
952
948
953
949 @contextlib.contextmanager
954 @contextlib.contextmanager
950 def _maketempfiles(repo, fco, fca, localpath, uselocalpath):
955 def _maketempfiles(repo, fco, fca, localpath, uselocalpath):
951 """Writes out `fco` and `fca` as temporary files, and (if uselocalpath)
956 """Writes out `fco` and `fca` as temporary files, and (if uselocalpath)
952 copies `localpath` to another temporary file, so an external merge tool may
957 copies `localpath` to another temporary file, so an external merge tool may
953 use them.
958 use them.
954 """
959 """
955 tmproot = None
960 tmproot = None
956 tmprootprefix = repo.ui.config(b'experimental', b'mergetempdirprefix')
961 tmprootprefix = repo.ui.config(b'experimental', b'mergetempdirprefix')
957 if tmprootprefix:
962 if tmprootprefix:
958 tmproot = pycompat.mkdtemp(prefix=tmprootprefix)
963 tmproot = pycompat.mkdtemp(prefix=tmprootprefix)
959
964
960 def maketempfrompath(prefix, path):
965 def maketempfrompath(prefix, path):
961 fullbase, ext = os.path.splitext(path)
966 fullbase, ext = os.path.splitext(path)
962 pre = b"%s~%s" % (os.path.basename(fullbase), prefix)
967 pre = b"%s~%s" % (os.path.basename(fullbase), prefix)
963 if tmproot:
968 if tmproot:
964 name = os.path.join(tmproot, pre)
969 name = os.path.join(tmproot, pre)
965 if ext:
970 if ext:
966 name += ext
971 name += ext
967 f = open(name, "wb")
972 f = open(name, "wb")
968 else:
973 else:
969 fd, name = pycompat.mkstemp(prefix=pre + b'.', suffix=ext)
974 fd, name = pycompat.mkstemp(prefix=pre + b'.', suffix=ext)
970 f = os.fdopen(fd, "wb")
975 f = os.fdopen(fd, "wb")
971 return f, name
976 return f, name
972
977
973 def tempfromcontext(prefix, ctx):
978 def tempfromcontext(prefix, ctx):
974 f, name = maketempfrompath(prefix, ctx.path())
979 f, name = maketempfrompath(prefix, ctx.path())
975 data = repo.wwritedata(ctx.path(), ctx.data())
980 data = repo.wwritedata(ctx.path(), ctx.data())
976 f.write(data)
981 f.write(data)
977 f.close()
982 f.close()
978 return name
983 return name
979
984
980 b = tempfromcontext(b"base", fca)
985 b = tempfromcontext(b"base", fca)
981 c = tempfromcontext(b"other", fco)
986 c = tempfromcontext(b"other", fco)
982 d = localpath
987 d = localpath
983 if uselocalpath:
988 if uselocalpath:
984 # We start off with this being the backup filename, so remove the .orig
989 # We start off with this being the backup filename, so remove the .orig
985 # to make syntax-highlighting more likely.
990 # to make syntax-highlighting more likely.
986 if d.endswith(b'.orig'):
991 if d.endswith(b'.orig'):
987 d, _ = os.path.splitext(d)
992 d, _ = os.path.splitext(d)
988 f, d = maketempfrompath(b"local", d)
993 f, d = maketempfrompath(b"local", d)
989 with open(localpath, b'rb') as src:
994 with open(localpath, b'rb') as src:
990 f.write(src.read())
995 f.write(src.read())
991 f.close()
996 f.close()
992
997
993 try:
998 try:
994 yield b, c, d
999 yield b, c, d
995 finally:
1000 finally:
996 if tmproot:
1001 if tmproot:
997 shutil.rmtree(tmproot)
1002 shutil.rmtree(tmproot)
998 else:
1003 else:
999 util.unlink(b)
1004 util.unlink(b)
1000 util.unlink(c)
1005 util.unlink(c)
1001 # if not uselocalpath, d is the 'orig'/backup file which we
1006 # if not uselocalpath, d is the 'orig'/backup file which we
1002 # shouldn't delete.
1007 # shouldn't delete.
1003 if d and uselocalpath:
1008 if d and uselocalpath:
1004 util.unlink(d)
1009 util.unlink(d)
1005
1010
1006
1011
1007 def _filemerge(premerge, repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
1012 def _filemerge(premerge, repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
1008 """perform a 3-way merge in the working directory
1013 """perform a 3-way merge in the working directory
1009
1014
1010 premerge = whether this is a premerge
1015 premerge = whether this is a premerge
1011 mynode = parent node before merge
1016 mynode = parent node before merge
1012 orig = original local filename before merge
1017 orig = original local filename before merge
1013 fco = other file context
1018 fco = other file context
1014 fca = ancestor file context
1019 fca = ancestor file context
1015 fcd = local file context for current/destination file
1020 fcd = local file context for current/destination file
1016
1021
1017 Returns whether the merge is complete, the return value of the merge, and
1022 Returns whether the merge is complete, the return value of the merge, and
1018 a boolean indicating whether the file was deleted from disk."""
1023 a boolean indicating whether the file was deleted from disk."""
1019
1024
1020 if not fco.cmp(fcd): # files identical?
1025 if not fco.cmp(fcd): # files identical?
1021 return True, None, False
1026 return True, None, False
1022
1027
1023 ui = repo.ui
1028 ui = repo.ui
1024 fd = fcd.path()
1029 fd = fcd.path()
1025 uipathfn = scmutil.getuipathfn(repo)
1030 uipathfn = scmutil.getuipathfn(repo)
1026 fduipath = uipathfn(fd)
1031 fduipath = uipathfn(fd)
1027 binary = fcd.isbinary() or fco.isbinary() or fca.isbinary()
1032 binary = fcd.isbinary() or fco.isbinary() or fca.isbinary()
1028 symlink = b'l' in fcd.flags() + fco.flags()
1033 symlink = b'l' in fcd.flags() + fco.flags()
1029 changedelete = fcd.isabsent() or fco.isabsent()
1034 changedelete = fcd.isabsent() or fco.isabsent()
1030 tool, toolpath = _picktool(repo, ui, fd, binary, symlink, changedelete)
1035 tool, toolpath = _picktool(repo, ui, fd, binary, symlink, changedelete)
1031 scriptfn = None
1036 scriptfn = None
1032 if tool in internals and tool.startswith(b'internal:'):
1037 if tool in internals and tool.startswith(b'internal:'):
1033 # normalize to new-style names (':merge' etc)
1038 # normalize to new-style names (':merge' etc)
1034 tool = tool[len(b'internal') :]
1039 tool = tool[len(b'internal') :]
1035 if toolpath and toolpath.startswith(b'python:'):
1040 if toolpath and toolpath.startswith(b'python:'):
1036 invalidsyntax = False
1041 invalidsyntax = False
1037 if toolpath.count(b':') >= 2:
1042 if toolpath.count(b':') >= 2:
1038 script, scriptfn = toolpath[7:].rsplit(b':', 1)
1043 script, scriptfn = toolpath[7:].rsplit(b':', 1)
1039 if not scriptfn:
1044 if not scriptfn:
1040 invalidsyntax = True
1045 invalidsyntax = True
1041 # missing :callable can lead to spliting on windows drive letter
1046 # missing :callable can lead to spliting on windows drive letter
1042 if b'\\' in scriptfn or b'/' in scriptfn:
1047 if b'\\' in scriptfn or b'/' in scriptfn:
1043 invalidsyntax = True
1048 invalidsyntax = True
1044 else:
1049 else:
1045 invalidsyntax = True
1050 invalidsyntax = True
1046 if invalidsyntax:
1051 if invalidsyntax:
1047 raise error.Abort(_(b"invalid 'python:' syntax: %s") % toolpath)
1052 raise error.Abort(_(b"invalid 'python:' syntax: %s") % toolpath)
1048 toolpath = script
1053 toolpath = script
1049 ui.debug(
1054 ui.debug(
1050 b"picked tool '%s' for %s (binary %s symlink %s changedelete %s)\n"
1055 b"picked tool '%s' for %s (binary %s symlink %s changedelete %s)\n"
1051 % (
1056 % (
1052 tool,
1057 tool,
1053 fduipath,
1058 fduipath,
1054 pycompat.bytestr(binary),
1059 pycompat.bytestr(binary),
1055 pycompat.bytestr(symlink),
1060 pycompat.bytestr(symlink),
1056 pycompat.bytestr(changedelete),
1061 pycompat.bytestr(changedelete),
1057 )
1062 )
1058 )
1063 )
1059
1064
1060 if tool in internals:
1065 if tool in internals:
1061 func = internals[tool]
1066 func = internals[tool]
1062 mergetype = func.mergetype
1067 mergetype = func.mergetype
1063 onfailure = func.onfailure
1068 onfailure = func.onfailure
1064 precheck = func.precheck
1069 precheck = func.precheck
1065 isexternal = False
1070 isexternal = False
1066 else:
1071 else:
1067 if wctx.isinmemory():
1072 if wctx.isinmemory():
1068 func = _xmergeimm
1073 func = _xmergeimm
1069 else:
1074 else:
1070 func = _xmerge
1075 func = _xmerge
1071 mergetype = fullmerge
1076 mergetype = fullmerge
1072 onfailure = _(b"merging %s failed!\n")
1077 onfailure = _(b"merging %s failed!\n")
1073 precheck = None
1078 precheck = None
1074 isexternal = True
1079 isexternal = True
1075
1080
1076 toolconf = tool, toolpath, binary, symlink, scriptfn
1081 toolconf = tool, toolpath, binary, symlink, scriptfn
1077
1082
1078 if mergetype == nomerge:
1083 if mergetype == nomerge:
1079 r, deleted = func(repo, mynode, orig, fcd, fco, fca, toolconf, labels)
1084 r, deleted = func(repo, mynode, orig, fcd, fco, fca, toolconf, labels)
1080 return True, r, deleted
1085 return True, r, deleted
1081
1086
1082 if premerge:
1087 if premerge:
1083 if orig != fco.path():
1088 if orig != fco.path():
1084 ui.status(
1089 ui.status(
1085 _(b"merging %s and %s to %s\n")
1090 _(b"merging %s and %s to %s\n")
1086 % (uipathfn(orig), uipathfn(fco.path()), fduipath)
1091 % (uipathfn(orig), uipathfn(fco.path()), fduipath)
1087 )
1092 )
1088 else:
1093 else:
1089 ui.status(_(b"merging %s\n") % fduipath)
1094 ui.status(_(b"merging %s\n") % fduipath)
1090
1095
1091 ui.debug(b"my %s other %s ancestor %s\n" % (fcd, fco, fca))
1096 ui.debug(b"my %s other %s ancestor %s\n" % (fcd, fco, fca))
1092
1097
1093 if precheck and not precheck(repo, mynode, orig, fcd, fco, fca, toolconf):
1098 if precheck and not precheck(repo, mynode, orig, fcd, fco, fca, toolconf):
1094 if onfailure:
1099 if onfailure:
1095 if wctx.isinmemory():
1100 if wctx.isinmemory():
1096 raise error.InMemoryMergeConflictsError(
1101 raise error.InMemoryMergeConflictsError(
1097 b'in-memory merge does not support merge conflicts'
1102 b'in-memory merge does not support merge conflicts'
1098 )
1103 )
1099 ui.warn(onfailure % fduipath)
1104 ui.warn(onfailure % fduipath)
1100 return True, 1, False
1105 return True, 1, False
1101
1106
1102 back = _makebackup(repo, ui, wctx, fcd, premerge)
1107 back = _makebackup(repo, ui, wctx, fcd, premerge)
1103 files = (None, None, None, back)
1108 files = (None, None, None, back)
1104 r = 1
1109 r = 1
1105 try:
1110 try:
1106 internalmarkerstyle = ui.config(b'ui', b'mergemarkers')
1111 internalmarkerstyle = ui.config(b'ui', b'mergemarkers')
1107 if isexternal:
1112 if isexternal:
1108 markerstyle = _toolstr(ui, tool, b'mergemarkers')
1113 markerstyle = _toolstr(ui, tool, b'mergemarkers')
1109 else:
1114 else:
1110 markerstyle = internalmarkerstyle
1115 markerstyle = internalmarkerstyle
1111
1116
1112 if not labels:
1117 if not labels:
1113 labels = _defaultconflictlabels
1118 labels = _defaultconflictlabels
1114 formattedlabels = labels
1119 formattedlabels = labels
1115 if markerstyle != b'basic':
1120 if markerstyle != b'basic':
1116 formattedlabels = _formatlabels(
1121 formattedlabels = _formatlabels(
1117 repo, fcd, fco, fca, labels, tool=tool
1122 repo, fcd, fco, fca, labels, tool=tool
1118 )
1123 )
1119
1124
1120 if premerge and mergetype == fullmerge:
1125 if premerge and mergetype == fullmerge:
1121 # conflict markers generated by premerge will use 'detailed'
1126 # conflict markers generated by premerge will use 'detailed'
1122 # settings if either ui.mergemarkers or the tool's mergemarkers
1127 # settings if either ui.mergemarkers or the tool's mergemarkers
1123 # setting is 'detailed'. This way tools can have basic labels in
1128 # setting is 'detailed'. This way tools can have basic labels in
1124 # space-constrained areas of the UI, but still get full information
1129 # space-constrained areas of the UI, but still get full information
1125 # in conflict markers if premerge is 'keep' or 'keep-merge3'.
1130 # in conflict markers if premerge is 'keep' or 'keep-merge3'.
1126 premergelabels = labels
1131 premergelabels = labels
1127 labeltool = None
1132 labeltool = None
1128 if markerstyle != b'basic':
1133 if markerstyle != b'basic':
1129 # respect 'tool's mergemarkertemplate (which defaults to
1134 # respect 'tool's mergemarkertemplate (which defaults to
1130 # command-templates.mergemarker)
1135 # command-templates.mergemarker)
1131 labeltool = tool
1136 labeltool = tool
1132 if internalmarkerstyle != b'basic' or markerstyle != b'basic':
1137 if internalmarkerstyle != b'basic' or markerstyle != b'basic':
1133 premergelabels = _formatlabels(
1138 premergelabels = _formatlabels(
1134 repo, fcd, fco, fca, premergelabels, tool=labeltool
1139 repo, fcd, fco, fca, premergelabels, tool=labeltool
1135 )
1140 )
1136
1141
1137 r = _premerge(
1142 r = _premerge(
1138 repo, fcd, fco, fca, toolconf, files, labels=premergelabels
1143 repo, fcd, fco, fca, toolconf, files, labels=premergelabels
1139 )
1144 )
1140 # complete if premerge successful (r is 0)
1145 # complete if premerge successful (r is 0)
1141 return not r, r, False
1146 return not r, r, False
1142
1147
1143 needcheck, r, deleted = func(
1148 needcheck, r, deleted = func(
1144 repo,
1149 repo,
1145 mynode,
1150 mynode,
1146 orig,
1151 orig,
1147 fcd,
1152 fcd,
1148 fco,
1153 fco,
1149 fca,
1154 fca,
1150 toolconf,
1155 toolconf,
1151 files,
1156 files,
1152 labels=formattedlabels,
1157 labels=formattedlabels,
1153 )
1158 )
1154
1159
1155 if needcheck:
1160 if needcheck:
1156 r = _check(repo, r, ui, tool, fcd, files)
1161 r = _check(repo, r, ui, tool, fcd, files)
1157
1162
1158 if r:
1163 if r:
1159 if onfailure:
1164 if onfailure:
1160 if wctx.isinmemory():
1165 if wctx.isinmemory():
1161 raise error.InMemoryMergeConflictsError(
1166 raise error.InMemoryMergeConflictsError(
1162 b'in-memory merge '
1167 b'in-memory merge '
1163 b'does not support '
1168 b'does not support '
1164 b'merge conflicts'
1169 b'merge conflicts'
1165 )
1170 )
1166 ui.warn(onfailure % fduipath)
1171 ui.warn(onfailure % fduipath)
1167 _onfilemergefailure(ui)
1172 _onfilemergefailure(ui)
1168
1173
1169 return True, r, deleted
1174 return True, r, deleted
1170 finally:
1175 finally:
1171 if not r and back is not None:
1176 if not r and back is not None:
1172 back.remove()
1177 back.remove()
1173
1178
1174
1179
1175 def _haltmerge():
1180 def _haltmerge():
1176 msg = _(b'merge halted after failed merge (see hg resolve)')
1181 msg = _(b'merge halted after failed merge (see hg resolve)')
1177 raise error.InterventionRequired(msg)
1182 raise error.InterventionRequired(msg)
1178
1183
1179
1184
1180 def _onfilemergefailure(ui):
1185 def _onfilemergefailure(ui):
1181 action = ui.config(b'merge', b'on-failure')
1186 action = ui.config(b'merge', b'on-failure')
1182 if action == b'prompt':
1187 if action == b'prompt':
1183 msg = _(b'continue merge operation (yn)?$$ &Yes $$ &No')
1188 msg = _(b'continue merge operation (yn)?$$ &Yes $$ &No')
1184 if ui.promptchoice(msg, 0) == 1:
1189 if ui.promptchoice(msg, 0) == 1:
1185 _haltmerge()
1190 _haltmerge()
1186 if action == b'halt':
1191 if action == b'halt':
1187 _haltmerge()
1192 _haltmerge()
1188 # default action is 'continue', in which case we neither prompt nor halt
1193 # default action is 'continue', in which case we neither prompt nor halt
1189
1194
1190
1195
1191 def hasconflictmarkers(data):
1196 def hasconflictmarkers(data):
1192 return bool(
1197 return bool(
1193 re.search(b"^(<<<<<<< .*|=======|>>>>>>> .*)$", data, re.MULTILINE)
1198 re.search(b"^(<<<<<<< .*|=======|>>>>>>> .*)$", data, re.MULTILINE)
1194 )
1199 )
1195
1200
1196
1201
1197 def _check(repo, r, ui, tool, fcd, files):
1202 def _check(repo, r, ui, tool, fcd, files):
1198 fd = fcd.path()
1203 fd = fcd.path()
1199 uipathfn = scmutil.getuipathfn(repo)
1204 uipathfn = scmutil.getuipathfn(repo)
1200 unused, unused, unused, back = files
1205 unused, unused, unused, back = files
1201
1206
1202 if not r and (
1207 if not r and (
1203 _toolbool(ui, tool, b"checkconflicts")
1208 _toolbool(ui, tool, b"checkconflicts")
1204 or b'conflicts' in _toollist(ui, tool, b"check")
1209 or b'conflicts' in _toollist(ui, tool, b"check")
1205 ):
1210 ):
1206 if hasconflictmarkers(fcd.data()):
1211 if hasconflictmarkers(fcd.data()):
1207 r = 1
1212 r = 1
1208
1213
1209 checked = False
1214 checked = False
1210 if b'prompt' in _toollist(ui, tool, b"check"):
1215 if b'prompt' in _toollist(ui, tool, b"check"):
1211 checked = True
1216 checked = True
1212 if ui.promptchoice(
1217 if ui.promptchoice(
1213 _(b"was merge of '%s' successful (yn)?$$ &Yes $$ &No")
1218 _(b"was merge of '%s' successful (yn)?$$ &Yes $$ &No")
1214 % uipathfn(fd),
1219 % uipathfn(fd),
1215 1,
1220 1,
1216 ):
1221 ):
1217 r = 1
1222 r = 1
1218
1223
1219 if (
1224 if (
1220 not r
1225 not r
1221 and not checked
1226 and not checked
1222 and (
1227 and (
1223 _toolbool(ui, tool, b"checkchanged")
1228 _toolbool(ui, tool, b"checkchanged")
1224 or b'changed' in _toollist(ui, tool, b"check")
1229 or b'changed' in _toollist(ui, tool, b"check")
1225 )
1230 )
1226 ):
1231 ):
1227 if back is not None and not fcd.cmp(back):
1232 if back is not None and not fcd.cmp(back):
1228 if ui.promptchoice(
1233 if ui.promptchoice(
1229 _(
1234 _(
1230 b" output file %s appears unchanged\n"
1235 b" output file %s appears unchanged\n"
1231 b"was merge successful (yn)?"
1236 b"was merge successful (yn)?"
1232 b"$$ &Yes $$ &No"
1237 b"$$ &Yes $$ &No"
1233 )
1238 )
1234 % uipathfn(fd),
1239 % uipathfn(fd),
1235 1,
1240 1,
1236 ):
1241 ):
1237 r = 1
1242 r = 1
1238
1243
1239 if back is not None and _toolbool(ui, tool, b"fixeol"):
1244 if back is not None and _toolbool(ui, tool, b"fixeol"):
1240 _matcheol(_workingpath(repo, fcd), back)
1245 _matcheol(_workingpath(repo, fcd), back)
1241
1246
1242 return r
1247 return r
1243
1248
1244
1249
1245 def _workingpath(repo, ctx):
1250 def _workingpath(repo, ctx):
1246 return repo.wjoin(ctx.path())
1251 return repo.wjoin(ctx.path())
1247
1252
1248
1253
1249 def premerge(repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
1254 def premerge(repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
1250 return _filemerge(
1255 return _filemerge(
1251 True, repo, wctx, mynode, orig, fcd, fco, fca, labels=labels
1256 True, repo, wctx, mynode, orig, fcd, fco, fca, labels=labels
1252 )
1257 )
1253
1258
1254
1259
1255 def filemerge(repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
1260 def filemerge(repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
1256 return _filemerge(
1261 return _filemerge(
1257 False, repo, wctx, mynode, orig, fcd, fco, fca, labels=labels
1262 False, repo, wctx, mynode, orig, fcd, fco, fca, labels=labels
1258 )
1263 )
1259
1264
1260
1265
1261 def loadinternalmerge(ui, extname, registrarobj):
1266 def loadinternalmerge(ui, extname, registrarobj):
1262 """Load internal merge tool from specified registrarobj"""
1267 """Load internal merge tool from specified registrarobj"""
1263 for name, func in pycompat.iteritems(registrarobj._table):
1268 for name, func in pycompat.iteritems(registrarobj._table):
1264 fullname = b':' + name
1269 fullname = b':' + name
1265 internals[fullname] = func
1270 internals[fullname] = func
1266 internals[b'internal:' + name] = func
1271 internals[b'internal:' + name] = func
1267 internalsdoc[fullname] = func
1272 internalsdoc[fullname] = func
1268
1273
1269 capabilities = sorted([k for k, v in func.capabilities.items() if v])
1274 capabilities = sorted([k for k, v in func.capabilities.items() if v])
1270 if capabilities:
1275 if capabilities:
1271 capdesc = b" (actual capabilities: %s)" % b', '.join(
1276 capdesc = b" (actual capabilities: %s)" % b', '.join(
1272 capabilities
1277 capabilities
1273 )
1278 )
1274 func.__doc__ = func.__doc__ + pycompat.sysstr(b"\n\n%s" % capdesc)
1279 func.__doc__ = func.__doc__ + pycompat.sysstr(b"\n\n%s" % capdesc)
1275
1280
1276 # to put i18n comments into hg.pot for automatically generated texts
1281 # to put i18n comments into hg.pot for automatically generated texts
1277
1282
1278 # i18n: "binary" and "symlink" are keywords
1283 # i18n: "binary" and "symlink" are keywords
1279 # i18n: this text is added automatically
1284 # i18n: this text is added automatically
1280 _(b" (actual capabilities: binary, symlink)")
1285 _(b" (actual capabilities: binary, symlink)")
1281 # i18n: "binary" is keyword
1286 # i18n: "binary" is keyword
1282 # i18n: this text is added automatically
1287 # i18n: this text is added automatically
1283 _(b" (actual capabilities: binary)")
1288 _(b" (actual capabilities: binary)")
1284 # i18n: "symlink" is keyword
1289 # i18n: "symlink" is keyword
1285 # i18n: this text is added automatically
1290 # i18n: this text is added automatically
1286 _(b" (actual capabilities: symlink)")
1291 _(b" (actual capabilities: symlink)")
1287
1292
1288
1293
1289 # load built-in merge tools explicitly to setup internalsdoc
1294 # load built-in merge tools explicitly to setup internalsdoc
1290 loadinternalmerge(None, None, internaltool)
1295 loadinternalmerge(None, None, internaltool)
1291
1296
1292 # tell hggettext to extract docstrings from these functions:
1297 # tell hggettext to extract docstrings from these functions:
1293 i18nfunctions = internals.values()
1298 i18nfunctions = internals.values()
@@ -1,2945 +1,2946 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-not-shared`` (per-repository)
57 - ``<repo>/.hg/hgrc-not-shared`` (per-repository)
58 - ``<repo>/.hg/hgrc`` (per-repository)
58 - ``<repo>/.hg/hgrc`` (per-repository)
59 - ``$HOME/.hgrc`` (per-user)
59 - ``$HOME/.hgrc`` (per-user)
60 - ``${XDG_CONFIG_HOME:-$HOME/.config}/hg/hgrc`` (per-user)
60 - ``${XDG_CONFIG_HOME:-$HOME/.config}/hg/hgrc`` (per-user)
61 - ``<install-root>/etc/mercurial/hgrc`` (per-installation)
61 - ``<install-root>/etc/mercurial/hgrc`` (per-installation)
62 - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation)
62 - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation)
63 - ``/etc/mercurial/hgrc`` (per-system)
63 - ``/etc/mercurial/hgrc`` (per-system)
64 - ``/etc/mercurial/hgrc.d/*.rc`` (per-system)
64 - ``/etc/mercurial/hgrc.d/*.rc`` (per-system)
65 - ``<internal>/*.rc`` (defaults)
65 - ``<internal>/*.rc`` (defaults)
66
66
67 .. container:: verbose.windows
67 .. container:: verbose.windows
68
68
69 On Windows, the following files are consulted:
69 On Windows, the following files are consulted:
70
70
71 - ``<repo>/.hg/hgrc-not-shared`` (per-repository)
71 - ``<repo>/.hg/hgrc-not-shared`` (per-repository)
72 - ``<repo>/.hg/hgrc`` (per-repository)
72 - ``<repo>/.hg/hgrc`` (per-repository)
73 - ``%USERPROFILE%\.hgrc`` (per-user)
73 - ``%USERPROFILE%\.hgrc`` (per-user)
74 - ``%USERPROFILE%\Mercurial.ini`` (per-user)
74 - ``%USERPROFILE%\Mercurial.ini`` (per-user)
75 - ``%HOME%\.hgrc`` (per-user)
75 - ``%HOME%\.hgrc`` (per-user)
76 - ``%HOME%\Mercurial.ini`` (per-user)
76 - ``%HOME%\Mercurial.ini`` (per-user)
77 - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-system)
77 - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-system)
78 - ``<install-dir>\hgrc.d\*.rc`` (per-installation)
78 - ``<install-dir>\hgrc.d\*.rc`` (per-installation)
79 - ``<install-dir>\Mercurial.ini`` (per-installation)
79 - ``<install-dir>\Mercurial.ini`` (per-installation)
80 - ``%PROGRAMDATA%\Mercurial\hgrc`` (per-system)
80 - ``%PROGRAMDATA%\Mercurial\hgrc`` (per-system)
81 - ``%PROGRAMDATA%\Mercurial\Mercurial.ini`` (per-system)
81 - ``%PROGRAMDATA%\Mercurial\Mercurial.ini`` (per-system)
82 - ``%PROGRAMDATA%\Mercurial\hgrc.d\*.rc`` (per-system)
82 - ``%PROGRAMDATA%\Mercurial\hgrc.d\*.rc`` (per-system)
83 - ``<internal>/*.rc`` (defaults)
83 - ``<internal>/*.rc`` (defaults)
84
84
85 .. note::
85 .. note::
86
86
87 The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial``
87 The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial``
88 is used when running 32-bit Python on 64-bit Windows.
88 is used when running 32-bit Python on 64-bit Windows.
89
89
90 .. container:: verbose.plan9
90 .. container:: verbose.plan9
91
91
92 On Plan9, the following files are consulted:
92 On Plan9, the following files are consulted:
93
93
94 - ``<repo>/.hg/hgrc-not-shared`` (per-repository)
94 - ``<repo>/.hg/hgrc-not-shared`` (per-repository)
95 - ``<repo>/.hg/hgrc`` (per-repository)
95 - ``<repo>/.hg/hgrc`` (per-repository)
96 - ``$home/lib/hgrc`` (per-user)
96 - ``$home/lib/hgrc`` (per-user)
97 - ``<install-root>/lib/mercurial/hgrc`` (per-installation)
97 - ``<install-root>/lib/mercurial/hgrc`` (per-installation)
98 - ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation)
98 - ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation)
99 - ``/lib/mercurial/hgrc`` (per-system)
99 - ``/lib/mercurial/hgrc`` (per-system)
100 - ``/lib/mercurial/hgrc.d/*.rc`` (per-system)
100 - ``/lib/mercurial/hgrc.d/*.rc`` (per-system)
101 - ``<internal>/*.rc`` (defaults)
101 - ``<internal>/*.rc`` (defaults)
102
102
103 Per-repository configuration options only apply in a
103 Per-repository configuration options only apply in a
104 particular repository. This file is not version-controlled, and
104 particular repository. This file is not version-controlled, and
105 will not get transferred during a "clone" operation. Options in
105 will not get transferred during a "clone" operation. Options in
106 this file override options in all other configuration files.
106 this file override options in all other configuration files.
107
107
108 .. container:: unix.plan9
108 .. container:: unix.plan9
109
109
110 On Plan 9 and Unix, most of this file will be ignored if it doesn't
110 On Plan 9 and Unix, most of this file will be ignored if it doesn't
111 belong to a trusted user or to a trusted group. See
111 belong to a trusted user or to a trusted group. See
112 :hg:`help config.trusted` for more details.
112 :hg:`help config.trusted` for more details.
113
113
114 Per-user configuration file(s) are for the user running Mercurial. Options
114 Per-user configuration file(s) are for the user running Mercurial. Options
115 in these files apply to all Mercurial commands executed by this user in any
115 in these files apply to all Mercurial commands executed by this user in any
116 directory. Options in these files override per-system and per-installation
116 directory. Options in these files override per-system and per-installation
117 options.
117 options.
118
118
119 Per-installation configuration files are searched for in the
119 Per-installation configuration files are searched for in the
120 directory where Mercurial is installed. ``<install-root>`` is the
120 directory where Mercurial is installed. ``<install-root>`` is the
121 parent directory of the **hg** executable (or symlink) being run.
121 parent directory of the **hg** executable (or symlink) being run.
122
122
123 .. container:: unix.plan9
123 .. container:: unix.plan9
124
124
125 For example, if installed in ``/shared/tools/bin/hg``, Mercurial
125 For example, if installed in ``/shared/tools/bin/hg``, Mercurial
126 will look in ``/shared/tools/etc/mercurial/hgrc``. Options in these
126 will look in ``/shared/tools/etc/mercurial/hgrc``. Options in these
127 files apply to all Mercurial commands executed by any user in any
127 files apply to all Mercurial commands executed by any user in any
128 directory.
128 directory.
129
129
130 Per-installation configuration files are for the system on
130 Per-installation configuration files are for the system on
131 which Mercurial is running. Options in these files apply to all
131 which Mercurial is running. Options in these files apply to all
132 Mercurial commands executed by any user in any directory. Registry
132 Mercurial commands executed by any user in any directory. Registry
133 keys contain PATH-like strings, every part of which must reference
133 keys contain PATH-like strings, every part of which must reference
134 a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will
134 a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will
135 be read. Mercurial checks each of these locations in the specified
135 be read. Mercurial checks each of these locations in the specified
136 order until one or more configuration files are detected.
136 order until one or more configuration files are detected.
137
137
138 Per-system configuration files are for the system on which Mercurial
138 Per-system configuration files are for the system on which Mercurial
139 is running. Options in these files apply to all Mercurial commands
139 is running. Options in these files apply to all Mercurial commands
140 executed by any user in any directory. Options in these files
140 executed by any user in any directory. Options in these files
141 override per-installation options.
141 override per-installation options.
142
142
143 Mercurial comes with some default configuration. The default configuration
143 Mercurial comes with some default configuration. The default configuration
144 files are installed with Mercurial and will be overwritten on upgrades. Default
144 files are installed with Mercurial and will be overwritten on upgrades. Default
145 configuration files should never be edited by users or administrators but can
145 configuration files should never be edited by users or administrators but can
146 be overridden in other configuration files. So far the directory only contains
146 be overridden in other configuration files. So far the directory only contains
147 merge tool configuration but packagers can also put other default configuration
147 merge tool configuration but packagers can also put other default configuration
148 there.
148 there.
149
149
150 .. container:: verbose
150 .. container:: verbose
151
151
152 On versions 5.7 and later, if share-safe functionality is enabled,
152 On versions 5.7 and later, if share-safe functionality is enabled,
153 shares will read config file of share source too.
153 shares will read config file of share source too.
154 `<share-source/.hg/hgrc>` is read before reading `<repo/.hg/hgrc>`.
154 `<share-source/.hg/hgrc>` is read before reading `<repo/.hg/hgrc>`.
155
155
156 For configs which should not be shared, `<repo/.hg/hgrc-not-shared>`
156 For configs which should not be shared, `<repo/.hg/hgrc-not-shared>`
157 should be used.
157 should be used.
158
158
159 Syntax
159 Syntax
160 ======
160 ======
161
161
162 A configuration file consists of sections, led by a ``[section]`` header
162 A configuration file consists of sections, led by a ``[section]`` header
163 and followed by ``name = value`` entries (sometimes called
163 and followed by ``name = value`` entries (sometimes called
164 ``configuration keys``)::
164 ``configuration keys``)::
165
165
166 [spam]
166 [spam]
167 eggs=ham
167 eggs=ham
168 green=
168 green=
169 eggs
169 eggs
170
170
171 Each line contains one entry. If the lines that follow are indented,
171 Each line contains one entry. If the lines that follow are indented,
172 they are treated as continuations of that entry. Leading whitespace is
172 they are treated as continuations of that entry. Leading whitespace is
173 removed from values. Empty lines are skipped. Lines beginning with
173 removed from values. Empty lines are skipped. Lines beginning with
174 ``#`` or ``;`` are ignored and may be used to provide comments.
174 ``#`` or ``;`` are ignored and may be used to provide comments.
175
175
176 Configuration keys can be set multiple times, in which case Mercurial
176 Configuration keys can be set multiple times, in which case Mercurial
177 will use the value that was configured last. As an example::
177 will use the value that was configured last. As an example::
178
178
179 [spam]
179 [spam]
180 eggs=large
180 eggs=large
181 ham=serrano
181 ham=serrano
182 eggs=small
182 eggs=small
183
183
184 This would set the configuration key named ``eggs`` to ``small``.
184 This would set the configuration key named ``eggs`` to ``small``.
185
185
186 It is also possible to define a section multiple times. A section can
186 It is also possible to define a section multiple times. A section can
187 be redefined on the same and/or on different configuration files. For
187 be redefined on the same and/or on different configuration files. For
188 example::
188 example::
189
189
190 [foo]
190 [foo]
191 eggs=large
191 eggs=large
192 ham=serrano
192 ham=serrano
193 eggs=small
193 eggs=small
194
194
195 [bar]
195 [bar]
196 eggs=ham
196 eggs=ham
197 green=
197 green=
198 eggs
198 eggs
199
199
200 [foo]
200 [foo]
201 ham=prosciutto
201 ham=prosciutto
202 eggs=medium
202 eggs=medium
203 bread=toasted
203 bread=toasted
204
204
205 This would set the ``eggs``, ``ham``, and ``bread`` configuration keys
205 This would set the ``eggs``, ``ham``, and ``bread`` configuration keys
206 of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``,
206 of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``,
207 respectively. As you can see there only thing that matters is the last
207 respectively. As you can see there only thing that matters is the last
208 value that was set for each of the configuration keys.
208 value that was set for each of the configuration keys.
209
209
210 If a configuration key is set multiple times in different
210 If a configuration key is set multiple times in different
211 configuration files the final value will depend on the order in which
211 configuration files the final value will depend on the order in which
212 the different configuration files are read, with settings from earlier
212 the different configuration files are read, with settings from earlier
213 paths overriding later ones as described on the ``Files`` section
213 paths overriding later ones as described on the ``Files`` section
214 above.
214 above.
215
215
216 A line of the form ``%include file`` will include ``file`` into the
216 A line of the form ``%include file`` will include ``file`` into the
217 current configuration file. The inclusion is recursive, which means
217 current configuration file. The inclusion is recursive, which means
218 that included files can include other files. Filenames are relative to
218 that included files can include other files. Filenames are relative to
219 the configuration file in which the ``%include`` directive is found.
219 the configuration file in which the ``%include`` directive is found.
220 Environment variables and ``~user`` constructs are expanded in
220 Environment variables and ``~user`` constructs are expanded in
221 ``file``. This lets you do something like::
221 ``file``. This lets you do something like::
222
222
223 %include ~/.hgrc.d/$HOST.rc
223 %include ~/.hgrc.d/$HOST.rc
224
224
225 to include a different configuration file on each computer you use.
225 to include a different configuration file on each computer you use.
226
226
227 A line with ``%unset name`` will remove ``name`` from the current
227 A line with ``%unset name`` will remove ``name`` from the current
228 section, if it has been set previously.
228 section, if it has been set previously.
229
229
230 The values are either free-form text strings, lists of text strings,
230 The values are either free-form text strings, lists of text strings,
231 or Boolean values. Boolean values can be set to true using any of "1",
231 or Boolean values. Boolean values can be set to true using any of "1",
232 "yes", "true", or "on" and to false using "0", "no", "false", or "off"
232 "yes", "true", or "on" and to false using "0", "no", "false", or "off"
233 (all case insensitive).
233 (all case insensitive).
234
234
235 List values are separated by whitespace or comma, except when values are
235 List values are separated by whitespace or comma, except when values are
236 placed in double quotation marks::
236 placed in double quotation marks::
237
237
238 allow_read = "John Doe, PhD", brian, betty
238 allow_read = "John Doe, PhD", brian, betty
239
239
240 Quotation marks can be escaped by prefixing them with a backslash. Only
240 Quotation marks can be escaped by prefixing them with a backslash. Only
241 quotation marks at the beginning of a word is counted as a quotation
241 quotation marks at the beginning of a word is counted as a quotation
242 (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``).
242 (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``).
243
243
244 Sections
244 Sections
245 ========
245 ========
246
246
247 This section describes the different sections that may appear in a
247 This section describes the different sections that may appear in a
248 Mercurial configuration file, the purpose of each section, its possible
248 Mercurial configuration file, the purpose of each section, its possible
249 keys, and their possible values.
249 keys, and their possible values.
250
250
251 ``alias``
251 ``alias``
252 ---------
252 ---------
253
253
254 Defines command aliases.
254 Defines command aliases.
255
255
256 Aliases allow you to define your own commands in terms of other
256 Aliases allow you to define your own commands in terms of other
257 commands (or aliases), optionally including arguments. Positional
257 commands (or aliases), optionally including arguments. Positional
258 arguments in the form of ``$1``, ``$2``, etc. in the alias definition
258 arguments in the form of ``$1``, ``$2``, etc. in the alias definition
259 are expanded by Mercurial before execution. Positional arguments not
259 are expanded by Mercurial before execution. Positional arguments not
260 already used by ``$N`` in the definition are put at the end of the
260 already used by ``$N`` in the definition are put at the end of the
261 command to be executed.
261 command to be executed.
262
262
263 Alias definitions consist of lines of the form::
263 Alias definitions consist of lines of the form::
264
264
265 <alias> = <command> [<argument>]...
265 <alias> = <command> [<argument>]...
266
266
267 For example, this definition::
267 For example, this definition::
268
268
269 latest = log --limit 5
269 latest = log --limit 5
270
270
271 creates a new command ``latest`` that shows only the five most recent
271 creates a new command ``latest`` that shows only the five most recent
272 changesets. You can define subsequent aliases using earlier ones::
272 changesets. You can define subsequent aliases using earlier ones::
273
273
274 stable5 = latest -b stable
274 stable5 = latest -b stable
275
275
276 .. note::
276 .. note::
277
277
278 It is possible to create aliases with the same names as
278 It is possible to create aliases with the same names as
279 existing commands, which will then override the original
279 existing commands, which will then override the original
280 definitions. This is almost always a bad idea!
280 definitions. This is almost always a bad idea!
281
281
282 An alias can start with an exclamation point (``!``) to make it a
282 An alias can start with an exclamation point (``!``) to make it a
283 shell alias. A shell alias is executed with the shell and will let you
283 shell alias. A shell alias is executed with the shell and will let you
284 run arbitrary commands. As an example, ::
284 run arbitrary commands. As an example, ::
285
285
286 echo = !echo $@
286 echo = !echo $@
287
287
288 will let you do ``hg echo foo`` to have ``foo`` printed in your
288 will let you do ``hg echo foo`` to have ``foo`` printed in your
289 terminal. A better example might be::
289 terminal. A better example might be::
290
290
291 purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm -f
291 purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm -f
292
292
293 which will make ``hg purge`` delete all unknown files in the
293 which will make ``hg purge`` delete all unknown files in the
294 repository in the same manner as the purge extension.
294 repository in the same manner as the purge extension.
295
295
296 Positional arguments like ``$1``, ``$2``, etc. in the alias definition
296 Positional arguments like ``$1``, ``$2``, etc. in the alias definition
297 expand to the command arguments. Unmatched arguments are
297 expand to the command arguments. Unmatched arguments are
298 removed. ``$0`` expands to the alias name and ``$@`` expands to all
298 removed. ``$0`` expands to the alias name and ``$@`` expands to all
299 arguments separated by a space. ``"$@"`` (with quotes) expands to all
299 arguments separated by a space. ``"$@"`` (with quotes) expands to all
300 arguments quoted individually and separated by a space. These expansions
300 arguments quoted individually and separated by a space. These expansions
301 happen before the command is passed to the shell.
301 happen before the command is passed to the shell.
302
302
303 Shell aliases are executed in an environment where ``$HG`` expands to
303 Shell aliases are executed in an environment where ``$HG`` expands to
304 the path of the Mercurial that was used to execute the alias. This is
304 the path of the Mercurial that was used to execute the alias. This is
305 useful when you want to call further Mercurial commands in a shell
305 useful when you want to call further Mercurial commands in a shell
306 alias, as was done above for the purge alias. In addition,
306 alias, as was done above for the purge alias. In addition,
307 ``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg
307 ``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg
308 echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``.
308 echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``.
309
309
310 .. note::
310 .. note::
311
311
312 Some global configuration options such as ``-R`` are
312 Some global configuration options such as ``-R`` are
313 processed before shell aliases and will thus not be passed to
313 processed before shell aliases and will thus not be passed to
314 aliases.
314 aliases.
315
315
316
316
317 ``annotate``
317 ``annotate``
318 ------------
318 ------------
319
319
320 Settings used when displaying file annotations. All values are
320 Settings used when displaying file annotations. All values are
321 Booleans and default to False. See :hg:`help config.diff` for
321 Booleans and default to False. See :hg:`help config.diff` for
322 related options for the diff command.
322 related options for the diff command.
323
323
324 ``ignorews``
324 ``ignorews``
325 Ignore white space when comparing lines.
325 Ignore white space when comparing lines.
326
326
327 ``ignorewseol``
327 ``ignorewseol``
328 Ignore white space at the end of a line when comparing lines.
328 Ignore white space at the end of a line when comparing lines.
329
329
330 ``ignorewsamount``
330 ``ignorewsamount``
331 Ignore changes in the amount of white space.
331 Ignore changes in the amount of white space.
332
332
333 ``ignoreblanklines``
333 ``ignoreblanklines``
334 Ignore changes whose lines are all blank.
334 Ignore changes whose lines are all blank.
335
335
336
336
337 ``auth``
337 ``auth``
338 --------
338 --------
339
339
340 Authentication credentials and other authentication-like configuration
340 Authentication credentials and other authentication-like configuration
341 for HTTP connections. This section allows you to store usernames and
341 for HTTP connections. This section allows you to store usernames and
342 passwords for use when logging *into* HTTP servers. See
342 passwords for use when logging *into* HTTP servers. See
343 :hg:`help config.web` if you want to configure *who* can login to
343 :hg:`help config.web` if you want to configure *who* can login to
344 your HTTP server.
344 your HTTP server.
345
345
346 The following options apply to all hosts.
346 The following options apply to all hosts.
347
347
348 ``cookiefile``
348 ``cookiefile``
349 Path to a file containing HTTP cookie lines. Cookies matching a
349 Path to a file containing HTTP cookie lines. Cookies matching a
350 host will be sent automatically.
350 host will be sent automatically.
351
351
352 The file format uses the Mozilla cookies.txt format, which defines cookies
352 The file format uses the Mozilla cookies.txt format, which defines cookies
353 on their own lines. Each line contains 7 fields delimited by the tab
353 on their own lines. Each line contains 7 fields delimited by the tab
354 character (domain, is_domain_cookie, path, is_secure, expires, name,
354 character (domain, is_domain_cookie, path, is_secure, expires, name,
355 value). For more info, do an Internet search for "Netscape cookies.txt
355 value). For more info, do an Internet search for "Netscape cookies.txt
356 format."
356 format."
357
357
358 Note: the cookies parser does not handle port numbers on domains. You
358 Note: the cookies parser does not handle port numbers on domains. You
359 will need to remove ports from the domain for the cookie to be recognized.
359 will need to remove ports from the domain for the cookie to be recognized.
360 This could result in a cookie being disclosed to an unwanted server.
360 This could result in a cookie being disclosed to an unwanted server.
361
361
362 The cookies file is read-only.
362 The cookies file is read-only.
363
363
364 Other options in this section are grouped by name and have the following
364 Other options in this section are grouped by name and have the following
365 format::
365 format::
366
366
367 <name>.<argument> = <value>
367 <name>.<argument> = <value>
368
368
369 where ``<name>`` is used to group arguments into authentication
369 where ``<name>`` is used to group arguments into authentication
370 entries. Example::
370 entries. Example::
371
371
372 foo.prefix = hg.intevation.de/mercurial
372 foo.prefix = hg.intevation.de/mercurial
373 foo.username = foo
373 foo.username = foo
374 foo.password = bar
374 foo.password = bar
375 foo.schemes = http https
375 foo.schemes = http https
376
376
377 bar.prefix = secure.example.org
377 bar.prefix = secure.example.org
378 bar.key = path/to/file.key
378 bar.key = path/to/file.key
379 bar.cert = path/to/file.cert
379 bar.cert = path/to/file.cert
380 bar.schemes = https
380 bar.schemes = https
381
381
382 Supported arguments:
382 Supported arguments:
383
383
384 ``prefix``
384 ``prefix``
385 Either ``*`` or a URI prefix with or without the scheme part.
385 Either ``*`` or a URI prefix with or without the scheme part.
386 The authentication entry with the longest matching prefix is used
386 The authentication entry with the longest matching prefix is used
387 (where ``*`` matches everything and counts as a match of length
387 (where ``*`` matches everything and counts as a match of length
388 1). If the prefix doesn't include a scheme, the match is performed
388 1). If the prefix doesn't include a scheme, the match is performed
389 against the URI with its scheme stripped as well, and the schemes
389 against the URI with its scheme stripped as well, and the schemes
390 argument, q.v., is then subsequently consulted.
390 argument, q.v., is then subsequently consulted.
391
391
392 ``username``
392 ``username``
393 Optional. Username to authenticate with. If not given, and the
393 Optional. Username to authenticate with. If not given, and the
394 remote site requires basic or digest authentication, the user will
394 remote site requires basic or digest authentication, the user will
395 be prompted for it. Environment variables are expanded in the
395 be prompted for it. Environment variables are expanded in the
396 username letting you do ``foo.username = $USER``. If the URI
396 username letting you do ``foo.username = $USER``. If the URI
397 includes a username, only ``[auth]`` entries with a matching
397 includes a username, only ``[auth]`` entries with a matching
398 username or without a username will be considered.
398 username or without a username will be considered.
399
399
400 ``password``
400 ``password``
401 Optional. Password to authenticate with. If not given, and the
401 Optional. Password to authenticate with. If not given, and the
402 remote site requires basic or digest authentication, the user
402 remote site requires basic or digest authentication, the user
403 will be prompted for it.
403 will be prompted for it.
404
404
405 ``key``
405 ``key``
406 Optional. PEM encoded client certificate key file. Environment
406 Optional. PEM encoded client certificate key file. Environment
407 variables are expanded in the filename.
407 variables are expanded in the filename.
408
408
409 ``cert``
409 ``cert``
410 Optional. PEM encoded client certificate chain file. Environment
410 Optional. PEM encoded client certificate chain file. Environment
411 variables are expanded in the filename.
411 variables are expanded in the filename.
412
412
413 ``schemes``
413 ``schemes``
414 Optional. Space separated list of URI schemes to use this
414 Optional. Space separated list of URI schemes to use this
415 authentication entry with. Only used if the prefix doesn't include
415 authentication entry with. Only used if the prefix doesn't include
416 a scheme. Supported schemes are http and https. They will match
416 a scheme. Supported schemes are http and https. They will match
417 static-http and static-https respectively, as well.
417 static-http and static-https respectively, as well.
418 (default: https)
418 (default: https)
419
419
420 If no suitable authentication entry is found, the user is prompted
420 If no suitable authentication entry is found, the user is prompted
421 for credentials as usual if required by the remote.
421 for credentials as usual if required by the remote.
422
422
423 ``cmdserver``
423 ``cmdserver``
424 -------------
424 -------------
425
425
426 Controls command server settings. (ADVANCED)
426 Controls command server settings. (ADVANCED)
427
427
428 ``message-encodings``
428 ``message-encodings``
429 List of encodings for the ``m`` (message) channel. The first encoding
429 List of encodings for the ``m`` (message) channel. The first encoding
430 supported by the server will be selected and advertised in the hello
430 supported by the server will be selected and advertised in the hello
431 message. This is useful only when ``ui.message-output`` is set to
431 message. This is useful only when ``ui.message-output`` is set to
432 ``channel``. Supported encodings are ``cbor``.
432 ``channel``. Supported encodings are ``cbor``.
433
433
434 ``shutdown-on-interrupt``
434 ``shutdown-on-interrupt``
435 If set to false, the server's main loop will continue running after
435 If set to false, the server's main loop will continue running after
436 SIGINT received. ``runcommand`` requests can still be interrupted by
436 SIGINT received. ``runcommand`` requests can still be interrupted by
437 SIGINT. Close the write end of the pipe to shut down the server
437 SIGINT. Close the write end of the pipe to shut down the server
438 process gracefully.
438 process gracefully.
439 (default: True)
439 (default: True)
440
440
441 ``color``
441 ``color``
442 ---------
442 ---------
443
443
444 Configure the Mercurial color mode. For details about how to define your custom
444 Configure the Mercurial color mode. For details about how to define your custom
445 effect and style see :hg:`help color`.
445 effect and style see :hg:`help color`.
446
446
447 ``mode``
447 ``mode``
448 String: control the method used to output color. One of ``auto``, ``ansi``,
448 String: control the method used to output color. One of ``auto``, ``ansi``,
449 ``win32``, ``terminfo`` or ``debug``. In auto mode, Mercurial will
449 ``win32``, ``terminfo`` or ``debug``. In auto mode, Mercurial will
450 use ANSI mode by default (or win32 mode prior to Windows 10) if it detects a
450 use ANSI mode by default (or win32 mode prior to Windows 10) if it detects a
451 terminal. Any invalid value will disable color.
451 terminal. Any invalid value will disable color.
452
452
453 ``pagermode``
453 ``pagermode``
454 String: optional override of ``color.mode`` used with pager.
454 String: optional override of ``color.mode`` used with pager.
455
455
456 On some systems, terminfo mode may cause problems when using
456 On some systems, terminfo mode may cause problems when using
457 color with ``less -R`` as a pager program. less with the -R option
457 color with ``less -R`` as a pager program. less with the -R option
458 will only display ECMA-48 color codes, and terminfo mode may sometimes
458 will only display ECMA-48 color codes, and terminfo mode may sometimes
459 emit codes that less doesn't understand. You can work around this by
459 emit codes that less doesn't understand. You can work around this by
460 either using ansi mode (or auto mode), or by using less -r (which will
460 either using ansi mode (or auto mode), or by using less -r (which will
461 pass through all terminal control codes, not just color control
461 pass through all terminal control codes, not just color control
462 codes).
462 codes).
463
463
464 On some systems (such as MSYS in Windows), the terminal may support
464 On some systems (such as MSYS in Windows), the terminal may support
465 a different color mode than the pager program.
465 a different color mode than the pager program.
466
466
467 ``commands``
467 ``commands``
468 ------------
468 ------------
469
469
470 ``commit.post-status``
470 ``commit.post-status``
471 Show status of files in the working directory after successful commit.
471 Show status of files in the working directory after successful commit.
472 (default: False)
472 (default: False)
473
473
474 ``merge.require-rev``
474 ``merge.require-rev``
475 Require that the revision to merge the current commit with be specified on
475 Require that the revision to merge the current commit with be specified on
476 the command line. If this is enabled and a revision is not specified, the
476 the command line. If this is enabled and a revision is not specified, the
477 command aborts.
477 command aborts.
478 (default: False)
478 (default: False)
479
479
480 ``push.require-revs``
480 ``push.require-revs``
481 Require revisions to push be specified using one or more mechanisms such as
481 Require revisions to push be specified using one or more mechanisms such as
482 specifying them positionally on the command line, using ``-r``, ``-b``,
482 specifying them positionally on the command line, using ``-r``, ``-b``,
483 and/or ``-B`` on the command line, or using ``paths.<path>:pushrev`` in the
483 and/or ``-B`` on the command line, or using ``paths.<path>:pushrev`` in the
484 configuration. If this is enabled and revisions are not specified, the
484 configuration. If this is enabled and revisions are not specified, the
485 command aborts.
485 command aborts.
486 (default: False)
486 (default: False)
487
487
488 ``resolve.confirm``
488 ``resolve.confirm``
489 Confirm before performing action if no filename is passed.
489 Confirm before performing action if no filename is passed.
490 (default: False)
490 (default: False)
491
491
492 ``resolve.explicit-re-merge``
492 ``resolve.explicit-re-merge``
493 Require uses of ``hg resolve`` to specify which action it should perform,
493 Require uses of ``hg resolve`` to specify which action it should perform,
494 instead of re-merging files by default.
494 instead of re-merging files by default.
495 (default: False)
495 (default: False)
496
496
497 ``resolve.mark-check``
497 ``resolve.mark-check``
498 Determines what level of checking :hg:`resolve --mark` will perform before
498 Determines what level of checking :hg:`resolve --mark` will perform before
499 marking files as resolved. Valid values are ``none`, ``warn``, and
499 marking files as resolved. Valid values are ``none`, ``warn``, and
500 ``abort``. ``warn`` will output a warning listing the file(s) that still
500 ``abort``. ``warn`` will output a warning listing the file(s) that still
501 have conflict markers in them, but will still mark everything resolved.
501 have conflict markers in them, but will still mark everything resolved.
502 ``abort`` will output the same warning but will not mark things as resolved.
502 ``abort`` will output the same warning but will not mark things as resolved.
503 If --all is passed and this is set to ``abort``, only a warning will be
503 If --all is passed and this is set to ``abort``, only a warning will be
504 shown (an error will not be raised).
504 shown (an error will not be raised).
505 (default: ``none``)
505 (default: ``none``)
506
506
507 ``status.relative``
507 ``status.relative``
508 Make paths in :hg:`status` output relative to the current directory.
508 Make paths in :hg:`status` output relative to the current directory.
509 (default: False)
509 (default: False)
510
510
511 ``status.terse``
511 ``status.terse``
512 Default value for the --terse flag, which condenses status output.
512 Default value for the --terse flag, which condenses status output.
513 (default: empty)
513 (default: empty)
514
514
515 ``update.check``
515 ``update.check``
516 Determines what level of checking :hg:`update` will perform before moving
516 Determines what level of checking :hg:`update` will perform before moving
517 to a destination revision. Valid values are ``abort``, ``none``,
517 to a destination revision. Valid values are ``abort``, ``none``,
518 ``linear``, and ``noconflict``. ``abort`` always fails if the working
518 ``linear``, and ``noconflict``. ``abort`` always fails if the working
519 directory has uncommitted changes. ``none`` performs no checking, and may
519 directory has uncommitted changes. ``none`` performs no checking, and may
520 result in a merge with uncommitted changes. ``linear`` allows any update
520 result in a merge with uncommitted changes. ``linear`` allows any update
521 as long as it follows a straight line in the revision history, and may
521 as long as it follows a straight line in the revision history, and may
522 trigger a merge with uncommitted changes. ``noconflict`` will allow any
522 trigger a merge with uncommitted changes. ``noconflict`` will allow any
523 update which would not trigger a merge with uncommitted changes, if any
523 update which would not trigger a merge with uncommitted changes, if any
524 are present.
524 are present.
525 (default: ``linear``)
525 (default: ``linear``)
526
526
527 ``update.requiredest``
527 ``update.requiredest``
528 Require that the user pass a destination when running :hg:`update`.
528 Require that the user pass a destination when running :hg:`update`.
529 For example, :hg:`update .::` will be allowed, but a plain :hg:`update`
529 For example, :hg:`update .::` will be allowed, but a plain :hg:`update`
530 will be disallowed.
530 will be disallowed.
531 (default: False)
531 (default: False)
532
532
533 ``committemplate``
533 ``committemplate``
534 ------------------
534 ------------------
535
535
536 ``changeset``
536 ``changeset``
537 String: configuration in this section is used as the template to
537 String: configuration in this section is used as the template to
538 customize the text shown in the editor when committing.
538 customize the text shown in the editor when committing.
539
539
540 In addition to pre-defined template keywords, commit log specific one
540 In addition to pre-defined template keywords, commit log specific one
541 below can be used for customization:
541 below can be used for customization:
542
542
543 ``extramsg``
543 ``extramsg``
544 String: Extra message (typically 'Leave message empty to abort
544 String: Extra message (typically 'Leave message empty to abort
545 commit.'). This may be changed by some commands or extensions.
545 commit.'). This may be changed by some commands or extensions.
546
546
547 For example, the template configuration below shows as same text as
547 For example, the template configuration below shows as same text as
548 one shown by default::
548 one shown by default::
549
549
550 [committemplate]
550 [committemplate]
551 changeset = {desc}\n\n
551 changeset = {desc}\n\n
552 HG: Enter commit message. Lines beginning with 'HG:' are removed.
552 HG: Enter commit message. Lines beginning with 'HG:' are removed.
553 HG: {extramsg}
553 HG: {extramsg}
554 HG: --
554 HG: --
555 HG: user: {author}\n{ifeq(p2rev, "-1", "",
555 HG: user: {author}\n{ifeq(p2rev, "-1", "",
556 "HG: branch merge\n")
556 "HG: branch merge\n")
557 }HG: branch '{branch}'\n{if(activebookmark,
557 }HG: branch '{branch}'\n{if(activebookmark,
558 "HG: bookmark '{activebookmark}'\n") }{subrepos %
558 "HG: bookmark '{activebookmark}'\n") }{subrepos %
559 "HG: subrepo {subrepo}\n" }{file_adds %
559 "HG: subrepo {subrepo}\n" }{file_adds %
560 "HG: added {file}\n" }{file_mods %
560 "HG: added {file}\n" }{file_mods %
561 "HG: changed {file}\n" }{file_dels %
561 "HG: changed {file}\n" }{file_dels %
562 "HG: removed {file}\n" }{if(files, "",
562 "HG: removed {file}\n" }{if(files, "",
563 "HG: no files changed\n")}
563 "HG: no files changed\n")}
564
564
565 ``diff()``
565 ``diff()``
566 String: show the diff (see :hg:`help templates` for detail)
566 String: show the diff (see :hg:`help templates` for detail)
567
567
568 Sometimes it is helpful to show the diff of the changeset in the editor without
568 Sometimes it is helpful to show the diff of the changeset in the editor without
569 having to prefix 'HG: ' to each line so that highlighting works correctly. For
569 having to prefix 'HG: ' to each line so that highlighting works correctly. For
570 this, Mercurial provides a special string which will ignore everything below
570 this, Mercurial provides a special string which will ignore everything below
571 it::
571 it::
572
572
573 HG: ------------------------ >8 ------------------------
573 HG: ------------------------ >8 ------------------------
574
574
575 For example, the template configuration below will show the diff below the
575 For example, the template configuration below will show the diff below the
576 extra message::
576 extra message::
577
577
578 [committemplate]
578 [committemplate]
579 changeset = {desc}\n\n
579 changeset = {desc}\n\n
580 HG: Enter commit message. Lines beginning with 'HG:' are removed.
580 HG: Enter commit message. Lines beginning with 'HG:' are removed.
581 HG: {extramsg}
581 HG: {extramsg}
582 HG: ------------------------ >8 ------------------------
582 HG: ------------------------ >8 ------------------------
583 HG: Do not touch the line above.
583 HG: Do not touch the line above.
584 HG: Everything below will be removed.
584 HG: Everything below will be removed.
585 {diff()}
585 {diff()}
586
586
587 .. note::
587 .. note::
588
588
589 For some problematic encodings (see :hg:`help win32mbcs` for
589 For some problematic encodings (see :hg:`help win32mbcs` for
590 detail), this customization should be configured carefully, to
590 detail), this customization should be configured carefully, to
591 avoid showing broken characters.
591 avoid showing broken characters.
592
592
593 For example, if a multibyte character ending with backslash (0x5c) is
593 For example, if a multibyte character ending with backslash (0x5c) is
594 followed by the ASCII character 'n' in the customized template,
594 followed by the ASCII character 'n' in the customized template,
595 the sequence of backslash and 'n' is treated as line-feed unexpectedly
595 the sequence of backslash and 'n' is treated as line-feed unexpectedly
596 (and the multibyte character is broken, too).
596 (and the multibyte character is broken, too).
597
597
598 Customized template is used for commands below (``--edit`` may be
598 Customized template is used for commands below (``--edit`` may be
599 required):
599 required):
600
600
601 - :hg:`backout`
601 - :hg:`backout`
602 - :hg:`commit`
602 - :hg:`commit`
603 - :hg:`fetch` (for merge commit only)
603 - :hg:`fetch` (for merge commit only)
604 - :hg:`graft`
604 - :hg:`graft`
605 - :hg:`histedit`
605 - :hg:`histedit`
606 - :hg:`import`
606 - :hg:`import`
607 - :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh`
607 - :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh`
608 - :hg:`rebase`
608 - :hg:`rebase`
609 - :hg:`shelve`
609 - :hg:`shelve`
610 - :hg:`sign`
610 - :hg:`sign`
611 - :hg:`tag`
611 - :hg:`tag`
612 - :hg:`transplant`
612 - :hg:`transplant`
613
613
614 Configuring items below instead of ``changeset`` allows showing
614 Configuring items below instead of ``changeset`` allows showing
615 customized message only for specific actions, or showing different
615 customized message only for specific actions, or showing different
616 messages for each action.
616 messages for each action.
617
617
618 - ``changeset.backout`` for :hg:`backout`
618 - ``changeset.backout`` for :hg:`backout`
619 - ``changeset.commit.amend.merge`` for :hg:`commit --amend` on merges
619 - ``changeset.commit.amend.merge`` for :hg:`commit --amend` on merges
620 - ``changeset.commit.amend.normal`` for :hg:`commit --amend` on other
620 - ``changeset.commit.amend.normal`` for :hg:`commit --amend` on other
621 - ``changeset.commit.normal.merge`` for :hg:`commit` on merges
621 - ``changeset.commit.normal.merge`` for :hg:`commit` on merges
622 - ``changeset.commit.normal.normal`` for :hg:`commit` on other
622 - ``changeset.commit.normal.normal`` for :hg:`commit` on other
623 - ``changeset.fetch`` for :hg:`fetch` (impling merge commit)
623 - ``changeset.fetch`` for :hg:`fetch` (impling merge commit)
624 - ``changeset.gpg.sign`` for :hg:`sign`
624 - ``changeset.gpg.sign`` for :hg:`sign`
625 - ``changeset.graft`` for :hg:`graft`
625 - ``changeset.graft`` for :hg:`graft`
626 - ``changeset.histedit.edit`` for ``edit`` of :hg:`histedit`
626 - ``changeset.histedit.edit`` for ``edit`` of :hg:`histedit`
627 - ``changeset.histedit.fold`` for ``fold`` of :hg:`histedit`
627 - ``changeset.histedit.fold`` for ``fold`` of :hg:`histedit`
628 - ``changeset.histedit.mess`` for ``mess`` of :hg:`histedit`
628 - ``changeset.histedit.mess`` for ``mess`` of :hg:`histedit`
629 - ``changeset.histedit.pick`` for ``pick`` of :hg:`histedit`
629 - ``changeset.histedit.pick`` for ``pick`` of :hg:`histedit`
630 - ``changeset.import.bypass`` for :hg:`import --bypass`
630 - ``changeset.import.bypass`` for :hg:`import --bypass`
631 - ``changeset.import.normal.merge`` for :hg:`import` on merges
631 - ``changeset.import.normal.merge`` for :hg:`import` on merges
632 - ``changeset.import.normal.normal`` for :hg:`import` on other
632 - ``changeset.import.normal.normal`` for :hg:`import` on other
633 - ``changeset.mq.qnew`` for :hg:`qnew`
633 - ``changeset.mq.qnew`` for :hg:`qnew`
634 - ``changeset.mq.qfold`` for :hg:`qfold`
634 - ``changeset.mq.qfold`` for :hg:`qfold`
635 - ``changeset.mq.qrefresh`` for :hg:`qrefresh`
635 - ``changeset.mq.qrefresh`` for :hg:`qrefresh`
636 - ``changeset.rebase.collapse`` for :hg:`rebase --collapse`
636 - ``changeset.rebase.collapse`` for :hg:`rebase --collapse`
637 - ``changeset.rebase.merge`` for :hg:`rebase` on merges
637 - ``changeset.rebase.merge`` for :hg:`rebase` on merges
638 - ``changeset.rebase.normal`` for :hg:`rebase` on other
638 - ``changeset.rebase.normal`` for :hg:`rebase` on other
639 - ``changeset.shelve.shelve`` for :hg:`shelve`
639 - ``changeset.shelve.shelve`` for :hg:`shelve`
640 - ``changeset.tag.add`` for :hg:`tag` without ``--remove``
640 - ``changeset.tag.add`` for :hg:`tag` without ``--remove``
641 - ``changeset.tag.remove`` for :hg:`tag --remove`
641 - ``changeset.tag.remove`` for :hg:`tag --remove`
642 - ``changeset.transplant.merge`` for :hg:`transplant` on merges
642 - ``changeset.transplant.merge`` for :hg:`transplant` on merges
643 - ``changeset.transplant.normal`` for :hg:`transplant` on other
643 - ``changeset.transplant.normal`` for :hg:`transplant` on other
644
644
645 These dot-separated lists of names are treated as hierarchical ones.
645 These dot-separated lists of names are treated as hierarchical ones.
646 For example, ``changeset.tag.remove`` customizes the commit message
646 For example, ``changeset.tag.remove`` customizes the commit message
647 only for :hg:`tag --remove`, but ``changeset.tag`` customizes the
647 only for :hg:`tag --remove`, but ``changeset.tag`` customizes the
648 commit message for :hg:`tag` regardless of ``--remove`` option.
648 commit message for :hg:`tag` regardless of ``--remove`` option.
649
649
650 When the external editor is invoked for a commit, the corresponding
650 When the external editor is invoked for a commit, the corresponding
651 dot-separated list of names without the ``changeset.`` prefix
651 dot-separated list of names without the ``changeset.`` prefix
652 (e.g. ``commit.normal.normal``) is in the ``HGEDITFORM`` environment
652 (e.g. ``commit.normal.normal``) is in the ``HGEDITFORM`` environment
653 variable.
653 variable.
654
654
655 In this section, items other than ``changeset`` can be referred from
655 In this section, items other than ``changeset`` can be referred from
656 others. For example, the configuration to list committed files up
656 others. For example, the configuration to list committed files up
657 below can be referred as ``{listupfiles}``::
657 below can be referred as ``{listupfiles}``::
658
658
659 [committemplate]
659 [committemplate]
660 listupfiles = {file_adds %
660 listupfiles = {file_adds %
661 "HG: added {file}\n" }{file_mods %
661 "HG: added {file}\n" }{file_mods %
662 "HG: changed {file}\n" }{file_dels %
662 "HG: changed {file}\n" }{file_dels %
663 "HG: removed {file}\n" }{if(files, "",
663 "HG: removed {file}\n" }{if(files, "",
664 "HG: no files changed\n")}
664 "HG: no files changed\n")}
665
665
666 ``decode/encode``
666 ``decode/encode``
667 -----------------
667 -----------------
668
668
669 Filters for transforming files on checkout/checkin. This would
669 Filters for transforming files on checkout/checkin. This would
670 typically be used for newline processing or other
670 typically be used for newline processing or other
671 localization/canonicalization of files.
671 localization/canonicalization of files.
672
672
673 Filters consist of a filter pattern followed by a filter command.
673 Filters consist of a filter pattern followed by a filter command.
674 Filter patterns are globs by default, rooted at the repository root.
674 Filter patterns are globs by default, rooted at the repository root.
675 For example, to match any file ending in ``.txt`` in the root
675 For example, to match any file ending in ``.txt`` in the root
676 directory only, use the pattern ``*.txt``. To match any file ending
676 directory only, use the pattern ``*.txt``. To match any file ending
677 in ``.c`` anywhere in the repository, use the pattern ``**.c``.
677 in ``.c`` anywhere in the repository, use the pattern ``**.c``.
678 For each file only the first matching filter applies.
678 For each file only the first matching filter applies.
679
679
680 The filter command can start with a specifier, either ``pipe:`` or
680 The filter command can start with a specifier, either ``pipe:`` or
681 ``tempfile:``. If no specifier is given, ``pipe:`` is used by default.
681 ``tempfile:``. If no specifier is given, ``pipe:`` is used by default.
682
682
683 A ``pipe:`` command must accept data on stdin and return the transformed
683 A ``pipe:`` command must accept data on stdin and return the transformed
684 data on stdout.
684 data on stdout.
685
685
686 Pipe example::
686 Pipe example::
687
687
688 [encode]
688 [encode]
689 # uncompress gzip files on checkin to improve delta compression
689 # uncompress gzip files on checkin to improve delta compression
690 # note: not necessarily a good idea, just an example
690 # note: not necessarily a good idea, just an example
691 *.gz = pipe: gunzip
691 *.gz = pipe: gunzip
692
692
693 [decode]
693 [decode]
694 # recompress gzip files when writing them to the working dir (we
694 # recompress gzip files when writing them to the working dir (we
695 # can safely omit "pipe:", because it's the default)
695 # can safely omit "pipe:", because it's the default)
696 *.gz = gzip
696 *.gz = gzip
697
697
698 A ``tempfile:`` command is a template. The string ``INFILE`` is replaced
698 A ``tempfile:`` command is a template. The string ``INFILE`` is replaced
699 with the name of a temporary file that contains the data to be
699 with the name of a temporary file that contains the data to be
700 filtered by the command. The string ``OUTFILE`` is replaced with the name
700 filtered by the command. The string ``OUTFILE`` is replaced with the name
701 of an empty temporary file, where the filtered data must be written by
701 of an empty temporary file, where the filtered data must be written by
702 the command.
702 the command.
703
703
704 .. container:: windows
704 .. container:: windows
705
705
706 .. note::
706 .. note::
707
707
708 The tempfile mechanism is recommended for Windows systems,
708 The tempfile mechanism is recommended for Windows systems,
709 where the standard shell I/O redirection operators often have
709 where the standard shell I/O redirection operators often have
710 strange effects and may corrupt the contents of your files.
710 strange effects and may corrupt the contents of your files.
711
711
712 This filter mechanism is used internally by the ``eol`` extension to
712 This filter mechanism is used internally by the ``eol`` extension to
713 translate line ending characters between Windows (CRLF) and Unix (LF)
713 translate line ending characters between Windows (CRLF) and Unix (LF)
714 format. We suggest you use the ``eol`` extension for convenience.
714 format. We suggest you use the ``eol`` extension for convenience.
715
715
716
716
717 ``defaults``
717 ``defaults``
718 ------------
718 ------------
719
719
720 (defaults are deprecated. Don't use them. Use aliases instead.)
720 (defaults are deprecated. Don't use them. Use aliases instead.)
721
721
722 Use the ``[defaults]`` section to define command defaults, i.e. the
722 Use the ``[defaults]`` section to define command defaults, i.e. the
723 default options/arguments to pass to the specified commands.
723 default options/arguments to pass to the specified commands.
724
724
725 The following example makes :hg:`log` run in verbose mode, and
725 The following example makes :hg:`log` run in verbose mode, and
726 :hg:`status` show only the modified files, by default::
726 :hg:`status` show only the modified files, by default::
727
727
728 [defaults]
728 [defaults]
729 log = -v
729 log = -v
730 status = -m
730 status = -m
731
731
732 The actual commands, instead of their aliases, must be used when
732 The actual commands, instead of their aliases, must be used when
733 defining command defaults. The command defaults will also be applied
733 defining command defaults. The command defaults will also be applied
734 to the aliases of the commands defined.
734 to the aliases of the commands defined.
735
735
736
736
737 ``diff``
737 ``diff``
738 --------
738 --------
739
739
740 Settings used when displaying diffs. Everything except for ``unified``
740 Settings used when displaying diffs. Everything except for ``unified``
741 is a Boolean and defaults to False. See :hg:`help config.annotate`
741 is a Boolean and defaults to False. See :hg:`help config.annotate`
742 for related options for the annotate command.
742 for related options for the annotate command.
743
743
744 ``git``
744 ``git``
745 Use git extended diff format.
745 Use git extended diff format.
746
746
747 ``nobinary``
747 ``nobinary``
748 Omit git binary patches.
748 Omit git binary patches.
749
749
750 ``nodates``
750 ``nodates``
751 Don't include dates in diff headers.
751 Don't include dates in diff headers.
752
752
753 ``noprefix``
753 ``noprefix``
754 Omit 'a/' and 'b/' prefixes from filenames. Ignored in plain mode.
754 Omit 'a/' and 'b/' prefixes from filenames. Ignored in plain mode.
755
755
756 ``showfunc``
756 ``showfunc``
757 Show which function each change is in.
757 Show which function each change is in.
758
758
759 ``ignorews``
759 ``ignorews``
760 Ignore white space when comparing lines.
760 Ignore white space when comparing lines.
761
761
762 ``ignorewsamount``
762 ``ignorewsamount``
763 Ignore changes in the amount of white space.
763 Ignore changes in the amount of white space.
764
764
765 ``ignoreblanklines``
765 ``ignoreblanklines``
766 Ignore changes whose lines are all blank.
766 Ignore changes whose lines are all blank.
767
767
768 ``unified``
768 ``unified``
769 Number of lines of context to show.
769 Number of lines of context to show.
770
770
771 ``word-diff``
771 ``word-diff``
772 Highlight changed words.
772 Highlight changed words.
773
773
774 ``email``
774 ``email``
775 ---------
775 ---------
776
776
777 Settings for extensions that send email messages.
777 Settings for extensions that send email messages.
778
778
779 ``from``
779 ``from``
780 Optional. Email address to use in "From" header and SMTP envelope
780 Optional. Email address to use in "From" header and SMTP envelope
781 of outgoing messages.
781 of outgoing messages.
782
782
783 ``to``
783 ``to``
784 Optional. Comma-separated list of recipients' email addresses.
784 Optional. Comma-separated list of recipients' email addresses.
785
785
786 ``cc``
786 ``cc``
787 Optional. Comma-separated list of carbon copy recipients'
787 Optional. Comma-separated list of carbon copy recipients'
788 email addresses.
788 email addresses.
789
789
790 ``bcc``
790 ``bcc``
791 Optional. Comma-separated list of blind carbon copy recipients'
791 Optional. Comma-separated list of blind carbon copy recipients'
792 email addresses.
792 email addresses.
793
793
794 ``method``
794 ``method``
795 Optional. Method to use to send email messages. If value is ``smtp``
795 Optional. Method to use to send email messages. If value is ``smtp``
796 (default), use SMTP (see the ``[smtp]`` section for configuration).
796 (default), use SMTP (see the ``[smtp]`` section for configuration).
797 Otherwise, use as name of program to run that acts like sendmail
797 Otherwise, use as name of program to run that acts like sendmail
798 (takes ``-f`` option for sender, list of recipients on command line,
798 (takes ``-f`` option for sender, list of recipients on command line,
799 message on stdin). Normally, setting this to ``sendmail`` or
799 message on stdin). Normally, setting this to ``sendmail`` or
800 ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
800 ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
801
801
802 ``charsets``
802 ``charsets``
803 Optional. Comma-separated list of character sets considered
803 Optional. Comma-separated list of character sets considered
804 convenient for recipients. Addresses, headers, and parts not
804 convenient for recipients. Addresses, headers, and parts not
805 containing patches of outgoing messages will be encoded in the
805 containing patches of outgoing messages will be encoded in the
806 first character set to which conversion from local encoding
806 first character set to which conversion from local encoding
807 (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
807 (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
808 conversion fails, the text in question is sent as is.
808 conversion fails, the text in question is sent as is.
809 (default: '')
809 (default: '')
810
810
811 Order of outgoing email character sets:
811 Order of outgoing email character sets:
812
812
813 1. ``us-ascii``: always first, regardless of settings
813 1. ``us-ascii``: always first, regardless of settings
814 2. ``email.charsets``: in order given by user
814 2. ``email.charsets``: in order given by user
815 3. ``ui.fallbackencoding``: if not in email.charsets
815 3. ``ui.fallbackencoding``: if not in email.charsets
816 4. ``$HGENCODING``: if not in email.charsets
816 4. ``$HGENCODING``: if not in email.charsets
817 5. ``utf-8``: always last, regardless of settings
817 5. ``utf-8``: always last, regardless of settings
818
818
819 Email example::
819 Email example::
820
820
821 [email]
821 [email]
822 from = Joseph User <joe.user@example.com>
822 from = Joseph User <joe.user@example.com>
823 method = /usr/sbin/sendmail
823 method = /usr/sbin/sendmail
824 # charsets for western Europeans
824 # charsets for western Europeans
825 # us-ascii, utf-8 omitted, as they are tried first and last
825 # us-ascii, utf-8 omitted, as they are tried first and last
826 charsets = iso-8859-1, iso-8859-15, windows-1252
826 charsets = iso-8859-1, iso-8859-15, windows-1252
827
827
828
828
829 ``extensions``
829 ``extensions``
830 --------------
830 --------------
831
831
832 Mercurial has an extension mechanism for adding new features. To
832 Mercurial has an extension mechanism for adding new features. To
833 enable an extension, create an entry for it in this section.
833 enable an extension, create an entry for it in this section.
834
834
835 If you know that the extension is already in Python's search path,
835 If you know that the extension is already in Python's search path,
836 you can give the name of the module, followed by ``=``, with nothing
836 you can give the name of the module, followed by ``=``, with nothing
837 after the ``=``.
837 after the ``=``.
838
838
839 Otherwise, give a name that you choose, followed by ``=``, followed by
839 Otherwise, give a name that you choose, followed by ``=``, followed by
840 the path to the ``.py`` file (including the file name extension) that
840 the path to the ``.py`` file (including the file name extension) that
841 defines the extension.
841 defines the extension.
842
842
843 To explicitly disable an extension that is enabled in an hgrc of
843 To explicitly disable an extension that is enabled in an hgrc of
844 broader scope, prepend its path with ``!``, as in ``foo = !/ext/path``
844 broader scope, prepend its path with ``!``, as in ``foo = !/ext/path``
845 or ``foo = !`` when path is not supplied.
845 or ``foo = !`` when path is not supplied.
846
846
847 Example for ``~/.hgrc``::
847 Example for ``~/.hgrc``::
848
848
849 [extensions]
849 [extensions]
850 # (the churn extension will get loaded from Mercurial's path)
850 # (the churn extension will get loaded from Mercurial's path)
851 churn =
851 churn =
852 # (this extension will get loaded from the file specified)
852 # (this extension will get loaded from the file specified)
853 myfeature = ~/.hgext/myfeature.py
853 myfeature = ~/.hgext/myfeature.py
854
854
855
855
856 ``format``
856 ``format``
857 ----------
857 ----------
858
858
859 Configuration that controls the repository format. Newer format options are more
859 Configuration that controls the repository format. Newer format options are more
860 powerful, but incompatible with some older versions of Mercurial. Format options
860 powerful, but incompatible with some older versions of Mercurial. Format options
861 are considered at repository initialization only. You need to make a new clone
861 are considered at repository initialization only. You need to make a new clone
862 for config changes to be taken into account.
862 for config changes to be taken into account.
863
863
864 For more details about repository format and version compatibility, see
864 For more details about repository format and version compatibility, see
865 https://www.mercurial-scm.org/wiki/MissingRequirement
865 https://www.mercurial-scm.org/wiki/MissingRequirement
866
866
867 ``usegeneraldelta``
867 ``usegeneraldelta``
868 Enable or disable the "generaldelta" repository format which improves
868 Enable or disable the "generaldelta" repository format which improves
869 repository compression by allowing "revlog" to store deltas against
869 repository compression by allowing "revlog" to store deltas against
870 arbitrary revisions instead of the previously stored one. This provides
870 arbitrary revisions instead of the previously stored one. This provides
871 significant improvement for repositories with branches.
871 significant improvement for repositories with branches.
872
872
873 Repositories with this on-disk format require Mercurial version 1.9.
873 Repositories with this on-disk format require Mercurial version 1.9.
874
874
875 Enabled by default.
875 Enabled by default.
876
876
877 ``dotencode``
877 ``dotencode``
878 Enable or disable the "dotencode" repository format which enhances
878 Enable or disable the "dotencode" repository format which enhances
879 the "fncache" repository format (which has to be enabled to use
879 the "fncache" repository format (which has to be enabled to use
880 dotencode) to avoid issues with filenames starting with "._" on
880 dotencode) to avoid issues with filenames starting with "._" on
881 Mac OS X and spaces on Windows.
881 Mac OS X and spaces on Windows.
882
882
883 Repositories with this on-disk format require Mercurial version 1.7.
883 Repositories with this on-disk format require Mercurial version 1.7.
884
884
885 Enabled by default.
885 Enabled by default.
886
886
887 ``usefncache``
887 ``usefncache``
888 Enable or disable the "fncache" repository format which enhances
888 Enable or disable the "fncache" repository format which enhances
889 the "store" repository format (which has to be enabled to use
889 the "store" repository format (which has to be enabled to use
890 fncache) to allow longer filenames and avoids using Windows
890 fncache) to allow longer filenames and avoids using Windows
891 reserved names, e.g. "nul".
891 reserved names, e.g. "nul".
892
892
893 Repositories with this on-disk format require Mercurial version 1.1.
893 Repositories with this on-disk format require Mercurial version 1.1.
894
894
895 Enabled by default.
895 Enabled by default.
896
896
897 ``usestore``
897 ``usestore``
898 Enable or disable the "store" repository format which improves
898 Enable or disable the "store" repository format which improves
899 compatibility with systems that fold case or otherwise mangle
899 compatibility with systems that fold case or otherwise mangle
900 filenames. Disabling this option will allow you to store longer filenames
900 filenames. Disabling this option will allow you to store longer filenames
901 in some situations at the expense of compatibility.
901 in some situations at the expense of compatibility.
902
902
903 Repositories with this on-disk format require Mercurial version 0.9.4.
903 Repositories with this on-disk format require Mercurial version 0.9.4.
904
904
905 Enabled by default.
905 Enabled by default.
906
906
907 ``sparse-revlog``
907 ``sparse-revlog``
908 Enable or disable the ``sparse-revlog`` delta strategy. This format improves
908 Enable or disable the ``sparse-revlog`` delta strategy. This format improves
909 delta re-use inside revlog. For very branchy repositories, it results in a
909 delta re-use inside revlog. For very branchy repositories, it results in a
910 smaller store. For repositories with many revisions, it also helps
910 smaller store. For repositories with many revisions, it also helps
911 performance (by using shortened delta chains.)
911 performance (by using shortened delta chains.)
912
912
913 Repositories with this on-disk format require Mercurial version 4.7
913 Repositories with this on-disk format require Mercurial version 4.7
914
914
915 Enabled by default.
915 Enabled by default.
916
916
917 ``revlog-compression``
917 ``revlog-compression``
918 Compression algorithm used by revlog. Supported values are `zlib` and
918 Compression algorithm used by revlog. Supported values are `zlib` and
919 `zstd`. The `zlib` engine is the historical default of Mercurial. `zstd` is
919 `zstd`. The `zlib` engine is the historical default of Mercurial. `zstd` is
920 a newer format that is usually a net win over `zlib`, operating faster at
920 a newer format that is usually a net win over `zlib`, operating faster at
921 better compression rates. Use `zstd` to reduce CPU usage. Multiple values
921 better compression rates. Use `zstd` to reduce CPU usage. Multiple values
922 can be specified, the first available one will be used.
922 can be specified, the first available one will be used.
923
923
924 On some systems, the Mercurial installation may lack `zstd` support.
924 On some systems, the Mercurial installation may lack `zstd` support.
925
925
926 Default is `zlib`.
926 Default is `zlib`.
927
927
928 ``bookmarks-in-store``
928 ``bookmarks-in-store``
929 Store bookmarks in .hg/store/. This means that bookmarks are shared when
929 Store bookmarks in .hg/store/. This means that bookmarks are shared when
930 using `hg share` regardless of the `-B` option.
930 using `hg share` regardless of the `-B` option.
931
931
932 Repositories with this on-disk format require Mercurial version 5.1.
932 Repositories with this on-disk format require Mercurial version 5.1.
933
933
934 Disabled by default.
934 Disabled by default.
935
935
936
936
937 ``graph``
937 ``graph``
938 ---------
938 ---------
939
939
940 Web graph view configuration. This section let you change graph
940 Web graph view configuration. This section let you change graph
941 elements display properties by branches, for instance to make the
941 elements display properties by branches, for instance to make the
942 ``default`` branch stand out.
942 ``default`` branch stand out.
943
943
944 Each line has the following format::
944 Each line has the following format::
945
945
946 <branch>.<argument> = <value>
946 <branch>.<argument> = <value>
947
947
948 where ``<branch>`` is the name of the branch being
948 where ``<branch>`` is the name of the branch being
949 customized. Example::
949 customized. Example::
950
950
951 [graph]
951 [graph]
952 # 2px width
952 # 2px width
953 default.width = 2
953 default.width = 2
954 # red color
954 # red color
955 default.color = FF0000
955 default.color = FF0000
956
956
957 Supported arguments:
957 Supported arguments:
958
958
959 ``width``
959 ``width``
960 Set branch edges width in pixels.
960 Set branch edges width in pixels.
961
961
962 ``color``
962 ``color``
963 Set branch edges color in hexadecimal RGB notation.
963 Set branch edges color in hexadecimal RGB notation.
964
964
965 ``hooks``
965 ``hooks``
966 ---------
966 ---------
967
967
968 Commands or Python functions that get automatically executed by
968 Commands or Python functions that get automatically executed by
969 various actions such as starting or finishing a commit. Multiple
969 various actions such as starting or finishing a commit. Multiple
970 hooks can be run for the same action by appending a suffix to the
970 hooks can be run for the same action by appending a suffix to the
971 action. Overriding a site-wide hook can be done by changing its
971 action. Overriding a site-wide hook can be done by changing its
972 value or setting it to an empty string. Hooks can be prioritized
972 value or setting it to an empty string. Hooks can be prioritized
973 by adding a prefix of ``priority.`` to the hook name on a new line
973 by adding a prefix of ``priority.`` to the hook name on a new line
974 and setting the priority. The default priority is 0.
974 and setting the priority. The default priority is 0.
975
975
976 Example ``.hg/hgrc``::
976 Example ``.hg/hgrc``::
977
977
978 [hooks]
978 [hooks]
979 # update working directory after adding changesets
979 # update working directory after adding changesets
980 changegroup.update = hg update
980 changegroup.update = hg update
981 # do not use the site-wide hook
981 # do not use the site-wide hook
982 incoming =
982 incoming =
983 incoming.email = /my/email/hook
983 incoming.email = /my/email/hook
984 incoming.autobuild = /my/build/hook
984 incoming.autobuild = /my/build/hook
985 # force autobuild hook to run before other incoming hooks
985 # force autobuild hook to run before other incoming hooks
986 priority.incoming.autobuild = 1
986 priority.incoming.autobuild = 1
987
987
988 Most hooks are run with environment variables set that give useful
988 Most hooks are run with environment variables set that give useful
989 additional information. For each hook below, the environment variables
989 additional information. For each hook below, the environment variables
990 it is passed are listed with names in the form ``$HG_foo``. The
990 it is passed are listed with names in the form ``$HG_foo``. The
991 ``$HG_HOOKTYPE`` and ``$HG_HOOKNAME`` variables are set for all hooks.
991 ``$HG_HOOKTYPE`` and ``$HG_HOOKNAME`` variables are set for all hooks.
992 They contain the type of hook which triggered the run and the full name
992 They contain the type of hook which triggered the run and the full name
993 of the hook in the config, respectively. In the example above, this will
993 of the hook in the config, respectively. In the example above, this will
994 be ``$HG_HOOKTYPE=incoming`` and ``$HG_HOOKNAME=incoming.email``.
994 be ``$HG_HOOKTYPE=incoming`` and ``$HG_HOOKNAME=incoming.email``.
995
995
996 .. container:: windows
996 .. container:: windows
997
997
998 Some basic Unix syntax can be enabled for portability, including ``$VAR``
998 Some basic Unix syntax can be enabled for portability, including ``$VAR``
999 and ``${VAR}`` style variables. A ``~`` followed by ``\`` or ``/`` will
999 and ``${VAR}`` style variables. A ``~`` followed by ``\`` or ``/`` will
1000 be expanded to ``%USERPROFILE%`` to simulate a subset of tilde expansion
1000 be expanded to ``%USERPROFILE%`` to simulate a subset of tilde expansion
1001 on Unix. To use a literal ``$`` or ``~``, it must be escaped with a back
1001 on Unix. To use a literal ``$`` or ``~``, it must be escaped with a back
1002 slash or inside of a strong quote. Strong quotes will be replaced by
1002 slash or inside of a strong quote. Strong quotes will be replaced by
1003 double quotes after processing.
1003 double quotes after processing.
1004
1004
1005 This feature is enabled by adding a prefix of ``tonative.`` to the hook
1005 This feature is enabled by adding a prefix of ``tonative.`` to the hook
1006 name on a new line, and setting it to ``True``. For example::
1006 name on a new line, and setting it to ``True``. For example::
1007
1007
1008 [hooks]
1008 [hooks]
1009 incoming.autobuild = /my/build/hook
1009 incoming.autobuild = /my/build/hook
1010 # enable translation to cmd.exe syntax for autobuild hook
1010 # enable translation to cmd.exe syntax for autobuild hook
1011 tonative.incoming.autobuild = True
1011 tonative.incoming.autobuild = True
1012
1012
1013 ``changegroup``
1013 ``changegroup``
1014 Run after a changegroup has been added via push, pull or unbundle. The ID of
1014 Run after a changegroup has been added via push, pull or unbundle. The ID of
1015 the first new changeset is in ``$HG_NODE`` and last is in ``$HG_NODE_LAST``.
1015 the first new changeset is in ``$HG_NODE`` and last is in ``$HG_NODE_LAST``.
1016 The URL from which changes came is in ``$HG_URL``.
1016 The URL from which changes came is in ``$HG_URL``.
1017
1017
1018 ``commit``
1018 ``commit``
1019 Run after a changeset has been created in the local repository. The ID
1019 Run after a changeset has been created in the local repository. The ID
1020 of the newly created changeset is in ``$HG_NODE``. Parent changeset
1020 of the newly created changeset is in ``$HG_NODE``. Parent changeset
1021 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1021 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1022
1022
1023 ``incoming``
1023 ``incoming``
1024 Run after a changeset has been pulled, pushed, or unbundled into
1024 Run after a changeset has been pulled, pushed, or unbundled into
1025 the local repository. The ID of the newly arrived changeset is in
1025 the local repository. The ID of the newly arrived changeset is in
1026 ``$HG_NODE``. The URL that was source of the changes is in ``$HG_URL``.
1026 ``$HG_NODE``. The URL that was source of the changes is in ``$HG_URL``.
1027
1027
1028 ``outgoing``
1028 ``outgoing``
1029 Run after sending changes from the local repository to another. The ID of
1029 Run after sending changes from the local repository to another. The ID of
1030 first changeset sent is in ``$HG_NODE``. The source of operation is in
1030 first changeset sent is in ``$HG_NODE``. The source of operation is in
1031 ``$HG_SOURCE``. Also see :hg:`help config.hooks.preoutgoing`.
1031 ``$HG_SOURCE``. Also see :hg:`help config.hooks.preoutgoing`.
1032
1032
1033 ``post-<command>``
1033 ``post-<command>``
1034 Run after successful invocations of the associated command. The
1034 Run after successful invocations of the associated command. The
1035 contents of the command line are passed as ``$HG_ARGS`` and the result
1035 contents of the command line are passed as ``$HG_ARGS`` and the result
1036 code in ``$HG_RESULT``. Parsed command line arguments are passed as
1036 code in ``$HG_RESULT``. Parsed command line arguments are passed as
1037 ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of
1037 ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of
1038 the python data internally passed to <command>. ``$HG_OPTS`` is a
1038 the python data internally passed to <command>. ``$HG_OPTS`` is a
1039 dictionary of options (with unspecified options set to their defaults).
1039 dictionary of options (with unspecified options set to their defaults).
1040 ``$HG_PATS`` is a list of arguments. Hook failure is ignored.
1040 ``$HG_PATS`` is a list of arguments. Hook failure is ignored.
1041
1041
1042 ``fail-<command>``
1042 ``fail-<command>``
1043 Run after a failed invocation of an associated command. The contents
1043 Run after a failed invocation of an associated command. The contents
1044 of the command line are passed as ``$HG_ARGS``. Parsed command line
1044 of the command line are passed as ``$HG_ARGS``. Parsed command line
1045 arguments are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain
1045 arguments are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain
1046 string representations of the python data internally passed to
1046 string representations of the python data internally passed to
1047 <command>. ``$HG_OPTS`` is a dictionary of options (with unspecified
1047 <command>. ``$HG_OPTS`` is a dictionary of options (with unspecified
1048 options set to their defaults). ``$HG_PATS`` is a list of arguments.
1048 options set to their defaults). ``$HG_PATS`` is a list of arguments.
1049 Hook failure is ignored.
1049 Hook failure is ignored.
1050
1050
1051 ``pre-<command>``
1051 ``pre-<command>``
1052 Run before executing the associated command. The contents of the
1052 Run before executing the associated command. The contents of the
1053 command line are passed as ``$HG_ARGS``. Parsed command line arguments
1053 command line are passed as ``$HG_ARGS``. Parsed command line arguments
1054 are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string
1054 are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string
1055 representations of the data internally passed to <command>. ``$HG_OPTS``
1055 representations of the data internally passed to <command>. ``$HG_OPTS``
1056 is a dictionary of options (with unspecified options set to their
1056 is a dictionary of options (with unspecified options set to their
1057 defaults). ``$HG_PATS`` is a list of arguments. If the hook returns
1057 defaults). ``$HG_PATS`` is a list of arguments. If the hook returns
1058 failure, the command doesn't execute and Mercurial returns the failure
1058 failure, the command doesn't execute and Mercurial returns the failure
1059 code.
1059 code.
1060
1060
1061 ``prechangegroup``
1061 ``prechangegroup``
1062 Run before a changegroup is added via push, pull or unbundle. Exit
1062 Run before a changegroup is added via push, pull or unbundle. Exit
1063 status 0 allows the changegroup to proceed. A non-zero status will
1063 status 0 allows the changegroup to proceed. A non-zero status will
1064 cause the push, pull or unbundle to fail. The URL from which changes
1064 cause the push, pull or unbundle to fail. The URL from which changes
1065 will come is in ``$HG_URL``.
1065 will come is in ``$HG_URL``.
1066
1066
1067 ``precommit``
1067 ``precommit``
1068 Run before starting a local commit. Exit status 0 allows the
1068 Run before starting a local commit. Exit status 0 allows the
1069 commit to proceed. A non-zero status will cause the commit to fail.
1069 commit to proceed. A non-zero status will cause the commit to fail.
1070 Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1070 Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1071
1071
1072 ``prelistkeys``
1072 ``prelistkeys``
1073 Run before listing pushkeys (like bookmarks) in the
1073 Run before listing pushkeys (like bookmarks) in the
1074 repository. A non-zero status will cause failure. The key namespace is
1074 repository. A non-zero status will cause failure. The key namespace is
1075 in ``$HG_NAMESPACE``.
1075 in ``$HG_NAMESPACE``.
1076
1076
1077 ``preoutgoing``
1077 ``preoutgoing``
1078 Run before collecting changes to send from the local repository to
1078 Run before collecting changes to send from the local repository to
1079 another. A non-zero status will cause failure. This lets you prevent
1079 another. A non-zero status will cause failure. This lets you prevent
1080 pull over HTTP or SSH. It can also prevent propagating commits (via
1080 pull over HTTP or SSH. It can also prevent propagating commits (via
1081 local pull, push (outbound) or bundle commands), but not completely,
1081 local pull, push (outbound) or bundle commands), but not completely,
1082 since you can just copy files instead. The source of operation is in
1082 since you can just copy files instead. The source of operation is in
1083 ``$HG_SOURCE``. If "serve", the operation is happening on behalf of a remote
1083 ``$HG_SOURCE``. If "serve", the operation is happening on behalf of a remote
1084 SSH or HTTP repository. If "push", "pull" or "bundle", the operation
1084 SSH or HTTP repository. If "push", "pull" or "bundle", the operation
1085 is happening on behalf of a repository on same system.
1085 is happening on behalf of a repository on same system.
1086
1086
1087 ``prepushkey``
1087 ``prepushkey``
1088 Run before a pushkey (like a bookmark) is added to the
1088 Run before a pushkey (like a bookmark) is added to the
1089 repository. A non-zero status will cause the key to be rejected. The
1089 repository. A non-zero status will cause the key to be rejected. The
1090 key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``,
1090 key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``,
1091 the old value (if any) is in ``$HG_OLD``, and the new value is in
1091 the old value (if any) is in ``$HG_OLD``, and the new value is in
1092 ``$HG_NEW``.
1092 ``$HG_NEW``.
1093
1093
1094 ``pretag``
1094 ``pretag``
1095 Run before creating a tag. Exit status 0 allows the tag to be
1095 Run before creating a tag. Exit status 0 allows the tag to be
1096 created. A non-zero status will cause the tag to fail. The ID of the
1096 created. A non-zero status will cause the tag to fail. The ID of the
1097 changeset to tag is in ``$HG_NODE``. The name of tag is in ``$HG_TAG``. The
1097 changeset to tag is in ``$HG_NODE``. The name of tag is in ``$HG_TAG``. The
1098 tag is local if ``$HG_LOCAL=1``, or in the repository if ``$HG_LOCAL=0``.
1098 tag is local if ``$HG_LOCAL=1``, or in the repository if ``$HG_LOCAL=0``.
1099
1099
1100 ``pretxnopen``
1100 ``pretxnopen``
1101 Run before any new repository transaction is open. The reason for the
1101 Run before any new repository transaction is open. The reason for the
1102 transaction will be in ``$HG_TXNNAME``, and a unique identifier for the
1102 transaction will be in ``$HG_TXNNAME``, and a unique identifier for the
1103 transaction will be in ``HG_TXNID``. A non-zero status will prevent the
1103 transaction will be in ``HG_TXNID``. A non-zero status will prevent the
1104 transaction from being opened.
1104 transaction from being opened.
1105
1105
1106 ``pretxnclose``
1106 ``pretxnclose``
1107 Run right before the transaction is actually finalized. Any repository change
1107 Run right before the transaction is actually finalized. Any repository change
1108 will be visible to the hook program. This lets you validate the transaction
1108 will be visible to the hook program. This lets you validate the transaction
1109 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1109 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1110 status will cause the transaction to be rolled back. The reason for the
1110 status will cause the transaction to be rolled back. The reason for the
1111 transaction opening will be in ``$HG_TXNNAME``, and a unique identifier for
1111 transaction opening will be in ``$HG_TXNNAME``, and a unique identifier for
1112 the transaction will be in ``HG_TXNID``. The rest of the available data will
1112 the transaction will be in ``HG_TXNID``. The rest of the available data will
1113 vary according the transaction type. New changesets will add ``$HG_NODE``
1113 vary according the transaction type. New changesets will add ``$HG_NODE``
1114 (the ID of the first added changeset), ``$HG_NODE_LAST`` (the ID of the last
1114 (the ID of the first added changeset), ``$HG_NODE_LAST`` (the ID of the last
1115 added changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables. Bookmark and
1115 added changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables. Bookmark and
1116 phase changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1``
1116 phase changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1``
1117 respectively, etc.
1117 respectively, etc.
1118
1118
1119 ``pretxnclose-bookmark``
1119 ``pretxnclose-bookmark``
1120 Run right before a bookmark change is actually finalized. Any repository
1120 Run right before a bookmark change is actually finalized. Any repository
1121 change will be visible to the hook program. This lets you validate the
1121 change will be visible to the hook program. This lets you validate the
1122 transaction content or change it. Exit status 0 allows the commit to
1122 transaction content or change it. Exit status 0 allows the commit to
1123 proceed. A non-zero status will cause the transaction to be rolled back.
1123 proceed. A non-zero status will cause the transaction to be rolled back.
1124 The name of the bookmark will be available in ``$HG_BOOKMARK``, the new
1124 The name of the bookmark will be available in ``$HG_BOOKMARK``, the new
1125 bookmark location will be available in ``$HG_NODE`` while the previous
1125 bookmark location will be available in ``$HG_NODE`` while the previous
1126 location will be available in ``$HG_OLDNODE``. In case of a bookmark
1126 location will be available in ``$HG_OLDNODE``. In case of a bookmark
1127 creation ``$HG_OLDNODE`` will be empty. In case of deletion ``$HG_NODE``
1127 creation ``$HG_OLDNODE`` will be empty. In case of deletion ``$HG_NODE``
1128 will be empty.
1128 will be empty.
1129 In addition, the reason for the transaction opening will be in
1129 In addition, the reason for the transaction opening will be in
1130 ``$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
1131 ``HG_TXNID``.
1131 ``HG_TXNID``.
1132
1132
1133 ``pretxnclose-phase``
1133 ``pretxnclose-phase``
1134 Run right before a phase change is actually finalized. Any repository change
1134 Run right before a phase change is actually finalized. Any repository change
1135 will be visible to the hook program. This lets you validate the transaction
1135 will be visible to the hook program. This lets you validate the transaction
1136 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1136 content or change it. Exit status 0 allows the commit to proceed. A non-zero
1137 status will cause the transaction to be rolled back. The hook is called
1137 status will cause the transaction to be rolled back. The hook is called
1138 multiple times, once for each revision affected by a phase change.
1138 multiple times, once for each revision affected by a phase change.
1139 The affected node is available in ``$HG_NODE``, the phase in ``$HG_PHASE``
1139 The affected node is available in ``$HG_NODE``, the phase in ``$HG_PHASE``
1140 while the previous ``$HG_OLDPHASE``. In case of new node, ``$HG_OLDPHASE``
1140 while the previous ``$HG_OLDPHASE``. In case of new node, ``$HG_OLDPHASE``
1141 will be empty. In addition, the reason for the transaction opening will be in
1141 will be empty. In addition, the reason for the transaction opening will be in
1142 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1142 ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
1143 ``HG_TXNID``. The hook is also run for newly added revisions. In this case
1143 ``HG_TXNID``. The hook is also run for newly added revisions. In this case
1144 the ``$HG_OLDPHASE`` entry will be empty.
1144 the ``$HG_OLDPHASE`` entry will be empty.
1145
1145
1146 ``txnclose``
1146 ``txnclose``
1147 Run after any repository transaction has been committed. At this
1147 Run after any repository transaction has been committed. At this
1148 point, the transaction can no longer be rolled back. The hook will run
1148 point, the transaction can no longer be rolled back. The hook will run
1149 after the lock is released. See :hg:`help config.hooks.pretxnclose` for
1149 after the lock is released. See :hg:`help config.hooks.pretxnclose` for
1150 details about available variables.
1150 details about available variables.
1151
1151
1152 ``txnclose-bookmark``
1152 ``txnclose-bookmark``
1153 Run after any bookmark change has been committed. At this point, the
1153 Run after any bookmark change has been committed. At this point, the
1154 transaction can no longer be rolled back. The hook will run after the lock
1154 transaction can no longer be rolled back. The hook will run after the lock
1155 is released. See :hg:`help config.hooks.pretxnclose-bookmark` for details
1155 is released. See :hg:`help config.hooks.pretxnclose-bookmark` for details
1156 about available variables.
1156 about available variables.
1157
1157
1158 ``txnclose-phase``
1158 ``txnclose-phase``
1159 Run after any phase change has been committed. At this point, the
1159 Run after any phase change has been committed. At this point, the
1160 transaction can no longer be rolled back. The hook will run after the lock
1160 transaction can no longer be rolled back. The hook will run after the lock
1161 is released. See :hg:`help config.hooks.pretxnclose-phase` for details about
1161 is released. See :hg:`help config.hooks.pretxnclose-phase` for details about
1162 available variables.
1162 available variables.
1163
1163
1164 ``txnabort``
1164 ``txnabort``
1165 Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose`
1165 Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose`
1166 for details about available variables.
1166 for details about available variables.
1167
1167
1168 ``pretxnchangegroup``
1168 ``pretxnchangegroup``
1169 Run after a changegroup has been added via push, pull or unbundle, but before
1169 Run after a changegroup has been added via push, pull or unbundle, but before
1170 the transaction has been committed. The changegroup is visible to the hook
1170 the transaction has been committed. The changegroup is visible to the hook
1171 program. This allows validation of incoming changes before accepting them.
1171 program. This allows validation of incoming changes before accepting them.
1172 The ID of the first new changeset is in ``$HG_NODE`` and last is in
1172 The ID of the first new changeset is in ``$HG_NODE`` and last is in
1173 ``$HG_NODE_LAST``. Exit status 0 allows the transaction to commit. A non-zero
1173 ``$HG_NODE_LAST``. Exit status 0 allows the transaction to commit. A non-zero
1174 status will cause the transaction to be rolled back, and the push, pull or
1174 status will cause the transaction to be rolled back, and the push, pull or
1175 unbundle will fail. The URL that was the source of changes is in ``$HG_URL``.
1175 unbundle will fail. The URL that was the source of changes is in ``$HG_URL``.
1176
1176
1177 ``pretxncommit``
1177 ``pretxncommit``
1178 Run after a changeset has been created, but before the transaction is
1178 Run after a changeset has been created, but before the transaction is
1179 committed. The changeset is visible to the hook program. This allows
1179 committed. The changeset is visible to the hook program. This allows
1180 validation of the commit message and changes. Exit status 0 allows the
1180 validation of the commit message and changes. Exit status 0 allows the
1181 commit to proceed. A non-zero status will cause the transaction to
1181 commit to proceed. A non-zero status will cause the transaction to
1182 be rolled back. The ID of the new changeset is in ``$HG_NODE``. The parent
1182 be rolled back. The ID of the new changeset is in ``$HG_NODE``. The parent
1183 changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1183 changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1184
1184
1185 ``preupdate``
1185 ``preupdate``
1186 Run before updating the working directory. Exit status 0 allows
1186 Run before updating the working directory. Exit status 0 allows
1187 the update to proceed. A non-zero status will prevent the update.
1187 the update to proceed. A non-zero status will prevent the update.
1188 The changeset ID of first new parent is in ``$HG_PARENT1``. If updating to a
1188 The changeset ID of first new parent is in ``$HG_PARENT1``. If updating to a
1189 merge, the ID of second new parent is in ``$HG_PARENT2``.
1189 merge, the ID of second new parent is in ``$HG_PARENT2``.
1190
1190
1191 ``listkeys``
1191 ``listkeys``
1192 Run after listing pushkeys (like bookmarks) in the repository. The
1192 Run after listing pushkeys (like bookmarks) in the repository. The
1193 key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a
1193 key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a
1194 dictionary containing the keys and values.
1194 dictionary containing the keys and values.
1195
1195
1196 ``pushkey``
1196 ``pushkey``
1197 Run after a pushkey (like a bookmark) is added to the
1197 Run after a pushkey (like a bookmark) is added to the
1198 repository. The key namespace is in ``$HG_NAMESPACE``, the key is in
1198 repository. The key namespace is in ``$HG_NAMESPACE``, the key is in
1199 ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new
1199 ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new
1200 value is in ``$HG_NEW``.
1200 value is in ``$HG_NEW``.
1201
1201
1202 ``tag``
1202 ``tag``
1203 Run after a tag is created. The ID of the tagged changeset is in ``$HG_NODE``.
1203 Run after a tag is created. The ID of the tagged changeset is in ``$HG_NODE``.
1204 The name of tag is in ``$HG_TAG``. The tag is local if ``$HG_LOCAL=1``, or in
1204 The name of tag is in ``$HG_TAG``. The tag is local if ``$HG_LOCAL=1``, or in
1205 the repository if ``$HG_LOCAL=0``.
1205 the repository if ``$HG_LOCAL=0``.
1206
1206
1207 ``update``
1207 ``update``
1208 Run after updating the working directory. The changeset ID of first
1208 Run after updating the working directory. The changeset ID of first
1209 new parent is in ``$HG_PARENT1``. If updating to a merge, the ID of second new
1209 new parent is in ``$HG_PARENT1``. If updating to a merge, the ID of second new
1210 parent is in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
1210 parent is in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
1211 update failed (e.g. because conflicts were not resolved), ``$HG_ERROR=1``.
1211 update failed (e.g. because conflicts were not resolved), ``$HG_ERROR=1``.
1212
1212
1213 .. note::
1213 .. note::
1214
1214
1215 It is generally better to use standard hooks rather than the
1215 It is generally better to use standard hooks rather than the
1216 generic pre- and post- command hooks, as they are guaranteed to be
1216 generic pre- and post- command hooks, as they are guaranteed to be
1217 called in the appropriate contexts for influencing transactions.
1217 called in the appropriate contexts for influencing transactions.
1218 Also, hooks like "commit" will be called in all contexts that
1218 Also, hooks like "commit" will be called in all contexts that
1219 generate a commit (e.g. tag) and not just the commit command.
1219 generate a commit (e.g. tag) and not just the commit command.
1220
1220
1221 .. note::
1221 .. note::
1222
1222
1223 Environment variables with empty values may not be passed to
1223 Environment variables with empty values may not be passed to
1224 hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
1224 hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
1225 will have an empty value under Unix-like platforms for non-merge
1225 will have an empty value under Unix-like platforms for non-merge
1226 changesets, while it will not be available at all under Windows.
1226 changesets, while it will not be available at all under Windows.
1227
1227
1228 The syntax for Python hooks is as follows::
1228 The syntax for Python hooks is as follows::
1229
1229
1230 hookname = python:modulename.submodule.callable
1230 hookname = python:modulename.submodule.callable
1231 hookname = python:/path/to/python/module.py:callable
1231 hookname = python:/path/to/python/module.py:callable
1232
1232
1233 Python hooks are run within the Mercurial process. Each hook is
1233 Python hooks are run within the Mercurial process. Each hook is
1234 called with at least three keyword arguments: a ui object (keyword
1234 called with at least three keyword arguments: a ui object (keyword
1235 ``ui``), a repository object (keyword ``repo``), and a ``hooktype``
1235 ``ui``), a repository object (keyword ``repo``), and a ``hooktype``
1236 keyword that tells what kind of hook is used. Arguments listed as
1236 keyword that tells what kind of hook is used. Arguments listed as
1237 environment variables above are passed as keyword arguments, with no
1237 environment variables above are passed as keyword arguments, with no
1238 ``HG_`` prefix, and names in lower case.
1238 ``HG_`` prefix, and names in lower case.
1239
1239
1240 If a Python hook returns a "true" value or raises an exception, this
1240 If a Python hook returns a "true" value or raises an exception, this
1241 is treated as a failure.
1241 is treated as a failure.
1242
1242
1243
1243
1244 ``hostfingerprints``
1244 ``hostfingerprints``
1245 --------------------
1245 --------------------
1246
1246
1247 (Deprecated. Use ``[hostsecurity]``'s ``fingerprints`` options instead.)
1247 (Deprecated. Use ``[hostsecurity]``'s ``fingerprints`` options instead.)
1248
1248
1249 Fingerprints of the certificates of known HTTPS servers.
1249 Fingerprints of the certificates of known HTTPS servers.
1250
1250
1251 A HTTPS connection to a server with a fingerprint configured here will
1251 A HTTPS connection to a server with a fingerprint configured here will
1252 only succeed if the servers certificate matches the fingerprint.
1252 only succeed if the servers certificate matches the fingerprint.
1253 This is very similar to how ssh known hosts works.
1253 This is very similar to how ssh known hosts works.
1254
1254
1255 The fingerprint is the SHA-1 hash value of the DER encoded certificate.
1255 The fingerprint is the SHA-1 hash value of the DER encoded certificate.
1256 Multiple values can be specified (separated by spaces or commas). This can
1256 Multiple values can be specified (separated by spaces or commas). This can
1257 be used to define both old and new fingerprints while a host transitions
1257 be used to define both old and new fingerprints while a host transitions
1258 to a new certificate.
1258 to a new certificate.
1259
1259
1260 The CA chain and web.cacerts is not used for servers with a fingerprint.
1260 The CA chain and web.cacerts is not used for servers with a fingerprint.
1261
1261
1262 For example::
1262 For example::
1263
1263
1264 [hostfingerprints]
1264 [hostfingerprints]
1265 hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1265 hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1266 hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1266 hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
1267
1267
1268 ``hostsecurity``
1268 ``hostsecurity``
1269 ----------------
1269 ----------------
1270
1270
1271 Used to specify global and per-host security settings for connecting to
1271 Used to specify global and per-host security settings for connecting to
1272 other machines.
1272 other machines.
1273
1273
1274 The following options control default behavior for all hosts.
1274 The following options control default behavior for all hosts.
1275
1275
1276 ``ciphers``
1276 ``ciphers``
1277 Defines the cryptographic ciphers to use for connections.
1277 Defines the cryptographic ciphers to use for connections.
1278
1278
1279 Value must be a valid OpenSSL Cipher List Format as documented at
1279 Value must be a valid OpenSSL Cipher List Format as documented at
1280 https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT.
1280 https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT.
1281
1281
1282 This setting is for advanced users only. Setting to incorrect values
1282 This setting is for advanced users only. Setting to incorrect values
1283 can significantly lower connection security or decrease performance.
1283 can significantly lower connection security or decrease performance.
1284 You have been warned.
1284 You have been warned.
1285
1285
1286 This option requires Python 2.7.
1286 This option requires Python 2.7.
1287
1287
1288 ``minimumprotocol``
1288 ``minimumprotocol``
1289 Defines the minimum channel encryption protocol to use.
1289 Defines the minimum channel encryption protocol to use.
1290
1290
1291 By default, the highest version of TLS supported by both client and server
1291 By default, the highest version of TLS supported by both client and server
1292 is used.
1292 is used.
1293
1293
1294 Allowed values are: ``tls1.0``, ``tls1.1``, ``tls1.2``.
1294 Allowed values are: ``tls1.0``, ``tls1.1``, ``tls1.2``.
1295
1295
1296 When running on an old Python version, only ``tls1.0`` is allowed since
1296 When running on an old Python version, only ``tls1.0`` is allowed since
1297 old versions of Python only support up to TLS 1.0.
1297 old versions of Python only support up to TLS 1.0.
1298
1298
1299 When running a Python that supports modern TLS versions, the default is
1299 When running a Python that supports modern TLS versions, the default is
1300 ``tls1.1``. ``tls1.0`` can still be used to allow TLS 1.0. However, this
1300 ``tls1.1``. ``tls1.0`` can still be used to allow TLS 1.0. However, this
1301 weakens security and should only be used as a feature of last resort if
1301 weakens security and should only be used as a feature of last resort if
1302 a server does not support TLS 1.1+.
1302 a server does not support TLS 1.1+.
1303
1303
1304 Options in the ``[hostsecurity]`` section can have the form
1304 Options in the ``[hostsecurity]`` section can have the form
1305 ``hostname``:``setting``. This allows multiple settings to be defined on a
1305 ``hostname``:``setting``. This allows multiple settings to be defined on a
1306 per-host basis.
1306 per-host basis.
1307
1307
1308 The following per-host settings can be defined.
1308 The following per-host settings can be defined.
1309
1309
1310 ``ciphers``
1310 ``ciphers``
1311 This behaves like ``ciphers`` as described above except it only applies
1311 This behaves like ``ciphers`` as described above except it only applies
1312 to the host on which it is defined.
1312 to the host on which it is defined.
1313
1313
1314 ``fingerprints``
1314 ``fingerprints``
1315 A list of hashes of the DER encoded peer/remote certificate. Values have
1315 A list of hashes of the DER encoded peer/remote certificate. Values have
1316 the form ``algorithm``:``fingerprint``. e.g.
1316 the form ``algorithm``:``fingerprint``. e.g.
1317 ``sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2``.
1317 ``sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2``.
1318 In addition, colons (``:``) can appear in the fingerprint part.
1318 In addition, colons (``:``) can appear in the fingerprint part.
1319
1319
1320 The following algorithms/prefixes are supported: ``sha1``, ``sha256``,
1320 The following algorithms/prefixes are supported: ``sha1``, ``sha256``,
1321 ``sha512``.
1321 ``sha512``.
1322
1322
1323 Use of ``sha256`` or ``sha512`` is preferred.
1323 Use of ``sha256`` or ``sha512`` is preferred.
1324
1324
1325 If a fingerprint is specified, the CA chain is not validated for this
1325 If a fingerprint is specified, the CA chain is not validated for this
1326 host and Mercurial will require the remote certificate to match one
1326 host and Mercurial will require the remote certificate to match one
1327 of the fingerprints specified. This means if the server updates its
1327 of the fingerprints specified. This means if the server updates its
1328 certificate, Mercurial will abort until a new fingerprint is defined.
1328 certificate, Mercurial will abort until a new fingerprint is defined.
1329 This can provide stronger security than traditional CA-based validation
1329 This can provide stronger security than traditional CA-based validation
1330 at the expense of convenience.
1330 at the expense of convenience.
1331
1331
1332 This option takes precedence over ``verifycertsfile``.
1332 This option takes precedence over ``verifycertsfile``.
1333
1333
1334 ``minimumprotocol``
1334 ``minimumprotocol``
1335 This behaves like ``minimumprotocol`` as described above except it
1335 This behaves like ``minimumprotocol`` as described above except it
1336 only applies to the host on which it is defined.
1336 only applies to the host on which it is defined.
1337
1337
1338 ``verifycertsfile``
1338 ``verifycertsfile``
1339 Path to file a containing a list of PEM encoded certificates used to
1339 Path to file a containing a list of PEM encoded certificates used to
1340 verify the server certificate. Environment variables and ``~user``
1340 verify the server certificate. Environment variables and ``~user``
1341 constructs are expanded in the filename.
1341 constructs are expanded in the filename.
1342
1342
1343 The server certificate or the certificate's certificate authority (CA)
1343 The server certificate or the certificate's certificate authority (CA)
1344 must match a certificate from this file or certificate verification
1344 must match a certificate from this file or certificate verification
1345 will fail and connections to the server will be refused.
1345 will fail and connections to the server will be refused.
1346
1346
1347 If defined, only certificates provided by this file will be used:
1347 If defined, only certificates provided by this file will be used:
1348 ``web.cacerts`` and any system/default certificates will not be
1348 ``web.cacerts`` and any system/default certificates will not be
1349 used.
1349 used.
1350
1350
1351 This option has no effect if the per-host ``fingerprints`` option
1351 This option has no effect if the per-host ``fingerprints`` option
1352 is set.
1352 is set.
1353
1353
1354 The format of the file is as follows::
1354 The format of the file is as follows::
1355
1355
1356 -----BEGIN CERTIFICATE-----
1356 -----BEGIN CERTIFICATE-----
1357 ... (certificate in base64 PEM encoding) ...
1357 ... (certificate in base64 PEM encoding) ...
1358 -----END CERTIFICATE-----
1358 -----END CERTIFICATE-----
1359 -----BEGIN CERTIFICATE-----
1359 -----BEGIN CERTIFICATE-----
1360 ... (certificate in base64 PEM encoding) ...
1360 ... (certificate in base64 PEM encoding) ...
1361 -----END CERTIFICATE-----
1361 -----END CERTIFICATE-----
1362
1362
1363 For example::
1363 For example::
1364
1364
1365 [hostsecurity]
1365 [hostsecurity]
1366 hg.example.com:fingerprints = sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
1366 hg.example.com:fingerprints = sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
1367 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
1367 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
1368 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
1368 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
1369 foo.example.com:verifycertsfile = /etc/ssl/trusted-ca-certs.pem
1369 foo.example.com:verifycertsfile = /etc/ssl/trusted-ca-certs.pem
1370
1370
1371 To change the default minimum protocol version to TLS 1.2 but to allow TLS 1.1
1371 To change the default minimum protocol version to TLS 1.2 but to allow TLS 1.1
1372 when connecting to ``hg.example.com``::
1372 when connecting to ``hg.example.com``::
1373
1373
1374 [hostsecurity]
1374 [hostsecurity]
1375 minimumprotocol = tls1.2
1375 minimumprotocol = tls1.2
1376 hg.example.com:minimumprotocol = tls1.1
1376 hg.example.com:minimumprotocol = tls1.1
1377
1377
1378 ``http_proxy``
1378 ``http_proxy``
1379 --------------
1379 --------------
1380
1380
1381 Used to access web-based Mercurial repositories through a HTTP
1381 Used to access web-based Mercurial repositories through a HTTP
1382 proxy.
1382 proxy.
1383
1383
1384 ``host``
1384 ``host``
1385 Host name and (optional) port of the proxy server, for example
1385 Host name and (optional) port of the proxy server, for example
1386 "myproxy:8000".
1386 "myproxy:8000".
1387
1387
1388 ``no``
1388 ``no``
1389 Optional. Comma-separated list of host names that should bypass
1389 Optional. Comma-separated list of host names that should bypass
1390 the proxy.
1390 the proxy.
1391
1391
1392 ``passwd``
1392 ``passwd``
1393 Optional. Password to authenticate with at the proxy server.
1393 Optional. Password to authenticate with at the proxy server.
1394
1394
1395 ``user``
1395 ``user``
1396 Optional. User name to authenticate with at the proxy server.
1396 Optional. User name to authenticate with at the proxy server.
1397
1397
1398 ``always``
1398 ``always``
1399 Optional. Always use the proxy, even for localhost and any entries
1399 Optional. Always use the proxy, even for localhost and any entries
1400 in ``http_proxy.no``. (default: False)
1400 in ``http_proxy.no``. (default: False)
1401
1401
1402 ``http``
1402 ``http``
1403 ----------
1403 ----------
1404
1404
1405 Used to configure access to Mercurial repositories via HTTP.
1405 Used to configure access to Mercurial repositories via HTTP.
1406
1406
1407 ``timeout``
1407 ``timeout``
1408 If set, blocking operations will timeout after that many seconds.
1408 If set, blocking operations will timeout after that many seconds.
1409 (default: None)
1409 (default: None)
1410
1410
1411 ``merge``
1411 ``merge``
1412 ---------
1412 ---------
1413
1413
1414 This section specifies behavior during merges and updates.
1414 This section specifies behavior during merges and updates.
1415
1415
1416 ``checkignored``
1416 ``checkignored``
1417 Controls behavior when an ignored file on disk has the same name as a tracked
1417 Controls behavior when an ignored file on disk has the same name as a tracked
1418 file in the changeset being merged or updated to, and has different
1418 file in the changeset being merged or updated to, and has different
1419 contents. Options are ``abort``, ``warn`` and ``ignore``. With ``abort``,
1419 contents. Options are ``abort``, ``warn`` and ``ignore``. With ``abort``,
1420 abort on such files. With ``warn``, warn on such files and back them up as
1420 abort on such files. With ``warn``, warn on such files and back them up as
1421 ``.orig``. With ``ignore``, don't print a warning and back them up as
1421 ``.orig``. With ``ignore``, don't print a warning and back them up as
1422 ``.orig``. (default: ``abort``)
1422 ``.orig``. (default: ``abort``)
1423
1423
1424 ``checkunknown``
1424 ``checkunknown``
1425 Controls behavior when an unknown file that isn't ignored has the same name
1425 Controls behavior when an unknown file that isn't ignored has the same name
1426 as a tracked file in the changeset being merged or updated to, and has
1426 as a tracked file in the changeset being merged or updated to, and has
1427 different contents. Similar to ``merge.checkignored``, except for files that
1427 different contents. Similar to ``merge.checkignored``, except for files that
1428 are not ignored. (default: ``abort``)
1428 are not ignored. (default: ``abort``)
1429
1429
1430 ``on-failure``
1430 ``on-failure``
1431 When set to ``continue`` (the default), the merge process attempts to
1431 When set to ``continue`` (the default), the merge process attempts to
1432 merge all unresolved files using the merge chosen tool, regardless of
1432 merge all unresolved files using the merge chosen tool, regardless of
1433 whether previous file merge attempts during the process succeeded or not.
1433 whether previous file merge attempts during the process succeeded or not.
1434 Setting this to ``prompt`` will prompt after any merge failure continue
1434 Setting this to ``prompt`` will prompt after any merge failure continue
1435 or halt the merge process. Setting this to ``halt`` will automatically
1435 or halt the merge process. Setting this to ``halt`` will automatically
1436 halt the merge process on any merge tool failure. The merge process
1436 halt the merge process on any merge tool failure. The merge process
1437 can be restarted by using the ``resolve`` command. When a merge is
1437 can be restarted by using the ``resolve`` command. When a merge is
1438 halted, the repository is left in a normal ``unresolved`` merge state.
1438 halted, the repository is left in a normal ``unresolved`` merge state.
1439 (default: ``continue``)
1439 (default: ``continue``)
1440
1440
1441 ``strict-capability-check``
1441 ``strict-capability-check``
1442 Whether capabilities of internal merge tools are checked strictly
1442 Whether capabilities of internal merge tools are checked strictly
1443 or not, while examining rules to decide merge tool to be used.
1443 or not, while examining rules to decide merge tool to be used.
1444 (default: False)
1444 (default: False)
1445
1445
1446 ``merge-patterns``
1446 ``merge-patterns``
1447 ------------------
1447 ------------------
1448
1448
1449 This section specifies merge tools to associate with particular file
1449 This section specifies merge tools to associate with particular file
1450 patterns. Tools matched here will take precedence over the default
1450 patterns. Tools matched here will take precedence over the default
1451 merge tool. Patterns are globs by default, rooted at the repository
1451 merge tool. Patterns are globs by default, rooted at the repository
1452 root.
1452 root.
1453
1453
1454 Example::
1454 Example::
1455
1455
1456 [merge-patterns]
1456 [merge-patterns]
1457 **.c = kdiff3
1457 **.c = kdiff3
1458 **.jpg = myimgmerge
1458 **.jpg = myimgmerge
1459
1459
1460 ``merge-tools``
1460 ``merge-tools``
1461 ---------------
1461 ---------------
1462
1462
1463 This section configures external merge tools to use for file-level
1463 This section configures external merge tools to use for file-level
1464 merges. This section has likely been preconfigured at install time.
1464 merges. This section has likely been preconfigured at install time.
1465 Use :hg:`config merge-tools` to check the existing configuration.
1465 Use :hg:`config merge-tools` to check the existing configuration.
1466 Also see :hg:`help merge-tools` for more details.
1466 Also see :hg:`help merge-tools` for more details.
1467
1467
1468 Example ``~/.hgrc``::
1468 Example ``~/.hgrc``::
1469
1469
1470 [merge-tools]
1470 [merge-tools]
1471 # Override stock tool location
1471 # Override stock tool location
1472 kdiff3.executable = ~/bin/kdiff3
1472 kdiff3.executable = ~/bin/kdiff3
1473 # Specify command line
1473 # Specify command line
1474 kdiff3.args = $base $local $other -o $output
1474 kdiff3.args = $base $local $other -o $output
1475 # Give higher priority
1475 # Give higher priority
1476 kdiff3.priority = 1
1476 kdiff3.priority = 1
1477
1477
1478 # Changing the priority of preconfigured tool
1478 # Changing the priority of preconfigured tool
1479 meld.priority = 0
1479 meld.priority = 0
1480
1480
1481 # Disable a preconfigured tool
1481 # Disable a preconfigured tool
1482 vimdiff.disabled = yes
1482 vimdiff.disabled = yes
1483
1483
1484 # Define new tool
1484 # Define new tool
1485 myHtmlTool.args = -m $local $other $base $output
1485 myHtmlTool.args = -m $local $other $base $output
1486 myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
1486 myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
1487 myHtmlTool.priority = 1
1487 myHtmlTool.priority = 1
1488
1488
1489 Supported arguments:
1489 Supported arguments:
1490
1490
1491 ``priority``
1491 ``priority``
1492 The priority in which to evaluate this tool.
1492 The priority in which to evaluate this tool.
1493 (default: 0)
1493 (default: 0)
1494
1494
1495 ``executable``
1495 ``executable``
1496 Either just the name of the executable or its pathname.
1496 Either just the name of the executable or its pathname.
1497
1497
1498 .. container:: windows
1498 .. container:: windows
1499
1499
1500 On Windows, the path can use environment variables with ${ProgramFiles}
1500 On Windows, the path can use environment variables with ${ProgramFiles}
1501 syntax.
1501 syntax.
1502
1502
1503 (default: the tool name)
1503 (default: the tool name)
1504
1504
1505 ``args``
1505 ``args``
1506 The arguments to pass to the tool executable. You can refer to the
1506 The arguments to pass to the tool executable. You can refer to the
1507 files being merged as well as the output file through these
1507 files being merged as well as the output file through these
1508 variables: ``$base``, ``$local``, ``$other``, ``$output``.
1508 variables: ``$base``, ``$local``, ``$other``, ``$output``.
1509
1509
1510 The meaning of ``$local`` and ``$other`` can vary depending on which action is
1510 The meaning of ``$local`` and ``$other`` can vary depending on which action is
1511 being performed. During an update or merge, ``$local`` represents the original
1511 being performed. During an update or merge, ``$local`` represents the original
1512 state of the file, while ``$other`` represents the commit you are updating to or
1512 state of the file, while ``$other`` represents the commit you are updating to or
1513 the commit you are merging with. During a rebase, ``$local`` represents the
1513 the commit you are merging with. During a rebase, ``$local`` represents the
1514 destination of the rebase, and ``$other`` represents the commit being rebased.
1514 destination of the rebase, and ``$other`` represents the commit being rebased.
1515
1515
1516 Some operations define custom labels to assist with identifying the revisions,
1516 Some operations define custom labels to assist with identifying the revisions,
1517 accessible via ``$labellocal``, ``$labelother``, and ``$labelbase``. If custom
1517 accessible via ``$labellocal``, ``$labelother``, and ``$labelbase``. If custom
1518 labels are not available, these will be ``local``, ``other``, and ``base``,
1518 labels are not available, these will be ``local``, ``other``, and ``base``,
1519 respectively.
1519 respectively.
1520 (default: ``$local $base $other``)
1520 (default: ``$local $base $other``)
1521
1521
1522 ``premerge``
1522 ``premerge``
1523 Attempt to run internal non-interactive 3-way merge tool before
1523 Attempt to run internal non-interactive 3-way merge tool before
1524 launching external tool. Options are ``true``, ``false``, ``keep`` or
1524 launching external tool. Options are ``true``, ``false``, ``keep``,
1525 ``keep-merge3``. The ``keep`` option will leave markers in the file if the
1525 ``keep-merge3``, or ``keep-mergediff`` (experimental). The ``keep`` option
1526 premerge fails. The ``keep-merge3`` will do the same but include information
1526 will leave markers in the file if the premerge fails. The ``keep-merge3``
1527 about the base of the merge in the marker (see internal :merge3 in
1527 will do the same but include information about the base of the merge in the
1528 :hg:`help merge-tools`).
1528 marker (see internal :merge3 in :hg:`help merge-tools`). The
1529 (default: True)
1529 ``keep-mergediff`` option is similar but uses a different marker style
1530 (see internal :merge3 in :hg:`help merge-tools`). (default: True)
1530
1531
1531 ``binary``
1532 ``binary``
1532 This tool can merge binary files. (default: False, unless tool
1533 This tool can merge binary files. (default: False, unless tool
1533 was selected by file pattern match)
1534 was selected by file pattern match)
1534
1535
1535 ``symlink``
1536 ``symlink``
1536 This tool can merge symlinks. (default: False)
1537 This tool can merge symlinks. (default: False)
1537
1538
1538 ``check``
1539 ``check``
1539 A list of merge success-checking options:
1540 A list of merge success-checking options:
1540
1541
1541 ``changed``
1542 ``changed``
1542 Ask whether merge was successful when the merged file shows no changes.
1543 Ask whether merge was successful when the merged file shows no changes.
1543 ``conflicts``
1544 ``conflicts``
1544 Check whether there are conflicts even though the tool reported success.
1545 Check whether there are conflicts even though the tool reported success.
1545 ``prompt``
1546 ``prompt``
1546 Always prompt for merge success, regardless of success reported by tool.
1547 Always prompt for merge success, regardless of success reported by tool.
1547
1548
1548 ``fixeol``
1549 ``fixeol``
1549 Attempt to fix up EOL changes caused by the merge tool.
1550 Attempt to fix up EOL changes caused by the merge tool.
1550 (default: False)
1551 (default: False)
1551
1552
1552 ``gui``
1553 ``gui``
1553 This tool requires a graphical interface to run. (default: False)
1554 This tool requires a graphical interface to run. (default: False)
1554
1555
1555 ``mergemarkers``
1556 ``mergemarkers``
1556 Controls whether the labels passed via ``$labellocal``, ``$labelother``, and
1557 Controls whether the labels passed via ``$labellocal``, ``$labelother``, and
1557 ``$labelbase`` are ``detailed`` (respecting ``mergemarkertemplate``) or
1558 ``$labelbase`` are ``detailed`` (respecting ``mergemarkertemplate``) or
1558 ``basic``. If ``premerge`` is ``keep`` or ``keep-merge3``, the conflict
1559 ``basic``. If ``premerge`` is ``keep`` or ``keep-merge3``, the conflict
1559 markers generated during premerge will be ``detailed`` if either this option or
1560 markers generated during premerge will be ``detailed`` if either this option or
1560 the corresponding option in the ``[ui]`` section is ``detailed``.
1561 the corresponding option in the ``[ui]`` section is ``detailed``.
1561 (default: ``basic``)
1562 (default: ``basic``)
1562
1563
1563 ``mergemarkertemplate``
1564 ``mergemarkertemplate``
1564 This setting can be used to override ``mergemarker`` from the
1565 This setting can be used to override ``mergemarker`` from the
1565 ``[command-templates]`` section on a per-tool basis; this applies to the
1566 ``[command-templates]`` section on a per-tool basis; this applies to the
1566 ``$label``-prefixed variables and to the conflict markers that are generated
1567 ``$label``-prefixed variables and to the conflict markers that are generated
1567 if ``premerge`` is ``keep` or ``keep-merge3``. See the corresponding variable
1568 if ``premerge`` is ``keep` or ``keep-merge3``. See the corresponding variable
1568 in ``[ui]`` for more information.
1569 in ``[ui]`` for more information.
1569
1570
1570 .. container:: windows
1571 .. container:: windows
1571
1572
1572 ``regkey``
1573 ``regkey``
1573 Windows registry key which describes install location of this
1574 Windows registry key which describes install location of this
1574 tool. Mercurial will search for this key first under
1575 tool. Mercurial will search for this key first under
1575 ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
1576 ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
1576 (default: None)
1577 (default: None)
1577
1578
1578 ``regkeyalt``
1579 ``regkeyalt``
1579 An alternate Windows registry key to try if the first key is not
1580 An alternate Windows registry key to try if the first key is not
1580 found. The alternate key uses the same ``regname`` and ``regappend``
1581 found. The alternate key uses the same ``regname`` and ``regappend``
1581 semantics of the primary key. The most common use for this key
1582 semantics of the primary key. The most common use for this key
1582 is to search for 32bit applications on 64bit operating systems.
1583 is to search for 32bit applications on 64bit operating systems.
1583 (default: None)
1584 (default: None)
1584
1585
1585 ``regname``
1586 ``regname``
1586 Name of value to read from specified registry key.
1587 Name of value to read from specified registry key.
1587 (default: the unnamed (default) value)
1588 (default: the unnamed (default) value)
1588
1589
1589 ``regappend``
1590 ``regappend``
1590 String to append to the value read from the registry, typically
1591 String to append to the value read from the registry, typically
1591 the executable name of the tool.
1592 the executable name of the tool.
1592 (default: None)
1593 (default: None)
1593
1594
1594 ``pager``
1595 ``pager``
1595 ---------
1596 ---------
1596
1597
1597 Setting used to control when to paginate and with what external tool. See
1598 Setting used to control when to paginate and with what external tool. See
1598 :hg:`help pager` for details.
1599 :hg:`help pager` for details.
1599
1600
1600 ``pager``
1601 ``pager``
1601 Define the external tool used as pager.
1602 Define the external tool used as pager.
1602
1603
1603 If no pager is set, Mercurial uses the environment variable $PAGER.
1604 If no pager is set, Mercurial uses the environment variable $PAGER.
1604 If neither pager.pager, nor $PAGER is set, a default pager will be
1605 If neither pager.pager, nor $PAGER is set, a default pager will be
1605 used, typically `less` on Unix and `more` on Windows. Example::
1606 used, typically `less` on Unix and `more` on Windows. Example::
1606
1607
1607 [pager]
1608 [pager]
1608 pager = less -FRX
1609 pager = less -FRX
1609
1610
1610 ``ignore``
1611 ``ignore``
1611 List of commands to disable the pager for. Example::
1612 List of commands to disable the pager for. Example::
1612
1613
1613 [pager]
1614 [pager]
1614 ignore = version, help, update
1615 ignore = version, help, update
1615
1616
1616 ``patch``
1617 ``patch``
1617 ---------
1618 ---------
1618
1619
1619 Settings used when applying patches, for instance through the 'import'
1620 Settings used when applying patches, for instance through the 'import'
1620 command or with Mercurial Queues extension.
1621 command or with Mercurial Queues extension.
1621
1622
1622 ``eol``
1623 ``eol``
1623 When set to 'strict' patch content and patched files end of lines
1624 When set to 'strict' patch content and patched files end of lines
1624 are preserved. When set to ``lf`` or ``crlf``, both files end of
1625 are preserved. When set to ``lf`` or ``crlf``, both files end of
1625 lines are ignored when patching and the result line endings are
1626 lines are ignored when patching and the result line endings are
1626 normalized to either LF (Unix) or CRLF (Windows). When set to
1627 normalized to either LF (Unix) or CRLF (Windows). When set to
1627 ``auto``, end of lines are again ignored while patching but line
1628 ``auto``, end of lines are again ignored while patching but line
1628 endings in patched files are normalized to their original setting
1629 endings in patched files are normalized to their original setting
1629 on a per-file basis. If target file does not exist or has no end
1630 on a per-file basis. If target file does not exist or has no end
1630 of line, patch line endings are preserved.
1631 of line, patch line endings are preserved.
1631 (default: strict)
1632 (default: strict)
1632
1633
1633 ``fuzz``
1634 ``fuzz``
1634 The number of lines of 'fuzz' to allow when applying patches. This
1635 The number of lines of 'fuzz' to allow when applying patches. This
1635 controls how much context the patcher is allowed to ignore when
1636 controls how much context the patcher is allowed to ignore when
1636 trying to apply a patch.
1637 trying to apply a patch.
1637 (default: 2)
1638 (default: 2)
1638
1639
1639 ``paths``
1640 ``paths``
1640 ---------
1641 ---------
1641
1642
1642 Assigns symbolic names and behavior to repositories.
1643 Assigns symbolic names and behavior to repositories.
1643
1644
1644 Options are symbolic names defining the URL or directory that is the
1645 Options are symbolic names defining the URL or directory that is the
1645 location of the repository. Example::
1646 location of the repository. Example::
1646
1647
1647 [paths]
1648 [paths]
1648 my_server = https://example.com/my_repo
1649 my_server = https://example.com/my_repo
1649 local_path = /home/me/repo
1650 local_path = /home/me/repo
1650
1651
1651 These symbolic names can be used from the command line. To pull
1652 These symbolic names can be used from the command line. To pull
1652 from ``my_server``: :hg:`pull my_server`. To push to ``local_path``:
1653 from ``my_server``: :hg:`pull my_server`. To push to ``local_path``:
1653 :hg:`push local_path`.
1654 :hg:`push local_path`.
1654
1655
1655 Options containing colons (``:``) denote sub-options that can influence
1656 Options containing colons (``:``) denote sub-options that can influence
1656 behavior for that specific path. Example::
1657 behavior for that specific path. Example::
1657
1658
1658 [paths]
1659 [paths]
1659 my_server = https://example.com/my_path
1660 my_server = https://example.com/my_path
1660 my_server:pushurl = ssh://example.com/my_path
1661 my_server:pushurl = ssh://example.com/my_path
1661
1662
1662 The following sub-options can be defined:
1663 The following sub-options can be defined:
1663
1664
1664 ``pushurl``
1665 ``pushurl``
1665 The URL to use for push operations. If not defined, the location
1666 The URL to use for push operations. If not defined, the location
1666 defined by the path's main entry is used.
1667 defined by the path's main entry is used.
1667
1668
1668 ``pushrev``
1669 ``pushrev``
1669 A revset defining which revisions to push by default.
1670 A revset defining which revisions to push by default.
1670
1671
1671 When :hg:`push` is executed without a ``-r`` argument, the revset
1672 When :hg:`push` is executed without a ``-r`` argument, the revset
1672 defined by this sub-option is evaluated to determine what to push.
1673 defined by this sub-option is evaluated to determine what to push.
1673
1674
1674 For example, a value of ``.`` will push the working directory's
1675 For example, a value of ``.`` will push the working directory's
1675 revision by default.
1676 revision by default.
1676
1677
1677 Revsets specifying bookmarks will not result in the bookmark being
1678 Revsets specifying bookmarks will not result in the bookmark being
1678 pushed.
1679 pushed.
1679
1680
1680 The following special named paths exist:
1681 The following special named paths exist:
1681
1682
1682 ``default``
1683 ``default``
1683 The URL or directory to use when no source or remote is specified.
1684 The URL or directory to use when no source or remote is specified.
1684
1685
1685 :hg:`clone` will automatically define this path to the location the
1686 :hg:`clone` will automatically define this path to the location the
1686 repository was cloned from.
1687 repository was cloned from.
1687
1688
1688 ``default-push``
1689 ``default-push``
1689 (deprecated) The URL or directory for the default :hg:`push` location.
1690 (deprecated) The URL or directory for the default :hg:`push` location.
1690 ``default:pushurl`` should be used instead.
1691 ``default:pushurl`` should be used instead.
1691
1692
1692 ``phases``
1693 ``phases``
1693 ----------
1694 ----------
1694
1695
1695 Specifies default handling of phases. See :hg:`help phases` for more
1696 Specifies default handling of phases. See :hg:`help phases` for more
1696 information about working with phases.
1697 information about working with phases.
1697
1698
1698 ``publish``
1699 ``publish``
1699 Controls draft phase behavior when working as a server. When true,
1700 Controls draft phase behavior when working as a server. When true,
1700 pushed changesets are set to public in both client and server and
1701 pushed changesets are set to public in both client and server and
1701 pulled or cloned changesets are set to public in the client.
1702 pulled or cloned changesets are set to public in the client.
1702 (default: True)
1703 (default: True)
1703
1704
1704 ``new-commit``
1705 ``new-commit``
1705 Phase of newly-created commits.
1706 Phase of newly-created commits.
1706 (default: draft)
1707 (default: draft)
1707
1708
1708 ``checksubrepos``
1709 ``checksubrepos``
1709 Check the phase of the current revision of each subrepository. Allowed
1710 Check the phase of the current revision of each subrepository. Allowed
1710 values are "ignore", "follow" and "abort". For settings other than
1711 values are "ignore", "follow" and "abort". For settings other than
1711 "ignore", the phase of the current revision of each subrepository is
1712 "ignore", the phase of the current revision of each subrepository is
1712 checked before committing the parent repository. If any of those phases is
1713 checked before committing the parent repository. If any of those phases is
1713 greater than the phase of the parent repository (e.g. if a subrepo is in a
1714 greater than the phase of the parent repository (e.g. if a subrepo is in a
1714 "secret" phase while the parent repo is in "draft" phase), the commit is
1715 "secret" phase while the parent repo is in "draft" phase), the commit is
1715 either aborted (if checksubrepos is set to "abort") or the higher phase is
1716 either aborted (if checksubrepos is set to "abort") or the higher phase is
1716 used for the parent repository commit (if set to "follow").
1717 used for the parent repository commit (if set to "follow").
1717 (default: follow)
1718 (default: follow)
1718
1719
1719
1720
1720 ``profiling``
1721 ``profiling``
1721 -------------
1722 -------------
1722
1723
1723 Specifies profiling type, format, and file output. Two profilers are
1724 Specifies profiling type, format, and file output. Two profilers are
1724 supported: an instrumenting profiler (named ``ls``), and a sampling
1725 supported: an instrumenting profiler (named ``ls``), and a sampling
1725 profiler (named ``stat``).
1726 profiler (named ``stat``).
1726
1727
1727 In this section description, 'profiling data' stands for the raw data
1728 In this section description, 'profiling data' stands for the raw data
1728 collected during profiling, while 'profiling report' stands for a
1729 collected during profiling, while 'profiling report' stands for a
1729 statistical text report generated from the profiling data.
1730 statistical text report generated from the profiling data.
1730
1731
1731 ``enabled``
1732 ``enabled``
1732 Enable the profiler.
1733 Enable the profiler.
1733 (default: false)
1734 (default: false)
1734
1735
1735 This is equivalent to passing ``--profile`` on the command line.
1736 This is equivalent to passing ``--profile`` on the command line.
1736
1737
1737 ``type``
1738 ``type``
1738 The type of profiler to use.
1739 The type of profiler to use.
1739 (default: stat)
1740 (default: stat)
1740
1741
1741 ``ls``
1742 ``ls``
1742 Use Python's built-in instrumenting profiler. This profiler
1743 Use Python's built-in instrumenting profiler. This profiler
1743 works on all platforms, but each line number it reports is the
1744 works on all platforms, but each line number it reports is the
1744 first line of a function. This restriction makes it difficult to
1745 first line of a function. This restriction makes it difficult to
1745 identify the expensive parts of a non-trivial function.
1746 identify the expensive parts of a non-trivial function.
1746 ``stat``
1747 ``stat``
1747 Use a statistical profiler, statprof. This profiler is most
1748 Use a statistical profiler, statprof. This profiler is most
1748 useful for profiling commands that run for longer than about 0.1
1749 useful for profiling commands that run for longer than about 0.1
1749 seconds.
1750 seconds.
1750
1751
1751 ``format``
1752 ``format``
1752 Profiling format. Specific to the ``ls`` instrumenting profiler.
1753 Profiling format. Specific to the ``ls`` instrumenting profiler.
1753 (default: text)
1754 (default: text)
1754
1755
1755 ``text``
1756 ``text``
1756 Generate a profiling report. When saving to a file, it should be
1757 Generate a profiling report. When saving to a file, it should be
1757 noted that only the report is saved, and the profiling data is
1758 noted that only the report is saved, and the profiling data is
1758 not kept.
1759 not kept.
1759 ``kcachegrind``
1760 ``kcachegrind``
1760 Format profiling data for kcachegrind use: when saving to a
1761 Format profiling data for kcachegrind use: when saving to a
1761 file, the generated file can directly be loaded into
1762 file, the generated file can directly be loaded into
1762 kcachegrind.
1763 kcachegrind.
1763
1764
1764 ``statformat``
1765 ``statformat``
1765 Profiling format for the ``stat`` profiler.
1766 Profiling format for the ``stat`` profiler.
1766 (default: hotpath)
1767 (default: hotpath)
1767
1768
1768 ``hotpath``
1769 ``hotpath``
1769 Show a tree-based display containing the hot path of execution (where
1770 Show a tree-based display containing the hot path of execution (where
1770 most time was spent).
1771 most time was spent).
1771 ``bymethod``
1772 ``bymethod``
1772 Show a table of methods ordered by how frequently they are active.
1773 Show a table of methods ordered by how frequently they are active.
1773 ``byline``
1774 ``byline``
1774 Show a table of lines in files ordered by how frequently they are active.
1775 Show a table of lines in files ordered by how frequently they are active.
1775 ``json``
1776 ``json``
1776 Render profiling data as JSON.
1777 Render profiling data as JSON.
1777
1778
1778 ``frequency``
1779 ``frequency``
1779 Sampling frequency. Specific to the ``stat`` sampling profiler.
1780 Sampling frequency. Specific to the ``stat`` sampling profiler.
1780 (default: 1000)
1781 (default: 1000)
1781
1782
1782 ``output``
1783 ``output``
1783 File path where profiling data or report should be saved. If the
1784 File path where profiling data or report should be saved. If the
1784 file exists, it is replaced. (default: None, data is printed on
1785 file exists, it is replaced. (default: None, data is printed on
1785 stderr)
1786 stderr)
1786
1787
1787 ``sort``
1788 ``sort``
1788 Sort field. Specific to the ``ls`` instrumenting profiler.
1789 Sort field. Specific to the ``ls`` instrumenting profiler.
1789 One of ``callcount``, ``reccallcount``, ``totaltime`` and
1790 One of ``callcount``, ``reccallcount``, ``totaltime`` and
1790 ``inlinetime``.
1791 ``inlinetime``.
1791 (default: inlinetime)
1792 (default: inlinetime)
1792
1793
1793 ``time-track``
1794 ``time-track``
1794 Control if the stat profiler track ``cpu`` or ``real`` time.
1795 Control if the stat profiler track ``cpu`` or ``real`` time.
1795 (default: ``cpu`` on Windows, otherwise ``real``)
1796 (default: ``cpu`` on Windows, otherwise ``real``)
1796
1797
1797 ``limit``
1798 ``limit``
1798 Number of lines to show. Specific to the ``ls`` instrumenting profiler.
1799 Number of lines to show. Specific to the ``ls`` instrumenting profiler.
1799 (default: 30)
1800 (default: 30)
1800
1801
1801 ``nested``
1802 ``nested``
1802 Show at most this number of lines of drill-down info after each main entry.
1803 Show at most this number of lines of drill-down info after each main entry.
1803 This can help explain the difference between Total and Inline.
1804 This can help explain the difference between Total and Inline.
1804 Specific to the ``ls`` instrumenting profiler.
1805 Specific to the ``ls`` instrumenting profiler.
1805 (default: 0)
1806 (default: 0)
1806
1807
1807 ``showmin``
1808 ``showmin``
1808 Minimum fraction of samples an entry must have for it to be displayed.
1809 Minimum fraction of samples an entry must have for it to be displayed.
1809 Can be specified as a float between ``0.0`` and ``1.0`` or can have a
1810 Can be specified as a float between ``0.0`` and ``1.0`` or can have a
1810 ``%`` afterwards to allow values up to ``100``. e.g. ``5%``.
1811 ``%`` afterwards to allow values up to ``100``. e.g. ``5%``.
1811
1812
1812 Only used by the ``stat`` profiler.
1813 Only used by the ``stat`` profiler.
1813
1814
1814 For the ``hotpath`` format, default is ``0.05``.
1815 For the ``hotpath`` format, default is ``0.05``.
1815 For the ``chrome`` format, default is ``0.005``.
1816 For the ``chrome`` format, default is ``0.005``.
1816
1817
1817 The option is unused on other formats.
1818 The option is unused on other formats.
1818
1819
1819 ``showmax``
1820 ``showmax``
1820 Maximum fraction of samples an entry can have before it is ignored in
1821 Maximum fraction of samples an entry can have before it is ignored in
1821 display. Values format is the same as ``showmin``.
1822 display. Values format is the same as ``showmin``.
1822
1823
1823 Only used by the ``stat`` profiler.
1824 Only used by the ``stat`` profiler.
1824
1825
1825 For the ``chrome`` format, default is ``0.999``.
1826 For the ``chrome`` format, default is ``0.999``.
1826
1827
1827 The option is unused on other formats.
1828 The option is unused on other formats.
1828
1829
1829 ``showtime``
1830 ``showtime``
1830 Show time taken as absolute durations, in addition to percentages.
1831 Show time taken as absolute durations, in addition to percentages.
1831 Only used by the ``hotpath`` format.
1832 Only used by the ``hotpath`` format.
1832 (default: true)
1833 (default: true)
1833
1834
1834 ``progress``
1835 ``progress``
1835 ------------
1836 ------------
1836
1837
1837 Mercurial commands can draw progress bars that are as informative as
1838 Mercurial commands can draw progress bars that are as informative as
1838 possible. Some progress bars only offer indeterminate information, while others
1839 possible. Some progress bars only offer indeterminate information, while others
1839 have a definite end point.
1840 have a definite end point.
1840
1841
1841 ``debug``
1842 ``debug``
1842 Whether to print debug info when updating the progress bar. (default: False)
1843 Whether to print debug info when updating the progress bar. (default: False)
1843
1844
1844 ``delay``
1845 ``delay``
1845 Number of seconds (float) before showing the progress bar. (default: 3)
1846 Number of seconds (float) before showing the progress bar. (default: 3)
1846
1847
1847 ``changedelay``
1848 ``changedelay``
1848 Minimum delay before showing a new topic. When set to less than 3 * refresh,
1849 Minimum delay before showing a new topic. When set to less than 3 * refresh,
1849 that value will be used instead. (default: 1)
1850 that value will be used instead. (default: 1)
1850
1851
1851 ``estimateinterval``
1852 ``estimateinterval``
1852 Maximum sampling interval in seconds for speed and estimated time
1853 Maximum sampling interval in seconds for speed and estimated time
1853 calculation. (default: 60)
1854 calculation. (default: 60)
1854
1855
1855 ``refresh``
1856 ``refresh``
1856 Time in seconds between refreshes of the progress bar. (default: 0.1)
1857 Time in seconds between refreshes of the progress bar. (default: 0.1)
1857
1858
1858 ``format``
1859 ``format``
1859 Format of the progress bar.
1860 Format of the progress bar.
1860
1861
1861 Valid entries for the format field are ``topic``, ``bar``, ``number``,
1862 Valid entries for the format field are ``topic``, ``bar``, ``number``,
1862 ``unit``, ``estimate``, ``speed``, and ``item``. ``item`` defaults to the
1863 ``unit``, ``estimate``, ``speed``, and ``item``. ``item`` defaults to the
1863 last 20 characters of the item, but this can be changed by adding either
1864 last 20 characters of the item, but this can be changed by adding either
1864 ``-<num>`` which would take the last num characters, or ``+<num>`` for the
1865 ``-<num>`` which would take the last num characters, or ``+<num>`` for the
1865 first num characters.
1866 first num characters.
1866
1867
1867 (default: topic bar number estimate)
1868 (default: topic bar number estimate)
1868
1869
1869 ``width``
1870 ``width``
1870 If set, the maximum width of the progress information (that is, min(width,
1871 If set, the maximum width of the progress information (that is, min(width,
1871 term width) will be used).
1872 term width) will be used).
1872
1873
1873 ``clear-complete``
1874 ``clear-complete``
1874 Clear the progress bar after it's done. (default: True)
1875 Clear the progress bar after it's done. (default: True)
1875
1876
1876 ``disable``
1877 ``disable``
1877 If true, don't show a progress bar.
1878 If true, don't show a progress bar.
1878
1879
1879 ``assume-tty``
1880 ``assume-tty``
1880 If true, ALWAYS show a progress bar, unless disable is given.
1881 If true, ALWAYS show a progress bar, unless disable is given.
1881
1882
1882 ``rebase``
1883 ``rebase``
1883 ----------
1884 ----------
1884
1885
1885 ``evolution.allowdivergence``
1886 ``evolution.allowdivergence``
1886 Default to False, when True allow creating divergence when performing
1887 Default to False, when True allow creating divergence when performing
1887 rebase of obsolete changesets.
1888 rebase of obsolete changesets.
1888
1889
1889 ``revsetalias``
1890 ``revsetalias``
1890 ---------------
1891 ---------------
1891
1892
1892 Alias definitions for revsets. See :hg:`help revsets` for details.
1893 Alias definitions for revsets. See :hg:`help revsets` for details.
1893
1894
1894 ``rewrite``
1895 ``rewrite``
1895 -----------
1896 -----------
1896
1897
1897 ``backup-bundle``
1898 ``backup-bundle``
1898 Whether to save stripped changesets to a bundle file. (default: True)
1899 Whether to save stripped changesets to a bundle file. (default: True)
1899
1900
1900 ``update-timestamp``
1901 ``update-timestamp``
1901 If true, updates the date and time of the changeset to current. It is only
1902 If true, updates the date and time of the changeset to current. It is only
1902 applicable for `hg amend`, `hg commit --amend` and `hg uncommit` in the
1903 applicable for `hg amend`, `hg commit --amend` and `hg uncommit` in the
1903 current version.
1904 current version.
1904
1905
1905 ``empty-successor``
1906 ``empty-successor``
1906
1907
1907 Control what happens with empty successors that are the result of rewrite
1908 Control what happens with empty successors that are the result of rewrite
1908 operations. If set to ``skip``, the successor is not created. If set to
1909 operations. If set to ``skip``, the successor is not created. If set to
1909 ``keep``, the empty successor is created and kept.
1910 ``keep``, the empty successor is created and kept.
1910
1911
1911 Currently, only the rebase and absorb commands consider this configuration.
1912 Currently, only the rebase and absorb commands consider this configuration.
1912 (EXPERIMENTAL)
1913 (EXPERIMENTAL)
1913
1914
1914 ``storage``
1915 ``storage``
1915 -----------
1916 -----------
1916
1917
1917 Control the strategy Mercurial uses internally to store history. Options in this
1918 Control the strategy Mercurial uses internally to store history. Options in this
1918 category impact performance and repository size.
1919 category impact performance and repository size.
1919
1920
1920 ``revlog.optimize-delta-parent-choice``
1921 ``revlog.optimize-delta-parent-choice``
1921 When storing a merge revision, both parents will be equally considered as
1922 When storing a merge revision, both parents will be equally considered as
1922 a possible delta base. This results in better delta selection and improved
1923 a possible delta base. This results in better delta selection and improved
1923 revlog compression. This option is enabled by default.
1924 revlog compression. This option is enabled by default.
1924
1925
1925 Turning this option off can result in large increase of repository size for
1926 Turning this option off can result in large increase of repository size for
1926 repository with many merges.
1927 repository with many merges.
1927
1928
1928 ``revlog.reuse-external-delta-parent``
1929 ``revlog.reuse-external-delta-parent``
1929 Control the order in which delta parents are considered when adding new
1930 Control the order in which delta parents are considered when adding new
1930 revisions from an external source.
1931 revisions from an external source.
1931 (typically: apply bundle from `hg pull` or `hg push`).
1932 (typically: apply bundle from `hg pull` or `hg push`).
1932
1933
1933 New revisions are usually provided as a delta against other revisions. By
1934 New revisions are usually provided as a delta against other revisions. By
1934 default, Mercurial will try to reuse this delta first, therefore using the
1935 default, Mercurial will try to reuse this delta first, therefore using the
1935 same "delta parent" as the source. Directly using delta's from the source
1936 same "delta parent" as the source. Directly using delta's from the source
1936 reduces CPU usage and usually speeds up operation. However, in some case,
1937 reduces CPU usage and usually speeds up operation. However, in some case,
1937 the source might have sub-optimal delta bases and forcing their reevaluation
1938 the source might have sub-optimal delta bases and forcing their reevaluation
1938 is useful. For example, pushes from an old client could have sub-optimal
1939 is useful. For example, pushes from an old client could have sub-optimal
1939 delta's parent that the server want to optimize. (lack of general delta, bad
1940 delta's parent that the server want to optimize. (lack of general delta, bad
1940 parents, choice, lack of sparse-revlog, etc).
1941 parents, choice, lack of sparse-revlog, etc).
1941
1942
1942 This option is enabled by default. Turning it off will ensure bad delta
1943 This option is enabled by default. Turning it off will ensure bad delta
1943 parent choices from older client do not propagate to this repository, at
1944 parent choices from older client do not propagate to this repository, at
1944 the cost of a small increase in CPU consumption.
1945 the cost of a small increase in CPU consumption.
1945
1946
1946 Note: this option only control the order in which delta parents are
1947 Note: this option only control the order in which delta parents are
1947 considered. Even when disabled, the existing delta from the source will be
1948 considered. Even when disabled, the existing delta from the source will be
1948 reused if the same delta parent is selected.
1949 reused if the same delta parent is selected.
1949
1950
1950 ``revlog.reuse-external-delta``
1951 ``revlog.reuse-external-delta``
1951 Control the reuse of delta from external source.
1952 Control the reuse of delta from external source.
1952 (typically: apply bundle from `hg pull` or `hg push`).
1953 (typically: apply bundle from `hg pull` or `hg push`).
1953
1954
1954 New revisions are usually provided as a delta against another revision. By
1955 New revisions are usually provided as a delta against another revision. By
1955 default, Mercurial will not recompute the same delta again, trusting
1956 default, Mercurial will not recompute the same delta again, trusting
1956 externally provided deltas. There have been rare cases of small adjustment
1957 externally provided deltas. There have been rare cases of small adjustment
1957 to the diffing algorithm in the past. So in some rare case, recomputing
1958 to the diffing algorithm in the past. So in some rare case, recomputing
1958 delta provided by ancient clients can provides better results. Disabling
1959 delta provided by ancient clients can provides better results. Disabling
1959 this option means going through a full delta recomputation for all incoming
1960 this option means going through a full delta recomputation for all incoming
1960 revisions. It means a large increase in CPU usage and will slow operations
1961 revisions. It means a large increase in CPU usage and will slow operations
1961 down.
1962 down.
1962
1963
1963 This option is enabled by default. When disabled, it also disables the
1964 This option is enabled by default. When disabled, it also disables the
1964 related ``storage.revlog.reuse-external-delta-parent`` option.
1965 related ``storage.revlog.reuse-external-delta-parent`` option.
1965
1966
1966 ``revlog.zlib.level``
1967 ``revlog.zlib.level``
1967 Zlib compression level used when storing data into the repository. Accepted
1968 Zlib compression level used when storing data into the repository. Accepted
1968 Value range from 1 (lowest compression) to 9 (highest compression). Zlib
1969 Value range from 1 (lowest compression) to 9 (highest compression). Zlib
1969 default value is 6.
1970 default value is 6.
1970
1971
1971
1972
1972 ``revlog.zstd.level``
1973 ``revlog.zstd.level``
1973 zstd compression level used when storing data into the repository. Accepted
1974 zstd compression level used when storing data into the repository. Accepted
1974 Value range from 1 (lowest compression) to 22 (highest compression).
1975 Value range from 1 (lowest compression) to 22 (highest compression).
1975 (default 3)
1976 (default 3)
1976
1977
1977 ``server``
1978 ``server``
1978 ----------
1979 ----------
1979
1980
1980 Controls generic server settings.
1981 Controls generic server settings.
1981
1982
1982 ``bookmarks-pushkey-compat``
1983 ``bookmarks-pushkey-compat``
1983 Trigger pushkey hook when being pushed bookmark updates. This config exist
1984 Trigger pushkey hook when being pushed bookmark updates. This config exist
1984 for compatibility purpose (default to True)
1985 for compatibility purpose (default to True)
1985
1986
1986 If you use ``pushkey`` and ``pre-pushkey`` hooks to control bookmark
1987 If you use ``pushkey`` and ``pre-pushkey`` hooks to control bookmark
1987 movement we recommend you migrate them to ``txnclose-bookmark`` and
1988 movement we recommend you migrate them to ``txnclose-bookmark`` and
1988 ``pretxnclose-bookmark``.
1989 ``pretxnclose-bookmark``.
1989
1990
1990 ``compressionengines``
1991 ``compressionengines``
1991 List of compression engines and their relative priority to advertise
1992 List of compression engines and their relative priority to advertise
1992 to clients.
1993 to clients.
1993
1994
1994 The order of compression engines determines their priority, the first
1995 The order of compression engines determines their priority, the first
1995 having the highest priority. If a compression engine is not listed
1996 having the highest priority. If a compression engine is not listed
1996 here, it won't be advertised to clients.
1997 here, it won't be advertised to clients.
1997
1998
1998 If not set (the default), built-in defaults are used. Run
1999 If not set (the default), built-in defaults are used. Run
1999 :hg:`debuginstall` to list available compression engines and their
2000 :hg:`debuginstall` to list available compression engines and their
2000 default wire protocol priority.
2001 default wire protocol priority.
2001
2002
2002 Older Mercurial clients only support zlib compression and this setting
2003 Older Mercurial clients only support zlib compression and this setting
2003 has no effect for legacy clients.
2004 has no effect for legacy clients.
2004
2005
2005 ``uncompressed``
2006 ``uncompressed``
2006 Whether to allow clients to clone a repository using the
2007 Whether to allow clients to clone a repository using the
2007 uncompressed streaming protocol. This transfers about 40% more
2008 uncompressed streaming protocol. This transfers about 40% more
2008 data than a regular clone, but uses less memory and CPU on both
2009 data than a regular clone, but uses less memory and CPU on both
2009 server and client. Over a LAN (100 Mbps or better) or a very fast
2010 server and client. Over a LAN (100 Mbps or better) or a very fast
2010 WAN, an uncompressed streaming clone is a lot faster (~10x) than a
2011 WAN, an uncompressed streaming clone is a lot faster (~10x) than a
2011 regular clone. Over most WAN connections (anything slower than
2012 regular clone. Over most WAN connections (anything slower than
2012 about 6 Mbps), uncompressed streaming is slower, because of the
2013 about 6 Mbps), uncompressed streaming is slower, because of the
2013 extra data transfer overhead. This mode will also temporarily hold
2014 extra data transfer overhead. This mode will also temporarily hold
2014 the write lock while determining what data to transfer.
2015 the write lock while determining what data to transfer.
2015 (default: True)
2016 (default: True)
2016
2017
2017 ``uncompressedallowsecret``
2018 ``uncompressedallowsecret``
2018 Whether to allow stream clones when the repository contains secret
2019 Whether to allow stream clones when the repository contains secret
2019 changesets. (default: False)
2020 changesets. (default: False)
2020
2021
2021 ``preferuncompressed``
2022 ``preferuncompressed``
2022 When set, clients will try to use the uncompressed streaming
2023 When set, clients will try to use the uncompressed streaming
2023 protocol. (default: False)
2024 protocol. (default: False)
2024
2025
2025 ``disablefullbundle``
2026 ``disablefullbundle``
2026 When set, servers will refuse attempts to do pull-based clones.
2027 When set, servers will refuse attempts to do pull-based clones.
2027 If this option is set, ``preferuncompressed`` and/or clone bundles
2028 If this option is set, ``preferuncompressed`` and/or clone bundles
2028 are highly recommended. Partial clones will still be allowed.
2029 are highly recommended. Partial clones will still be allowed.
2029 (default: False)
2030 (default: False)
2030
2031
2031 ``streamunbundle``
2032 ``streamunbundle``
2032 When set, servers will apply data sent from the client directly,
2033 When set, servers will apply data sent from the client directly,
2033 otherwise it will be written to a temporary file first. This option
2034 otherwise it will be written to a temporary file first. This option
2034 effectively prevents concurrent pushes.
2035 effectively prevents concurrent pushes.
2035
2036
2036 ``pullbundle``
2037 ``pullbundle``
2037 When set, the server will check pullbundle.manifest for bundles
2038 When set, the server will check pullbundle.manifest for bundles
2038 covering the requested heads and common nodes. The first matching
2039 covering the requested heads and common nodes. The first matching
2039 entry will be streamed to the client.
2040 entry will be streamed to the client.
2040
2041
2041 For HTTP transport, the stream will still use zlib compression
2042 For HTTP transport, the stream will still use zlib compression
2042 for older clients.
2043 for older clients.
2043
2044
2044 ``concurrent-push-mode``
2045 ``concurrent-push-mode``
2045 Level of allowed race condition between two pushing clients.
2046 Level of allowed race condition between two pushing clients.
2046
2047
2047 - 'strict': push is abort if another client touched the repository
2048 - 'strict': push is abort if another client touched the repository
2048 while the push was preparing.
2049 while the push was preparing.
2049 - 'check-related': push is only aborted if it affects head that got also
2050 - 'check-related': push is only aborted if it affects head that got also
2050 affected while the push was preparing. (default since 5.4)
2051 affected while the push was preparing. (default since 5.4)
2051
2052
2052 'check-related' only takes effect for compatible clients (version
2053 'check-related' only takes effect for compatible clients (version
2053 4.3 and later). Older clients will use 'strict'.
2054 4.3 and later). Older clients will use 'strict'.
2054
2055
2055 ``validate``
2056 ``validate``
2056 Whether to validate the completeness of pushed changesets by
2057 Whether to validate the completeness of pushed changesets by
2057 checking that all new file revisions specified in manifests are
2058 checking that all new file revisions specified in manifests are
2058 present. (default: False)
2059 present. (default: False)
2059
2060
2060 ``maxhttpheaderlen``
2061 ``maxhttpheaderlen``
2061 Instruct HTTP clients not to send request headers longer than this
2062 Instruct HTTP clients not to send request headers longer than this
2062 many bytes. (default: 1024)
2063 many bytes. (default: 1024)
2063
2064
2064 ``bundle1``
2065 ``bundle1``
2065 Whether to allow clients to push and pull using the legacy bundle1
2066 Whether to allow clients to push and pull using the legacy bundle1
2066 exchange format. (default: True)
2067 exchange format. (default: True)
2067
2068
2068 ``bundle1gd``
2069 ``bundle1gd``
2069 Like ``bundle1`` but only used if the repository is using the
2070 Like ``bundle1`` but only used if the repository is using the
2070 *generaldelta* storage format. (default: True)
2071 *generaldelta* storage format. (default: True)
2071
2072
2072 ``bundle1.push``
2073 ``bundle1.push``
2073 Whether to allow clients to push using the legacy bundle1 exchange
2074 Whether to allow clients to push using the legacy bundle1 exchange
2074 format. (default: True)
2075 format. (default: True)
2075
2076
2076 ``bundle1gd.push``
2077 ``bundle1gd.push``
2077 Like ``bundle1.push`` but only used if the repository is using the
2078 Like ``bundle1.push`` but only used if the repository is using the
2078 *generaldelta* storage format. (default: True)
2079 *generaldelta* storage format. (default: True)
2079
2080
2080 ``bundle1.pull``
2081 ``bundle1.pull``
2081 Whether to allow clients to pull using the legacy bundle1 exchange
2082 Whether to allow clients to pull using the legacy bundle1 exchange
2082 format. (default: True)
2083 format. (default: True)
2083
2084
2084 ``bundle1gd.pull``
2085 ``bundle1gd.pull``
2085 Like ``bundle1.pull`` but only used if the repository is using the
2086 Like ``bundle1.pull`` but only used if the repository is using the
2086 *generaldelta* storage format. (default: True)
2087 *generaldelta* storage format. (default: True)
2087
2088
2088 Large repositories using the *generaldelta* storage format should
2089 Large repositories using the *generaldelta* storage format should
2089 consider setting this option because converting *generaldelta*
2090 consider setting this option because converting *generaldelta*
2090 repositories to the exchange format required by the bundle1 data
2091 repositories to the exchange format required by the bundle1 data
2091 format can consume a lot of CPU.
2092 format can consume a lot of CPU.
2092
2093
2093 ``bundle2.stream``
2094 ``bundle2.stream``
2094 Whether to allow clients to pull using the bundle2 streaming protocol.
2095 Whether to allow clients to pull using the bundle2 streaming protocol.
2095 (default: True)
2096 (default: True)
2096
2097
2097 ``zliblevel``
2098 ``zliblevel``
2098 Integer between ``-1`` and ``9`` that controls the zlib compression level
2099 Integer between ``-1`` and ``9`` that controls the zlib compression level
2099 for wire protocol commands that send zlib compressed output (notably the
2100 for wire protocol commands that send zlib compressed output (notably the
2100 commands that send repository history data).
2101 commands that send repository history data).
2101
2102
2102 The default (``-1``) uses the default zlib compression level, which is
2103 The default (``-1``) uses the default zlib compression level, which is
2103 likely equivalent to ``6``. ``0`` means no compression. ``9`` means
2104 likely equivalent to ``6``. ``0`` means no compression. ``9`` means
2104 maximum compression.
2105 maximum compression.
2105
2106
2106 Setting this option allows server operators to make trade-offs between
2107 Setting this option allows server operators to make trade-offs between
2107 bandwidth and CPU used. Lowering the compression lowers CPU utilization
2108 bandwidth and CPU used. Lowering the compression lowers CPU utilization
2108 but sends more bytes to clients.
2109 but sends more bytes to clients.
2109
2110
2110 This option only impacts the HTTP server.
2111 This option only impacts the HTTP server.
2111
2112
2112 ``zstdlevel``
2113 ``zstdlevel``
2113 Integer between ``1`` and ``22`` that controls the zstd compression level
2114 Integer between ``1`` and ``22`` that controls the zstd compression level
2114 for wire protocol commands. ``1`` is the minimal amount of compression and
2115 for wire protocol commands. ``1`` is the minimal amount of compression and
2115 ``22`` is the highest amount of compression.
2116 ``22`` is the highest amount of compression.
2116
2117
2117 The default (``3``) should be significantly faster than zlib while likely
2118 The default (``3``) should be significantly faster than zlib while likely
2118 delivering better compression ratios.
2119 delivering better compression ratios.
2119
2120
2120 This option only impacts the HTTP server.
2121 This option only impacts the HTTP server.
2121
2122
2122 See also ``server.zliblevel``.
2123 See also ``server.zliblevel``.
2123
2124
2124 ``view``
2125 ``view``
2125 Repository filter used when exchanging revisions with the peer.
2126 Repository filter used when exchanging revisions with the peer.
2126
2127
2127 The default view (``served``) excludes secret and hidden changesets.
2128 The default view (``served``) excludes secret and hidden changesets.
2128 Another useful value is ``immutable`` (no draft, secret or hidden
2129 Another useful value is ``immutable`` (no draft, secret or hidden
2129 changesets). (EXPERIMENTAL)
2130 changesets). (EXPERIMENTAL)
2130
2131
2131 ``smtp``
2132 ``smtp``
2132 --------
2133 --------
2133
2134
2134 Configuration for extensions that need to send email messages.
2135 Configuration for extensions that need to send email messages.
2135
2136
2136 ``host``
2137 ``host``
2137 Host name of mail server, e.g. "mail.example.com".
2138 Host name of mail server, e.g. "mail.example.com".
2138
2139
2139 ``port``
2140 ``port``
2140 Optional. Port to connect to on mail server. (default: 465 if
2141 Optional. Port to connect to on mail server. (default: 465 if
2141 ``tls`` is smtps; 25 otherwise)
2142 ``tls`` is smtps; 25 otherwise)
2142
2143
2143 ``tls``
2144 ``tls``
2144 Optional. Method to enable TLS when connecting to mail server: starttls,
2145 Optional. Method to enable TLS when connecting to mail server: starttls,
2145 smtps or none. (default: none)
2146 smtps or none. (default: none)
2146
2147
2147 ``username``
2148 ``username``
2148 Optional. User name for authenticating with the SMTP server.
2149 Optional. User name for authenticating with the SMTP server.
2149 (default: None)
2150 (default: None)
2150
2151
2151 ``password``
2152 ``password``
2152 Optional. Password for authenticating with the SMTP server. If not
2153 Optional. Password for authenticating with the SMTP server. If not
2153 specified, interactive sessions will prompt the user for a
2154 specified, interactive sessions will prompt the user for a
2154 password; non-interactive sessions will fail. (default: None)
2155 password; non-interactive sessions will fail. (default: None)
2155
2156
2156 ``local_hostname``
2157 ``local_hostname``
2157 Optional. The hostname that the sender can use to identify
2158 Optional. The hostname that the sender can use to identify
2158 itself to the MTA.
2159 itself to the MTA.
2159
2160
2160
2161
2161 ``subpaths``
2162 ``subpaths``
2162 ------------
2163 ------------
2163
2164
2164 Subrepository source URLs can go stale if a remote server changes name
2165 Subrepository source URLs can go stale if a remote server changes name
2165 or becomes temporarily unavailable. This section lets you define
2166 or becomes temporarily unavailable. This section lets you define
2166 rewrite rules of the form::
2167 rewrite rules of the form::
2167
2168
2168 <pattern> = <replacement>
2169 <pattern> = <replacement>
2169
2170
2170 where ``pattern`` is a regular expression matching a subrepository
2171 where ``pattern`` is a regular expression matching a subrepository
2171 source URL and ``replacement`` is the replacement string used to
2172 source URL and ``replacement`` is the replacement string used to
2172 rewrite it. Groups can be matched in ``pattern`` and referenced in
2173 rewrite it. Groups can be matched in ``pattern`` and referenced in
2173 ``replacements``. For instance::
2174 ``replacements``. For instance::
2174
2175
2175 http://server/(.*)-hg/ = http://hg.server/\1/
2176 http://server/(.*)-hg/ = http://hg.server/\1/
2176
2177
2177 rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``.
2178 rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``.
2178
2179
2179 Relative subrepository paths are first made absolute, and the
2180 Relative subrepository paths are first made absolute, and the
2180 rewrite rules are then applied on the full (absolute) path. If ``pattern``
2181 rewrite rules are then applied on the full (absolute) path. If ``pattern``
2181 doesn't match the full path, an attempt is made to apply it on the
2182 doesn't match the full path, an attempt is made to apply it on the
2182 relative path alone. The rules are applied in definition order.
2183 relative path alone. The rules are applied in definition order.
2183
2184
2184 ``subrepos``
2185 ``subrepos``
2185 ------------
2186 ------------
2186
2187
2187 This section contains options that control the behavior of the
2188 This section contains options that control the behavior of the
2188 subrepositories feature. See also :hg:`help subrepos`.
2189 subrepositories feature. See also :hg:`help subrepos`.
2189
2190
2190 Security note: auditing in Mercurial is known to be insufficient to
2191 Security note: auditing in Mercurial is known to be insufficient to
2191 prevent clone-time code execution with carefully constructed Git
2192 prevent clone-time code execution with carefully constructed Git
2192 subrepos. It is unknown if a similar detect is present in Subversion
2193 subrepos. It is unknown if a similar detect is present in Subversion
2193 subrepos. Both Git and Subversion subrepos are disabled by default
2194 subrepos. Both Git and Subversion subrepos are disabled by default
2194 out of security concerns. These subrepo types can be enabled using
2195 out of security concerns. These subrepo types can be enabled using
2195 the respective options below.
2196 the respective options below.
2196
2197
2197 ``allowed``
2198 ``allowed``
2198 Whether subrepositories are allowed in the working directory.
2199 Whether subrepositories are allowed in the working directory.
2199
2200
2200 When false, commands involving subrepositories (like :hg:`update`)
2201 When false, commands involving subrepositories (like :hg:`update`)
2201 will fail for all subrepository types.
2202 will fail for all subrepository types.
2202 (default: true)
2203 (default: true)
2203
2204
2204 ``hg:allowed``
2205 ``hg:allowed``
2205 Whether Mercurial subrepositories are allowed in the working
2206 Whether Mercurial subrepositories are allowed in the working
2206 directory. This option only has an effect if ``subrepos.allowed``
2207 directory. This option only has an effect if ``subrepos.allowed``
2207 is true.
2208 is true.
2208 (default: true)
2209 (default: true)
2209
2210
2210 ``git:allowed``
2211 ``git:allowed``
2211 Whether Git subrepositories are allowed in the working directory.
2212 Whether Git subrepositories are allowed in the working directory.
2212 This option only has an effect if ``subrepos.allowed`` is true.
2213 This option only has an effect if ``subrepos.allowed`` is true.
2213
2214
2214 See the security note above before enabling Git subrepos.
2215 See the security note above before enabling Git subrepos.
2215 (default: false)
2216 (default: false)
2216
2217
2217 ``svn:allowed``
2218 ``svn:allowed``
2218 Whether Subversion subrepositories are allowed in the working
2219 Whether Subversion subrepositories are allowed in the working
2219 directory. This option only has an effect if ``subrepos.allowed``
2220 directory. This option only has an effect if ``subrepos.allowed``
2220 is true.
2221 is true.
2221
2222
2222 See the security note above before enabling Subversion subrepos.
2223 See the security note above before enabling Subversion subrepos.
2223 (default: false)
2224 (default: false)
2224
2225
2225 ``templatealias``
2226 ``templatealias``
2226 -----------------
2227 -----------------
2227
2228
2228 Alias definitions for templates. See :hg:`help templates` for details.
2229 Alias definitions for templates. See :hg:`help templates` for details.
2229
2230
2230 ``templates``
2231 ``templates``
2231 -------------
2232 -------------
2232
2233
2233 Use the ``[templates]`` section to define template strings.
2234 Use the ``[templates]`` section to define template strings.
2234 See :hg:`help templates` for details.
2235 See :hg:`help templates` for details.
2235
2236
2236 ``trusted``
2237 ``trusted``
2237 -----------
2238 -----------
2238
2239
2239 Mercurial will not use the settings in the
2240 Mercurial will not use the settings in the
2240 ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
2241 ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
2241 user or to a trusted group, as various hgrc features allow arbitrary
2242 user or to a trusted group, as various hgrc features allow arbitrary
2242 commands to be run. This issue is often encountered when configuring
2243 commands to be run. This issue is often encountered when configuring
2243 hooks or extensions for shared repositories or servers. However,
2244 hooks or extensions for shared repositories or servers. However,
2244 the web interface will use some safe settings from the ``[web]``
2245 the web interface will use some safe settings from the ``[web]``
2245 section.
2246 section.
2246
2247
2247 This section specifies what users and groups are trusted. The
2248 This section specifies what users and groups are trusted. The
2248 current user is always trusted. To trust everybody, list a user or a
2249 current user is always trusted. To trust everybody, list a user or a
2249 group with name ``*``. These settings must be placed in an
2250 group with name ``*``. These settings must be placed in an
2250 *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the
2251 *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the
2251 user or service running Mercurial.
2252 user or service running Mercurial.
2252
2253
2253 ``users``
2254 ``users``
2254 Comma-separated list of trusted users.
2255 Comma-separated list of trusted users.
2255
2256
2256 ``groups``
2257 ``groups``
2257 Comma-separated list of trusted groups.
2258 Comma-separated list of trusted groups.
2258
2259
2259
2260
2260 ``ui``
2261 ``ui``
2261 ------
2262 ------
2262
2263
2263 User interface controls.
2264 User interface controls.
2264
2265
2265 ``archivemeta``
2266 ``archivemeta``
2266 Whether to include the .hg_archival.txt file containing meta data
2267 Whether to include the .hg_archival.txt file containing meta data
2267 (hashes for the repository base and for tip) in archives created
2268 (hashes for the repository base and for tip) in archives created
2268 by the :hg:`archive` command or downloaded via hgweb.
2269 by the :hg:`archive` command or downloaded via hgweb.
2269 (default: True)
2270 (default: True)
2270
2271
2271 ``askusername``
2272 ``askusername``
2272 Whether to prompt for a username when committing. If True, and
2273 Whether to prompt for a username when committing. If True, and
2273 neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
2274 neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
2274 be prompted to enter a username. If no username is entered, the
2275 be prompted to enter a username. If no username is entered, the
2275 default ``USER@HOST`` is used instead.
2276 default ``USER@HOST`` is used instead.
2276 (default: False)
2277 (default: False)
2277
2278
2278 ``clonebundles``
2279 ``clonebundles``
2279 Whether the "clone bundles" feature is enabled.
2280 Whether the "clone bundles" feature is enabled.
2280
2281
2281 When enabled, :hg:`clone` may download and apply a server-advertised
2282 When enabled, :hg:`clone` may download and apply a server-advertised
2282 bundle file from a URL instead of using the normal exchange mechanism.
2283 bundle file from a URL instead of using the normal exchange mechanism.
2283
2284
2284 This can likely result in faster and more reliable clones.
2285 This can likely result in faster and more reliable clones.
2285
2286
2286 (default: True)
2287 (default: True)
2287
2288
2288 ``clonebundlefallback``
2289 ``clonebundlefallback``
2289 Whether failure to apply an advertised "clone bundle" from a server
2290 Whether failure to apply an advertised "clone bundle" from a server
2290 should result in fallback to a regular clone.
2291 should result in fallback to a regular clone.
2291
2292
2292 This is disabled by default because servers advertising "clone
2293 This is disabled by default because servers advertising "clone
2293 bundles" often do so to reduce server load. If advertised bundles
2294 bundles" often do so to reduce server load. If advertised bundles
2294 start mass failing and clients automatically fall back to a regular
2295 start mass failing and clients automatically fall back to a regular
2295 clone, this would add significant and unexpected load to the server
2296 clone, this would add significant and unexpected load to the server
2296 since the server is expecting clone operations to be offloaded to
2297 since the server is expecting clone operations to be offloaded to
2297 pre-generated bundles. Failing fast (the default behavior) ensures
2298 pre-generated bundles. Failing fast (the default behavior) ensures
2298 clients don't overwhelm the server when "clone bundle" application
2299 clients don't overwhelm the server when "clone bundle" application
2299 fails.
2300 fails.
2300
2301
2301 (default: False)
2302 (default: False)
2302
2303
2303 ``clonebundleprefers``
2304 ``clonebundleprefers``
2304 Defines preferences for which "clone bundles" to use.
2305 Defines preferences for which "clone bundles" to use.
2305
2306
2306 Servers advertising "clone bundles" may advertise multiple available
2307 Servers advertising "clone bundles" may advertise multiple available
2307 bundles. Each bundle may have different attributes, such as the bundle
2308 bundles. Each bundle may have different attributes, such as the bundle
2308 type and compression format. This option is used to prefer a particular
2309 type and compression format. This option is used to prefer a particular
2309 bundle over another.
2310 bundle over another.
2310
2311
2311 The following keys are defined by Mercurial:
2312 The following keys are defined by Mercurial:
2312
2313
2313 BUNDLESPEC
2314 BUNDLESPEC
2314 A bundle type specifier. These are strings passed to :hg:`bundle -t`.
2315 A bundle type specifier. These are strings passed to :hg:`bundle -t`.
2315 e.g. ``gzip-v2`` or ``bzip2-v1``.
2316 e.g. ``gzip-v2`` or ``bzip2-v1``.
2316
2317
2317 COMPRESSION
2318 COMPRESSION
2318 The compression format of the bundle. e.g. ``gzip`` and ``bzip2``.
2319 The compression format of the bundle. e.g. ``gzip`` and ``bzip2``.
2319
2320
2320 Server operators may define custom keys.
2321 Server operators may define custom keys.
2321
2322
2322 Example values: ``COMPRESSION=bzip2``,
2323 Example values: ``COMPRESSION=bzip2``,
2323 ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``.
2324 ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``.
2324
2325
2325 By default, the first bundle advertised by the server is used.
2326 By default, the first bundle advertised by the server is used.
2326
2327
2327 ``color``
2328 ``color``
2328 When to colorize output. Possible value are Boolean ("yes" or "no"), or
2329 When to colorize output. Possible value are Boolean ("yes" or "no"), or
2329 "debug", or "always". (default: "yes"). "yes" will use color whenever it
2330 "debug", or "always". (default: "yes"). "yes" will use color whenever it
2330 seems possible. See :hg:`help color` for details.
2331 seems possible. See :hg:`help color` for details.
2331
2332
2332 ``commitsubrepos``
2333 ``commitsubrepos``
2333 Whether to commit modified subrepositories when committing the
2334 Whether to commit modified subrepositories when committing the
2334 parent repository. If False and one subrepository has uncommitted
2335 parent repository. If False and one subrepository has uncommitted
2335 changes, abort the commit.
2336 changes, abort the commit.
2336 (default: False)
2337 (default: False)
2337
2338
2338 ``debug``
2339 ``debug``
2339 Print debugging information. (default: False)
2340 Print debugging information. (default: False)
2340
2341
2341 ``editor``
2342 ``editor``
2342 The editor to use during a commit. (default: ``$EDITOR`` or ``vi``)
2343 The editor to use during a commit. (default: ``$EDITOR`` or ``vi``)
2343
2344
2344 ``fallbackencoding``
2345 ``fallbackencoding``
2345 Encoding to try if it's not possible to decode the changelog using
2346 Encoding to try if it's not possible to decode the changelog using
2346 UTF-8. (default: ISO-8859-1)
2347 UTF-8. (default: ISO-8859-1)
2347
2348
2348 ``graphnodetemplate``
2349 ``graphnodetemplate``
2349 (DEPRECATED) Use ``command-templates.graphnode`` instead.
2350 (DEPRECATED) Use ``command-templates.graphnode`` instead.
2350
2351
2351 ``ignore``
2352 ``ignore``
2352 A file to read per-user ignore patterns from. This file should be
2353 A file to read per-user ignore patterns from. This file should be
2353 in the same format as a repository-wide .hgignore file. Filenames
2354 in the same format as a repository-wide .hgignore file. Filenames
2354 are relative to the repository root. This option supports hook syntax,
2355 are relative to the repository root. This option supports hook syntax,
2355 so if you want to specify multiple ignore files, you can do so by
2356 so if you want to specify multiple ignore files, you can do so by
2356 setting something like ``ignore.other = ~/.hgignore2``. For details
2357 setting something like ``ignore.other = ~/.hgignore2``. For details
2357 of the ignore file format, see the ``hgignore(5)`` man page.
2358 of the ignore file format, see the ``hgignore(5)`` man page.
2358
2359
2359 ``interactive``
2360 ``interactive``
2360 Allow to prompt the user. (default: True)
2361 Allow to prompt the user. (default: True)
2361
2362
2362 ``interface``
2363 ``interface``
2363 Select the default interface for interactive features (default: text).
2364 Select the default interface for interactive features (default: text).
2364 Possible values are 'text' and 'curses'.
2365 Possible values are 'text' and 'curses'.
2365
2366
2366 ``interface.chunkselector``
2367 ``interface.chunkselector``
2367 Select the interface for change recording (e.g. :hg:`commit -i`).
2368 Select the interface for change recording (e.g. :hg:`commit -i`).
2368 Possible values are 'text' and 'curses'.
2369 Possible values are 'text' and 'curses'.
2369 This config overrides the interface specified by ui.interface.
2370 This config overrides the interface specified by ui.interface.
2370
2371
2371 ``large-file-limit``
2372 ``large-file-limit``
2372 Largest file size that gives no memory use warning.
2373 Largest file size that gives no memory use warning.
2373 Possible values are integers or 0 to disable the check.
2374 Possible values are integers or 0 to disable the check.
2374 (default: 10000000)
2375 (default: 10000000)
2375
2376
2376 ``logtemplate``
2377 ``logtemplate``
2377 (DEPRECATED) Use ``command-templates.log`` instead.
2378 (DEPRECATED) Use ``command-templates.log`` instead.
2378
2379
2379 ``merge``
2380 ``merge``
2380 The conflict resolution program to use during a manual merge.
2381 The conflict resolution program to use during a manual merge.
2381 For more information on merge tools see :hg:`help merge-tools`.
2382 For more information on merge tools see :hg:`help merge-tools`.
2382 For configuring merge tools see the ``[merge-tools]`` section.
2383 For configuring merge tools see the ``[merge-tools]`` section.
2383
2384
2384 ``mergemarkers``
2385 ``mergemarkers``
2385 Sets the merge conflict marker label styling. The ``detailed`` style
2386 Sets the merge conflict marker label styling. The ``detailed`` style
2386 uses the ``command-templates.mergemarker`` setting to style the labels.
2387 uses the ``command-templates.mergemarker`` setting to style the labels.
2387 The ``basic`` style just uses 'local' and 'other' as the marker label.
2388 The ``basic`` style just uses 'local' and 'other' as the marker label.
2388 One of ``basic`` or ``detailed``.
2389 One of ``basic`` or ``detailed``.
2389 (default: ``basic``)
2390 (default: ``basic``)
2390
2391
2391 ``mergemarkertemplate``
2392 ``mergemarkertemplate``
2392 (DEPRECATED) Use ``command-templates.mergemarker`` instead.
2393 (DEPRECATED) Use ``command-templates.mergemarker`` instead.
2393
2394
2394 ``message-output``
2395 ``message-output``
2395 Where to write status and error messages. (default: ``stdio``)
2396 Where to write status and error messages. (default: ``stdio``)
2396
2397
2397 ``channel``
2398 ``channel``
2398 Use separate channel for structured output. (Command-server only)
2399 Use separate channel for structured output. (Command-server only)
2399 ``stderr``
2400 ``stderr``
2400 Everything to stderr.
2401 Everything to stderr.
2401 ``stdio``
2402 ``stdio``
2402 Status to stdout, and error to stderr.
2403 Status to stdout, and error to stderr.
2403
2404
2404 ``origbackuppath``
2405 ``origbackuppath``
2405 The path to a directory used to store generated .orig files. If the path is
2406 The path to a directory used to store generated .orig files. If the path is
2406 not a directory, one will be created. If set, files stored in this
2407 not a directory, one will be created. If set, files stored in this
2407 directory have the same name as the original file and do not have a .orig
2408 directory have the same name as the original file and do not have a .orig
2408 suffix.
2409 suffix.
2409
2410
2410 ``paginate``
2411 ``paginate``
2411 Control the pagination of command output (default: True). See :hg:`help pager`
2412 Control the pagination of command output (default: True). See :hg:`help pager`
2412 for details.
2413 for details.
2413
2414
2414 ``patch``
2415 ``patch``
2415 An optional external tool that ``hg import`` and some extensions
2416 An optional external tool that ``hg import`` and some extensions
2416 will use for applying patches. By default Mercurial uses an
2417 will use for applying patches. By default Mercurial uses an
2417 internal patch utility. The external tool must work as the common
2418 internal patch utility. The external tool must work as the common
2418 Unix ``patch`` program. In particular, it must accept a ``-p``
2419 Unix ``patch`` program. In particular, it must accept a ``-p``
2419 argument to strip patch headers, a ``-d`` argument to specify the
2420 argument to strip patch headers, a ``-d`` argument to specify the
2420 current directory, a file name to patch, and a patch file to take
2421 current directory, a file name to patch, and a patch file to take
2421 from stdin.
2422 from stdin.
2422
2423
2423 It is possible to specify a patch tool together with extra
2424 It is possible to specify a patch tool together with extra
2424 arguments. For example, setting this option to ``patch --merge``
2425 arguments. For example, setting this option to ``patch --merge``
2425 will use the ``patch`` program with its 2-way merge option.
2426 will use the ``patch`` program with its 2-way merge option.
2426
2427
2427 ``portablefilenames``
2428 ``portablefilenames``
2428 Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``.
2429 Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``.
2429 (default: ``warn``)
2430 (default: ``warn``)
2430
2431
2431 ``warn``
2432 ``warn``
2432 Print a warning message on POSIX platforms, if a file with a non-portable
2433 Print a warning message on POSIX platforms, if a file with a non-portable
2433 filename is added (e.g. a file with a name that can't be created on
2434 filename is added (e.g. a file with a name that can't be created on
2434 Windows because it contains reserved parts like ``AUX``, reserved
2435 Windows because it contains reserved parts like ``AUX``, reserved
2435 characters like ``:``, or would cause a case collision with an existing
2436 characters like ``:``, or would cause a case collision with an existing
2436 file).
2437 file).
2437
2438
2438 ``ignore``
2439 ``ignore``
2439 Don't print a warning.
2440 Don't print a warning.
2440
2441
2441 ``abort``
2442 ``abort``
2442 The command is aborted.
2443 The command is aborted.
2443
2444
2444 ``true``
2445 ``true``
2445 Alias for ``warn``.
2446 Alias for ``warn``.
2446
2447
2447 ``false``
2448 ``false``
2448 Alias for ``ignore``.
2449 Alias for ``ignore``.
2449
2450
2450 .. container:: windows
2451 .. container:: windows
2451
2452
2452 On Windows, this configuration option is ignored and the command aborted.
2453 On Windows, this configuration option is ignored and the command aborted.
2453
2454
2454 ``pre-merge-tool-output-template``
2455 ``pre-merge-tool-output-template``
2455 (DEPRECATED) Use ``command-template.pre-merge-tool-output`` instead.
2456 (DEPRECATED) Use ``command-template.pre-merge-tool-output`` instead.
2456
2457
2457 ``quiet``
2458 ``quiet``
2458 Reduce the amount of output printed.
2459 Reduce the amount of output printed.
2459 (default: False)
2460 (default: False)
2460
2461
2461 ``relative-paths``
2462 ``relative-paths``
2462 Prefer relative paths in the UI.
2463 Prefer relative paths in the UI.
2463
2464
2464 ``remotecmd``
2465 ``remotecmd``
2465 Remote command to use for clone/push/pull operations.
2466 Remote command to use for clone/push/pull operations.
2466 (default: ``hg``)
2467 (default: ``hg``)
2467
2468
2468 ``report_untrusted``
2469 ``report_untrusted``
2469 Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
2470 Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
2470 trusted user or group.
2471 trusted user or group.
2471 (default: True)
2472 (default: True)
2472
2473
2473 ``slash``
2474 ``slash``
2474 (Deprecated. Use ``slashpath`` template filter instead.)
2475 (Deprecated. Use ``slashpath`` template filter instead.)
2475
2476
2476 Display paths using a slash (``/``) as the path separator. This
2477 Display paths using a slash (``/``) as the path separator. This
2477 only makes a difference on systems where the default path
2478 only makes a difference on systems where the default path
2478 separator is not the slash character (e.g. Windows uses the
2479 separator is not the slash character (e.g. Windows uses the
2479 backslash character (``\``)).
2480 backslash character (``\``)).
2480 (default: False)
2481 (default: False)
2481
2482
2482 ``statuscopies``
2483 ``statuscopies``
2483 Display copies in the status command.
2484 Display copies in the status command.
2484
2485
2485 ``ssh``
2486 ``ssh``
2486 Command to use for SSH connections. (default: ``ssh``)
2487 Command to use for SSH connections. (default: ``ssh``)
2487
2488
2488 ``ssherrorhint``
2489 ``ssherrorhint``
2489 A hint shown to the user in the case of SSH error (e.g.
2490 A hint shown to the user in the case of SSH error (e.g.
2490 ``Please see http://company/internalwiki/ssh.html``)
2491 ``Please see http://company/internalwiki/ssh.html``)
2491
2492
2492 ``strict``
2493 ``strict``
2493 Require exact command names, instead of allowing unambiguous
2494 Require exact command names, instead of allowing unambiguous
2494 abbreviations. (default: False)
2495 abbreviations. (default: False)
2495
2496
2496 ``style``
2497 ``style``
2497 Name of style to use for command output.
2498 Name of style to use for command output.
2498
2499
2499 ``supportcontact``
2500 ``supportcontact``
2500 A URL where users should report a Mercurial traceback. Use this if you are a
2501 A URL where users should report a Mercurial traceback. Use this if you are a
2501 large organisation with its own Mercurial deployment process and crash
2502 large organisation with its own Mercurial deployment process and crash
2502 reports should be addressed to your internal support.
2503 reports should be addressed to your internal support.
2503
2504
2504 ``textwidth``
2505 ``textwidth``
2505 Maximum width of help text. A longer line generated by ``hg help`` or
2506 Maximum width of help text. A longer line generated by ``hg help`` or
2506 ``hg subcommand --help`` will be broken after white space to get this
2507 ``hg subcommand --help`` will be broken after white space to get this
2507 width or the terminal width, whichever comes first.
2508 width or the terminal width, whichever comes first.
2508 A non-positive value will disable this and the terminal width will be
2509 A non-positive value will disable this and the terminal width will be
2509 used. (default: 78)
2510 used. (default: 78)
2510
2511
2511 ``timeout``
2512 ``timeout``
2512 The timeout used when a lock is held (in seconds), a negative value
2513 The timeout used when a lock is held (in seconds), a negative value
2513 means no timeout. (default: 600)
2514 means no timeout. (default: 600)
2514
2515
2515 ``timeout.warn``
2516 ``timeout.warn``
2516 Time (in seconds) before a warning is printed about held lock. A negative
2517 Time (in seconds) before a warning is printed about held lock. A negative
2517 value means no warning. (default: 0)
2518 value means no warning. (default: 0)
2518
2519
2519 ``traceback``
2520 ``traceback``
2520 Mercurial always prints a traceback when an unknown exception
2521 Mercurial always prints a traceback when an unknown exception
2521 occurs. Setting this to True will make Mercurial print a traceback
2522 occurs. Setting this to True will make Mercurial print a traceback
2522 on all exceptions, even those recognized by Mercurial (such as
2523 on all exceptions, even those recognized by Mercurial (such as
2523 IOError or MemoryError). (default: False)
2524 IOError or MemoryError). (default: False)
2524
2525
2525 ``tweakdefaults``
2526 ``tweakdefaults``
2526
2527
2527 By default Mercurial's behavior changes very little from release
2528 By default Mercurial's behavior changes very little from release
2528 to release, but over time the recommended config settings
2529 to release, but over time the recommended config settings
2529 shift. Enable this config to opt in to get automatic tweaks to
2530 shift. Enable this config to opt in to get automatic tweaks to
2530 Mercurial's behavior over time. This config setting will have no
2531 Mercurial's behavior over time. This config setting will have no
2531 effect if ``HGPLAIN`` is set or ``HGPLAINEXCEPT`` is set and does
2532 effect if ``HGPLAIN`` is set or ``HGPLAINEXCEPT`` is set and does
2532 not include ``tweakdefaults``. (default: False)
2533 not include ``tweakdefaults``. (default: False)
2533
2534
2534 It currently means::
2535 It currently means::
2535
2536
2536 .. tweakdefaultsmarker
2537 .. tweakdefaultsmarker
2537
2538
2538 ``username``
2539 ``username``
2539 The committer of a changeset created when running "commit".
2540 The committer of a changeset created when running "commit".
2540 Typically a person's name and email address, e.g. ``Fred Widget
2541 Typically a person's name and email address, e.g. ``Fred Widget
2541 <fred@example.com>``. Environment variables in the
2542 <fred@example.com>``. Environment variables in the
2542 username are expanded.
2543 username are expanded.
2543
2544
2544 (default: ``$EMAIL`` or ``username@hostname``. If the username in
2545 (default: ``$EMAIL`` or ``username@hostname``. If the username in
2545 hgrc is empty, e.g. if the system admin set ``username =`` in the
2546 hgrc is empty, e.g. if the system admin set ``username =`` in the
2546 system hgrc, it has to be specified manually or in a different
2547 system hgrc, it has to be specified manually or in a different
2547 hgrc file)
2548 hgrc file)
2548
2549
2549 ``verbose``
2550 ``verbose``
2550 Increase the amount of output printed. (default: False)
2551 Increase the amount of output printed. (default: False)
2551
2552
2552
2553
2553 ``command-templates``
2554 ``command-templates``
2554 ---------------------
2555 ---------------------
2555
2556
2556 Templates used for customizing the output of commands.
2557 Templates used for customizing the output of commands.
2557
2558
2558 ``graphnode``
2559 ``graphnode``
2559 The template used to print changeset nodes in an ASCII revision graph.
2560 The template used to print changeset nodes in an ASCII revision graph.
2560 (default: ``{graphnode}``)
2561 (default: ``{graphnode}``)
2561
2562
2562 ``log``
2563 ``log``
2563 Template string for commands that print changesets.
2564 Template string for commands that print changesets.
2564
2565
2565 ``mergemarker``
2566 ``mergemarker``
2566 The template used to print the commit description next to each conflict
2567 The template used to print the commit description next to each conflict
2567 marker during merge conflicts. See :hg:`help templates` for the template
2568 marker during merge conflicts. See :hg:`help templates` for the template
2568 format.
2569 format.
2569
2570
2570 Defaults to showing the hash, tags, branches, bookmarks, author, and
2571 Defaults to showing the hash, tags, branches, bookmarks, author, and
2571 the first line of the commit description.
2572 the first line of the commit description.
2572
2573
2573 If you use non-ASCII characters in names for tags, branches, bookmarks,
2574 If you use non-ASCII characters in names for tags, branches, bookmarks,
2574 authors, and/or commit descriptions, you must pay attention to encodings of
2575 authors, and/or commit descriptions, you must pay attention to encodings of
2575 managed files. At template expansion, non-ASCII characters use the encoding
2576 managed files. At template expansion, non-ASCII characters use the encoding
2576 specified by the ``--encoding`` global option, ``HGENCODING`` or other
2577 specified by the ``--encoding`` global option, ``HGENCODING`` or other
2577 environment variables that govern your locale. If the encoding of the merge
2578 environment variables that govern your locale. If the encoding of the merge
2578 markers is different from the encoding of the merged files,
2579 markers is different from the encoding of the merged files,
2579 serious problems may occur.
2580 serious problems may occur.
2580
2581
2581 Can be overridden per-merge-tool, see the ``[merge-tools]`` section.
2582 Can be overridden per-merge-tool, see the ``[merge-tools]`` section.
2582
2583
2583 ``oneline-summary``
2584 ``oneline-summary``
2584 A template used by `hg rebase` and other commands for showing a one-line
2585 A template used by `hg rebase` and other commands for showing a one-line
2585 summary of a commit. If the template configured here is longer than one
2586 summary of a commit. If the template configured here is longer than one
2586 line, then only the first line is used.
2587 line, then only the first line is used.
2587
2588
2588 The template can be overridden per command by defining a template in
2589 The template can be overridden per command by defining a template in
2589 `oneline-summary.<command>`, where `<command>` can be e.g. "rebase".
2590 `oneline-summary.<command>`, where `<command>` can be e.g. "rebase".
2590
2591
2591 ``pre-merge-tool-output``
2592 ``pre-merge-tool-output``
2592 A template that is printed before executing an external merge tool. This can
2593 A template that is printed before executing an external merge tool. This can
2593 be used to print out additional context that might be useful to have during
2594 be used to print out additional context that might be useful to have during
2594 the conflict resolution, such as the description of the various commits
2595 the conflict resolution, such as the description of the various commits
2595 involved or bookmarks/tags.
2596 involved or bookmarks/tags.
2596
2597
2597 Additional information is available in the ``local`, ``base``, and ``other``
2598 Additional information is available in the ``local`, ``base``, and ``other``
2598 dicts. For example: ``{local.label}``, ``{base.name}``, or
2599 dicts. For example: ``{local.label}``, ``{base.name}``, or
2599 ``{other.islink}``.
2600 ``{other.islink}``.
2600
2601
2601
2602
2602 ``web``
2603 ``web``
2603 -------
2604 -------
2604
2605
2605 Web interface configuration. The settings in this section apply to
2606 Web interface configuration. The settings in this section apply to
2606 both the builtin webserver (started by :hg:`serve`) and the script you
2607 both the builtin webserver (started by :hg:`serve`) and the script you
2607 run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI
2608 run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI
2608 and WSGI).
2609 and WSGI).
2609
2610
2610 The Mercurial webserver does no authentication (it does not prompt for
2611 The Mercurial webserver does no authentication (it does not prompt for
2611 usernames and passwords to validate *who* users are), but it does do
2612 usernames and passwords to validate *who* users are), but it does do
2612 authorization (it grants or denies access for *authenticated users*
2613 authorization (it grants or denies access for *authenticated users*
2613 based on settings in this section). You must either configure your
2614 based on settings in this section). You must either configure your
2614 webserver to do authentication for you, or disable the authorization
2615 webserver to do authentication for you, or disable the authorization
2615 checks.
2616 checks.
2616
2617
2617 For a quick setup in a trusted environment, e.g., a private LAN, where
2618 For a quick setup in a trusted environment, e.g., a private LAN, where
2618 you want it to accept pushes from anybody, you can use the following
2619 you want it to accept pushes from anybody, you can use the following
2619 command line::
2620 command line::
2620
2621
2621 $ hg --config web.allow-push=* --config web.push_ssl=False serve
2622 $ hg --config web.allow-push=* --config web.push_ssl=False serve
2622
2623
2623 Note that this will allow anybody to push anything to the server and
2624 Note that this will allow anybody to push anything to the server and
2624 that this should not be used for public servers.
2625 that this should not be used for public servers.
2625
2626
2626 The full set of options is:
2627 The full set of options is:
2627
2628
2628 ``accesslog``
2629 ``accesslog``
2629 Where to output the access log. (default: stdout)
2630 Where to output the access log. (default: stdout)
2630
2631
2631 ``address``
2632 ``address``
2632 Interface address to bind to. (default: all)
2633 Interface address to bind to. (default: all)
2633
2634
2634 ``allow-archive``
2635 ``allow-archive``
2635 List of archive format (bz2, gz, zip) allowed for downloading.
2636 List of archive format (bz2, gz, zip) allowed for downloading.
2636 (default: empty)
2637 (default: empty)
2637
2638
2638 ``allowbz2``
2639 ``allowbz2``
2639 (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
2640 (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
2640 revisions.
2641 revisions.
2641 (default: False)
2642 (default: False)
2642
2643
2643 ``allowgz``
2644 ``allowgz``
2644 (DEPRECATED) Whether to allow .tar.gz downloading of repository
2645 (DEPRECATED) Whether to allow .tar.gz downloading of repository
2645 revisions.
2646 revisions.
2646 (default: False)
2647 (default: False)
2647
2648
2648 ``allow-pull``
2649 ``allow-pull``
2649 Whether to allow pulling from the repository. (default: True)
2650 Whether to allow pulling from the repository. (default: True)
2650
2651
2651 ``allow-push``
2652 ``allow-push``
2652 Whether to allow pushing to the repository. If empty or not set,
2653 Whether to allow pushing to the repository. If empty or not set,
2653 pushing is not allowed. If the special value ``*``, any remote
2654 pushing is not allowed. If the special value ``*``, any remote
2654 user can push, including unauthenticated users. Otherwise, the
2655 user can push, including unauthenticated users. Otherwise, the
2655 remote user must have been authenticated, and the authenticated
2656 remote user must have been authenticated, and the authenticated
2656 user name must be present in this list. The contents of the
2657 user name must be present in this list. The contents of the
2657 allow-push list are examined after the deny_push list.
2658 allow-push list are examined after the deny_push list.
2658
2659
2659 ``allow_read``
2660 ``allow_read``
2660 If the user has not already been denied repository access due to
2661 If the user has not already been denied repository access due to
2661 the contents of deny_read, this list determines whether to grant
2662 the contents of deny_read, this list determines whether to grant
2662 repository access to the user. If this list is not empty, and the
2663 repository access to the user. If this list is not empty, and the
2663 user is unauthenticated or not present in the list, then access is
2664 user is unauthenticated or not present in the list, then access is
2664 denied for the user. If the list is empty or not set, then access
2665 denied for the user. If the list is empty or not set, then access
2665 is permitted to all users by default. Setting allow_read to the
2666 is permitted to all users by default. Setting allow_read to the
2666 special value ``*`` is equivalent to it not being set (i.e. access
2667 special value ``*`` is equivalent to it not being set (i.e. access
2667 is permitted to all users). The contents of the allow_read list are
2668 is permitted to all users). The contents of the allow_read list are
2668 examined after the deny_read list.
2669 examined after the deny_read list.
2669
2670
2670 ``allowzip``
2671 ``allowzip``
2671 (DEPRECATED) Whether to allow .zip downloading of repository
2672 (DEPRECATED) Whether to allow .zip downloading of repository
2672 revisions. This feature creates temporary files.
2673 revisions. This feature creates temporary files.
2673 (default: False)
2674 (default: False)
2674
2675
2675 ``archivesubrepos``
2676 ``archivesubrepos``
2676 Whether to recurse into subrepositories when archiving.
2677 Whether to recurse into subrepositories when archiving.
2677 (default: False)
2678 (default: False)
2678
2679
2679 ``baseurl``
2680 ``baseurl``
2680 Base URL to use when publishing URLs in other locations, so
2681 Base URL to use when publishing URLs in other locations, so
2681 third-party tools like email notification hooks can construct
2682 third-party tools like email notification hooks can construct
2682 URLs. Example: ``http://hgserver/repos/``.
2683 URLs. Example: ``http://hgserver/repos/``.
2683
2684
2684 ``cacerts``
2685 ``cacerts``
2685 Path to file containing a list of PEM encoded certificate
2686 Path to file containing a list of PEM encoded certificate
2686 authority certificates. Environment variables and ``~user``
2687 authority certificates. Environment variables and ``~user``
2687 constructs are expanded in the filename. If specified on the
2688 constructs are expanded in the filename. If specified on the
2688 client, then it will verify the identity of remote HTTPS servers
2689 client, then it will verify the identity of remote HTTPS servers
2689 with these certificates.
2690 with these certificates.
2690
2691
2691 To disable SSL verification temporarily, specify ``--insecure`` from
2692 To disable SSL verification temporarily, specify ``--insecure`` from
2692 command line.
2693 command line.
2693
2694
2694 You can use OpenSSL's CA certificate file if your platform has
2695 You can use OpenSSL's CA certificate file if your platform has
2695 one. On most Linux systems this will be
2696 one. On most Linux systems this will be
2696 ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to
2697 ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to
2697 generate this file manually. The form must be as follows::
2698 generate this file manually. The form must be as follows::
2698
2699
2699 -----BEGIN CERTIFICATE-----
2700 -----BEGIN CERTIFICATE-----
2700 ... (certificate in base64 PEM encoding) ...
2701 ... (certificate in base64 PEM encoding) ...
2701 -----END CERTIFICATE-----
2702 -----END CERTIFICATE-----
2702 -----BEGIN CERTIFICATE-----
2703 -----BEGIN CERTIFICATE-----
2703 ... (certificate in base64 PEM encoding) ...
2704 ... (certificate in base64 PEM encoding) ...
2704 -----END CERTIFICATE-----
2705 -----END CERTIFICATE-----
2705
2706
2706 ``cache``
2707 ``cache``
2707 Whether to support caching in hgweb. (default: True)
2708 Whether to support caching in hgweb. (default: True)
2708
2709
2709 ``certificate``
2710 ``certificate``
2710 Certificate to use when running :hg:`serve`.
2711 Certificate to use when running :hg:`serve`.
2711
2712
2712 ``collapse``
2713 ``collapse``
2713 With ``descend`` enabled, repositories in subdirectories are shown at
2714 With ``descend`` enabled, repositories in subdirectories are shown at
2714 a single level alongside repositories in the current path. With
2715 a single level alongside repositories in the current path. With
2715 ``collapse`` also enabled, repositories residing at a deeper level than
2716 ``collapse`` also enabled, repositories residing at a deeper level than
2716 the current path are grouped behind navigable directory entries that
2717 the current path are grouped behind navigable directory entries that
2717 lead to the locations of these repositories. In effect, this setting
2718 lead to the locations of these repositories. In effect, this setting
2718 collapses each collection of repositories found within a subdirectory
2719 collapses each collection of repositories found within a subdirectory
2719 into a single entry for that subdirectory. (default: False)
2720 into a single entry for that subdirectory. (default: False)
2720
2721
2721 ``comparisoncontext``
2722 ``comparisoncontext``
2722 Number of lines of context to show in side-by-side file comparison. If
2723 Number of lines of context to show in side-by-side file comparison. If
2723 negative or the value ``full``, whole files are shown. (default: 5)
2724 negative or the value ``full``, whole files are shown. (default: 5)
2724
2725
2725 This setting can be overridden by a ``context`` request parameter to the
2726 This setting can be overridden by a ``context`` request parameter to the
2726 ``comparison`` command, taking the same values.
2727 ``comparison`` command, taking the same values.
2727
2728
2728 ``contact``
2729 ``contact``
2729 Name or email address of the person in charge of the repository.
2730 Name or email address of the person in charge of the repository.
2730 (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty)
2731 (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty)
2731
2732
2732 ``csp``
2733 ``csp``
2733 Send a ``Content-Security-Policy`` HTTP header with this value.
2734 Send a ``Content-Security-Policy`` HTTP header with this value.
2734
2735
2735 The value may contain a special string ``%nonce%``, which will be replaced
2736 The value may contain a special string ``%nonce%``, which will be replaced
2736 by a randomly-generated one-time use value. If the value contains
2737 by a randomly-generated one-time use value. If the value contains
2737 ``%nonce%``, ``web.cache`` will be disabled, as caching undermines the
2738 ``%nonce%``, ``web.cache`` will be disabled, as caching undermines the
2738 one-time property of the nonce. This nonce will also be inserted into
2739 one-time property of the nonce. This nonce will also be inserted into
2739 ``<script>`` elements containing inline JavaScript.
2740 ``<script>`` elements containing inline JavaScript.
2740
2741
2741 Note: lots of HTML content sent by the server is derived from repository
2742 Note: lots of HTML content sent by the server is derived from repository
2742 data. Please consider the potential for malicious repository data to
2743 data. Please consider the potential for malicious repository data to
2743 "inject" itself into generated HTML content as part of your security
2744 "inject" itself into generated HTML content as part of your security
2744 threat model.
2745 threat model.
2745
2746
2746 ``deny_push``
2747 ``deny_push``
2747 Whether to deny pushing to the repository. If empty or not set,
2748 Whether to deny pushing to the repository. If empty or not set,
2748 push is not denied. If the special value ``*``, all remote users are
2749 push is not denied. If the special value ``*``, all remote users are
2749 denied push. Otherwise, unauthenticated users are all denied, and
2750 denied push. Otherwise, unauthenticated users are all denied, and
2750 any authenticated user name present in this list is also denied. The
2751 any authenticated user name present in this list is also denied. The
2751 contents of the deny_push list are examined before the allow-push list.
2752 contents of the deny_push list are examined before the allow-push list.
2752
2753
2753 ``deny_read``
2754 ``deny_read``
2754 Whether to deny reading/viewing of the repository. If this list is
2755 Whether to deny reading/viewing of the repository. If this list is
2755 not empty, unauthenticated users are all denied, and any
2756 not empty, unauthenticated users are all denied, and any
2756 authenticated user name present in this list is also denied access to
2757 authenticated user name present in this list is also denied access to
2757 the repository. If set to the special value ``*``, all remote users
2758 the repository. If set to the special value ``*``, all remote users
2758 are denied access (rarely needed ;). If deny_read is empty or not set,
2759 are denied access (rarely needed ;). If deny_read is empty or not set,
2759 the determination of repository access depends on the presence and
2760 the determination of repository access depends on the presence and
2760 content of the allow_read list (see description). If both
2761 content of the allow_read list (see description). If both
2761 deny_read and allow_read are empty or not set, then access is
2762 deny_read and allow_read are empty or not set, then access is
2762 permitted to all users by default. If the repository is being
2763 permitted to all users by default. If the repository is being
2763 served via hgwebdir, denied users will not be able to see it in
2764 served via hgwebdir, denied users will not be able to see it in
2764 the list of repositories. The contents of the deny_read list have
2765 the list of repositories. The contents of the deny_read list have
2765 priority over (are examined before) the contents of the allow_read
2766 priority over (are examined before) the contents of the allow_read
2766 list.
2767 list.
2767
2768
2768 ``descend``
2769 ``descend``
2769 hgwebdir indexes will not descend into subdirectories. Only repositories
2770 hgwebdir indexes will not descend into subdirectories. Only repositories
2770 directly in the current path will be shown (other repositories are still
2771 directly in the current path will be shown (other repositories are still
2771 available from the index corresponding to their containing path).
2772 available from the index corresponding to their containing path).
2772
2773
2773 ``description``
2774 ``description``
2774 Textual description of the repository's purpose or contents.
2775 Textual description of the repository's purpose or contents.
2775 (default: "unknown")
2776 (default: "unknown")
2776
2777
2777 ``encoding``
2778 ``encoding``
2778 Character encoding name. (default: the current locale charset)
2779 Character encoding name. (default: the current locale charset)
2779 Example: "UTF-8".
2780 Example: "UTF-8".
2780
2781
2781 ``errorlog``
2782 ``errorlog``
2782 Where to output the error log. (default: stderr)
2783 Where to output the error log. (default: stderr)
2783
2784
2784 ``guessmime``
2785 ``guessmime``
2785 Control MIME types for raw download of file content.
2786 Control MIME types for raw download of file content.
2786 Set to True to let hgweb guess the content type from the file
2787 Set to True to let hgweb guess the content type from the file
2787 extension. This will serve HTML files as ``text/html`` and might
2788 extension. This will serve HTML files as ``text/html`` and might
2788 allow cross-site scripting attacks when serving untrusted
2789 allow cross-site scripting attacks when serving untrusted
2789 repositories. (default: False)
2790 repositories. (default: False)
2790
2791
2791 ``hidden``
2792 ``hidden``
2792 Whether to hide the repository in the hgwebdir index.
2793 Whether to hide the repository in the hgwebdir index.
2793 (default: False)
2794 (default: False)
2794
2795
2795 ``ipv6``
2796 ``ipv6``
2796 Whether to use IPv6. (default: False)
2797 Whether to use IPv6. (default: False)
2797
2798
2798 ``labels``
2799 ``labels``
2799 List of string *labels* associated with the repository.
2800 List of string *labels* associated with the repository.
2800
2801
2801 Labels are exposed as a template keyword and can be used to customize
2802 Labels are exposed as a template keyword and can be used to customize
2802 output. e.g. the ``index`` template can group or filter repositories
2803 output. e.g. the ``index`` template can group or filter repositories
2803 by labels and the ``summary`` template can display additional content
2804 by labels and the ``summary`` template can display additional content
2804 if a specific label is present.
2805 if a specific label is present.
2805
2806
2806 ``logoimg``
2807 ``logoimg``
2807 File name of the logo image that some templates display on each page.
2808 File name of the logo image that some templates display on each page.
2808 The file name is relative to ``staticurl``. That is, the full path to
2809 The file name is relative to ``staticurl``. That is, the full path to
2809 the logo image is "staticurl/logoimg".
2810 the logo image is "staticurl/logoimg".
2810 If unset, ``hglogo.png`` will be used.
2811 If unset, ``hglogo.png`` will be used.
2811
2812
2812 ``logourl``
2813 ``logourl``
2813 Base URL to use for logos. If unset, ``https://mercurial-scm.org/``
2814 Base URL to use for logos. If unset, ``https://mercurial-scm.org/``
2814 will be used.
2815 will be used.
2815
2816
2816 ``maxchanges``
2817 ``maxchanges``
2817 Maximum number of changes to list on the changelog. (default: 10)
2818 Maximum number of changes to list on the changelog. (default: 10)
2818
2819
2819 ``maxfiles``
2820 ``maxfiles``
2820 Maximum number of files to list per changeset. (default: 10)
2821 Maximum number of files to list per changeset. (default: 10)
2821
2822
2822 ``maxshortchanges``
2823 ``maxshortchanges``
2823 Maximum number of changes to list on the shortlog, graph or filelog
2824 Maximum number of changes to list on the shortlog, graph or filelog
2824 pages. (default: 60)
2825 pages. (default: 60)
2825
2826
2826 ``name``
2827 ``name``
2827 Repository name to use in the web interface.
2828 Repository name to use in the web interface.
2828 (default: current working directory)
2829 (default: current working directory)
2829
2830
2830 ``port``
2831 ``port``
2831 Port to listen on. (default: 8000)
2832 Port to listen on. (default: 8000)
2832
2833
2833 ``prefix``
2834 ``prefix``
2834 Prefix path to serve from. (default: '' (server root))
2835 Prefix path to serve from. (default: '' (server root))
2835
2836
2836 ``push_ssl``
2837 ``push_ssl``
2837 Whether to require that inbound pushes be transported over SSL to
2838 Whether to require that inbound pushes be transported over SSL to
2838 prevent password sniffing. (default: True)
2839 prevent password sniffing. (default: True)
2839
2840
2840 ``refreshinterval``
2841 ``refreshinterval``
2841 How frequently directory listings re-scan the filesystem for new
2842 How frequently directory listings re-scan the filesystem for new
2842 repositories, in seconds. This is relevant when wildcards are used
2843 repositories, in seconds. This is relevant when wildcards are used
2843 to define paths. Depending on how much filesystem traversal is
2844 to define paths. Depending on how much filesystem traversal is
2844 required, refreshing may negatively impact performance.
2845 required, refreshing may negatively impact performance.
2845
2846
2846 Values less than or equal to 0 always refresh.
2847 Values less than or equal to 0 always refresh.
2847 (default: 20)
2848 (default: 20)
2848
2849
2849 ``server-header``
2850 ``server-header``
2850 Value for HTTP ``Server`` response header.
2851 Value for HTTP ``Server`` response header.
2851
2852
2852 ``static``
2853 ``static``
2853 Directory where static files are served from.
2854 Directory where static files are served from.
2854
2855
2855 ``staticurl``
2856 ``staticurl``
2856 Base URL to use for static files. If unset, static files (e.g. the
2857 Base URL to use for static files. If unset, static files (e.g. the
2857 hgicon.png favicon) will be served by the CGI script itself. Use
2858 hgicon.png favicon) will be served by the CGI script itself. Use
2858 this setting to serve them directly with the HTTP server.
2859 this setting to serve them directly with the HTTP server.
2859 Example: ``http://hgserver/static/``.
2860 Example: ``http://hgserver/static/``.
2860
2861
2861 ``stripes``
2862 ``stripes``
2862 How many lines a "zebra stripe" should span in multi-line output.
2863 How many lines a "zebra stripe" should span in multi-line output.
2863 Set to 0 to disable. (default: 1)
2864 Set to 0 to disable. (default: 1)
2864
2865
2865 ``style``
2866 ``style``
2866 Which template map style to use. The available options are the names of
2867 Which template map style to use. The available options are the names of
2867 subdirectories in the HTML templates path. (default: ``paper``)
2868 subdirectories in the HTML templates path. (default: ``paper``)
2868 Example: ``monoblue``.
2869 Example: ``monoblue``.
2869
2870
2870 ``templates``
2871 ``templates``
2871 Where to find the HTML templates. The default path to the HTML templates
2872 Where to find the HTML templates. The default path to the HTML templates
2872 can be obtained from ``hg debuginstall``.
2873 can be obtained from ``hg debuginstall``.
2873
2874
2874 ``websub``
2875 ``websub``
2875 ----------
2876 ----------
2876
2877
2877 Web substitution filter definition. You can use this section to
2878 Web substitution filter definition. You can use this section to
2878 define a set of regular expression substitution patterns which
2879 define a set of regular expression substitution patterns which
2879 let you automatically modify the hgweb server output.
2880 let you automatically modify the hgweb server output.
2880
2881
2881 The default hgweb templates only apply these substitution patterns
2882 The default hgweb templates only apply these substitution patterns
2882 on the revision description fields. You can apply them anywhere
2883 on the revision description fields. You can apply them anywhere
2883 you want when you create your own templates by adding calls to the
2884 you want when you create your own templates by adding calls to the
2884 "websub" filter (usually after calling the "escape" filter).
2885 "websub" filter (usually after calling the "escape" filter).
2885
2886
2886 This can be used, for example, to convert issue references to links
2887 This can be used, for example, to convert issue references to links
2887 to your issue tracker, or to convert "markdown-like" syntax into
2888 to your issue tracker, or to convert "markdown-like" syntax into
2888 HTML (see the examples below).
2889 HTML (see the examples below).
2889
2890
2890 Each entry in this section names a substitution filter.
2891 Each entry in this section names a substitution filter.
2891 The value of each entry defines the substitution expression itself.
2892 The value of each entry defines the substitution expression itself.
2892 The websub expressions follow the old interhg extension syntax,
2893 The websub expressions follow the old interhg extension syntax,
2893 which in turn imitates the Unix sed replacement syntax::
2894 which in turn imitates the Unix sed replacement syntax::
2894
2895
2895 patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i]
2896 patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i]
2896
2897
2897 You can use any separator other than "/". The final "i" is optional
2898 You can use any separator other than "/". The final "i" is optional
2898 and indicates that the search must be case insensitive.
2899 and indicates that the search must be case insensitive.
2899
2900
2900 Examples::
2901 Examples::
2901
2902
2902 [websub]
2903 [websub]
2903 issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i
2904 issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i
2904 italic = s/\b_(\S+)_\b/<i>\1<\/i>/
2905 italic = s/\b_(\S+)_\b/<i>\1<\/i>/
2905 bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/
2906 bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/
2906
2907
2907 ``worker``
2908 ``worker``
2908 ----------
2909 ----------
2909
2910
2910 Parallel master/worker configuration. We currently perform working
2911 Parallel master/worker configuration. We currently perform working
2911 directory updates in parallel on Unix-like systems, which greatly
2912 directory updates in parallel on Unix-like systems, which greatly
2912 helps performance.
2913 helps performance.
2913
2914
2914 ``enabled``
2915 ``enabled``
2915 Whether to enable workers code to be used.
2916 Whether to enable workers code to be used.
2916 (default: true)
2917 (default: true)
2917
2918
2918 ``numcpus``
2919 ``numcpus``
2919 Number of CPUs to use for parallel operations. A zero or
2920 Number of CPUs to use for parallel operations. A zero or
2920 negative value is treated as ``use the default``.
2921 negative value is treated as ``use the default``.
2921 (default: 4 or the number of CPUs on the system, whichever is larger)
2922 (default: 4 or the number of CPUs on the system, whichever is larger)
2922
2923
2923 ``backgroundclose``
2924 ``backgroundclose``
2924 Whether to enable closing file handles on background threads during certain
2925 Whether to enable closing file handles on background threads during certain
2925 operations. Some platforms aren't very efficient at closing file
2926 operations. Some platforms aren't very efficient at closing file
2926 handles that have been written or appended to. By performing file closing
2927 handles that have been written or appended to. By performing file closing
2927 on background threads, file write rate can increase substantially.
2928 on background threads, file write rate can increase substantially.
2928 (default: true on Windows, false elsewhere)
2929 (default: true on Windows, false elsewhere)
2929
2930
2930 ``backgroundcloseminfilecount``
2931 ``backgroundcloseminfilecount``
2931 Minimum number of files required to trigger background file closing.
2932 Minimum number of files required to trigger background file closing.
2932 Operations not writing this many files won't start background close
2933 Operations not writing this many files won't start background close
2933 threads.
2934 threads.
2934 (default: 2048)
2935 (default: 2048)
2935
2936
2936 ``backgroundclosemaxqueue``
2937 ``backgroundclosemaxqueue``
2937 The maximum number of opened file handles waiting to be closed in the
2938 The maximum number of opened file handles waiting to be closed in the
2938 background. This option only has an effect if ``backgroundclose`` is
2939 background. This option only has an effect if ``backgroundclose`` is
2939 enabled.
2940 enabled.
2940 (default: 384)
2941 (default: 384)
2941
2942
2942 ``backgroundclosethreadcount``
2943 ``backgroundclosethreadcount``
2943 Number of threads to process background file closes. Only relevant if
2944 Number of threads to process background file closes. Only relevant if
2944 ``backgroundclose`` is enabled.
2945 ``backgroundclose`` is enabled.
2945 (default: 4)
2946 (default: 4)
@@ -1,56 +1,58 b''
1 == New Features ==
1 == New Features ==
2
2
3 * There is a new config section for templates used by hg commands. It
3 * There is a new config section for templates used by hg commands. It
4 is called `[command-templates]`. Some existing config options have
4 is called `[command-templates]`. Some existing config options have
5 been deprecated in favor of config options in the new
5 been deprecated in favor of config options in the new
6 section. These are: `ui.logtemplate` to `command-templates.log`,
6 section. These are: `ui.logtemplate` to `command-templates.log`,
7 `ui.graphnodetemplate` to `command-templates.graphnode`,
7 `ui.graphnodetemplate` to `command-templates.graphnode`,
8 `ui.mergemarkertemplate` to `command-templates.mergemarker`,
8 `ui.mergemarkertemplate` to `command-templates.mergemarker`,
9 `ui.pre-merge-tool-output-template` to
9 `ui.pre-merge-tool-output-template` to
10 `command-templates.pre-merge-tool-output`.
10 `command-templates.pre-merge-tool-output`.
11
11
12 * There is a new set of config options for the template used for the
12 * There is a new set of config options for the template used for the
13 one-line commit summary displayed by various commands, such as `hg
13 one-line commit summary displayed by various commands, such as `hg
14 rebase`. The main one is `command-templates.oneline-summary`. That
14 rebase`. The main one is `command-templates.oneline-summary`. That
15 can be overridden per command with
15 can be overridden per command with
16 `command-templates.oneline-summary.<command>`, where `<command>`
16 `command-templates.oneline-summary.<command>`, where `<command>`
17 can be e.g. `rebase`. As part of this effort, the default format
17 can be e.g. `rebase`. As part of this effort, the default format
18 from `hg rebase` was reorganized a bit.
18 from `hg rebase` was reorganized a bit.
19
19
20 * `hg strip`, from the strip extension, is now a core command, `hg
20 * `hg strip`, from the strip extension, is now a core command, `hg
21 debugstrip`. The extension remains for compatibility.
21 debugstrip`. The extension remains for compatibility.
22
22
23 * `hg diff` now supports `--from <rev>` and `--to <rev>` arguments as
23 * `hg diff` now supports `--from <rev>` and `--to <rev>` arguments as
24 clearer alternatives to `-r <revs>`. `-r <revs>` has been
24 clearer alternatives to `-r <revs>`. `-r <revs>` has been
25 deprecated.
25 deprecated.
26
26
27 * The memory footprint per changeset during pull/unbundle
27 * The memory footprint per changeset during pull/unbundle
28 operations has been further reduced.
28 operations has been further reduced.
29
29
30 * There is a new internal merge tool called `internal:mergediff` (can
30 * There is a new internal merge tool called `internal:mergediff` (can
31 be set as the value for the `merge` config in the `[ui]`
31 be set as the value for the `merge` config in the `[ui]`
32 section). It resolves merges the same was as `internal:merge` and
32 section). It resolves merges the same was as `internal:merge` and
33 `internal:merge3`, but it shows conflicts differently. Instead of
33 `internal:merge3`, but it shows conflicts differently. Instead of
34 showing 2 or 3 snapshots of the conflicting pieces of code, it
34 showing 2 or 3 snapshots of the conflicting pieces of code, it
35 shows one snapshot and a diff. This may be useful when at least one
35 shows one snapshot and a diff. This may be useful when at least one
36 side of the conflict is similar to the base.
36 side of the conflict is similar to the base. The new marker style
37 is also supported by "premerge" as
38 `merge-tools.<tool>.premerge=keep-mergediff`.
37
39
38 == New Experimental Features ==
40 == New Experimental Features ==
39
41
40 * `experimental.single-head-per-branch:public-changes-only` can be used
42 * `experimental.single-head-per-branch:public-changes-only` can be used
41 restrict the single head check to public revision. This is useful for
43 restrict the single head check to public revision. This is useful for
42 overlay repository that have both a publishing and non-publishing view
44 overlay repository that have both a publishing and non-publishing view
43 of the same storage.
45 of the same storage.
44
46
45
47
46 == Bug Fixes ==
48 == Bug Fixes ==
47
49
48
50
49
51
50 == Backwards Compatibility Changes ==
52 == Backwards Compatibility Changes ==
51
53
52
54
53
55
54 == Internal API Changes ==
56 == Internal API Changes ==
55
57
56
58
@@ -1,2092 +1,2132 b''
1 test merge-tools configuration - mostly exercising filemerge.py
1 test merge-tools configuration - mostly exercising filemerge.py
2
2
3 $ unset HGMERGE # make sure HGMERGE doesn't interfere with the test
3 $ unset HGMERGE # make sure HGMERGE doesn't interfere with the test
4 $ cat >> $HGRCPATH << EOF
4 $ cat >> $HGRCPATH << EOF
5 > [ui]
5 > [ui]
6 > merge=
6 > merge=
7 > [commands]
7 > [commands]
8 > merge.require-rev=True
8 > merge.require-rev=True
9 > EOF
9 > EOF
10 $ hg init repo
10 $ hg init repo
11 $ cd repo
11 $ cd repo
12
12
13 revision 0
13 revision 0
14
14
15 $ echo "revision 0" > f
15 $ echo "revision 0" > f
16 $ echo "space" >> f
16 $ echo "space" >> f
17 $ hg commit -Am "revision 0"
17 $ hg commit -Am "revision 0"
18 adding f
18 adding f
19
19
20 revision 1
20 revision 1
21
21
22 $ echo "revision 1" > f
22 $ echo "revision 1" > f
23 $ echo "space" >> f
23 $ echo "space" >> f
24 $ hg commit -Am "revision 1"
24 $ hg commit -Am "revision 1"
25 $ hg update 0 > /dev/null
25 $ hg update 0 > /dev/null
26
26
27 revision 2
27 revision 2
28
28
29 $ echo "revision 2" > f
29 $ echo "revision 2" > f
30 $ echo "space" >> f
30 $ echo "space" >> f
31 $ hg commit -Am "revision 2"
31 $ hg commit -Am "revision 2"
32 created new head
32 created new head
33 $ hg update 0 > /dev/null
33 $ hg update 0 > /dev/null
34
34
35 revision 3 - simple to merge
35 revision 3 - simple to merge
36
36
37 $ echo "revision 3" >> f
37 $ echo "revision 3" >> f
38 $ hg commit -Am "revision 3"
38 $ hg commit -Am "revision 3"
39 created new head
39 created new head
40
40
41 revision 4 - hard to merge
41 revision 4 - hard to merge
42
42
43 $ hg update 0 > /dev/null
43 $ hg update 0 > /dev/null
44 $ echo "revision 4" > f
44 $ echo "revision 4" > f
45 $ hg commit -Am "revision 4"
45 $ hg commit -Am "revision 4"
46 created new head
46 created new head
47
47
48 $ echo "[merge-tools]" > .hg/hgrc
48 $ echo "[merge-tools]" > .hg/hgrc
49
49
50 $ beforemerge() {
50 $ beforemerge() {
51 > cat .hg/hgrc
51 > cat .hg/hgrc
52 > echo "# hg update -C 1"
52 > echo "# hg update -C 1"
53 > hg update -C 1 > /dev/null
53 > hg update -C 1 > /dev/null
54 > }
54 > }
55 $ aftermerge() {
55 $ aftermerge() {
56 > echo "# cat f"
56 > echo "# cat f"
57 > cat f
57 > cat f
58 > echo "# hg stat"
58 > echo "# hg stat"
59 > hg stat
59 > hg stat
60 > echo "# hg resolve --list"
60 > echo "# hg resolve --list"
61 > hg resolve --list
61 > hg resolve --list
62 > rm -f f.orig
62 > rm -f f.orig
63 > }
63 > }
64
64
65 Tool selection
65 Tool selection
66
66
67 default is internal merge:
67 default is internal merge:
68
68
69 $ beforemerge
69 $ beforemerge
70 [merge-tools]
70 [merge-tools]
71 # hg update -C 1
71 # hg update -C 1
72
72
73 hg merge -r 2
73 hg merge -r 2
74 override $PATH to ensure hgmerge not visible; use $PYTHON in case we're
74 override $PATH to ensure hgmerge not visible; use $PYTHON in case we're
75 running from a devel copy, not a temp installation
75 running from a devel copy, not a temp installation
76
76
77 $ PATH="/usr/sbin" "$PYTHON" "$BINDIR"/hg merge -r 2
77 $ PATH="/usr/sbin" "$PYTHON" "$BINDIR"/hg merge -r 2
78 merging f
78 merging f
79 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
79 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
80 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
80 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
81 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
81 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
82 [1]
82 [1]
83 $ aftermerge
83 $ aftermerge
84 # cat f
84 # cat f
85 <<<<<<< working copy: ef83787e2614 - test: revision 1
85 <<<<<<< working copy: ef83787e2614 - test: revision 1
86 revision 1
86 revision 1
87 =======
87 =======
88 revision 2
88 revision 2
89 >>>>>>> merge rev: 0185f4e0cf02 - test: revision 2
89 >>>>>>> merge rev: 0185f4e0cf02 - test: revision 2
90 space
90 space
91 # hg stat
91 # hg stat
92 M f
92 M f
93 ? f.orig
93 ? f.orig
94 # hg resolve --list
94 # hg resolve --list
95 U f
95 U f
96
96
97 simplest hgrc using false for merge:
97 simplest hgrc using false for merge:
98
98
99 $ echo "false.whatever=" >> .hg/hgrc
99 $ echo "false.whatever=" >> .hg/hgrc
100 $ beforemerge
100 $ beforemerge
101 [merge-tools]
101 [merge-tools]
102 false.whatever=
102 false.whatever=
103 # hg update -C 1
103 # hg update -C 1
104 $ hg merge -r 2
104 $ hg merge -r 2
105 merging f
105 merging f
106 merging f failed!
106 merging f failed!
107 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
107 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
108 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
108 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
109 [1]
109 [1]
110 $ aftermerge
110 $ aftermerge
111 # cat f
111 # cat f
112 revision 1
112 revision 1
113 space
113 space
114 # hg stat
114 # hg stat
115 M f
115 M f
116 ? f.orig
116 ? f.orig
117 # hg resolve --list
117 # hg resolve --list
118 U f
118 U f
119
119
120 #if unix-permissions
120 #if unix-permissions
121
121
122 unexecutable file in $PATH shouldn't be found:
122 unexecutable file in $PATH shouldn't be found:
123
123
124 $ echo "echo fail" > false
124 $ echo "echo fail" > false
125 $ hg up -qC 1
125 $ hg up -qC 1
126 $ PATH="`pwd`:/usr/sbin" "$PYTHON" "$BINDIR"/hg merge -r 2
126 $ PATH="`pwd`:/usr/sbin" "$PYTHON" "$BINDIR"/hg merge -r 2
127 merging f
127 merging f
128 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
128 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
129 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
129 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
130 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
130 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
131 [1]
131 [1]
132 $ rm false
132 $ rm false
133
133
134 #endif
134 #endif
135
135
136 executable directory in $PATH shouldn't be found:
136 executable directory in $PATH shouldn't be found:
137
137
138 $ mkdir false
138 $ mkdir false
139 $ hg up -qC 1
139 $ hg up -qC 1
140 $ PATH="`pwd`:/usr/sbin" "$PYTHON" "$BINDIR"/hg merge -r 2
140 $ PATH="`pwd`:/usr/sbin" "$PYTHON" "$BINDIR"/hg merge -r 2
141 merging f
141 merging f
142 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
142 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
143 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
143 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
144 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
144 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
145 [1]
145 [1]
146 $ rmdir false
146 $ rmdir false
147
147
148 true with higher .priority gets precedence:
148 true with higher .priority gets precedence:
149
149
150 $ echo "true.priority=1" >> .hg/hgrc
150 $ echo "true.priority=1" >> .hg/hgrc
151 $ beforemerge
151 $ beforemerge
152 [merge-tools]
152 [merge-tools]
153 false.whatever=
153 false.whatever=
154 true.priority=1
154 true.priority=1
155 # hg update -C 1
155 # hg update -C 1
156 $ hg merge -r 2
156 $ hg merge -r 2
157 merging f
157 merging f
158 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
158 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
159 (branch merge, don't forget to commit)
159 (branch merge, don't forget to commit)
160 $ aftermerge
160 $ aftermerge
161 # cat f
161 # cat f
162 revision 1
162 revision 1
163 space
163 space
164 # hg stat
164 # hg stat
165 M f
165 M f
166 # hg resolve --list
166 # hg resolve --list
167 R f
167 R f
168
168
169 unless lowered on command line:
169 unless lowered on command line:
170
170
171 $ beforemerge
171 $ beforemerge
172 [merge-tools]
172 [merge-tools]
173 false.whatever=
173 false.whatever=
174 true.priority=1
174 true.priority=1
175 # hg update -C 1
175 # hg update -C 1
176 $ hg merge -r 2 --config merge-tools.true.priority=-7
176 $ hg merge -r 2 --config merge-tools.true.priority=-7
177 merging f
177 merging f
178 merging f failed!
178 merging f failed!
179 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
179 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
180 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
180 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
181 [1]
181 [1]
182 $ aftermerge
182 $ aftermerge
183 # cat f
183 # cat f
184 revision 1
184 revision 1
185 space
185 space
186 # hg stat
186 # hg stat
187 M f
187 M f
188 ? f.orig
188 ? f.orig
189 # hg resolve --list
189 # hg resolve --list
190 U f
190 U f
191
191
192 or false set higher on command line:
192 or false set higher on command line:
193
193
194 $ beforemerge
194 $ beforemerge
195 [merge-tools]
195 [merge-tools]
196 false.whatever=
196 false.whatever=
197 true.priority=1
197 true.priority=1
198 # hg update -C 1
198 # hg update -C 1
199 $ hg merge -r 2 --config merge-tools.false.priority=117
199 $ hg merge -r 2 --config merge-tools.false.priority=117
200 merging f
200 merging f
201 merging f failed!
201 merging f failed!
202 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
202 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
203 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
203 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
204 [1]
204 [1]
205 $ aftermerge
205 $ aftermerge
206 # cat f
206 # cat f
207 revision 1
207 revision 1
208 space
208 space
209 # hg stat
209 # hg stat
210 M f
210 M f
211 ? f.orig
211 ? f.orig
212 # hg resolve --list
212 # hg resolve --list
213 U f
213 U f
214
214
215 or true set to disabled:
215 or true set to disabled:
216 $ beforemerge
216 $ beforemerge
217 [merge-tools]
217 [merge-tools]
218 false.whatever=
218 false.whatever=
219 true.priority=1
219 true.priority=1
220 # hg update -C 1
220 # hg update -C 1
221 $ hg merge -r 2 --config merge-tools.true.disabled=yes
221 $ hg merge -r 2 --config merge-tools.true.disabled=yes
222 merging f
222 merging f
223 merging f failed!
223 merging f failed!
224 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
224 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
225 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
225 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
226 [1]
226 [1]
227 $ aftermerge
227 $ aftermerge
228 # cat f
228 # cat f
229 revision 1
229 revision 1
230 space
230 space
231 # hg stat
231 # hg stat
232 M f
232 M f
233 ? f.orig
233 ? f.orig
234 # hg resolve --list
234 # hg resolve --list
235 U f
235 U f
236
236
237 or true.executable not found in PATH:
237 or true.executable not found in PATH:
238
238
239 $ beforemerge
239 $ beforemerge
240 [merge-tools]
240 [merge-tools]
241 false.whatever=
241 false.whatever=
242 true.priority=1
242 true.priority=1
243 # hg update -C 1
243 # hg update -C 1
244 $ hg merge -r 2 --config merge-tools.true.executable=nonexistentmergetool
244 $ hg merge -r 2 --config merge-tools.true.executable=nonexistentmergetool
245 merging f
245 merging f
246 merging f failed!
246 merging f failed!
247 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
247 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
248 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
248 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
249 [1]
249 [1]
250 $ aftermerge
250 $ aftermerge
251 # cat f
251 # cat f
252 revision 1
252 revision 1
253 space
253 space
254 # hg stat
254 # hg stat
255 M f
255 M f
256 ? f.orig
256 ? f.orig
257 # hg resolve --list
257 # hg resolve --list
258 U f
258 U f
259
259
260 or true.executable with bogus path:
260 or true.executable with bogus path:
261
261
262 $ beforemerge
262 $ beforemerge
263 [merge-tools]
263 [merge-tools]
264 false.whatever=
264 false.whatever=
265 true.priority=1
265 true.priority=1
266 # hg update -C 1
266 # hg update -C 1
267 $ hg merge -r 2 --config merge-tools.true.executable=/nonexistent/mergetool
267 $ hg merge -r 2 --config merge-tools.true.executable=/nonexistent/mergetool
268 merging f
268 merging f
269 merging f failed!
269 merging f failed!
270 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
270 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
271 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
271 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
272 [1]
272 [1]
273 $ aftermerge
273 $ aftermerge
274 # cat f
274 # cat f
275 revision 1
275 revision 1
276 space
276 space
277 # hg stat
277 # hg stat
278 M f
278 M f
279 ? f.orig
279 ? f.orig
280 # hg resolve --list
280 # hg resolve --list
281 U f
281 U f
282
282
283 but true.executable set to cat found in PATH works:
283 but true.executable set to cat found in PATH works:
284
284
285 $ echo "true.executable=cat" >> .hg/hgrc
285 $ echo "true.executable=cat" >> .hg/hgrc
286 $ beforemerge
286 $ beforemerge
287 [merge-tools]
287 [merge-tools]
288 false.whatever=
288 false.whatever=
289 true.priority=1
289 true.priority=1
290 true.executable=cat
290 true.executable=cat
291 # hg update -C 1
291 # hg update -C 1
292 $ hg merge -r 2
292 $ hg merge -r 2
293 merging f
293 merging f
294 revision 1
294 revision 1
295 space
295 space
296 revision 0
296 revision 0
297 space
297 space
298 revision 2
298 revision 2
299 space
299 space
300 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
300 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
301 (branch merge, don't forget to commit)
301 (branch merge, don't forget to commit)
302 $ aftermerge
302 $ aftermerge
303 # cat f
303 # cat f
304 revision 1
304 revision 1
305 space
305 space
306 # hg stat
306 # hg stat
307 M f
307 M f
308 # hg resolve --list
308 # hg resolve --list
309 R f
309 R f
310
310
311 and true.executable set to cat with path works:
311 and true.executable set to cat with path works:
312
312
313 $ beforemerge
313 $ beforemerge
314 [merge-tools]
314 [merge-tools]
315 false.whatever=
315 false.whatever=
316 true.priority=1
316 true.priority=1
317 true.executable=cat
317 true.executable=cat
318 # hg update -C 1
318 # hg update -C 1
319 $ hg merge -r 2 --config merge-tools.true.executable=cat
319 $ hg merge -r 2 --config merge-tools.true.executable=cat
320 merging f
320 merging f
321 revision 1
321 revision 1
322 space
322 space
323 revision 0
323 revision 0
324 space
324 space
325 revision 2
325 revision 2
326 space
326 space
327 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
327 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
328 (branch merge, don't forget to commit)
328 (branch merge, don't forget to commit)
329 $ aftermerge
329 $ aftermerge
330 # cat f
330 # cat f
331 revision 1
331 revision 1
332 space
332 space
333 # hg stat
333 # hg stat
334 M f
334 M f
335 # hg resolve --list
335 # hg resolve --list
336 R f
336 R f
337
337
338 executable set to python script that succeeds:
338 executable set to python script that succeeds:
339
339
340 $ cat > "$TESTTMP/myworkingmerge.py" <<EOF
340 $ cat > "$TESTTMP/myworkingmerge.py" <<EOF
341 > def myworkingmergefn(ui, repo, args, **kwargs):
341 > def myworkingmergefn(ui, repo, args, **kwargs):
342 > return False
342 > return False
343 > EOF
343 > EOF
344 $ beforemerge
344 $ beforemerge
345 [merge-tools]
345 [merge-tools]
346 false.whatever=
346 false.whatever=
347 true.priority=1
347 true.priority=1
348 true.executable=cat
348 true.executable=cat
349 # hg update -C 1
349 # hg update -C 1
350 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py:myworkingmergefn"
350 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py:myworkingmergefn"
351 merging f
351 merging f
352 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
352 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
353 (branch merge, don't forget to commit)
353 (branch merge, don't forget to commit)
354 $ aftermerge
354 $ aftermerge
355 # cat f
355 # cat f
356 revision 1
356 revision 1
357 space
357 space
358 # hg stat
358 # hg stat
359 M f
359 M f
360 # hg resolve --list
360 # hg resolve --list
361 R f
361 R f
362
362
363 executable set to python script that fails:
363 executable set to python script that fails:
364
364
365 $ cat > "$TESTTMP/mybrokenmerge.py" <<EOF
365 $ cat > "$TESTTMP/mybrokenmerge.py" <<EOF
366 > def mybrokenmergefn(ui, repo, args, **kwargs):
366 > def mybrokenmergefn(ui, repo, args, **kwargs):
367 > ui.write(b"some fail message\n")
367 > ui.write(b"some fail message\n")
368 > return True
368 > return True
369 > EOF
369 > EOF
370 $ beforemerge
370 $ beforemerge
371 [merge-tools]
371 [merge-tools]
372 false.whatever=
372 false.whatever=
373 true.priority=1
373 true.priority=1
374 true.executable=cat
374 true.executable=cat
375 # hg update -C 1
375 # hg update -C 1
376 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/mybrokenmerge.py:mybrokenmergefn"
376 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/mybrokenmerge.py:mybrokenmergefn"
377 merging f
377 merging f
378 some fail message
378 some fail message
379 abort: $TESTTMP/mybrokenmerge.py hook failed
379 abort: $TESTTMP/mybrokenmerge.py hook failed
380 [255]
380 [255]
381 $ aftermerge
381 $ aftermerge
382 # cat f
382 # cat f
383 revision 1
383 revision 1
384 space
384 space
385 # hg stat
385 # hg stat
386 ? f.orig
386 ? f.orig
387 # hg resolve --list
387 # hg resolve --list
388 U f
388 U f
389
389
390 executable set to python script that is missing function:
390 executable set to python script that is missing function:
391
391
392 $ beforemerge
392 $ beforemerge
393 [merge-tools]
393 [merge-tools]
394 false.whatever=
394 false.whatever=
395 true.priority=1
395 true.priority=1
396 true.executable=cat
396 true.executable=cat
397 # hg update -C 1
397 # hg update -C 1
398 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py:missingFunction"
398 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py:missingFunction"
399 merging f
399 merging f
400 abort: $TESTTMP/myworkingmerge.py does not have function: missingFunction
400 abort: $TESTTMP/myworkingmerge.py does not have function: missingFunction
401 [255]
401 [255]
402 $ aftermerge
402 $ aftermerge
403 # cat f
403 # cat f
404 revision 1
404 revision 1
405 space
405 space
406 # hg stat
406 # hg stat
407 ? f.orig
407 ? f.orig
408 # hg resolve --list
408 # hg resolve --list
409 U f
409 U f
410
410
411 executable set to missing python script:
411 executable set to missing python script:
412
412
413 $ beforemerge
413 $ beforemerge
414 [merge-tools]
414 [merge-tools]
415 false.whatever=
415 false.whatever=
416 true.priority=1
416 true.priority=1
417 true.executable=cat
417 true.executable=cat
418 # hg update -C 1
418 # hg update -C 1
419 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/missingpythonscript.py:mergefn"
419 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/missingpythonscript.py:mergefn"
420 merging f
420 merging f
421 abort: loading python merge script failed: $TESTTMP/missingpythonscript.py
421 abort: loading python merge script failed: $TESTTMP/missingpythonscript.py
422 [255]
422 [255]
423 $ aftermerge
423 $ aftermerge
424 # cat f
424 # cat f
425 revision 1
425 revision 1
426 space
426 space
427 # hg stat
427 # hg stat
428 ? f.orig
428 ? f.orig
429 # hg resolve --list
429 # hg resolve --list
430 U f
430 U f
431
431
432 executable set to python script but callable function is missing:
432 executable set to python script but callable function is missing:
433
433
434 $ beforemerge
434 $ beforemerge
435 [merge-tools]
435 [merge-tools]
436 false.whatever=
436 false.whatever=
437 true.priority=1
437 true.priority=1
438 true.executable=cat
438 true.executable=cat
439 # hg update -C 1
439 # hg update -C 1
440 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py"
440 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py"
441 abort: invalid 'python:' syntax: python:$TESTTMP/myworkingmerge.py
441 abort: invalid 'python:' syntax: python:$TESTTMP/myworkingmerge.py
442 [255]
442 [255]
443 $ aftermerge
443 $ aftermerge
444 # cat f
444 # cat f
445 revision 1
445 revision 1
446 space
446 space
447 # hg stat
447 # hg stat
448 # hg resolve --list
448 # hg resolve --list
449 U f
449 U f
450
450
451 executable set to python script but callable function is empty string:
451 executable set to python script but callable function is empty string:
452
452
453 $ beforemerge
453 $ beforemerge
454 [merge-tools]
454 [merge-tools]
455 false.whatever=
455 false.whatever=
456 true.priority=1
456 true.priority=1
457 true.executable=cat
457 true.executable=cat
458 # hg update -C 1
458 # hg update -C 1
459 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py:"
459 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py:"
460 abort: invalid 'python:' syntax: python:$TESTTMP/myworkingmerge.py:
460 abort: invalid 'python:' syntax: python:$TESTTMP/myworkingmerge.py:
461 [255]
461 [255]
462 $ aftermerge
462 $ aftermerge
463 # cat f
463 # cat f
464 revision 1
464 revision 1
465 space
465 space
466 # hg stat
466 # hg stat
467 # hg resolve --list
467 # hg resolve --list
468 U f
468 U f
469
469
470 executable set to python script but callable function is missing and path contains colon:
470 executable set to python script but callable function is missing and path contains colon:
471
471
472 $ beforemerge
472 $ beforemerge
473 [merge-tools]
473 [merge-tools]
474 false.whatever=
474 false.whatever=
475 true.priority=1
475 true.priority=1
476 true.executable=cat
476 true.executable=cat
477 # hg update -C 1
477 # hg update -C 1
478 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/some:dir/myworkingmerge.py"
478 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/some:dir/myworkingmerge.py"
479 abort: invalid 'python:' syntax: python:$TESTTMP/some:dir/myworkingmerge.py
479 abort: invalid 'python:' syntax: python:$TESTTMP/some:dir/myworkingmerge.py
480 [255]
480 [255]
481 $ aftermerge
481 $ aftermerge
482 # cat f
482 # cat f
483 revision 1
483 revision 1
484 space
484 space
485 # hg stat
485 # hg stat
486 # hg resolve --list
486 # hg resolve --list
487 U f
487 U f
488
488
489 executable set to python script filename that contains spaces:
489 executable set to python script filename that contains spaces:
490
490
491 $ mkdir -p "$TESTTMP/my path"
491 $ mkdir -p "$TESTTMP/my path"
492 $ cat > "$TESTTMP/my path/my working merge with spaces in filename.py" <<EOF
492 $ cat > "$TESTTMP/my path/my working merge with spaces in filename.py" <<EOF
493 > def myworkingmergefn(ui, repo, args, **kwargs):
493 > def myworkingmergefn(ui, repo, args, **kwargs):
494 > return False
494 > return False
495 > EOF
495 > EOF
496 $ beforemerge
496 $ beforemerge
497 [merge-tools]
497 [merge-tools]
498 false.whatever=
498 false.whatever=
499 true.priority=1
499 true.priority=1
500 true.executable=cat
500 true.executable=cat
501 # hg update -C 1
501 # hg update -C 1
502 $ hg merge -r 2 --config "merge-tools.true.executable=python:$TESTTMP/my path/my working merge with spaces in filename.py:myworkingmergefn"
502 $ hg merge -r 2 --config "merge-tools.true.executable=python:$TESTTMP/my path/my working merge with spaces in filename.py:myworkingmergefn"
503 merging f
503 merging f
504 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
504 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
505 (branch merge, don't forget to commit)
505 (branch merge, don't forget to commit)
506 $ aftermerge
506 $ aftermerge
507 # cat f
507 # cat f
508 revision 1
508 revision 1
509 space
509 space
510 # hg stat
510 # hg stat
511 M f
511 M f
512 # hg resolve --list
512 # hg resolve --list
513 R f
513 R f
514
514
515 #if unix-permissions
515 #if unix-permissions
516
516
517 environment variables in true.executable are handled:
517 environment variables in true.executable are handled:
518
518
519 $ echo 'echo "custom merge tool"' > .hg/merge.sh
519 $ echo 'echo "custom merge tool"' > .hg/merge.sh
520 $ beforemerge
520 $ beforemerge
521 [merge-tools]
521 [merge-tools]
522 false.whatever=
522 false.whatever=
523 true.priority=1
523 true.priority=1
524 true.executable=cat
524 true.executable=cat
525 # hg update -C 1
525 # hg update -C 1
526 $ hg --config merge-tools.true.executable='sh' \
526 $ hg --config merge-tools.true.executable='sh' \
527 > --config merge-tools.true.args=.hg/merge.sh \
527 > --config merge-tools.true.args=.hg/merge.sh \
528 > merge -r 2
528 > merge -r 2
529 merging f
529 merging f
530 custom merge tool
530 custom merge tool
531 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
531 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
532 (branch merge, don't forget to commit)
532 (branch merge, don't forget to commit)
533 $ aftermerge
533 $ aftermerge
534 # cat f
534 # cat f
535 revision 1
535 revision 1
536 space
536 space
537 # hg stat
537 # hg stat
538 M f
538 M f
539 # hg resolve --list
539 # hg resolve --list
540 R f
540 R f
541
541
542 #endif
542 #endif
543
543
544 Tool selection and merge-patterns
544 Tool selection and merge-patterns
545
545
546 merge-patterns specifies new tool false:
546 merge-patterns specifies new tool false:
547
547
548 $ beforemerge
548 $ beforemerge
549 [merge-tools]
549 [merge-tools]
550 false.whatever=
550 false.whatever=
551 true.priority=1
551 true.priority=1
552 true.executable=cat
552 true.executable=cat
553 # hg update -C 1
553 # hg update -C 1
554 $ hg merge -r 2 --config merge-patterns.f=false
554 $ hg merge -r 2 --config merge-patterns.f=false
555 merging f
555 merging f
556 merging f failed!
556 merging f failed!
557 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
557 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
558 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
558 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
559 [1]
559 [1]
560 $ aftermerge
560 $ aftermerge
561 # cat f
561 # cat f
562 revision 1
562 revision 1
563 space
563 space
564 # hg stat
564 # hg stat
565 M f
565 M f
566 ? f.orig
566 ? f.orig
567 # hg resolve --list
567 # hg resolve --list
568 U f
568 U f
569
569
570 merge-patterns specifies executable not found in PATH and gets warning:
570 merge-patterns specifies executable not found in PATH and gets warning:
571
571
572 $ beforemerge
572 $ beforemerge
573 [merge-tools]
573 [merge-tools]
574 false.whatever=
574 false.whatever=
575 true.priority=1
575 true.priority=1
576 true.executable=cat
576 true.executable=cat
577 # hg update -C 1
577 # hg update -C 1
578 $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool
578 $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool
579 couldn't find merge tool true (for pattern f)
579 couldn't find merge tool true (for pattern f)
580 merging f
580 merging f
581 couldn't find merge tool true (for pattern f)
581 couldn't find merge tool true (for pattern f)
582 merging f failed!
582 merging f failed!
583 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
583 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
584 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
584 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
585 [1]
585 [1]
586 $ aftermerge
586 $ aftermerge
587 # cat f
587 # cat f
588 revision 1
588 revision 1
589 space
589 space
590 # hg stat
590 # hg stat
591 M f
591 M f
592 ? f.orig
592 ? f.orig
593 # hg resolve --list
593 # hg resolve --list
594 U f
594 U f
595
595
596 merge-patterns specifies executable with bogus path and gets warning:
596 merge-patterns specifies executable with bogus path and gets warning:
597
597
598 $ beforemerge
598 $ beforemerge
599 [merge-tools]
599 [merge-tools]
600 false.whatever=
600 false.whatever=
601 true.priority=1
601 true.priority=1
602 true.executable=cat
602 true.executable=cat
603 # hg update -C 1
603 # hg update -C 1
604 $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexistent/mergetool
604 $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexistent/mergetool
605 couldn't find merge tool true (for pattern f)
605 couldn't find merge tool true (for pattern f)
606 merging f
606 merging f
607 couldn't find merge tool true (for pattern f)
607 couldn't find merge tool true (for pattern f)
608 merging f failed!
608 merging f failed!
609 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
609 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
610 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
610 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
611 [1]
611 [1]
612 $ aftermerge
612 $ aftermerge
613 # cat f
613 # cat f
614 revision 1
614 revision 1
615 space
615 space
616 # hg stat
616 # hg stat
617 M f
617 M f
618 ? f.orig
618 ? f.orig
619 # hg resolve --list
619 # hg resolve --list
620 U f
620 U f
621
621
622 ui.merge overrules priority
622 ui.merge overrules priority
623
623
624 ui.merge specifies false:
624 ui.merge specifies false:
625
625
626 $ beforemerge
626 $ beforemerge
627 [merge-tools]
627 [merge-tools]
628 false.whatever=
628 false.whatever=
629 true.priority=1
629 true.priority=1
630 true.executable=cat
630 true.executable=cat
631 # hg update -C 1
631 # hg update -C 1
632 $ hg merge -r 2 --config ui.merge=false
632 $ hg merge -r 2 --config ui.merge=false
633 merging f
633 merging f
634 merging f failed!
634 merging f failed!
635 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
635 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
636 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
636 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
637 [1]
637 [1]
638 $ aftermerge
638 $ aftermerge
639 # cat f
639 # cat f
640 revision 1
640 revision 1
641 space
641 space
642 # hg stat
642 # hg stat
643 M f
643 M f
644 ? f.orig
644 ? f.orig
645 # hg resolve --list
645 # hg resolve --list
646 U f
646 U f
647
647
648 ui.merge specifies internal:fail:
648 ui.merge specifies internal:fail:
649
649
650 $ beforemerge
650 $ beforemerge
651 [merge-tools]
651 [merge-tools]
652 false.whatever=
652 false.whatever=
653 true.priority=1
653 true.priority=1
654 true.executable=cat
654 true.executable=cat
655 # hg update -C 1
655 # hg update -C 1
656 $ hg merge -r 2 --config ui.merge=internal:fail
656 $ hg merge -r 2 --config ui.merge=internal:fail
657 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
657 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
658 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
658 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
659 [1]
659 [1]
660 $ aftermerge
660 $ aftermerge
661 # cat f
661 # cat f
662 revision 1
662 revision 1
663 space
663 space
664 # hg stat
664 # hg stat
665 M f
665 M f
666 # hg resolve --list
666 # hg resolve --list
667 U f
667 U f
668
668
669 ui.merge specifies :local (without internal prefix):
669 ui.merge specifies :local (without internal prefix):
670
670
671 $ beforemerge
671 $ beforemerge
672 [merge-tools]
672 [merge-tools]
673 false.whatever=
673 false.whatever=
674 true.priority=1
674 true.priority=1
675 true.executable=cat
675 true.executable=cat
676 # hg update -C 1
676 # hg update -C 1
677 $ hg merge -r 2 --config ui.merge=:local
677 $ hg merge -r 2 --config ui.merge=:local
678 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
678 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
679 (branch merge, don't forget to commit)
679 (branch merge, don't forget to commit)
680 $ aftermerge
680 $ aftermerge
681 # cat f
681 # cat f
682 revision 1
682 revision 1
683 space
683 space
684 # hg stat
684 # hg stat
685 M f
685 M f
686 # hg resolve --list
686 # hg resolve --list
687 R f
687 R f
688
688
689 ui.merge specifies internal:other:
689 ui.merge specifies internal:other:
690
690
691 $ beforemerge
691 $ beforemerge
692 [merge-tools]
692 [merge-tools]
693 false.whatever=
693 false.whatever=
694 true.priority=1
694 true.priority=1
695 true.executable=cat
695 true.executable=cat
696 # hg update -C 1
696 # hg update -C 1
697 $ hg merge -r 2 --config ui.merge=internal:other
697 $ hg merge -r 2 --config ui.merge=internal:other
698 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
698 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
699 (branch merge, don't forget to commit)
699 (branch merge, don't forget to commit)
700 $ aftermerge
700 $ aftermerge
701 # cat f
701 # cat f
702 revision 2
702 revision 2
703 space
703 space
704 # hg stat
704 # hg stat
705 M f
705 M f
706 # hg resolve --list
706 # hg resolve --list
707 R f
707 R f
708
708
709 ui.merge specifies internal:prompt:
709 ui.merge specifies internal:prompt:
710
710
711 $ beforemerge
711 $ beforemerge
712 [merge-tools]
712 [merge-tools]
713 false.whatever=
713 false.whatever=
714 true.priority=1
714 true.priority=1
715 true.executable=cat
715 true.executable=cat
716 # hg update -C 1
716 # hg update -C 1
717 $ hg merge -r 2 --config ui.merge=internal:prompt
717 $ hg merge -r 2 --config ui.merge=internal:prompt
718 file 'f' needs to be resolved.
718 file 'f' needs to be resolved.
719 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
719 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
720 What do you want to do? u
720 What do you want to do? u
721 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
721 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
722 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
722 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
723 [1]
723 [1]
724 $ aftermerge
724 $ aftermerge
725 # cat f
725 # cat f
726 revision 1
726 revision 1
727 space
727 space
728 # hg stat
728 # hg stat
729 M f
729 M f
730 # hg resolve --list
730 # hg resolve --list
731 U f
731 U f
732
732
733 ui.merge specifies :prompt, with 'leave unresolved' chosen
733 ui.merge specifies :prompt, with 'leave unresolved' chosen
734
734
735 $ beforemerge
735 $ beforemerge
736 [merge-tools]
736 [merge-tools]
737 false.whatever=
737 false.whatever=
738 true.priority=1
738 true.priority=1
739 true.executable=cat
739 true.executable=cat
740 # hg update -C 1
740 # hg update -C 1
741 $ hg merge -r 2 --config ui.merge=:prompt --config ui.interactive=True << EOF
741 $ hg merge -r 2 --config ui.merge=:prompt --config ui.interactive=True << EOF
742 > u
742 > u
743 > EOF
743 > EOF
744 file 'f' needs to be resolved.
744 file 'f' needs to be resolved.
745 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
745 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
746 What do you want to do? u
746 What do you want to do? u
747 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
747 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
748 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
748 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
749 [1]
749 [1]
750 $ aftermerge
750 $ aftermerge
751 # cat f
751 # cat f
752 revision 1
752 revision 1
753 space
753 space
754 # hg stat
754 # hg stat
755 M f
755 M f
756 # hg resolve --list
756 # hg resolve --list
757 U f
757 U f
758
758
759 prompt with EOF
759 prompt with EOF
760
760
761 $ beforemerge
761 $ beforemerge
762 [merge-tools]
762 [merge-tools]
763 false.whatever=
763 false.whatever=
764 true.priority=1
764 true.priority=1
765 true.executable=cat
765 true.executable=cat
766 # hg update -C 1
766 # hg update -C 1
767 $ hg merge -r 2 --config ui.merge=internal:prompt --config ui.interactive=true
767 $ hg merge -r 2 --config ui.merge=internal:prompt --config ui.interactive=true
768 file 'f' needs to be resolved.
768 file 'f' needs to be resolved.
769 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
769 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
770 What do you want to do?
770 What do you want to do?
771 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
771 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
772 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
772 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
773 [1]
773 [1]
774 $ aftermerge
774 $ aftermerge
775 # cat f
775 # cat f
776 revision 1
776 revision 1
777 space
777 space
778 # hg stat
778 # hg stat
779 M f
779 M f
780 # hg resolve --list
780 # hg resolve --list
781 U f
781 U f
782 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true
782 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true
783 file 'f' needs to be resolved.
783 file 'f' needs to be resolved.
784 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
784 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
785 What do you want to do?
785 What do you want to do?
786 [1]
786 [1]
787 $ aftermerge
787 $ aftermerge
788 # cat f
788 # cat f
789 revision 1
789 revision 1
790 space
790 space
791 # hg stat
791 # hg stat
792 M f
792 M f
793 ? f.orig
793 ? f.orig
794 # hg resolve --list
794 # hg resolve --list
795 U f
795 U f
796 $ rm f
796 $ rm f
797 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true
797 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true
798 file 'f' needs to be resolved.
798 file 'f' needs to be resolved.
799 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
799 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
800 What do you want to do?
800 What do you want to do?
801 [1]
801 [1]
802 $ aftermerge
802 $ aftermerge
803 # cat f
803 # cat f
804 revision 1
804 revision 1
805 space
805 space
806 # hg stat
806 # hg stat
807 M f
807 M f
808 # hg resolve --list
808 # hg resolve --list
809 U f
809 U f
810 $ hg resolve --all --config ui.merge=internal:prompt
810 $ hg resolve --all --config ui.merge=internal:prompt
811 file 'f' needs to be resolved.
811 file 'f' needs to be resolved.
812 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
812 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
813 What do you want to do? u
813 What do you want to do? u
814 [1]
814 [1]
815 $ aftermerge
815 $ aftermerge
816 # cat f
816 # cat f
817 revision 1
817 revision 1
818 space
818 space
819 # hg stat
819 # hg stat
820 M f
820 M f
821 ? f.orig
821 ? f.orig
822 # hg resolve --list
822 # hg resolve --list
823 U f
823 U f
824
824
825 ui.merge specifies internal:dump:
825 ui.merge specifies internal:dump:
826
826
827 $ beforemerge
827 $ beforemerge
828 [merge-tools]
828 [merge-tools]
829 false.whatever=
829 false.whatever=
830 true.priority=1
830 true.priority=1
831 true.executable=cat
831 true.executable=cat
832 # hg update -C 1
832 # hg update -C 1
833 $ hg merge -r 2 --config ui.merge=internal:dump
833 $ hg merge -r 2 --config ui.merge=internal:dump
834 merging f
834 merging f
835 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
835 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
836 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
836 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
837 [1]
837 [1]
838 $ aftermerge
838 $ aftermerge
839 # cat f
839 # cat f
840 revision 1
840 revision 1
841 space
841 space
842 # hg stat
842 # hg stat
843 M f
843 M f
844 ? f.base
844 ? f.base
845 ? f.local
845 ? f.local
846 ? f.orig
846 ? f.orig
847 ? f.other
847 ? f.other
848 # hg resolve --list
848 # hg resolve --list
849 U f
849 U f
850
850
851 f.base:
851 f.base:
852
852
853 $ cat f.base
853 $ cat f.base
854 revision 0
854 revision 0
855 space
855 space
856
856
857 f.local:
857 f.local:
858
858
859 $ cat f.local
859 $ cat f.local
860 revision 1
860 revision 1
861 space
861 space
862
862
863 f.other:
863 f.other:
864
864
865 $ cat f.other
865 $ cat f.other
866 revision 2
866 revision 2
867 space
867 space
868 $ rm f.base f.local f.other
868 $ rm f.base f.local f.other
869
869
870 check that internal:dump doesn't dump files if premerge runs
870 check that internal:dump doesn't dump files if premerge runs
871 successfully
871 successfully
872
872
873 $ beforemerge
873 $ beforemerge
874 [merge-tools]
874 [merge-tools]
875 false.whatever=
875 false.whatever=
876 true.priority=1
876 true.priority=1
877 true.executable=cat
877 true.executable=cat
878 # hg update -C 1
878 # hg update -C 1
879 $ hg merge -r 3 --config ui.merge=internal:dump
879 $ hg merge -r 3 --config ui.merge=internal:dump
880 merging f
880 merging f
881 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
881 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
882 (branch merge, don't forget to commit)
882 (branch merge, don't forget to commit)
883
883
884 $ aftermerge
884 $ aftermerge
885 # cat f
885 # cat f
886 revision 1
886 revision 1
887 space
887 space
888 revision 3
888 revision 3
889 # hg stat
889 # hg stat
890 M f
890 M f
891 # hg resolve --list
891 # hg resolve --list
892 R f
892 R f
893
893
894 check that internal:forcedump dumps files, even if local and other can
894 check that internal:forcedump dumps files, even if local and other can
895 be merged easily
895 be merged easily
896
896
897 $ beforemerge
897 $ beforemerge
898 [merge-tools]
898 [merge-tools]
899 false.whatever=
899 false.whatever=
900 true.priority=1
900 true.priority=1
901 true.executable=cat
901 true.executable=cat
902 # hg update -C 1
902 # hg update -C 1
903 $ hg merge -r 3 --config ui.merge=internal:forcedump
903 $ hg merge -r 3 --config ui.merge=internal:forcedump
904 merging f
904 merging f
905 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
905 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
906 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
906 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
907 [1]
907 [1]
908 $ aftermerge
908 $ aftermerge
909 # cat f
909 # cat f
910 revision 1
910 revision 1
911 space
911 space
912 # hg stat
912 # hg stat
913 M f
913 M f
914 ? f.base
914 ? f.base
915 ? f.local
915 ? f.local
916 ? f.orig
916 ? f.orig
917 ? f.other
917 ? f.other
918 # hg resolve --list
918 # hg resolve --list
919 U f
919 U f
920
920
921 $ cat f.base
921 $ cat f.base
922 revision 0
922 revision 0
923 space
923 space
924
924
925 $ cat f.local
925 $ cat f.local
926 revision 1
926 revision 1
927 space
927 space
928
928
929 $ cat f.other
929 $ cat f.other
930 revision 0
930 revision 0
931 space
931 space
932 revision 3
932 revision 3
933
933
934 $ rm -f f.base f.local f.other
934 $ rm -f f.base f.local f.other
935
935
936 ui.merge specifies internal:other but is overruled by pattern for false:
936 ui.merge specifies internal:other but is overruled by pattern for false:
937
937
938 $ beforemerge
938 $ beforemerge
939 [merge-tools]
939 [merge-tools]
940 false.whatever=
940 false.whatever=
941 true.priority=1
941 true.priority=1
942 true.executable=cat
942 true.executable=cat
943 # hg update -C 1
943 # hg update -C 1
944 $ hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
944 $ hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
945 merging f
945 merging f
946 merging f failed!
946 merging f failed!
947 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
947 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
948 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
948 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
949 [1]
949 [1]
950 $ aftermerge
950 $ aftermerge
951 # cat f
951 # cat f
952 revision 1
952 revision 1
953 space
953 space
954 # hg stat
954 # hg stat
955 M f
955 M f
956 ? f.orig
956 ? f.orig
957 # hg resolve --list
957 # hg resolve --list
958 U f
958 U f
959
959
960 Premerge
960 Premerge
961
961
962 ui.merge specifies internal:other but is overruled by --tool=false
962 ui.merge specifies internal:other but is overruled by --tool=false
963
963
964 $ beforemerge
964 $ beforemerge
965 [merge-tools]
965 [merge-tools]
966 false.whatever=
966 false.whatever=
967 true.priority=1
967 true.priority=1
968 true.executable=cat
968 true.executable=cat
969 # hg update -C 1
969 # hg update -C 1
970 $ hg merge -r 2 --config ui.merge=internal:other --tool=false
970 $ hg merge -r 2 --config ui.merge=internal:other --tool=false
971 merging f
971 merging f
972 merging f failed!
972 merging f failed!
973 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
973 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
974 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
974 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
975 [1]
975 [1]
976 $ aftermerge
976 $ aftermerge
977 # cat f
977 # cat f
978 revision 1
978 revision 1
979 space
979 space
980 # hg stat
980 # hg stat
981 M f
981 M f
982 ? f.orig
982 ? f.orig
983 # hg resolve --list
983 # hg resolve --list
984 U f
984 U f
985
985
986 HGMERGE specifies internal:other but is overruled by --tool=false
986 HGMERGE specifies internal:other but is overruled by --tool=false
987
987
988 $ HGMERGE=internal:other ; export HGMERGE
988 $ HGMERGE=internal:other ; export HGMERGE
989 $ beforemerge
989 $ beforemerge
990 [merge-tools]
990 [merge-tools]
991 false.whatever=
991 false.whatever=
992 true.priority=1
992 true.priority=1
993 true.executable=cat
993 true.executable=cat
994 # hg update -C 1
994 # hg update -C 1
995 $ hg merge -r 2 --tool=false
995 $ hg merge -r 2 --tool=false
996 merging f
996 merging f
997 merging f failed!
997 merging f failed!
998 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
998 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
999 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
999 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1000 [1]
1000 [1]
1001 $ aftermerge
1001 $ aftermerge
1002 # cat f
1002 # cat f
1003 revision 1
1003 revision 1
1004 space
1004 space
1005 # hg stat
1005 # hg stat
1006 M f
1006 M f
1007 ? f.orig
1007 ? f.orig
1008 # hg resolve --list
1008 # hg resolve --list
1009 U f
1009 U f
1010
1010
1011 $ unset HGMERGE # make sure HGMERGE doesn't interfere with remaining tests
1011 $ unset HGMERGE # make sure HGMERGE doesn't interfere with remaining tests
1012
1012
1013 update is a merge ...
1013 update is a merge ...
1014
1014
1015 (this also tests that files reverted with '--rev REV' are treated as
1015 (this also tests that files reverted with '--rev REV' are treated as
1016 "modified", even if none of mode, size and timestamp of them isn't
1016 "modified", even if none of mode, size and timestamp of them isn't
1017 changed on the filesystem (see also issue4583))
1017 changed on the filesystem (see also issue4583))
1018
1018
1019 $ cat >> $HGRCPATH <<EOF
1019 $ cat >> $HGRCPATH <<EOF
1020 > [fakedirstatewritetime]
1020 > [fakedirstatewritetime]
1021 > # emulate invoking dirstate.write() via repo.status()
1021 > # emulate invoking dirstate.write() via repo.status()
1022 > # at 2000-01-01 00:00
1022 > # at 2000-01-01 00:00
1023 > fakenow = 200001010000
1023 > fakenow = 200001010000
1024 > EOF
1024 > EOF
1025
1025
1026 $ beforemerge
1026 $ beforemerge
1027 [merge-tools]
1027 [merge-tools]
1028 false.whatever=
1028 false.whatever=
1029 true.priority=1
1029 true.priority=1
1030 true.executable=cat
1030 true.executable=cat
1031 # hg update -C 1
1031 # hg update -C 1
1032 $ hg update -q 0
1032 $ hg update -q 0
1033 $ f -s f
1033 $ f -s f
1034 f: size=17
1034 f: size=17
1035 $ touch -t 200001010000 f
1035 $ touch -t 200001010000 f
1036 $ hg debugrebuildstate
1036 $ hg debugrebuildstate
1037 $ cat >> $HGRCPATH <<EOF
1037 $ cat >> $HGRCPATH <<EOF
1038 > [extensions]
1038 > [extensions]
1039 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
1039 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
1040 > EOF
1040 > EOF
1041 $ hg revert -q -r 1 .
1041 $ hg revert -q -r 1 .
1042 $ cat >> $HGRCPATH <<EOF
1042 $ cat >> $HGRCPATH <<EOF
1043 > [extensions]
1043 > [extensions]
1044 > fakedirstatewritetime = !
1044 > fakedirstatewritetime = !
1045 > EOF
1045 > EOF
1046 $ f -s f
1046 $ f -s f
1047 f: size=17
1047 f: size=17
1048 $ touch -t 200001010000 f
1048 $ touch -t 200001010000 f
1049 $ hg status f
1049 $ hg status f
1050 M f
1050 M f
1051 $ hg update -r 2
1051 $ hg update -r 2
1052 merging f
1052 merging f
1053 revision 1
1053 revision 1
1054 space
1054 space
1055 revision 0
1055 revision 0
1056 space
1056 space
1057 revision 2
1057 revision 2
1058 space
1058 space
1059 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1059 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1060 $ aftermerge
1060 $ aftermerge
1061 # cat f
1061 # cat f
1062 revision 1
1062 revision 1
1063 space
1063 space
1064 # hg stat
1064 # hg stat
1065 M f
1065 M f
1066 # hg resolve --list
1066 # hg resolve --list
1067 R f
1067 R f
1068
1068
1069 update should also have --tool
1069 update should also have --tool
1070
1070
1071 $ beforemerge
1071 $ beforemerge
1072 [merge-tools]
1072 [merge-tools]
1073 false.whatever=
1073 false.whatever=
1074 true.priority=1
1074 true.priority=1
1075 true.executable=cat
1075 true.executable=cat
1076 # hg update -C 1
1076 # hg update -C 1
1077 $ hg update -q 0
1077 $ hg update -q 0
1078 $ f -s f
1078 $ f -s f
1079 f: size=17
1079 f: size=17
1080 $ touch -t 200001010000 f
1080 $ touch -t 200001010000 f
1081 $ hg debugrebuildstate
1081 $ hg debugrebuildstate
1082 $ cat >> $HGRCPATH <<EOF
1082 $ cat >> $HGRCPATH <<EOF
1083 > [extensions]
1083 > [extensions]
1084 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
1084 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
1085 > EOF
1085 > EOF
1086 $ hg revert -q -r 1 .
1086 $ hg revert -q -r 1 .
1087 $ cat >> $HGRCPATH <<EOF
1087 $ cat >> $HGRCPATH <<EOF
1088 > [extensions]
1088 > [extensions]
1089 > fakedirstatewritetime = !
1089 > fakedirstatewritetime = !
1090 > EOF
1090 > EOF
1091 $ f -s f
1091 $ f -s f
1092 f: size=17
1092 f: size=17
1093 $ touch -t 200001010000 f
1093 $ touch -t 200001010000 f
1094 $ hg status f
1094 $ hg status f
1095 M f
1095 M f
1096 $ hg update -r 2 --tool false
1096 $ hg update -r 2 --tool false
1097 merging f
1097 merging f
1098 merging f failed!
1098 merging f failed!
1099 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1099 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1100 use 'hg resolve' to retry unresolved file merges
1100 use 'hg resolve' to retry unresolved file merges
1101 [1]
1101 [1]
1102 $ aftermerge
1102 $ aftermerge
1103 # cat f
1103 # cat f
1104 revision 1
1104 revision 1
1105 space
1105 space
1106 # hg stat
1106 # hg stat
1107 M f
1107 M f
1108 ? f.orig
1108 ? f.orig
1109 # hg resolve --list
1109 # hg resolve --list
1110 U f
1110 U f
1111
1111
1112 Default is silent simplemerge:
1112 Default is silent simplemerge:
1113
1113
1114 $ beforemerge
1114 $ beforemerge
1115 [merge-tools]
1115 [merge-tools]
1116 false.whatever=
1116 false.whatever=
1117 true.priority=1
1117 true.priority=1
1118 true.executable=cat
1118 true.executable=cat
1119 # hg update -C 1
1119 # hg update -C 1
1120 $ hg merge -r 3
1120 $ hg merge -r 3
1121 merging f
1121 merging f
1122 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1122 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1123 (branch merge, don't forget to commit)
1123 (branch merge, don't forget to commit)
1124 $ aftermerge
1124 $ aftermerge
1125 # cat f
1125 # cat f
1126 revision 1
1126 revision 1
1127 space
1127 space
1128 revision 3
1128 revision 3
1129 # hg stat
1129 # hg stat
1130 M f
1130 M f
1131 # hg resolve --list
1131 # hg resolve --list
1132 R f
1132 R f
1133
1133
1134 .premerge=True is same:
1134 .premerge=True is same:
1135
1135
1136 $ beforemerge
1136 $ beforemerge
1137 [merge-tools]
1137 [merge-tools]
1138 false.whatever=
1138 false.whatever=
1139 true.priority=1
1139 true.priority=1
1140 true.executable=cat
1140 true.executable=cat
1141 # hg update -C 1
1141 # hg update -C 1
1142 $ hg merge -r 3 --config merge-tools.true.premerge=True
1142 $ hg merge -r 3 --config merge-tools.true.premerge=True
1143 merging f
1143 merging f
1144 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1144 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1145 (branch merge, don't forget to commit)
1145 (branch merge, don't forget to commit)
1146 $ aftermerge
1146 $ aftermerge
1147 # cat f
1147 # cat f
1148 revision 1
1148 revision 1
1149 space
1149 space
1150 revision 3
1150 revision 3
1151 # hg stat
1151 # hg stat
1152 M f
1152 M f
1153 # hg resolve --list
1153 # hg resolve --list
1154 R f
1154 R f
1155
1155
1156 .premerge=False executes merge-tool:
1156 .premerge=False executes merge-tool:
1157
1157
1158 $ beforemerge
1158 $ beforemerge
1159 [merge-tools]
1159 [merge-tools]
1160 false.whatever=
1160 false.whatever=
1161 true.priority=1
1161 true.priority=1
1162 true.executable=cat
1162 true.executable=cat
1163 # hg update -C 1
1163 # hg update -C 1
1164 $ hg merge -r 3 --config merge-tools.true.premerge=False
1164 $ hg merge -r 3 --config merge-tools.true.premerge=False
1165 merging f
1165 merging f
1166 revision 1
1166 revision 1
1167 space
1167 space
1168 revision 0
1168 revision 0
1169 space
1169 space
1170 revision 0
1170 revision 0
1171 space
1171 space
1172 revision 3
1172 revision 3
1173 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1173 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1174 (branch merge, don't forget to commit)
1174 (branch merge, don't forget to commit)
1175 $ aftermerge
1175 $ aftermerge
1176 # cat f
1176 # cat f
1177 revision 1
1177 revision 1
1178 space
1178 space
1179 # hg stat
1179 # hg stat
1180 M f
1180 M f
1181 # hg resolve --list
1181 # hg resolve --list
1182 R f
1182 R f
1183
1183
1184 premerge=keep keeps conflict markers in:
1184 premerge=keep keeps conflict markers in:
1185
1185
1186 $ beforemerge
1186 $ beforemerge
1187 [merge-tools]
1187 [merge-tools]
1188 false.whatever=
1188 false.whatever=
1189 true.priority=1
1189 true.priority=1
1190 true.executable=cat
1190 true.executable=cat
1191 # hg update -C 1
1191 # hg update -C 1
1192 $ hg merge -r 4 --config merge-tools.true.premerge=keep
1192 $ hg merge -r 4 --config merge-tools.true.premerge=keep
1193 merging f
1193 merging f
1194 <<<<<<< working copy: ef83787e2614 - test: revision 1
1194 <<<<<<< working copy: ef83787e2614 - test: revision 1
1195 revision 1
1195 revision 1
1196 space
1196 space
1197 =======
1197 =======
1198 revision 4
1198 revision 4
1199 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1199 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1200 revision 0
1200 revision 0
1201 space
1201 space
1202 revision 4
1202 revision 4
1203 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1203 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1204 (branch merge, don't forget to commit)
1204 (branch merge, don't forget to commit)
1205 $ aftermerge
1205 $ aftermerge
1206 # cat f
1206 # cat f
1207 <<<<<<< working copy: ef83787e2614 - test: revision 1
1207 <<<<<<< working copy: ef83787e2614 - test: revision 1
1208 revision 1
1208 revision 1
1209 space
1209 space
1210 =======
1210 =======
1211 revision 4
1211 revision 4
1212 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1212 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1213 # hg stat
1213 # hg stat
1214 M f
1214 M f
1215 # hg resolve --list
1215 # hg resolve --list
1216 R f
1216 R f
1217
1217
1218 premerge=keep-merge3 keeps conflict markers with base content:
1218 premerge=keep-merge3 keeps conflict markers with base content:
1219
1219
1220 $ beforemerge
1220 $ beforemerge
1221 [merge-tools]
1221 [merge-tools]
1222 false.whatever=
1222 false.whatever=
1223 true.priority=1
1223 true.priority=1
1224 true.executable=cat
1224 true.executable=cat
1225 # hg update -C 1
1225 # hg update -C 1
1226 $ hg merge -r 4 --config merge-tools.true.premerge=keep-merge3
1226 $ hg merge -r 4 --config merge-tools.true.premerge=keep-merge3
1227 merging f
1227 merging f
1228 <<<<<<< working copy: ef83787e2614 - test: revision 1
1228 <<<<<<< working copy: ef83787e2614 - test: revision 1
1229 revision 1
1229 revision 1
1230 space
1230 space
1231 ||||||| base
1231 ||||||| base
1232 revision 0
1232 revision 0
1233 space
1233 space
1234 =======
1234 =======
1235 revision 4
1235 revision 4
1236 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1236 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1237 revision 0
1237 revision 0
1238 space
1238 space
1239 revision 4
1239 revision 4
1240 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1240 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1241 (branch merge, don't forget to commit)
1241 (branch merge, don't forget to commit)
1242 $ aftermerge
1242 $ aftermerge
1243 # cat f
1243 # cat f
1244 <<<<<<< working copy: ef83787e2614 - test: revision 1
1244 <<<<<<< working copy: ef83787e2614 - test: revision 1
1245 revision 1
1245 revision 1
1246 space
1246 space
1247 ||||||| base
1247 ||||||| base
1248 revision 0
1248 revision 0
1249 space
1249 space
1250 =======
1250 =======
1251 revision 4
1251 revision 4
1252 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1252 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1253 # hg stat
1253 # hg stat
1254 M f
1254 M f
1255 # hg resolve --list
1255 # hg resolve --list
1256 R f
1256 R f
1257
1257
1258 premerge=keep-mergediff keeps conflict markers with base content:
1259
1260 $ beforemerge
1261 [merge-tools]
1262 false.whatever=
1263 true.priority=1
1264 true.executable=cat
1265 # hg update -C 1
1266 $ hg merge -r 4 --config merge-tools.true.premerge=keep-mergediff
1267 merging f
1268 <<<<<<<
1269 ------- base
1270 +++++++ working copy: ef83787e2614 - test: revision 1
1271 -revision 0
1272 +revision 1
1273 space
1274 ======= merge rev: 81448d39c9a0 - test: revision 4
1275 revision 4
1276 >>>>>>>
1277 revision 0
1278 space
1279 revision 4
1280 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1281 (branch merge, don't forget to commit)
1282 $ aftermerge
1283 # cat f
1284 <<<<<<<
1285 ------- base
1286 +++++++ working copy: ef83787e2614 - test: revision 1
1287 -revision 0
1288 +revision 1
1289 space
1290 ======= merge rev: 81448d39c9a0 - test: revision 4
1291 revision 4
1292 >>>>>>>
1293 # hg stat
1294 M f
1295 # hg resolve --list
1296 R f
1297
1258 premerge=keep respects ui.mergemarkers=basic:
1298 premerge=keep respects ui.mergemarkers=basic:
1259
1299
1260 $ beforemerge
1300 $ beforemerge
1261 [merge-tools]
1301 [merge-tools]
1262 false.whatever=
1302 false.whatever=
1263 true.priority=1
1303 true.priority=1
1264 true.executable=cat
1304 true.executable=cat
1265 # hg update -C 1
1305 # hg update -C 1
1266 $ hg merge -r 4 --config merge-tools.true.premerge=keep --config ui.mergemarkers=basic
1306 $ hg merge -r 4 --config merge-tools.true.premerge=keep --config ui.mergemarkers=basic
1267 merging f
1307 merging f
1268 <<<<<<< working copy
1308 <<<<<<< working copy
1269 revision 1
1309 revision 1
1270 space
1310 space
1271 =======
1311 =======
1272 revision 4
1312 revision 4
1273 >>>>>>> merge rev
1313 >>>>>>> merge rev
1274 revision 0
1314 revision 0
1275 space
1315 space
1276 revision 4
1316 revision 4
1277 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1317 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1278 (branch merge, don't forget to commit)
1318 (branch merge, don't forget to commit)
1279 $ aftermerge
1319 $ aftermerge
1280 # cat f
1320 # cat f
1281 <<<<<<< working copy
1321 <<<<<<< working copy
1282 revision 1
1322 revision 1
1283 space
1323 space
1284 =======
1324 =======
1285 revision 4
1325 revision 4
1286 >>>>>>> merge rev
1326 >>>>>>> merge rev
1287 # hg stat
1327 # hg stat
1288 M f
1328 M f
1289 # hg resolve --list
1329 # hg resolve --list
1290 R f
1330 R f
1291
1331
1292 premerge=keep ignores ui.mergemarkers=basic if true.mergemarkers=detailed:
1332 premerge=keep ignores ui.mergemarkers=basic if true.mergemarkers=detailed:
1293
1333
1294 $ beforemerge
1334 $ beforemerge
1295 [merge-tools]
1335 [merge-tools]
1296 false.whatever=
1336 false.whatever=
1297 true.priority=1
1337 true.priority=1
1298 true.executable=cat
1338 true.executable=cat
1299 # hg update -C 1
1339 # hg update -C 1
1300 $ hg merge -r 4 --config merge-tools.true.premerge=keep \
1340 $ hg merge -r 4 --config merge-tools.true.premerge=keep \
1301 > --config ui.mergemarkers=basic \
1341 > --config ui.mergemarkers=basic \
1302 > --config merge-tools.true.mergemarkers=detailed
1342 > --config merge-tools.true.mergemarkers=detailed
1303 merging f
1343 merging f
1304 <<<<<<< working copy: ef83787e2614 - test: revision 1
1344 <<<<<<< working copy: ef83787e2614 - test: revision 1
1305 revision 1
1345 revision 1
1306 space
1346 space
1307 =======
1347 =======
1308 revision 4
1348 revision 4
1309 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1349 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1310 revision 0
1350 revision 0
1311 space
1351 space
1312 revision 4
1352 revision 4
1313 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1353 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1314 (branch merge, don't forget to commit)
1354 (branch merge, don't forget to commit)
1315 $ aftermerge
1355 $ aftermerge
1316 # cat f
1356 # cat f
1317 <<<<<<< working copy: ef83787e2614 - test: revision 1
1357 <<<<<<< working copy: ef83787e2614 - test: revision 1
1318 revision 1
1358 revision 1
1319 space
1359 space
1320 =======
1360 =======
1321 revision 4
1361 revision 4
1322 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1362 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1323 # hg stat
1363 # hg stat
1324 M f
1364 M f
1325 # hg resolve --list
1365 # hg resolve --list
1326 R f
1366 R f
1327
1367
1328 premerge=keep respects ui.mergemarkertemplate instead of
1368 premerge=keep respects ui.mergemarkertemplate instead of
1329 true.mergemarkertemplate if true.mergemarkers=basic:
1369 true.mergemarkertemplate if true.mergemarkers=basic:
1330
1370
1331 $ beforemerge
1371 $ beforemerge
1332 [merge-tools]
1372 [merge-tools]
1333 false.whatever=
1373 false.whatever=
1334 true.priority=1
1374 true.priority=1
1335 true.executable=cat
1375 true.executable=cat
1336 # hg update -C 1
1376 # hg update -C 1
1337 $ hg merge -r 4 --config merge-tools.true.premerge=keep \
1377 $ hg merge -r 4 --config merge-tools.true.premerge=keep \
1338 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1378 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1339 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}'
1379 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}'
1340 merging f
1380 merging f
1341 <<<<<<< working copy: uitmpl 1
1381 <<<<<<< working copy: uitmpl 1
1342 revision 1
1382 revision 1
1343 space
1383 space
1344 =======
1384 =======
1345 revision 4
1385 revision 4
1346 >>>>>>> merge rev: uitmpl 4
1386 >>>>>>> merge rev: uitmpl 4
1347 revision 0
1387 revision 0
1348 space
1388 space
1349 revision 4
1389 revision 4
1350 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1390 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1351 (branch merge, don't forget to commit)
1391 (branch merge, don't forget to commit)
1352 $ aftermerge
1392 $ aftermerge
1353 # cat f
1393 # cat f
1354 <<<<<<< working copy: uitmpl 1
1394 <<<<<<< working copy: uitmpl 1
1355 revision 1
1395 revision 1
1356 space
1396 space
1357 =======
1397 =======
1358 revision 4
1398 revision 4
1359 >>>>>>> merge rev: uitmpl 4
1399 >>>>>>> merge rev: uitmpl 4
1360 # hg stat
1400 # hg stat
1361 M f
1401 M f
1362 # hg resolve --list
1402 # hg resolve --list
1363 R f
1403 R f
1364
1404
1365 premerge=keep respects true.mergemarkertemplate instead of
1405 premerge=keep respects true.mergemarkertemplate instead of
1366 true.mergemarkertemplate if true.mergemarkers=detailed:
1406 true.mergemarkertemplate if true.mergemarkers=detailed:
1367
1407
1368 $ beforemerge
1408 $ beforemerge
1369 [merge-tools]
1409 [merge-tools]
1370 false.whatever=
1410 false.whatever=
1371 true.priority=1
1411 true.priority=1
1372 true.executable=cat
1412 true.executable=cat
1373 # hg update -C 1
1413 # hg update -C 1
1374 $ hg merge -r 4 --config merge-tools.true.premerge=keep \
1414 $ hg merge -r 4 --config merge-tools.true.premerge=keep \
1375 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1415 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1376 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1416 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1377 > --config merge-tools.true.mergemarkers=detailed
1417 > --config merge-tools.true.mergemarkers=detailed
1378 merging f
1418 merging f
1379 <<<<<<< working copy: tooltmpl ef83787e2614
1419 <<<<<<< working copy: tooltmpl ef83787e2614
1380 revision 1
1420 revision 1
1381 space
1421 space
1382 =======
1422 =======
1383 revision 4
1423 revision 4
1384 >>>>>>> merge rev: tooltmpl 81448d39c9a0
1424 >>>>>>> merge rev: tooltmpl 81448d39c9a0
1385 revision 0
1425 revision 0
1386 space
1426 space
1387 revision 4
1427 revision 4
1388 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1428 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1389 (branch merge, don't forget to commit)
1429 (branch merge, don't forget to commit)
1390 $ aftermerge
1430 $ aftermerge
1391 # cat f
1431 # cat f
1392 <<<<<<< working copy: tooltmpl ef83787e2614
1432 <<<<<<< working copy: tooltmpl ef83787e2614
1393 revision 1
1433 revision 1
1394 space
1434 space
1395 =======
1435 =======
1396 revision 4
1436 revision 4
1397 >>>>>>> merge rev: tooltmpl 81448d39c9a0
1437 >>>>>>> merge rev: tooltmpl 81448d39c9a0
1398 # hg stat
1438 # hg stat
1399 M f
1439 M f
1400 # hg resolve --list
1440 # hg resolve --list
1401 R f
1441 R f
1402
1442
1403 Tool execution
1443 Tool execution
1404
1444
1405 set tools.args explicit to include $base $local $other $output:
1445 set tools.args explicit to include $base $local $other $output:
1406
1446
1407 $ beforemerge
1447 $ beforemerge
1408 [merge-tools]
1448 [merge-tools]
1409 false.whatever=
1449 false.whatever=
1410 true.priority=1
1450 true.priority=1
1411 true.executable=cat
1451 true.executable=cat
1412 # hg update -C 1
1452 # hg update -C 1
1413 $ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \
1453 $ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \
1414 > | sed 's,==> .* <==,==> ... <==,g'
1454 > | sed 's,==> .* <==,==> ... <==,g'
1415 merging f
1455 merging f
1416 ==> ... <==
1456 ==> ... <==
1417 revision 0
1457 revision 0
1418 space
1458 space
1419
1459
1420 ==> ... <==
1460 ==> ... <==
1421 revision 1
1461 revision 1
1422 space
1462 space
1423
1463
1424 ==> ... <==
1464 ==> ... <==
1425 revision 2
1465 revision 2
1426 space
1466 space
1427
1467
1428 ==> ... <==
1468 ==> ... <==
1429 revision 1
1469 revision 1
1430 space
1470 space
1431 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1471 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1432 (branch merge, don't forget to commit)
1472 (branch merge, don't forget to commit)
1433 $ aftermerge
1473 $ aftermerge
1434 # cat f
1474 # cat f
1435 revision 1
1475 revision 1
1436 space
1476 space
1437 # hg stat
1477 # hg stat
1438 M f
1478 M f
1439 # hg resolve --list
1479 # hg resolve --list
1440 R f
1480 R f
1441
1481
1442 Merge with "echo mergeresult > $local":
1482 Merge with "echo mergeresult > $local":
1443
1483
1444 $ beforemerge
1484 $ beforemerge
1445 [merge-tools]
1485 [merge-tools]
1446 false.whatever=
1486 false.whatever=
1447 true.priority=1
1487 true.priority=1
1448 true.executable=cat
1488 true.executable=cat
1449 # hg update -C 1
1489 # hg update -C 1
1450 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $local'
1490 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $local'
1451 merging f
1491 merging f
1452 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1492 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1453 (branch merge, don't forget to commit)
1493 (branch merge, don't forget to commit)
1454 $ aftermerge
1494 $ aftermerge
1455 # cat f
1495 # cat f
1456 mergeresult
1496 mergeresult
1457 # hg stat
1497 # hg stat
1458 M f
1498 M f
1459 # hg resolve --list
1499 # hg resolve --list
1460 R f
1500 R f
1461
1501
1462 - and $local is the file f:
1502 - and $local is the file f:
1463
1503
1464 $ beforemerge
1504 $ beforemerge
1465 [merge-tools]
1505 [merge-tools]
1466 false.whatever=
1506 false.whatever=
1467 true.priority=1
1507 true.priority=1
1468 true.executable=cat
1508 true.executable=cat
1469 # hg update -C 1
1509 # hg update -C 1
1470 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > f'
1510 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > f'
1471 merging f
1511 merging f
1472 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1512 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1473 (branch merge, don't forget to commit)
1513 (branch merge, don't forget to commit)
1474 $ aftermerge
1514 $ aftermerge
1475 # cat f
1515 # cat f
1476 mergeresult
1516 mergeresult
1477 # hg stat
1517 # hg stat
1478 M f
1518 M f
1479 # hg resolve --list
1519 # hg resolve --list
1480 R f
1520 R f
1481
1521
1482 Merge with "echo mergeresult > $output" - the variable is a bit magic:
1522 Merge with "echo mergeresult > $output" - the variable is a bit magic:
1483
1523
1484 $ beforemerge
1524 $ beforemerge
1485 [merge-tools]
1525 [merge-tools]
1486 false.whatever=
1526 false.whatever=
1487 true.priority=1
1527 true.priority=1
1488 true.executable=cat
1528 true.executable=cat
1489 # hg update -C 1
1529 # hg update -C 1
1490 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $output'
1530 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $output'
1491 merging f
1531 merging f
1492 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1532 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1493 (branch merge, don't forget to commit)
1533 (branch merge, don't forget to commit)
1494 $ aftermerge
1534 $ aftermerge
1495 # cat f
1535 # cat f
1496 mergeresult
1536 mergeresult
1497 # hg stat
1537 # hg stat
1498 M f
1538 M f
1499 # hg resolve --list
1539 # hg resolve --list
1500 R f
1540 R f
1501
1541
1502 Merge using tool with a path that must be quoted:
1542 Merge using tool with a path that must be quoted:
1503
1543
1504 $ beforemerge
1544 $ beforemerge
1505 [merge-tools]
1545 [merge-tools]
1506 false.whatever=
1546 false.whatever=
1507 true.priority=1
1547 true.priority=1
1508 true.executable=cat
1548 true.executable=cat
1509 # hg update -C 1
1549 # hg update -C 1
1510 $ cat <<EOF > 'my merge tool'
1550 $ cat <<EOF > 'my merge tool'
1511 > cat "\$1" "\$2" "\$3" > "\$4"
1551 > cat "\$1" "\$2" "\$3" > "\$4"
1512 > EOF
1552 > EOF
1513 $ hg --config merge-tools.true.executable='sh' \
1553 $ hg --config merge-tools.true.executable='sh' \
1514 > --config merge-tools.true.args='"./my merge tool" $base $local $other $output' \
1554 > --config merge-tools.true.args='"./my merge tool" $base $local $other $output' \
1515 > merge -r 2
1555 > merge -r 2
1516 merging f
1556 merging f
1517 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1557 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1518 (branch merge, don't forget to commit)
1558 (branch merge, don't forget to commit)
1519 $ rm -f 'my merge tool'
1559 $ rm -f 'my merge tool'
1520 $ aftermerge
1560 $ aftermerge
1521 # cat f
1561 # cat f
1522 revision 0
1562 revision 0
1523 space
1563 space
1524 revision 1
1564 revision 1
1525 space
1565 space
1526 revision 2
1566 revision 2
1527 space
1567 space
1528 # hg stat
1568 # hg stat
1529 M f
1569 M f
1530 # hg resolve --list
1570 # hg resolve --list
1531 R f
1571 R f
1532
1572
1533 Merge using a tool that supports labellocal, labelother, and labelbase, checking
1573 Merge using a tool that supports labellocal, labelother, and labelbase, checking
1534 that they're quoted properly as well. This is using the default 'basic'
1574 that they're quoted properly as well. This is using the default 'basic'
1535 mergemarkers even though ui.mergemarkers is 'detailed', so it's ignoring both
1575 mergemarkers even though ui.mergemarkers is 'detailed', so it's ignoring both
1536 mergemarkertemplate settings:
1576 mergemarkertemplate settings:
1537
1577
1538 $ beforemerge
1578 $ beforemerge
1539 [merge-tools]
1579 [merge-tools]
1540 false.whatever=
1580 false.whatever=
1541 true.priority=1
1581 true.priority=1
1542 true.executable=cat
1582 true.executable=cat
1543 # hg update -C 1
1583 # hg update -C 1
1544 $ cat <<EOF > printargs_merge_tool
1584 $ cat <<EOF > printargs_merge_tool
1545 > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done
1585 > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done
1546 > EOF
1586 > EOF
1547 $ hg --config merge-tools.true.executable='sh' \
1587 $ hg --config merge-tools.true.executable='sh' \
1548 > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \
1588 > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \
1549 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1589 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1550 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1590 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1551 > --config ui.mergemarkers=detailed \
1591 > --config ui.mergemarkers=detailed \
1552 > merge -r 2
1592 > merge -r 2
1553 merging f
1593 merging f
1554 arg: "ll:working copy"
1594 arg: "ll:working copy"
1555 arg: "lo:"
1595 arg: "lo:"
1556 arg: "merge rev"
1596 arg: "merge rev"
1557 arg: "lb:base: */f~base.*" (glob)
1597 arg: "lb:base: */f~base.*" (glob)
1558 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1598 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1559 (branch merge, don't forget to commit)
1599 (branch merge, don't forget to commit)
1560 $ rm -f 'printargs_merge_tool'
1600 $ rm -f 'printargs_merge_tool'
1561
1601
1562 Same test with experimental.mergetempdirprefix set:
1602 Same test with experimental.mergetempdirprefix set:
1563
1603
1564 $ beforemerge
1604 $ beforemerge
1565 [merge-tools]
1605 [merge-tools]
1566 false.whatever=
1606 false.whatever=
1567 true.priority=1
1607 true.priority=1
1568 true.executable=cat
1608 true.executable=cat
1569 # hg update -C 1
1609 # hg update -C 1
1570 $ cat <<EOF > printargs_merge_tool
1610 $ cat <<EOF > printargs_merge_tool
1571 > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done
1611 > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done
1572 > EOF
1612 > EOF
1573 $ hg --config experimental.mergetempdirprefix=$TESTTMP/hgmerge. \
1613 $ hg --config experimental.mergetempdirprefix=$TESTTMP/hgmerge. \
1574 > --config merge-tools.true.executable='sh' \
1614 > --config merge-tools.true.executable='sh' \
1575 > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \
1615 > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \
1576 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1616 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1577 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1617 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1578 > --config ui.mergemarkers=detailed \
1618 > --config ui.mergemarkers=detailed \
1579 > merge -r 2
1619 > merge -r 2
1580 merging f
1620 merging f
1581 arg: "ll:working copy"
1621 arg: "ll:working copy"
1582 arg: "lo:"
1622 arg: "lo:"
1583 arg: "merge rev"
1623 arg: "merge rev"
1584 arg: "lb:base: */hgmerge.*/f~base" (glob)
1624 arg: "lb:base: */hgmerge.*/f~base" (glob)
1585 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1625 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1586 (branch merge, don't forget to commit)
1626 (branch merge, don't forget to commit)
1587 $ rm -f 'printargs_merge_tool'
1627 $ rm -f 'printargs_merge_tool'
1588
1628
1589 Merge using a tool that supports labellocal, labelother, and labelbase, checking
1629 Merge using a tool that supports labellocal, labelother, and labelbase, checking
1590 that they're quoted properly as well. This is using 'detailed' mergemarkers,
1630 that they're quoted properly as well. This is using 'detailed' mergemarkers,
1591 even though ui.mergemarkers is 'basic', and using the tool's
1631 even though ui.mergemarkers is 'basic', and using the tool's
1592 mergemarkertemplate:
1632 mergemarkertemplate:
1593
1633
1594 $ beforemerge
1634 $ beforemerge
1595 [merge-tools]
1635 [merge-tools]
1596 false.whatever=
1636 false.whatever=
1597 true.priority=1
1637 true.priority=1
1598 true.executable=cat
1638 true.executable=cat
1599 # hg update -C 1
1639 # hg update -C 1
1600 $ cat <<EOF > printargs_merge_tool
1640 $ cat <<EOF > printargs_merge_tool
1601 > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done
1641 > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done
1602 > EOF
1642 > EOF
1603 $ hg --config merge-tools.true.executable='sh' \
1643 $ hg --config merge-tools.true.executable='sh' \
1604 > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \
1644 > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \
1605 > --config merge-tools.true.mergemarkers=detailed \
1645 > --config merge-tools.true.mergemarkers=detailed \
1606 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1646 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1607 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1647 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1608 > --config ui.mergemarkers=basic \
1648 > --config ui.mergemarkers=basic \
1609 > merge -r 2
1649 > merge -r 2
1610 merging f
1650 merging f
1611 arg: "ll:working copy: tooltmpl ef83787e2614"
1651 arg: "ll:working copy: tooltmpl ef83787e2614"
1612 arg: "lo:"
1652 arg: "lo:"
1613 arg: "merge rev: tooltmpl 0185f4e0cf02"
1653 arg: "merge rev: tooltmpl 0185f4e0cf02"
1614 arg: "lb:base: */f~base.*" (glob)
1654 arg: "lb:base: */f~base.*" (glob)
1615 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1655 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1616 (branch merge, don't forget to commit)
1656 (branch merge, don't forget to commit)
1617 $ rm -f 'printargs_merge_tool'
1657 $ rm -f 'printargs_merge_tool'
1618
1658
1619 The merge tool still gets labellocal and labelother as 'basic' even when
1659 The merge tool still gets labellocal and labelother as 'basic' even when
1620 premerge=keep is used and has 'detailed' markers:
1660 premerge=keep is used and has 'detailed' markers:
1621
1661
1622 $ beforemerge
1662 $ beforemerge
1623 [merge-tools]
1663 [merge-tools]
1624 false.whatever=
1664 false.whatever=
1625 true.priority=1
1665 true.priority=1
1626 true.executable=cat
1666 true.executable=cat
1627 # hg update -C 1
1667 # hg update -C 1
1628 $ cat <<EOF > mytool
1668 $ cat <<EOF > mytool
1629 > echo labellocal: \"\$1\"
1669 > echo labellocal: \"\$1\"
1630 > echo labelother: \"\$2\"
1670 > echo labelother: \"\$2\"
1631 > echo "output (arg)": \"\$3\"
1671 > echo "output (arg)": \"\$3\"
1632 > echo "output (contents)":
1672 > echo "output (contents)":
1633 > cat "\$3"
1673 > cat "\$3"
1634 > EOF
1674 > EOF
1635 $ hg --config merge-tools.true.executable='sh' \
1675 $ hg --config merge-tools.true.executable='sh' \
1636 > --config merge-tools.true.args='mytool $labellocal $labelother $output' \
1676 > --config merge-tools.true.args='mytool $labellocal $labelother $output' \
1637 > --config merge-tools.true.premerge=keep \
1677 > --config merge-tools.true.premerge=keep \
1638 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1678 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1639 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1679 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1640 > --config ui.mergemarkers=detailed \
1680 > --config ui.mergemarkers=detailed \
1641 > merge -r 2
1681 > merge -r 2
1642 merging f
1682 merging f
1643 labellocal: "working copy"
1683 labellocal: "working copy"
1644 labelother: "merge rev"
1684 labelother: "merge rev"
1645 output (arg): "$TESTTMP/repo/f"
1685 output (arg): "$TESTTMP/repo/f"
1646 output (contents):
1686 output (contents):
1647 <<<<<<< working copy: uitmpl 1
1687 <<<<<<< working copy: uitmpl 1
1648 revision 1
1688 revision 1
1649 =======
1689 =======
1650 revision 2
1690 revision 2
1651 >>>>>>> merge rev: uitmpl 2
1691 >>>>>>> merge rev: uitmpl 2
1652 space
1692 space
1653 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1693 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1654 (branch merge, don't forget to commit)
1694 (branch merge, don't forget to commit)
1655 $ rm -f 'mytool'
1695 $ rm -f 'mytool'
1656
1696
1657 premerge=keep uses the *tool's* mergemarkertemplate if tool's
1697 premerge=keep uses the *tool's* mergemarkertemplate if tool's
1658 mergemarkers=detailed; labellocal and labelother also use the tool's template
1698 mergemarkers=detailed; labellocal and labelother also use the tool's template
1659
1699
1660 $ beforemerge
1700 $ beforemerge
1661 [merge-tools]
1701 [merge-tools]
1662 false.whatever=
1702 false.whatever=
1663 true.priority=1
1703 true.priority=1
1664 true.executable=cat
1704 true.executable=cat
1665 # hg update -C 1
1705 # hg update -C 1
1666 $ cat <<EOF > mytool
1706 $ cat <<EOF > mytool
1667 > echo labellocal: \"\$1\"
1707 > echo labellocal: \"\$1\"
1668 > echo labelother: \"\$2\"
1708 > echo labelother: \"\$2\"
1669 > echo "output (arg)": \"\$3\"
1709 > echo "output (arg)": \"\$3\"
1670 > echo "output (contents)":
1710 > echo "output (contents)":
1671 > cat "\$3"
1711 > cat "\$3"
1672 > EOF
1712 > EOF
1673 $ hg --config merge-tools.true.executable='sh' \
1713 $ hg --config merge-tools.true.executable='sh' \
1674 > --config merge-tools.true.args='mytool $labellocal $labelother $output' \
1714 > --config merge-tools.true.args='mytool $labellocal $labelother $output' \
1675 > --config merge-tools.true.premerge=keep \
1715 > --config merge-tools.true.premerge=keep \
1676 > --config merge-tools.true.mergemarkers=detailed \
1716 > --config merge-tools.true.mergemarkers=detailed \
1677 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1717 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1678 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1718 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1679 > --config ui.mergemarkers=detailed \
1719 > --config ui.mergemarkers=detailed \
1680 > merge -r 2
1720 > merge -r 2
1681 merging f
1721 merging f
1682 labellocal: "working copy: tooltmpl ef83787e2614"
1722 labellocal: "working copy: tooltmpl ef83787e2614"
1683 labelother: "merge rev: tooltmpl 0185f4e0cf02"
1723 labelother: "merge rev: tooltmpl 0185f4e0cf02"
1684 output (arg): "$TESTTMP/repo/f"
1724 output (arg): "$TESTTMP/repo/f"
1685 output (contents):
1725 output (contents):
1686 <<<<<<< working copy: tooltmpl ef83787e2614
1726 <<<<<<< working copy: tooltmpl ef83787e2614
1687 revision 1
1727 revision 1
1688 =======
1728 =======
1689 revision 2
1729 revision 2
1690 >>>>>>> merge rev: tooltmpl 0185f4e0cf02
1730 >>>>>>> merge rev: tooltmpl 0185f4e0cf02
1691 space
1731 space
1692 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1732 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1693 (branch merge, don't forget to commit)
1733 (branch merge, don't forget to commit)
1694 $ rm -f 'mytool'
1734 $ rm -f 'mytool'
1695
1735
1696 Issue3581: Merging a filename that needs to be quoted
1736 Issue3581: Merging a filename that needs to be quoted
1697 (This test doesn't work on Windows filesystems even on Linux, so check
1737 (This test doesn't work on Windows filesystems even on Linux, so check
1698 for Unix-like permission)
1738 for Unix-like permission)
1699
1739
1700 #if unix-permissions
1740 #if unix-permissions
1701 $ beforemerge
1741 $ beforemerge
1702 [merge-tools]
1742 [merge-tools]
1703 false.whatever=
1743 false.whatever=
1704 true.priority=1
1744 true.priority=1
1705 true.executable=cat
1745 true.executable=cat
1706 # hg update -C 1
1746 # hg update -C 1
1707 $ echo "revision 5" > '"; exit 1; echo "'
1747 $ echo "revision 5" > '"; exit 1; echo "'
1708 $ hg commit -Am "revision 5"
1748 $ hg commit -Am "revision 5"
1709 adding "; exit 1; echo "
1749 adding "; exit 1; echo "
1710 warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "'
1750 warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "'
1711 $ hg update -C 1 > /dev/null
1751 $ hg update -C 1 > /dev/null
1712 $ echo "revision 6" > '"; exit 1; echo "'
1752 $ echo "revision 6" > '"; exit 1; echo "'
1713 $ hg commit -Am "revision 6"
1753 $ hg commit -Am "revision 6"
1714 adding "; exit 1; echo "
1754 adding "; exit 1; echo "
1715 warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "'
1755 warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "'
1716 created new head
1756 created new head
1717 $ hg merge --config merge-tools.true.executable="true" -r 5
1757 $ hg merge --config merge-tools.true.executable="true" -r 5
1718 merging "; exit 1; echo "
1758 merging "; exit 1; echo "
1719 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1759 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1720 (branch merge, don't forget to commit)
1760 (branch merge, don't forget to commit)
1721 $ hg update -C 1 > /dev/null
1761 $ hg update -C 1 > /dev/null
1722
1762
1723 #else
1763 #else
1724
1764
1725 Match the non-portable filename commits above for test stability
1765 Match the non-portable filename commits above for test stability
1726
1766
1727 $ hg import --bypass -q - << EOF
1767 $ hg import --bypass -q - << EOF
1728 > # HG changeset patch
1768 > # HG changeset patch
1729 > revision 5
1769 > revision 5
1730 >
1770 >
1731 > diff --git a/"; exit 1; echo " b/"; exit 1; echo "
1771 > diff --git a/"; exit 1; echo " b/"; exit 1; echo "
1732 > new file mode 100644
1772 > new file mode 100644
1733 > --- /dev/null
1773 > --- /dev/null
1734 > +++ b/"; exit 1; echo "
1774 > +++ b/"; exit 1; echo "
1735 > @@ -0,0 +1,1 @@
1775 > @@ -0,0 +1,1 @@
1736 > +revision 5
1776 > +revision 5
1737 > EOF
1777 > EOF
1738
1778
1739 $ hg import --bypass -q - << EOF
1779 $ hg import --bypass -q - << EOF
1740 > # HG changeset patch
1780 > # HG changeset patch
1741 > revision 6
1781 > revision 6
1742 >
1782 >
1743 > diff --git a/"; exit 1; echo " b/"; exit 1; echo "
1783 > diff --git a/"; exit 1; echo " b/"; exit 1; echo "
1744 > new file mode 100644
1784 > new file mode 100644
1745 > --- /dev/null
1785 > --- /dev/null
1746 > +++ b/"; exit 1; echo "
1786 > +++ b/"; exit 1; echo "
1747 > @@ -0,0 +1,1 @@
1787 > @@ -0,0 +1,1 @@
1748 > +revision 6
1788 > +revision 6
1749 > EOF
1789 > EOF
1750
1790
1751 #endif
1791 #endif
1752
1792
1753 Merge post-processing
1793 Merge post-processing
1754
1794
1755 cat is a bad merge-tool and doesn't change:
1795 cat is a bad merge-tool and doesn't change:
1756
1796
1757 $ beforemerge
1797 $ beforemerge
1758 [merge-tools]
1798 [merge-tools]
1759 false.whatever=
1799 false.whatever=
1760 true.priority=1
1800 true.priority=1
1761 true.executable=cat
1801 true.executable=cat
1762 # hg update -C 1
1802 # hg update -C 1
1763 $ hg merge -y -r 2 --config merge-tools.true.checkchanged=1
1803 $ hg merge -y -r 2 --config merge-tools.true.checkchanged=1
1764 merging f
1804 merging f
1765 revision 1
1805 revision 1
1766 space
1806 space
1767 revision 0
1807 revision 0
1768 space
1808 space
1769 revision 2
1809 revision 2
1770 space
1810 space
1771 output file f appears unchanged
1811 output file f appears unchanged
1772 was merge successful (yn)? n
1812 was merge successful (yn)? n
1773 merging f failed!
1813 merging f failed!
1774 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1814 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1775 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1815 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1776 [1]
1816 [1]
1777 $ aftermerge
1817 $ aftermerge
1778 # cat f
1818 # cat f
1779 revision 1
1819 revision 1
1780 space
1820 space
1781 # hg stat
1821 # hg stat
1782 M f
1822 M f
1783 ? f.orig
1823 ? f.orig
1784 # hg resolve --list
1824 # hg resolve --list
1785 U f
1825 U f
1786
1826
1787 missingbinary is a merge-tool that doesn't exist:
1827 missingbinary is a merge-tool that doesn't exist:
1788
1828
1789 $ echo "missingbinary.executable=doesnotexist" >> .hg/hgrc
1829 $ echo "missingbinary.executable=doesnotexist" >> .hg/hgrc
1790 $ beforemerge
1830 $ beforemerge
1791 [merge-tools]
1831 [merge-tools]
1792 false.whatever=
1832 false.whatever=
1793 true.priority=1
1833 true.priority=1
1794 true.executable=cat
1834 true.executable=cat
1795 missingbinary.executable=doesnotexist
1835 missingbinary.executable=doesnotexist
1796 # hg update -C 1
1836 # hg update -C 1
1797 $ hg merge -y -r 2 --config ui.merge=missingbinary
1837 $ hg merge -y -r 2 --config ui.merge=missingbinary
1798 couldn't find merge tool missingbinary (for pattern f)
1838 couldn't find merge tool missingbinary (for pattern f)
1799 merging f
1839 merging f
1800 couldn't find merge tool missingbinary (for pattern f)
1840 couldn't find merge tool missingbinary (for pattern f)
1801 revision 1
1841 revision 1
1802 space
1842 space
1803 revision 0
1843 revision 0
1804 space
1844 space
1805 revision 2
1845 revision 2
1806 space
1846 space
1807 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1847 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1808 (branch merge, don't forget to commit)
1848 (branch merge, don't forget to commit)
1809
1849
1810 $ hg update -q -C 1
1850 $ hg update -q -C 1
1811 $ rm f
1851 $ rm f
1812
1852
1813 internal merge cannot handle symlinks and shouldn't try:
1853 internal merge cannot handle symlinks and shouldn't try:
1814
1854
1815 #if symlink
1855 #if symlink
1816
1856
1817 $ ln -s symlink f
1857 $ ln -s symlink f
1818 $ hg commit -qm 'f is symlink'
1858 $ hg commit -qm 'f is symlink'
1819
1859
1820 #else
1860 #else
1821
1861
1822 $ hg import --bypass -q - << EOF
1862 $ hg import --bypass -q - << EOF
1823 > # HG changeset patch
1863 > # HG changeset patch
1824 > f is symlink
1864 > f is symlink
1825 >
1865 >
1826 > diff --git a/f b/f
1866 > diff --git a/f b/f
1827 > old mode 100644
1867 > old mode 100644
1828 > new mode 120000
1868 > new mode 120000
1829 > --- a/f
1869 > --- a/f
1830 > +++ b/f
1870 > +++ b/f
1831 > @@ -1,2 +1,1 @@
1871 > @@ -1,2 +1,1 @@
1832 > -revision 1
1872 > -revision 1
1833 > -space
1873 > -space
1834 > +symlink
1874 > +symlink
1835 > \ No newline at end of file
1875 > \ No newline at end of file
1836 > EOF
1876 > EOF
1837
1877
1838 Resolve 'other [destination] changed f which local [working copy] deleted' prompt
1878 Resolve 'other [destination] changed f which local [working copy] deleted' prompt
1839 $ hg up -q -C --config ui.interactive=True << EOF
1879 $ hg up -q -C --config ui.interactive=True << EOF
1840 > c
1880 > c
1841 > EOF
1881 > EOF
1842
1882
1843 #endif
1883 #endif
1844
1884
1845 $ hg merge -r 2 --tool internal:merge
1885 $ hg merge -r 2 --tool internal:merge
1846 merging f
1886 merging f
1847 warning: internal :merge cannot merge symlinks for f
1887 warning: internal :merge cannot merge symlinks for f
1848 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
1888 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
1849 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1889 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1850 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1890 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1851 [1]
1891 [1]
1852
1892
1853 Verify naming of temporary files and that extension is preserved:
1893 Verify naming of temporary files and that extension is preserved:
1854
1894
1855 $ hg update -q -C 1
1895 $ hg update -q -C 1
1856 $ hg mv f f.txt
1896 $ hg mv f f.txt
1857 $ hg ci -qm "f.txt"
1897 $ hg ci -qm "f.txt"
1858 $ hg update -q -C 2
1898 $ hg update -q -C 2
1859 $ hg merge -y -r tip --tool echo --config merge-tools.echo.args='$base $local $other $output'
1899 $ hg merge -y -r tip --tool echo --config merge-tools.echo.args='$base $local $other $output'
1860 merging f and f.txt to f.txt
1900 merging f and f.txt to f.txt
1861 */f~base.* */f~local.*.txt */f~other.*.txt $TESTTMP/repo/f.txt (glob)
1901 */f~base.* */f~local.*.txt */f~other.*.txt $TESTTMP/repo/f.txt (glob)
1862 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1902 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1863 (branch merge, don't forget to commit)
1903 (branch merge, don't forget to commit)
1864
1904
1865 Verify naming of temporary files and that extension is preserved
1905 Verify naming of temporary files and that extension is preserved
1866 (experimental.mergetempdirprefix version):
1906 (experimental.mergetempdirprefix version):
1867
1907
1868 $ hg update -q -C 1
1908 $ hg update -q -C 1
1869 $ hg mv f f.txt
1909 $ hg mv f f.txt
1870 $ hg ci -qm "f.txt"
1910 $ hg ci -qm "f.txt"
1871 warning: commit already existed in the repository!
1911 warning: commit already existed in the repository!
1872 $ hg update -q -C 2
1912 $ hg update -q -C 2
1873 $ hg merge -y -r tip --tool echo \
1913 $ hg merge -y -r tip --tool echo \
1874 > --config merge-tools.echo.args='$base $local $other $output' \
1914 > --config merge-tools.echo.args='$base $local $other $output' \
1875 > --config experimental.mergetempdirprefix=$TESTTMP/hgmerge.
1915 > --config experimental.mergetempdirprefix=$TESTTMP/hgmerge.
1876 merging f and f.txt to f.txt
1916 merging f and f.txt to f.txt
1877 $TESTTMP/hgmerge.*/f~base $TESTTMP/hgmerge.*/f~local.txt $TESTTMP/hgmerge.*/f~other.txt $TESTTMP/repo/f.txt (glob)
1917 $TESTTMP/hgmerge.*/f~base $TESTTMP/hgmerge.*/f~local.txt $TESTTMP/hgmerge.*/f~other.txt $TESTTMP/repo/f.txt (glob)
1878 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1918 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1879 (branch merge, don't forget to commit)
1919 (branch merge, don't forget to commit)
1880
1920
1881 Binary files capability checking
1921 Binary files capability checking
1882
1922
1883 $ hg update -q -C 0
1923 $ hg update -q -C 0
1884 $ python <<EOF
1924 $ python <<EOF
1885 > with open('b', 'wb') as fp:
1925 > with open('b', 'wb') as fp:
1886 > fp.write(b'\x00\x01\x02\x03')
1926 > fp.write(b'\x00\x01\x02\x03')
1887 > EOF
1927 > EOF
1888 $ hg add b
1928 $ hg add b
1889 $ hg commit -qm "add binary file (#1)"
1929 $ hg commit -qm "add binary file (#1)"
1890
1930
1891 $ hg update -q -C 0
1931 $ hg update -q -C 0
1892 $ python <<EOF
1932 $ python <<EOF
1893 > with open('b', 'wb') as fp:
1933 > with open('b', 'wb') as fp:
1894 > fp.write(b'\x03\x02\x01\x00')
1934 > fp.write(b'\x03\x02\x01\x00')
1895 > EOF
1935 > EOF
1896 $ hg add b
1936 $ hg add b
1897 $ hg commit -qm "add binary file (#2)"
1937 $ hg commit -qm "add binary file (#2)"
1898
1938
1899 By default, binary files capability of internal merge tools is not
1939 By default, binary files capability of internal merge tools is not
1900 checked strictly.
1940 checked strictly.
1901
1941
1902 (for merge-patterns, chosen unintentionally)
1942 (for merge-patterns, chosen unintentionally)
1903
1943
1904 $ hg merge 9 \
1944 $ hg merge 9 \
1905 > --config merge-patterns.b=:merge-other \
1945 > --config merge-patterns.b=:merge-other \
1906 > --config merge-patterns.re:[a-z]=:other
1946 > --config merge-patterns.re:[a-z]=:other
1907 warning: check merge-patterns configurations, if ':merge-other' for binary file 'b' is unintentional
1947 warning: check merge-patterns configurations, if ':merge-other' for binary file 'b' is unintentional
1908 (see 'hg help merge-tools' for binary files capability)
1948 (see 'hg help merge-tools' for binary files capability)
1909 merging b
1949 merging b
1910 warning: b looks like a binary file.
1950 warning: b looks like a binary file.
1911 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1951 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1912 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1952 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1913 [1]
1953 [1]
1914 (Testing that commands.merge.require-rev doesn't break --abort)
1954 (Testing that commands.merge.require-rev doesn't break --abort)
1915 $ hg merge --abort -q
1955 $ hg merge --abort -q
1916
1956
1917 (for ui.merge, ignored unintentionally)
1957 (for ui.merge, ignored unintentionally)
1918
1958
1919 $ hg merge 9 \
1959 $ hg merge 9 \
1920 > --config merge-tools.:other.binary=true \
1960 > --config merge-tools.:other.binary=true \
1921 > --config ui.merge=:other
1961 > --config ui.merge=:other
1922 tool :other (for pattern b) can't handle binary
1962 tool :other (for pattern b) can't handle binary
1923 tool true can't handle binary
1963 tool true can't handle binary
1924 tool :other can't handle binary
1964 tool :other can't handle binary
1925 tool false can't handle binary
1965 tool false can't handle binary
1926 no tool found to merge b
1966 no tool found to merge b
1927 file 'b' needs to be resolved.
1967 file 'b' needs to be resolved.
1928 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
1968 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
1929 What do you want to do? u
1969 What do you want to do? u
1930 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1970 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1931 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1971 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1932 [1]
1972 [1]
1933 $ hg merge --abort -q
1973 $ hg merge --abort -q
1934
1974
1935 With merge.strict-capability-check=true, binary files capability of
1975 With merge.strict-capability-check=true, binary files capability of
1936 internal merge tools is checked strictly.
1976 internal merge tools is checked strictly.
1937
1977
1938 $ f --hexdump b
1978 $ f --hexdump b
1939 b:
1979 b:
1940 0000: 03 02 01 00 |....|
1980 0000: 03 02 01 00 |....|
1941
1981
1942 (for merge-patterns)
1982 (for merge-patterns)
1943
1983
1944 $ hg merge 9 --config merge.strict-capability-check=true \
1984 $ hg merge 9 --config merge.strict-capability-check=true \
1945 > --config merge-tools.:merge-other.binary=true \
1985 > --config merge-tools.:merge-other.binary=true \
1946 > --config merge-patterns.b=:merge-other \
1986 > --config merge-patterns.b=:merge-other \
1947 > --config merge-patterns.re:[a-z]=:other
1987 > --config merge-patterns.re:[a-z]=:other
1948 tool :merge-other (for pattern b) can't handle binary
1988 tool :merge-other (for pattern b) can't handle binary
1949 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1989 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1950 (branch merge, don't forget to commit)
1990 (branch merge, don't forget to commit)
1951 $ f --hexdump b
1991 $ f --hexdump b
1952 b:
1992 b:
1953 0000: 00 01 02 03 |....|
1993 0000: 00 01 02 03 |....|
1954 $ hg merge --abort -q
1994 $ hg merge --abort -q
1955
1995
1956 (for ui.merge)
1996 (for ui.merge)
1957
1997
1958 $ hg merge 9 --config merge.strict-capability-check=true \
1998 $ hg merge 9 --config merge.strict-capability-check=true \
1959 > --config ui.merge=:other
1999 > --config ui.merge=:other
1960 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
2000 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1961 (branch merge, don't forget to commit)
2001 (branch merge, don't forget to commit)
1962 $ f --hexdump b
2002 $ f --hexdump b
1963 b:
2003 b:
1964 0000: 00 01 02 03 |....|
2004 0000: 00 01 02 03 |....|
1965 $ hg merge --abort -q
2005 $ hg merge --abort -q
1966
2006
1967 Check that the extra information is printed correctly
2007 Check that the extra information is printed correctly
1968
2008
1969 $ hg merge 9 \
2009 $ hg merge 9 \
1970 > --config merge-tools.testecho.executable='echo' \
2010 > --config merge-tools.testecho.executable='echo' \
1971 > --config merge-tools.testecho.args='merge runs here ...' \
2011 > --config merge-tools.testecho.args='merge runs here ...' \
1972 > --config merge-tools.testecho.binary=True \
2012 > --config merge-tools.testecho.binary=True \
1973 > --config ui.merge=testecho \
2013 > --config ui.merge=testecho \
1974 > --config ui.pre-merge-tool-output-template='\n{label("extmerge.running_merge_tool", "Running merge tool for {path} ({toolpath}):")}\n{separate("\n", extmerge_section(local), extmerge_section(base), extmerge_section(other))}\n' \
2014 > --config ui.pre-merge-tool-output-template='\n{label("extmerge.running_merge_tool", "Running merge tool for {path} ({toolpath}):")}\n{separate("\n", extmerge_section(local), extmerge_section(base), extmerge_section(other))}\n' \
1975 > --config 'templatealias.extmerge_section(sect)="- {pad("{sect.name} ({sect.label})", 20, left=True)}: {revset(sect.node)%"{rev}:{shortest(node,8)} {desc|firstline} {separate(" ", tags, bookmarks, branch)}"}"'
2015 > --config 'templatealias.extmerge_section(sect)="- {pad("{sect.name} ({sect.label})", 20, left=True)}: {revset(sect.node)%"{rev}:{shortest(node,8)} {desc|firstline} {separate(" ", tags, bookmarks, branch)}"}"'
1976 merging b
2016 merging b
1977
2017
1978 Running merge tool for b ("*/bin/echo.exe"): (glob) (windows !)
2018 Running merge tool for b ("*/bin/echo.exe"): (glob) (windows !)
1979 Running merge tool for b (*/bin/echo): (glob) (no-windows !)
2019 Running merge tool for b (*/bin/echo): (glob) (no-windows !)
1980 - local (working copy): 10:2d1f533d add binary file (#2) tip default
2020 - local (working copy): 10:2d1f533d add binary file (#2) tip default
1981 - base (base): -1:00000000 default
2021 - base (base): -1:00000000 default
1982 - other (merge rev): 9:1e7ad7d7 add binary file (#1) default
2022 - other (merge rev): 9:1e7ad7d7 add binary file (#1) default
1983 merge runs here ...
2023 merge runs here ...
1984 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
2024 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1985 (branch merge, don't forget to commit)
2025 (branch merge, don't forget to commit)
1986
2026
1987 Check that debugpicktool examines which merge tool is chosen for
2027 Check that debugpicktool examines which merge tool is chosen for
1988 specified file as expected
2028 specified file as expected
1989
2029
1990 $ beforemerge
2030 $ beforemerge
1991 [merge-tools]
2031 [merge-tools]
1992 false.whatever=
2032 false.whatever=
1993 true.priority=1
2033 true.priority=1
1994 true.executable=cat
2034 true.executable=cat
1995 missingbinary.executable=doesnotexist
2035 missingbinary.executable=doesnotexist
1996 # hg update -C 1
2036 # hg update -C 1
1997
2037
1998 (default behavior: checking files in the working parent context)
2038 (default behavior: checking files in the working parent context)
1999
2039
2000 $ hg manifest
2040 $ hg manifest
2001 f
2041 f
2002 $ hg debugpickmergetool
2042 $ hg debugpickmergetool
2003 f = true
2043 f = true
2004
2044
2005 (-X/-I and file patterns limmit examination targets)
2045 (-X/-I and file patterns limmit examination targets)
2006
2046
2007 $ hg debugpickmergetool -X f
2047 $ hg debugpickmergetool -X f
2008 $ hg debugpickmergetool unknown
2048 $ hg debugpickmergetool unknown
2009 unknown: no such file in rev ef83787e2614
2049 unknown: no such file in rev ef83787e2614
2010
2050
2011 (--changedelete emulates merging change and delete)
2051 (--changedelete emulates merging change and delete)
2012
2052
2013 $ hg debugpickmergetool --changedelete
2053 $ hg debugpickmergetool --changedelete
2014 f = :prompt
2054 f = :prompt
2015
2055
2016 (-r REV causes checking files in specified revision)
2056 (-r REV causes checking files in specified revision)
2017
2057
2018 $ hg manifest -r 8
2058 $ hg manifest -r 8
2019 f.txt
2059 f.txt
2020 $ hg debugpickmergetool -r 8
2060 $ hg debugpickmergetool -r 8
2021 f.txt = true
2061 f.txt = true
2022
2062
2023 #if symlink
2063 #if symlink
2024
2064
2025 (symlink causes chosing :prompt)
2065 (symlink causes chosing :prompt)
2026
2066
2027 $ hg debugpickmergetool -r 6d00b3726f6e
2067 $ hg debugpickmergetool -r 6d00b3726f6e
2028 f = :prompt
2068 f = :prompt
2029
2069
2030 (by default, it is assumed that no internal merge tools has symlinks
2070 (by default, it is assumed that no internal merge tools has symlinks
2031 capability)
2071 capability)
2032
2072
2033 $ hg debugpickmergetool \
2073 $ hg debugpickmergetool \
2034 > -r 6d00b3726f6e \
2074 > -r 6d00b3726f6e \
2035 > --config merge-tools.:merge-other.symlink=true \
2075 > --config merge-tools.:merge-other.symlink=true \
2036 > --config merge-patterns.f=:merge-other \
2076 > --config merge-patterns.f=:merge-other \
2037 > --config merge-patterns.re:[f]=:merge-local \
2077 > --config merge-patterns.re:[f]=:merge-local \
2038 > --config merge-patterns.re:[a-z]=:other
2078 > --config merge-patterns.re:[a-z]=:other
2039 f = :prompt
2079 f = :prompt
2040
2080
2041 $ hg debugpickmergetool \
2081 $ hg debugpickmergetool \
2042 > -r 6d00b3726f6e \
2082 > -r 6d00b3726f6e \
2043 > --config merge-tools.:other.symlink=true \
2083 > --config merge-tools.:other.symlink=true \
2044 > --config ui.merge=:other
2084 > --config ui.merge=:other
2045 f = :prompt
2085 f = :prompt
2046
2086
2047 (with strict-capability-check=true, actual symlink capabilities are
2087 (with strict-capability-check=true, actual symlink capabilities are
2048 checked striclty)
2088 checked striclty)
2049
2089
2050 $ hg debugpickmergetool --config merge.strict-capability-check=true \
2090 $ hg debugpickmergetool --config merge.strict-capability-check=true \
2051 > -r 6d00b3726f6e \
2091 > -r 6d00b3726f6e \
2052 > --config merge-tools.:merge-other.symlink=true \
2092 > --config merge-tools.:merge-other.symlink=true \
2053 > --config merge-patterns.f=:merge-other \
2093 > --config merge-patterns.f=:merge-other \
2054 > --config merge-patterns.re:[f]=:merge-local \
2094 > --config merge-patterns.re:[f]=:merge-local \
2055 > --config merge-patterns.re:[a-z]=:other
2095 > --config merge-patterns.re:[a-z]=:other
2056 f = :other
2096 f = :other
2057
2097
2058 $ hg debugpickmergetool --config merge.strict-capability-check=true \
2098 $ hg debugpickmergetool --config merge.strict-capability-check=true \
2059 > -r 6d00b3726f6e \
2099 > -r 6d00b3726f6e \
2060 > --config ui.merge=:other
2100 > --config ui.merge=:other
2061 f = :other
2101 f = :other
2062
2102
2063 $ hg debugpickmergetool --config merge.strict-capability-check=true \
2103 $ hg debugpickmergetool --config merge.strict-capability-check=true \
2064 > -r 6d00b3726f6e \
2104 > -r 6d00b3726f6e \
2065 > --config merge-tools.:merge-other.symlink=true \
2105 > --config merge-tools.:merge-other.symlink=true \
2066 > --config ui.merge=:merge-other
2106 > --config ui.merge=:merge-other
2067 f = :prompt
2107 f = :prompt
2068
2108
2069 #endif
2109 #endif
2070
2110
2071 (--verbose shows some configurations)
2111 (--verbose shows some configurations)
2072
2112
2073 $ hg debugpickmergetool --tool foobar -v
2113 $ hg debugpickmergetool --tool foobar -v
2074 with --tool 'foobar'
2114 with --tool 'foobar'
2075 f = foobar
2115 f = foobar
2076
2116
2077 $ HGMERGE=false hg debugpickmergetool -v
2117 $ HGMERGE=false hg debugpickmergetool -v
2078 with HGMERGE='false'
2118 with HGMERGE='false'
2079 f = false
2119 f = false
2080
2120
2081 $ hg debugpickmergetool --config ui.merge=false -v
2121 $ hg debugpickmergetool --config ui.merge=false -v
2082 with ui.merge='false'
2122 with ui.merge='false'
2083 f = false
2123 f = false
2084
2124
2085 (--debug shows errors detected intermediately)
2125 (--debug shows errors detected intermediately)
2086
2126
2087 $ hg debugpickmergetool --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool --debug f
2127 $ hg debugpickmergetool --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool --debug f
2088 couldn't find merge tool true (for pattern f)
2128 couldn't find merge tool true (for pattern f)
2089 couldn't find merge tool true
2129 couldn't find merge tool true
2090 f = false
2130 f = false
2091
2131
2092 $ cd ..
2132 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now