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