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