comparison doc/hgrc.5.txt @ 11222:e7adcef1504b

Merge with stable
author Martin Geisler <mg@lazybytes.net>
date Tue, 25 May 2010 18:45:44 +0200
parents d3c1eddfdbcf e655b378ce73
children b9e89fc5c7f1
comparison
equal deleted inserted replaced
11219:39a7f69a0a9a 11222:e7adcef1504b
88 88
89 Syntax 89 Syntax
90 ------ 90 ------
91 91
92 A configuration file consists of sections, led by a ``[section]`` header 92 A configuration file consists of sections, led by a ``[section]`` header
93 and followed by ``name = value`` entries:: 93 and followed by ``name = value`` entries (sometimes called
94 ``configuration keys``)::
94 95
95 [spam] 96 [spam]
96 eggs=ham 97 eggs=ham
97 green= 98 green=
98 eggs 99 eggs
99 100
100 Each line contains one entry. If the lines that follow are indented, 101 Each line contains one entry. If the lines that follow are indented,
101 they are treated as continuations of that entry. Leading whitespace is 102 they are treated as continuations of that entry. Leading whitespace is
102 removed from values. Empty lines are skipped. Lines beginning with 103 removed from values. Empty lines are skipped. Lines beginning with
103 ``#`` or ``;`` are ignored and may be used to provide comments. 104 ``#`` or ``;`` are ignored and may be used to provide comments.
105
106 Configuration keys can be set multiple times, in which case mercurial
107 will use the value that was configured last. As an example::
108
109 [spam]
110 eggs=large
111 ham=serrano
112 eggs=small
113
114 This would set the configuration key named ``eggs`` to ``small``.
115
116 It is also possible to define a section multiple times. A section can
117 be redefined on the same and/or on different hgrc files. For example::
118
119 [foo]
120 eggs=large
121 ham=serrano
122 eggs=small
123
124 [bar]
125 eggs=ham
126 green=
127 eggs
128
129 [foo]
130 ham=prosciutto
131 eggs=medium
132 bread=toasted
133
134 This would set the ``eggs``, ``ham``, and ``bread`` configuration keys
135 of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``,
136 respectively. As you can see there only thing that matters is the last
137 value that was set for each of the configuration keys.
138
139 If a configuration key is set multiple times in different
140 configuration files the final value will depend on the order in which
141 the different configuration files are read, with settings from earlier
142 paths overriding later ones as described on the ``Files`` section
143 above.
104 144
105 A line of the form ``%include file`` will include ``file`` into the 145 A line of the form ``%include file`` will include ``file`` into the
106 current configuration file. The inclusion is recursive, which means 146 current configuration file. The inclusion is recursive, which means
107 that included files can include other files. Filenames are relative to 147 that included files can include other files. Filenames are relative to
108 the configuration file in which the ``%include`` directive is found. 148 the configuration file in which the ``%include`` directive is found.