Show More
@@ -1,1009 +1,1011 | |||||
1 | ====== |
|
1 | ====== | |
2 | hgrc |
|
2 | hgrc | |
3 | ====== |
|
3 | ====== | |
4 |
|
4 | |||
5 | --------------------------------- |
|
5 | --------------------------------- | |
6 | configuration files for Mercurial |
|
6 | configuration files for Mercurial | |
7 | --------------------------------- |
|
7 | --------------------------------- | |
8 |
|
8 | |||
9 | :Author: Bryan O'Sullivan <bos@serpentine.com> |
|
9 | :Author: Bryan O'Sullivan <bos@serpentine.com> | |
10 | :Organization: Mercurial |
|
10 | :Organization: Mercurial | |
11 | :Manual section: 5 |
|
11 | :Manual section: 5 | |
12 | :Manual group: Mercurial Manual |
|
12 | :Manual group: Mercurial Manual | |
13 |
|
13 | |||
14 | .. contents:: |
|
14 | .. contents:: | |
15 | :backlinks: top |
|
15 | :backlinks: top | |
16 | :class: htmlonly |
|
16 | :class: htmlonly | |
17 |
|
17 | |||
18 |
|
18 | |||
19 | Synopsis |
|
19 | Synopsis | |
20 | -------- |
|
20 | -------- | |
21 |
|
21 | |||
22 | The Mercurial system uses a set of configuration files to control |
|
22 | The Mercurial system uses a set of configuration files to control | |
23 | aspects of its behavior. |
|
23 | aspects of its behavior. | |
24 |
|
24 | |||
25 | Files |
|
25 | Files | |
26 | ----- |
|
26 | ----- | |
27 |
|
27 | |||
28 | Mercurial reads configuration data from several files, if they exist. |
|
28 | Mercurial reads configuration data from several files, if they exist. | |
29 | The names of these files depend on the system on which Mercurial is |
|
29 | The names of these files depend on the system on which Mercurial is | |
30 | installed. ``*.rc`` files from a single directory are read in |
|
30 | installed. ``*.rc`` files from a single directory are read in | |
31 | alphabetical order, later ones overriding earlier ones. Where multiple |
|
31 | alphabetical order, later ones overriding earlier ones. Where multiple | |
32 | paths are given below, settings from earlier paths override later |
|
32 | paths are given below, settings from earlier paths override later | |
33 | ones. |
|
33 | ones. | |
34 |
|
34 | |||
35 | | (Unix, Windows) ``<repo>/.hg/hgrc`` |
|
35 | | (Unix, Windows) ``<repo>/.hg/hgrc`` | |
36 |
|
36 | |||
37 | Per-repository configuration options that only apply in a |
|
37 | Per-repository configuration options that only apply in a | |
38 | particular repository. This file is not version-controlled, and |
|
38 | particular repository. This file is not version-controlled, and | |
39 | will not get transferred during a "clone" operation. Options in |
|
39 | will not get transferred during a "clone" operation. Options in | |
40 | this file override options in all other configuration files. On |
|
40 | this file override options in all other configuration files. On | |
41 | Unix, most of this file will be ignored if it doesn't belong to a |
|
41 | Unix, most of this file will be ignored if it doesn't belong to a | |
42 | trusted user or to a trusted group. See the documentation for the |
|
42 | trusted user or to a trusted group. See the documentation for the | |
43 | trusted_ section below for more details. |
|
43 | trusted_ section below for more details. | |
44 |
|
44 | |||
45 | | (Unix) ``$HOME/.hgrc`` |
|
45 | | (Unix) ``$HOME/.hgrc`` | |
46 | | (Windows) ``%USERPROFILE%\.hgrc`` |
|
46 | | (Windows) ``%USERPROFILE%\.hgrc`` | |
47 | | (Windows) ``%USERPROFILE%\Mercurial.ini`` |
|
47 | | (Windows) ``%USERPROFILE%\Mercurial.ini`` | |
48 | | (Windows) ``%HOME%\.hgrc`` |
|
48 | | (Windows) ``%HOME%\.hgrc`` | |
49 | | (Windows) ``%HOME%\Mercurial.ini`` |
|
49 | | (Windows) ``%HOME%\Mercurial.ini`` | |
50 |
|
50 | |||
51 | Per-user configuration file(s), for the user running Mercurial. On |
|
51 | Per-user configuration file(s), for the user running Mercurial. On | |
52 | Windows 9x, ``%HOME%`` is replaced by ``%APPDATA%``. Options in these |
|
52 | Windows 9x, ``%HOME%`` is replaced by ``%APPDATA%``. Options in these | |
53 | files apply to all Mercurial commands executed by this user in any |
|
53 | files apply to all Mercurial commands executed by this user in any | |
54 | directory. Options in these files override per-system and per-installation |
|
54 | directory. Options in these files override per-system and per-installation | |
55 | options. |
|
55 | options. | |
56 |
|
56 | |||
57 | | (Unix) ``/etc/mercurial/hgrc`` |
|
57 | | (Unix) ``/etc/mercurial/hgrc`` | |
58 | | (Unix) ``/etc/mercurial/hgrc.d/*.rc`` |
|
58 | | (Unix) ``/etc/mercurial/hgrc.d/*.rc`` | |
59 |
|
59 | |||
60 | Per-system configuration files, for the system on which Mercurial |
|
60 | Per-system configuration files, for the system on which Mercurial | |
61 | is running. Options in these files apply to all Mercurial commands |
|
61 | is running. Options in these files apply to all Mercurial commands | |
62 | executed by any user in any directory. Options in these files |
|
62 | executed by any user in any directory. Options in these files | |
63 | override per-installation options. |
|
63 | override per-installation options. | |
64 |
|
64 | |||
65 | | (Unix) ``<install-root>/etc/mercurial/hgrc`` |
|
65 | | (Unix) ``<install-root>/etc/mercurial/hgrc`` | |
66 | | (Unix) ``<install-root>/etc/mercurial/hgrc.d/*.rc`` |
|
66 | | (Unix) ``<install-root>/etc/mercurial/hgrc.d/*.rc`` | |
67 |
|
67 | |||
68 | Per-installation configuration files, searched for in the |
|
68 | Per-installation configuration files, searched for in the | |
69 | directory where Mercurial is installed. ``<install-root>`` is the |
|
69 | directory where Mercurial is installed. ``<install-root>`` is the | |
70 | parent directory of the **hg** executable (or symlink) being run. For |
|
70 | parent directory of the **hg** executable (or symlink) being run. For | |
71 | example, if installed in ``/shared/tools/bin/hg``, Mercurial will look |
|
71 | example, if installed in ``/shared/tools/bin/hg``, Mercurial will look | |
72 | in ``/shared/tools/etc/mercurial/hgrc``. Options in these files apply |
|
72 | in ``/shared/tools/etc/mercurial/hgrc``. Options in these files apply | |
73 | to all Mercurial commands executed by any user in any directory. |
|
73 | to all Mercurial commands executed by any user in any directory. | |
74 |
|
74 | |||
75 | | (Windows) ``<install-dir>\Mercurial.ini`` |
|
75 | | (Windows) ``<install-dir>\Mercurial.ini`` | |
76 | | (Windows) ``<install-dir>\hgrc.d\*.rc`` |
|
76 | | (Windows) ``<install-dir>\hgrc.d\*.rc`` | |
77 | | (Windows) ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` |
|
77 | | (Windows) ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` | |
78 |
|
78 | |||
79 | Per-installation/system configuration files, for the system on |
|
79 | Per-installation/system configuration files, for the system on | |
80 | which Mercurial is running. Options in these files apply to all |
|
80 | which Mercurial is running. Options in these files apply to all | |
81 | Mercurial commands executed by any user in any directory. Registry |
|
81 | Mercurial commands executed by any user in any directory. Registry | |
82 | keys contain PATH-like strings, every part of which must reference |
|
82 | keys contain PATH-like strings, every part of which must reference | |
83 | a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will |
|
83 | a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will | |
84 | be read. Mercurial checks each of these locations in the specified |
|
84 | be read. Mercurial checks each of these locations in the specified | |
85 | order until one or more configuration files are detected. If the |
|
85 | order until one or more configuration files are detected. If the | |
86 | pywin32 extensions are not installed, Mercurial will only look for |
|
86 | pywin32 extensions are not installed, Mercurial will only look for | |
87 | site-wide configuration in ``C:\Mercurial\Mercurial.ini``. |
|
87 | site-wide configuration in ``C:\Mercurial\Mercurial.ini``. | |
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:: | |
94 |
|
94 | |||
95 | [spam] |
|
95 | [spam] | |
96 | eggs=ham |
|
96 | eggs=ham | |
97 | green= |
|
97 | green= | |
98 | eggs |
|
98 | eggs | |
99 |
|
99 | |||
100 | Each line contains one entry. If the lines that follow are indented, |
|
100 | Each line contains one entry. If the lines that follow are indented, | |
101 | they are treated as continuations of that entry. Leading whitespace is |
|
101 | they are treated as continuations of that entry. Leading whitespace is | |
102 | removed from values. Empty lines are skipped. Lines beginning with |
|
102 | removed from values. Empty lines are skipped. Lines beginning with | |
103 | ``#`` or ``;`` are ignored and may be used to provide comments. |
|
103 | ``#`` or ``;`` are ignored and may be used to provide comments. | |
104 |
|
104 | |||
105 | A line of the form ``%include file`` will include ``file`` into the |
|
105 | A line of the form ``%include file`` will include ``file`` into the | |
106 | current configuration file. The inclusion is recursive, which means |
|
106 | current configuration file. The inclusion is recursive, which means | |
107 | that included files can include other files. Filenames are relative to |
|
107 | that included files can include other files. Filenames are relative to | |
108 | the configuration file in which the ``%include`` directive is found. |
|
108 | the configuration file in which the ``%include`` directive is found. | |
109 |
|
109 | |||
110 | A line with ``%unset name`` will remove ``name`` from the current |
|
110 | A line with ``%unset name`` will remove ``name`` from the current | |
111 | section, if it has been set previously. |
|
111 | section, if it has been set previously. | |
112 |
|
112 | |||
113 | The values are either free-form text strings, lists of text strings, |
|
113 | The values are either free-form text strings, lists of text strings, | |
114 | or Boolean values. Boolean values can be set to true using any of "1", |
|
114 | or Boolean values. Boolean values can be set to true using any of "1", | |
115 | "yes", "true", or "on" and to false using "0", "no", "false", or "off" |
|
115 | "yes", "true", or "on" and to false using "0", "no", "false", or "off" | |
116 | (all case insensitive). |
|
116 | (all case insensitive). | |
117 |
|
117 | |||
118 | List values are separated by whitespace or comma, except when values are |
|
118 | List values are separated by whitespace or comma, except when values are | |
119 | placed in double quotation marks:: |
|
119 | placed in double quotation marks:: | |
120 |
|
120 | |||
121 | allow_read = "John Doe, PhD", brian, betty |
|
121 | allow_read = "John Doe, PhD", brian, betty | |
122 |
|
122 | |||
123 | Quotation marks can be escaped by prefixing them with a backslash. Only |
|
123 | Quotation marks can be escaped by prefixing them with a backslash. Only | |
124 | quotation marks at the beginning of a word is counted as a quotation |
|
124 | quotation marks at the beginning of a word is counted as a quotation | |
125 | (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``). |
|
125 | (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``). | |
126 |
|
126 | |||
127 | Sections |
|
127 | Sections | |
128 | -------- |
|
128 | -------- | |
129 |
|
129 | |||
130 | This section describes the different sections that may appear in a |
|
130 | This section describes the different sections that may appear in a | |
131 | Mercurial "hgrc" file, the purpose of each section, its possible keys, |
|
131 | Mercurial "hgrc" file, the purpose of each section, its possible keys, | |
132 | and their possible values. |
|
132 | and their possible values. | |
133 |
|
133 | |||
134 | ``alias`` |
|
134 | ``alias`` | |
135 | """"""""" |
|
135 | """"""""" | |
136 | Defines command aliases. |
|
136 | Defines command aliases. | |
137 | Aliases allow you to define your own commands in terms of other |
|
137 | Aliases allow you to define your own commands in terms of other | |
138 | commands (or aliases), optionally including arguments. |
|
138 | commands (or aliases), optionally including arguments. | |
139 |
|
139 | |||
140 | Alias definitions consist of lines of the form:: |
|
140 | Alias definitions consist of lines of the form:: | |
141 |
|
141 | |||
142 | <alias> = <command> [<argument]... |
|
142 | <alias> = <command> [<argument]... | |
143 |
|
143 | |||
144 | For example, this definition:: |
|
144 | For example, this definition:: | |
145 |
|
145 | |||
146 | latest = log --limit 5 |
|
146 | latest = log --limit 5 | |
147 |
|
147 | |||
148 | creates a new command ``latest`` that shows only the five most recent |
|
148 | creates a new command ``latest`` that shows only the five most recent | |
149 | changesets. You can define subsequent aliases using earlier ones:: |
|
149 | changesets. You can define subsequent aliases using earlier ones:: | |
150 |
|
150 | |||
151 | stable5 = latest -b stable |
|
151 | stable5 = latest -b stable | |
152 |
|
152 | |||
153 | .. note:: It is possible to create aliases with the same names as |
|
153 | .. note:: It is possible to create aliases with the same names as | |
154 | existing commands, which will then override the original |
|
154 | existing commands, which will then override the original | |
155 | definitions. This is almost always a bad idea! |
|
155 | definitions. This is almost always a bad idea! | |
156 |
|
156 | |||
157 |
|
157 | |||
158 | ``auth`` |
|
158 | ``auth`` | |
159 | """""""" |
|
159 | """""""" | |
160 | Authentication credentials for HTTP authentication. Each line has |
|
160 | Authentication credentials for HTTP authentication. Each line has | |
161 | the following format:: |
|
161 | the following format:: | |
162 |
|
162 | |||
163 | <name>.<argument> = <value> |
|
163 | <name>.<argument> = <value> | |
164 |
|
164 | |||
165 | where ``<name>`` is used to group arguments into authentication |
|
165 | where ``<name>`` is used to group arguments into authentication | |
166 | entries. Example:: |
|
166 | entries. Example:: | |
167 |
|
167 | |||
168 | foo.prefix = hg.intevation.org/mercurial |
|
168 | foo.prefix = hg.intevation.org/mercurial | |
169 | foo.username = foo |
|
169 | foo.username = foo | |
170 | foo.password = bar |
|
170 | foo.password = bar | |
171 | foo.schemes = http https |
|
171 | foo.schemes = http https | |
172 |
|
172 | |||
173 | bar.prefix = secure.example.org |
|
173 | bar.prefix = secure.example.org | |
174 | bar.key = path/to/file.key |
|
174 | bar.key = path/to/file.key | |
175 | bar.cert = path/to/file.cert |
|
175 | bar.cert = path/to/file.cert | |
176 | bar.schemes = https |
|
176 | bar.schemes = https | |
177 |
|
177 | |||
178 | Supported arguments: |
|
178 | Supported arguments: | |
179 |
|
179 | |||
180 | ``prefix`` |
|
180 | ``prefix`` | |
181 | Either ``*`` or a URI prefix with or without the scheme part. |
|
181 | Either ``*`` or a URI prefix with or without the scheme part. | |
182 | The authentication entry with the longest matching prefix is used |
|
182 | The authentication entry with the longest matching prefix is used | |
183 | (where ``*`` matches everything and counts as a match of length |
|
183 | (where ``*`` matches everything and counts as a match of length | |
184 | 1). If the prefix doesn't include a scheme, the match is performed |
|
184 | 1). If the prefix doesn't include a scheme, the match is performed | |
185 | against the URI with its scheme stripped as well, and the schemes |
|
185 | against the URI with its scheme stripped as well, and the schemes | |
186 | argument, q.v., is then subsequently consulted. |
|
186 | argument, q.v., is then subsequently consulted. | |
187 | ``username`` |
|
187 | ``username`` | |
188 | Optional. Username to authenticate with. If not given, and the |
|
188 | Optional. Username to authenticate with. If not given, and the | |
189 | remote site requires basic or digest authentication, the user |
|
189 | remote site requires basic or digest authentication, the user | |
190 | will be prompted for it. |
|
190 | will be prompted for it. | |
191 | ``password`` |
|
191 | ``password`` | |
192 | Optional. Password to authenticate with. If not given, and the |
|
192 | Optional. Password to authenticate with. If not given, and the | |
193 | remote site requires basic or digest authentication, the user |
|
193 | remote site requires basic or digest authentication, the user | |
194 | will be prompted for it. |
|
194 | will be prompted for it. | |
195 | ``key`` |
|
195 | ``key`` | |
196 | Optional. PEM encoded client certificate key file. |
|
196 | Optional. PEM encoded client certificate key file. | |
197 | ``cert`` |
|
197 | ``cert`` | |
198 | Optional. PEM encoded client certificate chain file. |
|
198 | Optional. PEM encoded client certificate chain file. | |
199 | ``schemes`` |
|
199 | ``schemes`` | |
200 | Optional. Space separated list of URI schemes to use this |
|
200 | Optional. Space separated list of URI schemes to use this | |
201 | authentication entry with. Only used if the prefix doesn't include |
|
201 | authentication entry with. Only used if the prefix doesn't include | |
202 | a scheme. Supported schemes are http and https. They will match |
|
202 | a scheme. Supported schemes are http and https. They will match | |
203 | static-http and static-https respectively, as well. |
|
203 | static-http and static-https respectively, as well. | |
204 | Default: https. |
|
204 | Default: https. | |
205 |
|
205 | |||
206 | If no suitable authentication entry is found, the user is prompted |
|
206 | If no suitable authentication entry is found, the user is prompted | |
207 | for credentials as usual if required by the remote. |
|
207 | for credentials as usual if required by the remote. | |
208 |
|
208 | |||
209 |
|
209 | |||
210 | ``decode/encode`` |
|
210 | ``decode/encode`` | |
211 | """"""""""""""""" |
|
211 | """"""""""""""""" | |
212 | Filters for transforming files on checkout/checkin. This would |
|
212 | Filters for transforming files on checkout/checkin. This would | |
213 | typically be used for newline processing or other |
|
213 | typically be used for newline processing or other | |
214 | localization/canonicalization of files. |
|
214 | localization/canonicalization of files. | |
215 |
|
215 | |||
216 | Filters consist of a filter pattern followed by a filter command. |
|
216 | Filters consist of a filter pattern followed by a filter command. | |
217 | Filter patterns are globs by default, rooted at the repository root. |
|
217 | Filter patterns are globs by default, rooted at the repository root. | |
218 | For example, to match any file ending in ``.txt`` in the root |
|
218 | For example, to match any file ending in ``.txt`` in the root | |
219 | directory only, use the pattern ``*.txt``. To match any file ending |
|
219 | directory only, use the pattern ``*.txt``. To match any file ending | |
220 | in ``.c`` anywhere in the repository, use the pattern ``**.c``. |
|
220 | in ``.c`` anywhere in the repository, use the pattern ``**.c``. | |
221 | For each file only the first matching filter applies. |
|
221 | For each file only the first matching filter applies. | |
222 |
|
222 | |||
223 | The filter command can start with a specifier, either ``pipe:`` or |
|
223 | The filter command can start with a specifier, either ``pipe:`` or | |
224 | ``tempfile:``. If no specifier is given, ``pipe:`` is used by default. |
|
224 | ``tempfile:``. If no specifier is given, ``pipe:`` is used by default. | |
225 |
|
225 | |||
226 | A ``pipe:`` command must accept data on stdin and return the transformed |
|
226 | A ``pipe:`` command must accept data on stdin and return the transformed | |
227 | data on stdout. |
|
227 | data on stdout. | |
228 |
|
228 | |||
229 | Pipe example:: |
|
229 | Pipe example:: | |
230 |
|
230 | |||
231 | [encode] |
|
231 | [encode] | |
232 | # uncompress gzip files on checkin to improve delta compression |
|
232 | # uncompress gzip files on checkin to improve delta compression | |
233 | # note: not necessarily a good idea, just an example |
|
233 | # note: not necessarily a good idea, just an example | |
234 | *.gz = pipe: gunzip |
|
234 | *.gz = pipe: gunzip | |
235 |
|
235 | |||
236 | [decode] |
|
236 | [decode] | |
237 | # recompress gzip files when writing them to the working dir (we |
|
237 | # recompress gzip files when writing them to the working dir (we | |
238 | # can safely omit "pipe:", because it's the default) |
|
238 | # can safely omit "pipe:", because it's the default) | |
239 | *.gz = gzip |
|
239 | *.gz = gzip | |
240 |
|
240 | |||
241 | A ``tempfile:`` command is a template. The string ``INFILE`` is replaced |
|
241 | A ``tempfile:`` command is a template. The string ``INFILE`` is replaced | |
242 | with the name of a temporary file that contains the data to be |
|
242 | with the name of a temporary file that contains the data to be | |
243 | filtered by the command. The string ``OUTFILE`` is replaced with the name |
|
243 | filtered by the command. The string ``OUTFILE`` is replaced with the name | |
244 | of an empty temporary file, where the filtered data must be written by |
|
244 | of an empty temporary file, where the filtered data must be written by | |
245 | the command. |
|
245 | the command. | |
246 |
|
246 | |||
247 | .. note:: The tempfile mechanism is recommended for Windows systems, |
|
247 | .. note:: The tempfile mechanism is recommended for Windows systems, | |
248 | where the standard shell I/O redirection operators often have |
|
248 | where the standard shell I/O redirection operators often have | |
249 | strange effects and may corrupt the contents of your files. |
|
249 | strange effects and may corrupt the contents of your files. | |
250 |
|
250 | |||
251 | The most common usage is for LF <-> CRLF translation on Windows. For |
|
251 | The most common usage is for LF <-> CRLF translation on Windows. For | |
252 | this, use the "smart" converters which check for binary files:: |
|
252 | this, use the "smart" converters which check for binary files:: | |
253 |
|
253 | |||
254 | [extensions] |
|
254 | [extensions] | |
255 | hgext.win32text = |
|
255 | hgext.win32text = | |
256 | [encode] |
|
256 | [encode] | |
257 | ** = cleverencode: |
|
257 | ** = cleverencode: | |
258 | [decode] |
|
258 | [decode] | |
259 | ** = cleverdecode: |
|
259 | ** = cleverdecode: | |
260 |
|
260 | |||
261 | or if you only want to translate certain files:: |
|
261 | or if you only want to translate certain files:: | |
262 |
|
262 | |||
263 | [extensions] |
|
263 | [extensions] | |
264 | hgext.win32text = |
|
264 | hgext.win32text = | |
265 | [encode] |
|
265 | [encode] | |
266 | **.txt = dumbencode: |
|
266 | **.txt = dumbencode: | |
267 | [decode] |
|
267 | [decode] | |
268 | **.txt = dumbdecode: |
|
268 | **.txt = dumbdecode: | |
269 |
|
269 | |||
270 |
|
270 | |||
271 | ``defaults`` |
|
271 | ``defaults`` | |
272 | """""""""""" |
|
272 | """""""""""" | |
273 |
|
273 | |||
274 | (defaults are deprecated. Don't use them. Use aliases instead) |
|
274 | (defaults are deprecated. Don't use them. Use aliases instead) | |
275 |
|
275 | |||
276 | Use the ``[defaults]`` section to define command defaults, i.e. the |
|
276 | Use the ``[defaults]`` section to define command defaults, i.e. the | |
277 | default options/arguments to pass to the specified commands. |
|
277 | default options/arguments to pass to the specified commands. | |
278 |
|
278 | |||
279 | The following example makes :hg:`log` run in verbose mode, and :hg:`hg |
|
279 | The following example makes :hg:`log` run in verbose mode, and :hg:`hg | |
280 | status` show only the modified files, by default:: |
|
280 | status` show only the modified files, by default:: | |
281 |
|
281 | |||
282 | [defaults] |
|
282 | [defaults] | |
283 | log = -v |
|
283 | log = -v | |
284 | status = -m |
|
284 | status = -m | |
285 |
|
285 | |||
286 | The actual commands, instead of their aliases, must be used when |
|
286 | The actual commands, instead of their aliases, must be used when | |
287 | defining command defaults. The command defaults will also be applied |
|
287 | defining command defaults. The command defaults will also be applied | |
288 | to the aliases of the commands defined. |
|
288 | to the aliases of the commands defined. | |
289 |
|
289 | |||
290 |
|
290 | |||
291 | ``diff`` |
|
291 | ``diff`` | |
292 | """""""" |
|
292 | """""""" | |
293 |
|
293 | |||
294 | Settings used when displaying diffs. They are all Boolean and |
|
294 | Settings used when displaying diffs. They are all Boolean and | |
295 | defaults to False. |
|
295 | defaults to False. | |
296 |
|
296 | |||
297 | ``git`` |
|
297 | ``git`` | |
298 | Use git extended diff format. |
|
298 | Use git extended diff format. | |
299 | ``nodates`` |
|
299 | ``nodates`` | |
300 | Don't include dates in diff headers. |
|
300 | Don't include dates in diff headers. | |
301 | ``showfunc`` |
|
301 | ``showfunc`` | |
302 | Show which function each change is in. |
|
302 | Show which function each change is in. | |
303 | ``ignorews`` |
|
303 | ``ignorews`` | |
304 | Ignore white space when comparing lines. |
|
304 | Ignore white space when comparing lines. | |
305 | ``ignorewsamount`` |
|
305 | ``ignorewsamount`` | |
306 | Ignore changes in the amount of white space. |
|
306 | Ignore changes in the amount of white space. | |
307 | ``ignoreblanklines`` |
|
307 | ``ignoreblanklines`` | |
308 | Ignore changes whose lines are all blank. |
|
308 | Ignore changes whose lines are all blank. | |
309 |
|
309 | |||
310 | ``email`` |
|
310 | ``email`` | |
311 | """"""""" |
|
311 | """"""""" | |
312 | Settings for extensions that send email messages. |
|
312 | Settings for extensions that send email messages. | |
313 |
|
313 | |||
314 | ``from`` |
|
314 | ``from`` | |
315 | Optional. Email address to use in "From" header and SMTP envelope |
|
315 | Optional. Email address to use in "From" header and SMTP envelope | |
316 | of outgoing messages. |
|
316 | of outgoing messages. | |
317 | ``to`` |
|
317 | ``to`` | |
318 | Optional. Comma-separated list of recipients' email addresses. |
|
318 | Optional. Comma-separated list of recipients' email addresses. | |
319 | ``cc`` |
|
319 | ``cc`` | |
320 | Optional. Comma-separated list of carbon copy recipients' |
|
320 | Optional. Comma-separated list of carbon copy recipients' | |
321 | email addresses. |
|
321 | email addresses. | |
322 | ``bcc`` |
|
322 | ``bcc`` | |
323 | Optional. Comma-separated list of blind carbon copy recipients' |
|
323 | Optional. Comma-separated list of blind carbon copy recipients' | |
324 | email addresses. |
|
324 | email addresses. | |
325 | ``method`` |
|
325 | ``method`` | |
326 | Optional. Method to use to send email messages. If value is ``smtp`` |
|
326 | Optional. Method to use to send email messages. If value is ``smtp`` | |
327 | (default), use SMTP (see the SMTP_ section for configuration). |
|
327 | (default), use SMTP (see the SMTP_ section for configuration). | |
328 | Otherwise, use as name of program to run that acts like sendmail |
|
328 | Otherwise, use as name of program to run that acts like sendmail | |
329 | (takes ``-f`` option for sender, list of recipients on command line, |
|
329 | (takes ``-f`` option for sender, list of recipients on command line, | |
330 | message on stdin). Normally, setting this to ``sendmail`` or |
|
330 | message on stdin). Normally, setting this to ``sendmail`` or | |
331 | ``/usr/sbin/sendmail`` is enough to use sendmail to send messages. |
|
331 | ``/usr/sbin/sendmail`` is enough to use sendmail to send messages. | |
332 | ``charsets`` |
|
332 | ``charsets`` | |
333 | Optional. Comma-separated list of character sets considered |
|
333 | Optional. Comma-separated list of character sets considered | |
334 | convenient for recipients. Addresses, headers, and parts not |
|
334 | convenient for recipients. Addresses, headers, and parts not | |
335 | containing patches of outgoing messages will be encoded in the |
|
335 | containing patches of outgoing messages will be encoded in the | |
336 | first character set to which conversion from local encoding |
|
336 | first character set to which conversion from local encoding | |
337 | (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct |
|
337 | (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct | |
338 | conversion fails, the text in question is sent as is. Defaults to |
|
338 | conversion fails, the text in question is sent as is. Defaults to | |
339 | empty (explicit) list. |
|
339 | empty (explicit) list. | |
340 |
|
340 | |||
341 | Order of outgoing email character sets: |
|
341 | Order of outgoing email character sets: | |
342 |
|
342 | |||
343 | 1. ``us-ascii``: always first, regardless of settings |
|
343 | 1. ``us-ascii``: always first, regardless of settings | |
344 | 2. ``email.charsets``: in order given by user |
|
344 | 2. ``email.charsets``: in order given by user | |
345 | 3. ``ui.fallbackencoding``: if not in email.charsets |
|
345 | 3. ``ui.fallbackencoding``: if not in email.charsets | |
346 | 4. ``$HGENCODING``: if not in email.charsets |
|
346 | 4. ``$HGENCODING``: if not in email.charsets | |
347 | 5. ``utf-8``: always last, regardless of settings |
|
347 | 5. ``utf-8``: always last, regardless of settings | |
348 |
|
348 | |||
349 | Email example:: |
|
349 | Email example:: | |
350 |
|
350 | |||
351 | [email] |
|
351 | [email] | |
352 | from = Joseph User <joe.user@example.com> |
|
352 | from = Joseph User <joe.user@example.com> | |
353 | method = /usr/sbin/sendmail |
|
353 | method = /usr/sbin/sendmail | |
354 | # charsets for western Europeans |
|
354 | # charsets for western Europeans | |
355 | # us-ascii, utf-8 omitted, as they are tried first and last |
|
355 | # us-ascii, utf-8 omitted, as they are tried first and last | |
356 | charsets = iso-8859-1, iso-8859-15, windows-1252 |
|
356 | charsets = iso-8859-1, iso-8859-15, windows-1252 | |
357 |
|
357 | |||
358 |
|
358 | |||
359 | ``extensions`` |
|
359 | ``extensions`` | |
360 | """""""""""""" |
|
360 | """""""""""""" | |
361 |
|
361 | |||
362 | Mercurial has an extension mechanism for adding new features. To |
|
362 | Mercurial has an extension mechanism for adding new features. To | |
363 | enable an extension, create an entry for it in this section. |
|
363 | enable an extension, create an entry for it in this section. | |
364 |
|
364 | |||
365 | If you know that the extension is already in Python's search path, |
|
365 | If you know that the extension is already in Python's search path, | |
366 | you can give the name of the module, followed by ``=``, with nothing |
|
366 | you can give the name of the module, followed by ``=``, with nothing | |
367 | after the ``=``. |
|
367 | after the ``=``. | |
368 |
|
368 | |||
369 | Otherwise, give a name that you choose, followed by ``=``, followed by |
|
369 | Otherwise, give a name that you choose, followed by ``=``, followed by | |
370 | the path to the ``.py`` file (including the file name extension) that |
|
370 | the path to the ``.py`` file (including the file name extension) that | |
371 | defines the extension. |
|
371 | defines the extension. | |
372 |
|
372 | |||
373 | To explicitly disable an extension that is enabled in an hgrc of |
|
373 | To explicitly disable an extension that is enabled in an hgrc of | |
374 | broader scope, prepend its path with ``!``, as in |
|
374 | broader scope, prepend its path with ``!``, as in | |
375 | ``hgext.foo = !/ext/path`` or ``hgext.foo = !`` when path is not |
|
375 | ``hgext.foo = !/ext/path`` or ``hgext.foo = !`` when path is not | |
376 | supplied. |
|
376 | supplied. | |
377 |
|
377 | |||
378 | Example for ``~/.hgrc``:: |
|
378 | Example for ``~/.hgrc``:: | |
379 |
|
379 | |||
380 | [extensions] |
|
380 | [extensions] | |
381 | # (the mq extension will get loaded from Mercurial's path) |
|
381 | # (the mq extension will get loaded from Mercurial's path) | |
382 | hgext.mq = |
|
382 | hgext.mq = | |
383 | # (this extension will get loaded from the file specified) |
|
383 | # (this extension will get loaded from the file specified) | |
384 | myfeature = ~/.hgext/myfeature.py |
|
384 | myfeature = ~/.hgext/myfeature.py | |
385 |
|
385 | |||
386 |
|
386 | |||
387 | ``format`` |
|
387 | ``format`` | |
388 | """""""""" |
|
388 | """""""""" | |
389 |
|
389 | |||
390 | ``usestore`` |
|
390 | ``usestore`` | |
391 | Enable or disable the "store" repository format which improves |
|
391 | Enable or disable the "store" repository format which improves | |
392 | compatibility with systems that fold case or otherwise mangle |
|
392 | compatibility with systems that fold case or otherwise mangle | |
393 | filenames. Enabled by default. Disabling this option will allow |
|
393 | filenames. Enabled by default. Disabling this option will allow | |
394 | you to store longer filenames in some situations at the expense of |
|
394 | you to store longer filenames in some situations at the expense of | |
395 | compatibility and ensures that the on-disk format of newly created |
|
395 | compatibility and ensures that the on-disk format of newly created | |
396 | repositories will be compatible with Mercurial before version 0.9.4. |
|
396 | repositories will be compatible with Mercurial before version 0.9.4. | |
397 |
|
397 | |||
398 | ``usefncache`` |
|
398 | ``usefncache`` | |
399 | Enable or disable the "fncache" repository format which enhances |
|
399 | Enable or disable the "fncache" repository format which enhances | |
400 | the "store" repository format (which has to be enabled to use |
|
400 | the "store" repository format (which has to be enabled to use | |
401 | fncache) to allow longer filenames and avoids using Windows |
|
401 | fncache) to allow longer filenames and avoids using Windows | |
402 | reserved names, e.g. "nul". Enabled by default. Disabling this |
|
402 | reserved names, e.g. "nul". Enabled by default. Disabling this | |
403 | option ensures that the on-disk format of newly created |
|
403 | option ensures that the on-disk format of newly created | |
404 | repositories will be compatible with Mercurial before version 1.1. |
|
404 | repositories will be compatible with Mercurial before version 1.1. | |
405 |
|
405 | |||
406 | ``merge-patterns`` |
|
406 | ``merge-patterns`` | |
407 | """""""""""""""""" |
|
407 | """""""""""""""""" | |
408 |
|
408 | |||
409 | This section specifies merge tools to associate with particular file |
|
409 | This section specifies merge tools to associate with particular file | |
410 | patterns. Tools matched here will take precedence over the default |
|
410 | patterns. Tools matched here will take precedence over the default | |
411 | merge tool. Patterns are globs by default, rooted at the repository |
|
411 | merge tool. Patterns are globs by default, rooted at the repository | |
412 | root. |
|
412 | root. | |
413 |
|
413 | |||
414 | Example:: |
|
414 | Example:: | |
415 |
|
415 | |||
416 | [merge-patterns] |
|
416 | [merge-patterns] | |
417 | **.c = kdiff3 |
|
417 | **.c = kdiff3 | |
418 | **.jpg = myimgmerge |
|
418 | **.jpg = myimgmerge | |
419 |
|
419 | |||
420 | ``merge-tools`` |
|
420 | ``merge-tools`` | |
421 | """"""""""""""" |
|
421 | """"""""""""""" | |
422 |
|
422 | |||
423 | This section configures external merge tools to use for file-level |
|
423 | This section configures external merge tools to use for file-level | |
424 | merges. |
|
424 | merges. | |
425 |
|
425 | |||
426 | Example ``~/.hgrc``:: |
|
426 | Example ``~/.hgrc``:: | |
427 |
|
427 | |||
428 | [merge-tools] |
|
428 | [merge-tools] | |
429 | # Override stock tool location |
|
429 | # Override stock tool location | |
430 | kdiff3.executable = ~/bin/kdiff3 |
|
430 | kdiff3.executable = ~/bin/kdiff3 | |
431 | # Specify command line |
|
431 | # Specify command line | |
432 | kdiff3.args = $base $local $other -o $output |
|
432 | kdiff3.args = $base $local $other -o $output | |
433 | # Give higher priority |
|
433 | # Give higher priority | |
434 | kdiff3.priority = 1 |
|
434 | kdiff3.priority = 1 | |
435 |
|
435 | |||
436 | # Define new tool |
|
436 | # Define new tool | |
437 | myHtmlTool.args = -m $local $other $base $output |
|
437 | myHtmlTool.args = -m $local $other $base $output | |
438 | myHtmlTool.regkey = Software\FooSoftware\HtmlMerge |
|
438 | myHtmlTool.regkey = Software\FooSoftware\HtmlMerge | |
439 | myHtmlTool.priority = 1 |
|
439 | myHtmlTool.priority = 1 | |
440 |
|
440 | |||
441 | Supported arguments: |
|
441 | Supported arguments: | |
442 |
|
442 | |||
443 | ``priority`` |
|
443 | ``priority`` | |
444 | The priority in which to evaluate this tool. |
|
444 | The priority in which to evaluate this tool. | |
445 | Default: 0. |
|
445 | Default: 0. | |
446 | ``executable`` |
|
446 | ``executable`` | |
447 | Either just the name of the executable or its pathname. On Windows, |
|
447 | Either just the name of the executable or its pathname. On Windows, | |
448 | the path can use environment variables with ${ProgramFiles} syntax. |
|
448 | the path can use environment variables with ${ProgramFiles} syntax. | |
449 | Default: the tool name. |
|
449 | Default: the tool name. | |
450 | ``args`` |
|
450 | ``args`` | |
451 | The arguments to pass to the tool executable. You can refer to the |
|
451 | The arguments to pass to the tool executable. You can refer to the | |
452 | files being merged as well as the output file through these |
|
452 | files being merged as well as the output file through these | |
453 | variables: ``$base``, ``$local``, ``$other``, ``$output``. |
|
453 | variables: ``$base``, ``$local``, ``$other``, ``$output``. | |
454 | Default: ``$local $base $other`` |
|
454 | Default: ``$local $base $other`` | |
455 | ``premerge`` |
|
455 | ``premerge`` | |
456 | Attempt to run internal non-interactive 3-way merge tool before |
|
456 | Attempt to run internal non-interactive 3-way merge tool before | |
457 | launching external tool. Options are ``true``, ``false``, or ``keep`` |
|
457 | launching external tool. Options are ``true``, ``false``, or ``keep`` | |
458 | to leave markers in the file if the premerge fails. |
|
458 | to leave markers in the file if the premerge fails. | |
459 | Default: True |
|
459 | Default: True | |
460 | ``binary`` |
|
460 | ``binary`` | |
461 | This tool can merge binary files. Defaults to False, unless tool |
|
461 | This tool can merge binary files. Defaults to False, unless tool | |
462 | was selected by file pattern match. |
|
462 | was selected by file pattern match. | |
463 | ``symlink`` |
|
463 | ``symlink`` | |
464 | This tool can merge symlinks. Defaults to False, even if tool was |
|
464 | This tool can merge symlinks. Defaults to False, even if tool was | |
465 | selected by file pattern match. |
|
465 | selected by file pattern match. | |
466 | ``check`` |
|
466 | ``check`` | |
467 | A list of merge success-checking options: |
|
467 | A list of merge success-checking options: | |
468 |
|
468 | |||
469 | ``changed`` |
|
469 | ``changed`` | |
470 | Ask whether merge was successful when the merged file shows no changes. |
|
470 | Ask whether merge was successful when the merged file shows no changes. | |
471 | ``conflicts`` |
|
471 | ``conflicts`` | |
472 | Check whether there are conflicts even though the tool reported success. |
|
472 | Check whether there are conflicts even though the tool reported success. | |
|
473 | ``prompt`` | |||
|
474 | Always prompt for merge success, regardless of success reported by tool. | |||
473 |
|
475 | |||
474 | ``checkchanged`` |
|
476 | ``checkchanged`` | |
475 | True is equivalent to ``check = changed``. |
|
477 | True is equivalent to ``check = changed``. | |
476 | Default: False |
|
478 | Default: False | |
477 | ``checkconflicts`` |
|
479 | ``checkconflicts`` | |
478 | True is equivalent to ``check = conflicts``. |
|
480 | True is equivalent to ``check = conflicts``. | |
479 | Default: False |
|
481 | Default: False | |
480 | ``fixeol`` |
|
482 | ``fixeol`` | |
481 | Attempt to fix up EOL changes caused by the merge tool. |
|
483 | Attempt to fix up EOL changes caused by the merge tool. | |
482 | Default: False |
|
484 | Default: False | |
483 | ``gui`` |
|
485 | ``gui`` | |
484 | This tool requires a graphical interface to run. Default: False |
|
486 | This tool requires a graphical interface to run. Default: False | |
485 | ``regkey`` |
|
487 | ``regkey`` | |
486 | Windows registry key which describes install location of this |
|
488 | Windows registry key which describes install location of this | |
487 | tool. Mercurial will search for this key first under |
|
489 | tool. Mercurial will search for this key first under | |
488 | ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``. |
|
490 | ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``. | |
489 | Default: None |
|
491 | Default: None | |
490 | ``regname`` |
|
492 | ``regname`` | |
491 | Name of value to read from specified registry key. Defaults to the |
|
493 | Name of value to read from specified registry key. Defaults to the | |
492 | unnamed (default) value. |
|
494 | unnamed (default) value. | |
493 | ``regappend`` |
|
495 | ``regappend`` | |
494 | String to append to the value read from the registry, typically |
|
496 | String to append to the value read from the registry, typically | |
495 | the executable name of the tool. |
|
497 | the executable name of the tool. | |
496 | Default: None |
|
498 | Default: None | |
497 |
|
499 | |||
498 |
|
500 | |||
499 | ``hooks`` |
|
501 | ``hooks`` | |
500 | """"""""" |
|
502 | """"""""" | |
501 | Commands or Python functions that get automatically executed by |
|
503 | Commands or Python functions that get automatically executed by | |
502 | various actions such as starting or finishing a commit. Multiple |
|
504 | various actions such as starting or finishing a commit. Multiple | |
503 | hooks can be run for the same action by appending a suffix to the |
|
505 | hooks can be run for the same action by appending a suffix to the | |
504 | action. Overriding a site-wide hook can be done by changing its |
|
506 | action. Overriding a site-wide hook can be done by changing its | |
505 | value or setting it to an empty string. |
|
507 | value or setting it to an empty string. | |
506 |
|
508 | |||
507 | Example ``.hg/hgrc``:: |
|
509 | Example ``.hg/hgrc``:: | |
508 |
|
510 | |||
509 | [hooks] |
|
511 | [hooks] | |
510 | # update working directory after adding changesets |
|
512 | # update working directory after adding changesets | |
511 | changegroup.update = hg update |
|
513 | changegroup.update = hg update | |
512 | # do not use the site-wide hook |
|
514 | # do not use the site-wide hook | |
513 | incoming = |
|
515 | incoming = | |
514 | incoming.email = /my/email/hook |
|
516 | incoming.email = /my/email/hook | |
515 | incoming.autobuild = /my/build/hook |
|
517 | incoming.autobuild = /my/build/hook | |
516 |
|
518 | |||
517 | Most hooks are run with environment variables set that give useful |
|
519 | Most hooks are run with environment variables set that give useful | |
518 | additional information. For each hook below, the environment |
|
520 | additional information. For each hook below, the environment | |
519 | variables it is passed are listed with names of the form ``$HG_foo``. |
|
521 | variables it is passed are listed with names of the form ``$HG_foo``. | |
520 |
|
522 | |||
521 | ``changegroup`` |
|
523 | ``changegroup`` | |
522 | Run after a changegroup has been added via push, pull or unbundle. |
|
524 | Run after a changegroup has been added via push, pull or unbundle. | |
523 | ID of the first new changeset is in ``$HG_NODE``. URL from which |
|
525 | ID of the first new changeset is in ``$HG_NODE``. URL from which | |
524 | changes came is in ``$HG_URL``. |
|
526 | changes came is in ``$HG_URL``. | |
525 | ``commit`` |
|
527 | ``commit`` | |
526 | Run after a changeset has been created in the local repository. ID |
|
528 | Run after a changeset has been created in the local repository. ID | |
527 | of the newly created changeset is in ``$HG_NODE``. Parent changeset |
|
529 | of the newly created changeset is in ``$HG_NODE``. Parent changeset | |
528 | IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. |
|
530 | IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. | |
529 | ``incoming`` |
|
531 | ``incoming`` | |
530 | Run after a changeset has been pulled, pushed, or unbundled into |
|
532 | Run after a changeset has been pulled, pushed, or unbundled into | |
531 | the local repository. The ID of the newly arrived changeset is in |
|
533 | the local repository. The ID of the newly arrived changeset is in | |
532 | ``$HG_NODE``. URL that was source of changes came is in ``$HG_URL``. |
|
534 | ``$HG_NODE``. URL that was source of changes came is in ``$HG_URL``. | |
533 | ``outgoing`` |
|
535 | ``outgoing`` | |
534 | Run after sending changes from local repository to another. ID of |
|
536 | Run after sending changes from local repository to another. ID of | |
535 | first changeset sent is in ``$HG_NODE``. Source of operation is in |
|
537 | first changeset sent is in ``$HG_NODE``. Source of operation is in | |
536 | ``$HG_SOURCE``; see "preoutgoing" hook for description. |
|
538 | ``$HG_SOURCE``; see "preoutgoing" hook for description. | |
537 | ``post-<command>`` |
|
539 | ``post-<command>`` | |
538 | Run after successful invocations of the associated command. The |
|
540 | Run after successful invocations of the associated command. The | |
539 | contents of the command line are passed as ``$HG_ARGS`` and the result |
|
541 | contents of the command line are passed as ``$HG_ARGS`` and the result | |
540 | code in ``$HG_RESULT``. Hook failure is ignored. |
|
542 | code in ``$HG_RESULT``. Hook failure is ignored. | |
541 | ``pre-<command>`` |
|
543 | ``pre-<command>`` | |
542 | Run before executing the associated command. The contents of the |
|
544 | Run before executing the associated command. The contents of the | |
543 | command line are passed as ``$HG_ARGS``. If the hook returns failure, |
|
545 | command line are passed as ``$HG_ARGS``. If the hook returns failure, | |
544 | the command doesn't execute and Mercurial returns the failure |
|
546 | the command doesn't execute and Mercurial returns the failure | |
545 | code. |
|
547 | code. | |
546 | ``prechangegroup`` |
|
548 | ``prechangegroup`` | |
547 | Run before a changegroup is added via push, pull or unbundle. Exit |
|
549 | Run before a changegroup is added via push, pull or unbundle. Exit | |
548 | status 0 allows the changegroup to proceed. Non-zero status will |
|
550 | status 0 allows the changegroup to proceed. Non-zero status will | |
549 | cause the push, pull or unbundle to fail. URL from which changes |
|
551 | cause the push, pull or unbundle to fail. URL from which changes | |
550 | will come is in ``$HG_URL``. |
|
552 | will come is in ``$HG_URL``. | |
551 | ``precommit`` |
|
553 | ``precommit`` | |
552 | Run before starting a local commit. Exit status 0 allows the |
|
554 | Run before starting a local commit. Exit status 0 allows the | |
553 | commit to proceed. Non-zero status will cause the commit to fail. |
|
555 | commit to proceed. Non-zero status will cause the commit to fail. | |
554 | Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. |
|
556 | Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. | |
555 | ``preoutgoing`` |
|
557 | ``preoutgoing`` | |
556 | Run before collecting changes to send from the local repository to |
|
558 | Run before collecting changes to send from the local repository to | |
557 | another. Non-zero status will cause failure. This lets you prevent |
|
559 | another. Non-zero status will cause failure. This lets you prevent | |
558 | pull over HTTP or SSH. Also prevents against local pull, push |
|
560 | pull over HTTP or SSH. Also prevents against local pull, push | |
559 | (outbound) or bundle commands, but not effective, since you can |
|
561 | (outbound) or bundle commands, but not effective, since you can | |
560 | just copy files instead then. Source of operation is in |
|
562 | just copy files instead then. Source of operation is in | |
561 | ``$HG_SOURCE``. If "serve", operation is happening on behalf of remote |
|
563 | ``$HG_SOURCE``. If "serve", operation is happening on behalf of remote | |
562 | SSH or HTTP repository. If "push", "pull" or "bundle", operation |
|
564 | SSH or HTTP repository. If "push", "pull" or "bundle", operation | |
563 | is happening on behalf of repository on same system. |
|
565 | is happening on behalf of repository on same system. | |
564 | ``pretag`` |
|
566 | ``pretag`` | |
565 | Run before creating a tag. Exit status 0 allows the tag to be |
|
567 | Run before creating a tag. Exit status 0 allows the tag to be | |
566 | created. Non-zero status will cause the tag to fail. ID of |
|
568 | created. Non-zero status will cause the tag to fail. ID of | |
567 | changeset to tag is in ``$HG_NODE``. Name of tag is in ``$HG_TAG``. Tag is |
|
569 | changeset to tag is in ``$HG_NODE``. Name of tag is in ``$HG_TAG``. Tag is | |
568 | local if ``$HG_LOCAL=1``, in repository if ``$HG_LOCAL=0``. |
|
570 | local if ``$HG_LOCAL=1``, in repository if ``$HG_LOCAL=0``. | |
569 | ``pretxnchangegroup`` |
|
571 | ``pretxnchangegroup`` | |
570 | Run after a changegroup has been added via push, pull or unbundle, |
|
572 | Run after a changegroup has been added via push, pull or unbundle, | |
571 | but before the transaction has been committed. Changegroup is |
|
573 | but before the transaction has been committed. Changegroup is | |
572 | visible to hook program. This lets you validate incoming changes |
|
574 | visible to hook program. This lets you validate incoming changes | |
573 | before accepting them. Passed the ID of the first new changeset in |
|
575 | before accepting them. Passed the ID of the first new changeset in | |
574 | ``$HG_NODE``. Exit status 0 allows the transaction to commit. Non-zero |
|
576 | ``$HG_NODE``. Exit status 0 allows the transaction to commit. Non-zero | |
575 | status will cause the transaction to be rolled back and the push, |
|
577 | status will cause the transaction to be rolled back and the push, | |
576 | pull or unbundle will fail. URL that was source of changes is in |
|
578 | pull or unbundle will fail. URL that was source of changes is in | |
577 | ``$HG_URL``. |
|
579 | ``$HG_URL``. | |
578 | ``pretxncommit`` |
|
580 | ``pretxncommit`` | |
579 | Run after a changeset has been created but the transaction not yet |
|
581 | Run after a changeset has been created but the transaction not yet | |
580 | committed. Changeset is visible to hook program. This lets you |
|
582 | committed. Changeset is visible to hook program. This lets you | |
581 | validate commit message and changes. Exit status 0 allows the |
|
583 | validate commit message and changes. Exit status 0 allows the | |
582 | commit to proceed. Non-zero status will cause the transaction to |
|
584 | commit to proceed. Non-zero status will cause the transaction to | |
583 | be rolled back. ID of changeset is in ``$HG_NODE``. Parent changeset |
|
585 | be rolled back. ID of changeset is in ``$HG_NODE``. Parent changeset | |
584 | IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. |
|
586 | IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. | |
585 | ``preupdate`` |
|
587 | ``preupdate`` | |
586 | Run before updating the working directory. Exit status 0 allows |
|
588 | Run before updating the working directory. Exit status 0 allows | |
587 | the update to proceed. Non-zero status will prevent the update. |
|
589 | the update to proceed. Non-zero status will prevent the update. | |
588 | Changeset ID of first new parent is in ``$HG_PARENT1``. If merge, ID |
|
590 | Changeset ID of first new parent is in ``$HG_PARENT1``. If merge, ID | |
589 | of second new parent is in ``$HG_PARENT2``. |
|
591 | of second new parent is in ``$HG_PARENT2``. | |
590 | ``tag`` |
|
592 | ``tag`` | |
591 | Run after a tag is created. ID of tagged changeset is in ``$HG_NODE``. |
|
593 | Run after a tag is created. ID of tagged changeset is in ``$HG_NODE``. | |
592 | Name of tag is in ``$HG_TAG``. Tag is local if ``$HG_LOCAL=1``, in |
|
594 | Name of tag is in ``$HG_TAG``. Tag is local if ``$HG_LOCAL=1``, in | |
593 | repository if ``$HG_LOCAL=0``. |
|
595 | repository if ``$HG_LOCAL=0``. | |
594 | ``update`` |
|
596 | ``update`` | |
595 | Run after updating the working directory. Changeset ID of first |
|
597 | Run after updating the working directory. Changeset ID of first | |
596 | new parent is in ``$HG_PARENT1``. If merge, ID of second new parent is |
|
598 | new parent is in ``$HG_PARENT1``. If merge, ID of second new parent is | |
597 | in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the |
|
599 | in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the | |
598 | update failed (e.g. because conflicts not resolved), ``$HG_ERROR=1``. |
|
600 | update failed (e.g. because conflicts not resolved), ``$HG_ERROR=1``. | |
599 |
|
601 | |||
600 | .. note:: It is generally better to use standard hooks rather than the |
|
602 | .. note:: It is generally better to use standard hooks rather than the | |
601 | generic pre- and post- command hooks as they are guaranteed to be |
|
603 | generic pre- and post- command hooks as they are guaranteed to be | |
602 | called in the appropriate contexts for influencing transactions. |
|
604 | called in the appropriate contexts for influencing transactions. | |
603 | Also, hooks like "commit" will be called in all contexts that |
|
605 | Also, hooks like "commit" will be called in all contexts that | |
604 | generate a commit (e.g. tag) and not just the commit command. |
|
606 | generate a commit (e.g. tag) and not just the commit command. | |
605 |
|
607 | |||
606 | .. note:: Environment variables with empty values may not be passed to |
|
608 | .. note:: Environment variables with empty values may not be passed to | |
607 | hooks on platforms such as Windows. As an example, ``$HG_PARENT2`` |
|
609 | hooks on platforms such as Windows. As an example, ``$HG_PARENT2`` | |
608 | will have an empty value under Unix-like platforms for non-merge |
|
610 | will have an empty value under Unix-like platforms for non-merge | |
609 | changesets, while it will not be available at all under Windows. |
|
611 | changesets, while it will not be available at all under Windows. | |
610 |
|
612 | |||
611 | The syntax for Python hooks is as follows:: |
|
613 | The syntax for Python hooks is as follows:: | |
612 |
|
614 | |||
613 | hookname = python:modulename.submodule.callable |
|
615 | hookname = python:modulename.submodule.callable | |
614 | hookname = python:/path/to/python/module.py:callable |
|
616 | hookname = python:/path/to/python/module.py:callable | |
615 |
|
617 | |||
616 | Python hooks are run within the Mercurial process. Each hook is |
|
618 | Python hooks are run within the Mercurial process. Each hook is | |
617 | called with at least three keyword arguments: a ui object (keyword |
|
619 | called with at least three keyword arguments: a ui object (keyword | |
618 | ``ui``), a repository object (keyword ``repo``), and a ``hooktype`` |
|
620 | ``ui``), a repository object (keyword ``repo``), and a ``hooktype`` | |
619 | keyword that tells what kind of hook is used. Arguments listed as |
|
621 | keyword that tells what kind of hook is used. Arguments listed as | |
620 | environment variables above are passed as keyword arguments, with no |
|
622 | environment variables above are passed as keyword arguments, with no | |
621 | ``HG_`` prefix, and names in lower case. |
|
623 | ``HG_`` prefix, and names in lower case. | |
622 |
|
624 | |||
623 | If a Python hook returns a "true" value or raises an exception, this |
|
625 | If a Python hook returns a "true" value or raises an exception, this | |
624 | is treated as a failure. |
|
626 | is treated as a failure. | |
625 |
|
627 | |||
626 |
|
628 | |||
627 | ``http_proxy`` |
|
629 | ``http_proxy`` | |
628 | """""""""""""" |
|
630 | """""""""""""" | |
629 | Used to access web-based Mercurial repositories through a HTTP |
|
631 | Used to access web-based Mercurial repositories through a HTTP | |
630 | proxy. |
|
632 | proxy. | |
631 |
|
633 | |||
632 | ``host`` |
|
634 | ``host`` | |
633 | Host name and (optional) port of the proxy server, for example |
|
635 | Host name and (optional) port of the proxy server, for example | |
634 | "myproxy:8000". |
|
636 | "myproxy:8000". | |
635 | ``no`` |
|
637 | ``no`` | |
636 | Optional. Comma-separated list of host names that should bypass |
|
638 | Optional. Comma-separated list of host names that should bypass | |
637 | the proxy. |
|
639 | the proxy. | |
638 | ``passwd`` |
|
640 | ``passwd`` | |
639 | Optional. Password to authenticate with at the proxy server. |
|
641 | Optional. Password to authenticate with at the proxy server. | |
640 | ``user`` |
|
642 | ``user`` | |
641 | Optional. User name to authenticate with at the proxy server. |
|
643 | Optional. User name to authenticate with at the proxy server. | |
642 | ``always`` |
|
644 | ``always`` | |
643 | Optional. Always use the proxy, even for localhost and any entries |
|
645 | Optional. Always use the proxy, even for localhost and any entries | |
644 | in ``http_proxy.no``. True or False. Default: False. |
|
646 | in ``http_proxy.no``. True or False. Default: False. | |
645 |
|
647 | |||
646 | ``smtp`` |
|
648 | ``smtp`` | |
647 | """""""" |
|
649 | """""""" | |
648 | Configuration for extensions that need to send email messages. |
|
650 | Configuration for extensions that need to send email messages. | |
649 |
|
651 | |||
650 | ``host`` |
|
652 | ``host`` | |
651 | Host name of mail server, e.g. "mail.example.com". |
|
653 | Host name of mail server, e.g. "mail.example.com". | |
652 | ``port`` |
|
654 | ``port`` | |
653 | Optional. Port to connect to on mail server. Default: 25. |
|
655 | Optional. Port to connect to on mail server. Default: 25. | |
654 | ``tls`` |
|
656 | ``tls`` | |
655 | Optional. Whether to connect to mail server using TLS. True or |
|
657 | Optional. Whether to connect to mail server using TLS. True or | |
656 | False. Default: False. |
|
658 | False. Default: False. | |
657 | ``username`` |
|
659 | ``username`` | |
658 | Optional. User name to authenticate to SMTP server with. If |
|
660 | Optional. User name to authenticate to SMTP server with. If | |
659 | username is specified, password must also be specified. |
|
661 | username is specified, password must also be specified. | |
660 | Default: none. |
|
662 | Default: none. | |
661 | ``password`` |
|
663 | ``password`` | |
662 | Optional. Password to authenticate to SMTP server with. If |
|
664 | Optional. Password to authenticate to SMTP server with. If | |
663 | username is specified, password must also be specified. |
|
665 | username is specified, password must also be specified. | |
664 | Default: none. |
|
666 | Default: none. | |
665 | ``local_hostname`` |
|
667 | ``local_hostname`` | |
666 | Optional. It's the hostname that the sender can use to identify |
|
668 | Optional. It's the hostname that the sender can use to identify | |
667 | itself to the MTA. |
|
669 | itself to the MTA. | |
668 |
|
670 | |||
669 |
|
671 | |||
670 | ``patch`` |
|
672 | ``patch`` | |
671 | """"""""" |
|
673 | """"""""" | |
672 | Settings used when applying patches, for instance through the 'import' |
|
674 | Settings used when applying patches, for instance through the 'import' | |
673 | command or with Mercurial Queues extension. |
|
675 | command or with Mercurial Queues extension. | |
674 |
|
676 | |||
675 | ``eol`` |
|
677 | ``eol`` | |
676 | When set to 'strict' patch content and patched files end of lines |
|
678 | When set to 'strict' patch content and patched files end of lines | |
677 | are preserved. When set to ``lf`` or ``crlf``, both files end of |
|
679 | are preserved. When set to ``lf`` or ``crlf``, both files end of | |
678 | lines are ignored when patching and the result line endings are |
|
680 | lines are ignored when patching and the result line endings are | |
679 | normalized to either LF (Unix) or CRLF (Windows). When set to |
|
681 | normalized to either LF (Unix) or CRLF (Windows). When set to | |
680 | ``auto``, end of lines are again ignored while patching but line |
|
682 | ``auto``, end of lines are again ignored while patching but line | |
681 | endings in patched files are normalized to their original setting |
|
683 | endings in patched files are normalized to their original setting | |
682 | on a per-file basis. If target file does not exist or has no end |
|
684 | on a per-file basis. If target file does not exist or has no end | |
683 | of line, patch line endings are preserved. |
|
685 | of line, patch line endings are preserved. | |
684 | Default: strict. |
|
686 | Default: strict. | |
685 |
|
687 | |||
686 |
|
688 | |||
687 | ``paths`` |
|
689 | ``paths`` | |
688 | """"""""" |
|
690 | """"""""" | |
689 | Assigns symbolic names to repositories. The left side is the |
|
691 | Assigns symbolic names to repositories. The left side is the | |
690 | symbolic name, and the right gives the directory or URL that is the |
|
692 | symbolic name, and the right gives the directory or URL that is the | |
691 | location of the repository. Default paths can be declared by setting |
|
693 | location of the repository. Default paths can be declared by setting | |
692 | the following entries. |
|
694 | the following entries. | |
693 |
|
695 | |||
694 | ``default`` |
|
696 | ``default`` | |
695 | Directory or URL to use when pulling if no source is specified. |
|
697 | Directory or URL to use when pulling if no source is specified. | |
696 | Default is set to repository from which the current repository was |
|
698 | Default is set to repository from which the current repository was | |
697 | cloned. |
|
699 | cloned. | |
698 | ``default-push`` |
|
700 | ``default-push`` | |
699 | Optional. Directory or URL to use when pushing if no destination |
|
701 | Optional. Directory or URL to use when pushing if no destination | |
700 | is specified. |
|
702 | is specified. | |
701 |
|
703 | |||
702 |
|
704 | |||
703 | ``profiling`` |
|
705 | ``profiling`` | |
704 | """"""""""""" |
|
706 | """"""""""""" | |
705 | Specifies profiling format and file output. In this section |
|
707 | Specifies profiling format and file output. In this section | |
706 | description, 'profiling data' stands for the raw data collected |
|
708 | description, 'profiling data' stands for the raw data collected | |
707 | during profiling, while 'profiling report' stands for a statistical |
|
709 | during profiling, while 'profiling report' stands for a statistical | |
708 | text report generated from the profiling data. The profiling is done |
|
710 | text report generated from the profiling data. The profiling is done | |
709 | using lsprof. |
|
711 | using lsprof. | |
710 |
|
712 | |||
711 | ``format`` |
|
713 | ``format`` | |
712 | Profiling format. |
|
714 | Profiling format. | |
713 | Default: text. |
|
715 | Default: text. | |
714 |
|
716 | |||
715 | ``text`` |
|
717 | ``text`` | |
716 | Generate a profiling report. When saving to a file, it should be |
|
718 | Generate a profiling report. When saving to a file, it should be | |
717 | noted that only the report is saved, and the profiling data is |
|
719 | noted that only the report is saved, and the profiling data is | |
718 | not kept. |
|
720 | not kept. | |
719 | ``kcachegrind`` |
|
721 | ``kcachegrind`` | |
720 | Format profiling data for kcachegrind use: when saving to a |
|
722 | Format profiling data for kcachegrind use: when saving to a | |
721 | file, the generated file can directly be loaded into |
|
723 | file, the generated file can directly be loaded into | |
722 | kcachegrind. |
|
724 | kcachegrind. | |
723 | ``output`` |
|
725 | ``output`` | |
724 | File path where profiling data or report should be saved. If the |
|
726 | File path where profiling data or report should be saved. If the | |
725 | file exists, it is replaced. Default: None, data is printed on |
|
727 | file exists, it is replaced. Default: None, data is printed on | |
726 | stderr |
|
728 | stderr | |
727 |
|
729 | |||
728 | ``server`` |
|
730 | ``server`` | |
729 | """""""""" |
|
731 | """""""""" | |
730 | Controls generic server settings. |
|
732 | Controls generic server settings. | |
731 |
|
733 | |||
732 | ``uncompressed`` |
|
734 | ``uncompressed`` | |
733 | Whether to allow clients to clone a repository using the |
|
735 | Whether to allow clients to clone a repository using the | |
734 | uncompressed streaming protocol. This transfers about 40% more |
|
736 | uncompressed streaming protocol. This transfers about 40% more | |
735 | data than a regular clone, but uses less memory and CPU on both |
|
737 | data than a regular clone, but uses less memory and CPU on both | |
736 | server and client. Over a LAN (100 Mbps or better) or a very fast |
|
738 | server and client. Over a LAN (100 Mbps or better) or a very fast | |
737 | WAN, an uncompressed streaming clone is a lot faster (~10x) than a |
|
739 | WAN, an uncompressed streaming clone is a lot faster (~10x) than a | |
738 | regular clone. Over most WAN connections (anything slower than |
|
740 | regular clone. Over most WAN connections (anything slower than | |
739 | about 6 Mbps), uncompressed streaming is slower, because of the |
|
741 | about 6 Mbps), uncompressed streaming is slower, because of the | |
740 | extra data transfer overhead. This mode will also temporarily hold |
|
742 | extra data transfer overhead. This mode will also temporarily hold | |
741 | the write lock while determining what data to transfer. |
|
743 | the write lock while determining what data to transfer. | |
742 | Default is True. |
|
744 | Default is True. | |
743 |
|
745 | |||
744 | ``validate`` |
|
746 | ``validate`` | |
745 | Whether to validate the completeness of pushed changesets by |
|
747 | Whether to validate the completeness of pushed changesets by | |
746 | checking that all new file revisions specified in manifests are |
|
748 | checking that all new file revisions specified in manifests are | |
747 | present. Default is False. |
|
749 | present. Default is False. | |
748 |
|
750 | |||
749 | ``trusted`` |
|
751 | ``trusted`` | |
750 | """"""""""" |
|
752 | """"""""""" | |
751 | For security reasons, Mercurial will not use the settings in the |
|
753 | For security reasons, Mercurial will not use the settings in the | |
752 | ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted |
|
754 | ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted | |
753 | user or to a trusted group. The main exception is the web interface, |
|
755 | user or to a trusted group. The main exception is the web interface, | |
754 | which automatically uses some safe settings, since it's common to |
|
756 | which automatically uses some safe settings, since it's common to | |
755 | serve repositories from different users. |
|
757 | serve repositories from different users. | |
756 |
|
758 | |||
757 | This section specifies what users and groups are trusted. The |
|
759 | This section specifies what users and groups are trusted. The | |
758 | current user is always trusted. To trust everybody, list a user or a |
|
760 | current user is always trusted. To trust everybody, list a user or a | |
759 | group with name ``*``. |
|
761 | group with name ``*``. | |
760 |
|
762 | |||
761 | ``users`` |
|
763 | ``users`` | |
762 | Comma-separated list of trusted users. |
|
764 | Comma-separated list of trusted users. | |
763 | ``groups`` |
|
765 | ``groups`` | |
764 | Comma-separated list of trusted groups. |
|
766 | Comma-separated list of trusted groups. | |
765 |
|
767 | |||
766 |
|
768 | |||
767 | ``ui`` |
|
769 | ``ui`` | |
768 | """""" |
|
770 | """""" | |
769 |
|
771 | |||
770 | User interface controls. |
|
772 | User interface controls. | |
771 |
|
773 | |||
772 | ``archivemeta`` |
|
774 | ``archivemeta`` | |
773 | Whether to include the .hg_archival.txt file containing meta data |
|
775 | Whether to include the .hg_archival.txt file containing meta data | |
774 | (hashes for the repository base and for tip) in archives created |
|
776 | (hashes for the repository base and for tip) in archives created | |
775 | by the :hg:`archive` command or downloaded via hgweb. |
|
777 | by the :hg:`archive` command or downloaded via hgweb. | |
776 | Default is True. |
|
778 | Default is True. | |
777 | ``askusername`` |
|
779 | ``askusername`` | |
778 | Whether to prompt for a username when committing. If True, and |
|
780 | Whether to prompt for a username when committing. If True, and | |
779 | neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will |
|
781 | neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will | |
780 | be prompted to enter a username. If no username is entered, the |
|
782 | be prompted to enter a username. If no username is entered, the | |
781 | default ``USER@HOST`` is used instead. |
|
783 | default ``USER@HOST`` is used instead. | |
782 | Default is False. |
|
784 | Default is False. | |
783 | ``debug`` |
|
785 | ``debug`` | |
784 | Print debugging information. True or False. Default is False. |
|
786 | Print debugging information. True or False. Default is False. | |
785 | ``editor`` |
|
787 | ``editor`` | |
786 | The editor to use during a commit. Default is ``$EDITOR`` or ``vi``. |
|
788 | The editor to use during a commit. Default is ``$EDITOR`` or ``vi``. | |
787 | ``fallbackencoding`` |
|
789 | ``fallbackencoding`` | |
788 | Encoding to try if it's not possible to decode the changelog using |
|
790 | Encoding to try if it's not possible to decode the changelog using | |
789 | UTF-8. Default is ISO-8859-1. |
|
791 | UTF-8. Default is ISO-8859-1. | |
790 | ``ignore`` |
|
792 | ``ignore`` | |
791 | A file to read per-user ignore patterns from. This file should be |
|
793 | A file to read per-user ignore patterns from. This file should be | |
792 | in the same format as a repository-wide .hgignore file. This |
|
794 | in the same format as a repository-wide .hgignore file. This | |
793 | option supports hook syntax, so if you want to specify multiple |
|
795 | option supports hook syntax, so if you want to specify multiple | |
794 | ignore files, you can do so by setting something like |
|
796 | ignore files, you can do so by setting something like | |
795 | ``ignore.other = ~/.hgignore2``. For details of the ignore file |
|
797 | ``ignore.other = ~/.hgignore2``. For details of the ignore file | |
796 | format, see the |hgignore(5)|_ man page. |
|
798 | format, see the |hgignore(5)|_ man page. | |
797 | ``interactive`` |
|
799 | ``interactive`` | |
798 | Allow to prompt the user. True or False. Default is True. |
|
800 | Allow to prompt the user. True or False. Default is True. | |
799 | ``logtemplate`` |
|
801 | ``logtemplate`` | |
800 | Template string for commands that print changesets. |
|
802 | Template string for commands that print changesets. | |
801 | ``merge`` |
|
803 | ``merge`` | |
802 | The conflict resolution program to use during a manual merge. |
|
804 | The conflict resolution program to use during a manual merge. | |
803 | There are some internal tools available: |
|
805 | There are some internal tools available: | |
804 |
|
806 | |||
805 | ``internal:local`` |
|
807 | ``internal:local`` | |
806 | keep the local version |
|
808 | keep the local version | |
807 | ``internal:other`` |
|
809 | ``internal:other`` | |
808 | use the other version |
|
810 | use the other version | |
809 | ``internal:merge`` |
|
811 | ``internal:merge`` | |
810 | use the internal non-interactive merge tool |
|
812 | use the internal non-interactive merge tool | |
811 | ``internal:fail`` |
|
813 | ``internal:fail`` | |
812 | fail to merge |
|
814 | fail to merge | |
813 |
|
815 | |||
814 | For more information on configuring merge tools see the |
|
816 | For more information on configuring merge tools see the | |
815 | merge-tools_ section. |
|
817 | merge-tools_ section. | |
816 |
|
818 | |||
817 | ``patch`` |
|
819 | ``patch`` | |
818 | command to use to apply patches. Look for ``gpatch`` or ``patch`` in |
|
820 | command to use to apply patches. Look for ``gpatch`` or ``patch`` in | |
819 | PATH if unset. |
|
821 | PATH if unset. | |
820 | ``quiet`` |
|
822 | ``quiet`` | |
821 | Reduce the amount of output printed. True or False. Default is False. |
|
823 | Reduce the amount of output printed. True or False. Default is False. | |
822 | ``remotecmd`` |
|
824 | ``remotecmd`` | |
823 | remote command to use for clone/push/pull operations. Default is ``hg``. |
|
825 | remote command to use for clone/push/pull operations. Default is ``hg``. | |
824 | ``report_untrusted`` |
|
826 | ``report_untrusted`` | |
825 | Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a |
|
827 | Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a | |
826 | trusted user or group. True or False. Default is True. |
|
828 | trusted user or group. True or False. Default is True. | |
827 | ``slash`` |
|
829 | ``slash`` | |
828 | Display paths using a slash (``/``) as the path separator. This |
|
830 | Display paths using a slash (``/``) as the path separator. This | |
829 | only makes a difference on systems where the default path |
|
831 | only makes a difference on systems where the default path | |
830 | separator is not the slash character (e.g. Windows uses the |
|
832 | separator is not the slash character (e.g. Windows uses the | |
831 | backslash character (``\``)). |
|
833 | backslash character (``\``)). | |
832 | Default is False. |
|
834 | Default is False. | |
833 | ``ssh`` |
|
835 | ``ssh`` | |
834 | command to use for SSH connections. Default is ``ssh``. |
|
836 | command to use for SSH connections. Default is ``ssh``. | |
835 | ``strict`` |
|
837 | ``strict`` | |
836 | Require exact command names, instead of allowing unambiguous |
|
838 | Require exact command names, instead of allowing unambiguous | |
837 | abbreviations. True or False. Default is False. |
|
839 | abbreviations. True or False. Default is False. | |
838 | ``style`` |
|
840 | ``style`` | |
839 | Name of style to use for command output. |
|
841 | Name of style to use for command output. | |
840 | ``timeout`` |
|
842 | ``timeout`` | |
841 | The timeout used when a lock is held (in seconds), a negative value |
|
843 | The timeout used when a lock is held (in seconds), a negative value | |
842 | means no timeout. Default is 600. |
|
844 | means no timeout. Default is 600. | |
843 | ``traceback`` |
|
845 | ``traceback`` | |
844 | Mercurial always prints a traceback when an unknown exception |
|
846 | Mercurial always prints a traceback when an unknown exception | |
845 | occurs. Setting this to True will make Mercurial print a traceback |
|
847 | occurs. Setting this to True will make Mercurial print a traceback | |
846 | on all exceptions, even those recognized by Mercurial (such as |
|
848 | on all exceptions, even those recognized by Mercurial (such as | |
847 | IOError or MemoryError). Default is False. |
|
849 | IOError or MemoryError). Default is False. | |
848 | ``username`` |
|
850 | ``username`` | |
849 | The committer of a changeset created when running "commit". |
|
851 | The committer of a changeset created when running "commit". | |
850 | Typically a person's name and email address, e.g. ``Fred Widget |
|
852 | Typically a person's name and email address, e.g. ``Fred Widget | |
851 | <fred@example.com>``. Default is ``$EMAIL`` or ``username@hostname``. If |
|
853 | <fred@example.com>``. Default is ``$EMAIL`` or ``username@hostname``. If | |
852 | the username in hgrc is empty, it has to be specified manually or |
|
854 | the username in hgrc is empty, it has to be specified manually or | |
853 | in a different hgrc file (e.g. ``$HOME/.hgrc``, if the admin set |
|
855 | in a different hgrc file (e.g. ``$HOME/.hgrc``, if the admin set | |
854 | ``username =`` in the system hgrc). |
|
856 | ``username =`` in the system hgrc). | |
855 | ``verbose`` |
|
857 | ``verbose`` | |
856 | Increase the amount of output printed. True or False. Default is False. |
|
858 | Increase the amount of output printed. True or False. Default is False. | |
857 |
|
859 | |||
858 |
|
860 | |||
859 | ``web`` |
|
861 | ``web`` | |
860 | """"""" |
|
862 | """"""" | |
861 | Web interface configuration. |
|
863 | Web interface configuration. | |
862 |
|
864 | |||
863 | ``accesslog`` |
|
865 | ``accesslog`` | |
864 | Where to output the access log. Default is stdout. |
|
866 | Where to output the access log. Default is stdout. | |
865 | ``address`` |
|
867 | ``address`` | |
866 | Interface address to bind to. Default is all. |
|
868 | Interface address to bind to. Default is all. | |
867 | ``allow_archive`` |
|
869 | ``allow_archive`` | |
868 | List of archive format (bz2, gz, zip) allowed for downloading. |
|
870 | List of archive format (bz2, gz, zip) allowed for downloading. | |
869 | Default is empty. |
|
871 | Default is empty. | |
870 | ``allowbz2`` |
|
872 | ``allowbz2`` | |
871 | (DEPRECATED) Whether to allow .tar.bz2 downloading of repository |
|
873 | (DEPRECATED) Whether to allow .tar.bz2 downloading of repository | |
872 | revisions. |
|
874 | revisions. | |
873 | Default is False. |
|
875 | Default is False. | |
874 | ``allowgz`` |
|
876 | ``allowgz`` | |
875 | (DEPRECATED) Whether to allow .tar.gz downloading of repository |
|
877 | (DEPRECATED) Whether to allow .tar.gz downloading of repository | |
876 | revisions. |
|
878 | revisions. | |
877 | Default is False. |
|
879 | Default is False. | |
878 | ``allowpull`` |
|
880 | ``allowpull`` | |
879 | Whether to allow pulling from the repository. Default is True. |
|
881 | Whether to allow pulling from the repository. Default is True. | |
880 | ``allow_push`` |
|
882 | ``allow_push`` | |
881 | Whether to allow pushing to the repository. If empty or not set, |
|
883 | Whether to allow pushing to the repository. If empty or not set, | |
882 | push is not allowed. If the special value ``*``, any remote user can |
|
884 | push is not allowed. If the special value ``*``, any remote user can | |
883 | push, including unauthenticated users. Otherwise, the remote user |
|
885 | push, including unauthenticated users. Otherwise, the remote user | |
884 | must have been authenticated, and the authenticated user name must |
|
886 | must have been authenticated, and the authenticated user name must | |
885 | be present in this list. The contents of the allow_push list are |
|
887 | be present in this list. The contents of the allow_push list are | |
886 | examined after the deny_push list. |
|
888 | examined after the deny_push list. | |
887 | ``allow_read`` |
|
889 | ``allow_read`` | |
888 | If the user has not already been denied repository access due to |
|
890 | If the user has not already been denied repository access due to | |
889 | the contents of deny_read, this list determines whether to grant |
|
891 | the contents of deny_read, this list determines whether to grant | |
890 | repository access to the user. If this list is not empty, and the |
|
892 | repository access to the user. If this list is not empty, and the | |
891 | user is unauthenticated or not present in the list, then access is |
|
893 | user is unauthenticated or not present in the list, then access is | |
892 | denied for the user. If the list is empty or not set, then access |
|
894 | denied for the user. If the list is empty or not set, then access | |
893 | is permitted to all users by default. Setting allow_read to the |
|
895 | is permitted to all users by default. Setting allow_read to the | |
894 | special value ``*`` is equivalent to it not being set (i.e. access |
|
896 | special value ``*`` is equivalent to it not being set (i.e. access | |
895 | is permitted to all users). The contents of the allow_read list are |
|
897 | is permitted to all users). The contents of the allow_read list are | |
896 | examined after the deny_read list. |
|
898 | examined after the deny_read list. | |
897 | ``allowzip`` |
|
899 | ``allowzip`` | |
898 | (DEPRECATED) Whether to allow .zip downloading of repository |
|
900 | (DEPRECATED) Whether to allow .zip downloading of repository | |
899 | revisions. Default is False. This feature creates temporary files. |
|
901 | revisions. Default is False. This feature creates temporary files. | |
900 | ``baseurl`` |
|
902 | ``baseurl`` | |
901 | Base URL to use when publishing URLs in other locations, so |
|
903 | Base URL to use when publishing URLs in other locations, so | |
902 | third-party tools like email notification hooks can construct |
|
904 | third-party tools like email notification hooks can construct | |
903 | URLs. Example: ``http://hgserver/repos/``. |
|
905 | URLs. Example: ``http://hgserver/repos/``. | |
904 | ``cacerts`` |
|
906 | ``cacerts`` | |
905 | Path to file containing a list of PEM encoded certificate authorities |
|
907 | Path to file containing a list of PEM encoded certificate authorities | |
906 | that may be used to verify an SSL server's identity. The form must be |
|
908 | that may be used to verify an SSL server's identity. The form must be | |
907 | as follows:: |
|
909 | as follows:: | |
908 |
|
910 | |||
909 | -----BEGIN CERTIFICATE----- |
|
911 | -----BEGIN CERTIFICATE----- | |
910 | ... (certificate in base64 PEM encoding) ... |
|
912 | ... (certificate in base64 PEM encoding) ... | |
911 | -----END CERTIFICATE----- |
|
913 | -----END CERTIFICATE----- | |
912 | -----BEGIN CERTIFICATE----- |
|
914 | -----BEGIN CERTIFICATE----- | |
913 | ... (certificate in base64 PEM encoding) ... |
|
915 | ... (certificate in base64 PEM encoding) ... | |
914 | -----END CERTIFICATE----- |
|
916 | -----END CERTIFICATE----- | |
915 |
|
917 | |||
916 | This feature is only supported when using Python 2.6. If you wish to |
|
918 | This feature is only supported when using Python 2.6. If you wish to | |
917 | use it with earlier versions of Python, install the backported |
|
919 | use it with earlier versions of Python, install the backported | |
918 | version of the ssl library that is available from |
|
920 | version of the ssl library that is available from | |
919 | ``http://pypi.python.org``. |
|
921 | ``http://pypi.python.org``. | |
920 |
|
922 | |||
921 | You can use OpenSSL's CA certificate file if your platform has one. |
|
923 | You can use OpenSSL's CA certificate file if your platform has one. | |
922 | On most Linux systems this will be ``/etc/ssl/certs/ca-certificates.crt``. |
|
924 | On most Linux systems this will be ``/etc/ssl/certs/ca-certificates.crt``. | |
923 | Otherwise you will have to generate this file manually. |
|
925 | Otherwise you will have to generate this file manually. | |
924 | ``contact`` |
|
926 | ``contact`` | |
925 | Name or email address of the person in charge of the repository. |
|
927 | Name or email address of the person in charge of the repository. | |
926 | Defaults to ui.username or ``$EMAIL`` or "unknown" if unset or empty. |
|
928 | Defaults to ui.username or ``$EMAIL`` or "unknown" if unset or empty. | |
927 | ``deny_push`` |
|
929 | ``deny_push`` | |
928 | Whether to deny pushing to the repository. If empty or not set, |
|
930 | Whether to deny pushing to the repository. If empty or not set, | |
929 | push is not denied. If the special value ``*``, all remote users are |
|
931 | push is not denied. If the special value ``*``, all remote users are | |
930 | denied push. Otherwise, unauthenticated users are all denied, and |
|
932 | denied push. Otherwise, unauthenticated users are all denied, and | |
931 | any authenticated user name present in this list is also denied. The |
|
933 | any authenticated user name present in this list is also denied. The | |
932 | contents of the deny_push list are examined before the allow_push list. |
|
934 | contents of the deny_push list are examined before the allow_push list. | |
933 | ``deny_read`` |
|
935 | ``deny_read`` | |
934 | Whether to deny reading/viewing of the repository. If this list is |
|
936 | Whether to deny reading/viewing of the repository. If this list is | |
935 | not empty, unauthenticated users are all denied, and any |
|
937 | not empty, unauthenticated users are all denied, and any | |
936 | authenticated user name present in this list is also denied access to |
|
938 | authenticated user name present in this list is also denied access to | |
937 | the repository. If set to the special value ``*``, all remote users |
|
939 | the repository. If set to the special value ``*``, all remote users | |
938 | are denied access (rarely needed ;). If deny_read is empty or not set, |
|
940 | are denied access (rarely needed ;). If deny_read is empty or not set, | |
939 | the determination of repository access depends on the presence and |
|
941 | the determination of repository access depends on the presence and | |
940 | content of the allow_read list (see description). If both |
|
942 | content of the allow_read list (see description). If both | |
941 | deny_read and allow_read are empty or not set, then access is |
|
943 | deny_read and allow_read are empty or not set, then access is | |
942 | permitted to all users by default. If the repository is being |
|
944 | permitted to all users by default. If the repository is being | |
943 | served via hgwebdir, denied users will not be able to see it in |
|
945 | served via hgwebdir, denied users will not be able to see it in | |
944 | the list of repositories. The contents of the deny_read list have |
|
946 | the list of repositories. The contents of the deny_read list have | |
945 | priority over (are examined before) the contents of the allow_read |
|
947 | priority over (are examined before) the contents of the allow_read | |
946 | list. |
|
948 | list. | |
947 | ``descend`` |
|
949 | ``descend`` | |
948 | hgwebdir indexes will not descend into subdirectories. Only repositories |
|
950 | hgwebdir indexes will not descend into subdirectories. Only repositories | |
949 | directly in the current path will be shown (other repositories are still |
|
951 | directly in the current path will be shown (other repositories are still | |
950 | available from the index corresponding to their containing path). |
|
952 | available from the index corresponding to their containing path). | |
951 | ``description`` |
|
953 | ``description`` | |
952 | Textual description of the repository's purpose or contents. |
|
954 | Textual description of the repository's purpose or contents. | |
953 | Default is "unknown". |
|
955 | Default is "unknown". | |
954 | ``encoding`` |
|
956 | ``encoding`` | |
955 | Character encoding name. Default is the current locale charset. |
|
957 | Character encoding name. Default is the current locale charset. | |
956 | Example: "UTF-8" |
|
958 | Example: "UTF-8" | |
957 | ``errorlog`` |
|
959 | ``errorlog`` | |
958 | Where to output the error log. Default is stderr. |
|
960 | Where to output the error log. Default is stderr. | |
959 | ``hidden`` |
|
961 | ``hidden`` | |
960 | Whether to hide the repository in the hgwebdir index. |
|
962 | Whether to hide the repository in the hgwebdir index. | |
961 | Default is False. |
|
963 | Default is False. | |
962 | ``ipv6`` |
|
964 | ``ipv6`` | |
963 | Whether to use IPv6. Default is False. |
|
965 | Whether to use IPv6. Default is False. | |
964 | ``name`` |
|
966 | ``name`` | |
965 | Repository name to use in the web interface. Default is current |
|
967 | Repository name to use in the web interface. Default is current | |
966 | working directory. |
|
968 | working directory. | |
967 | ``maxchanges`` |
|
969 | ``maxchanges`` | |
968 | Maximum number of changes to list on the changelog. Default is 10. |
|
970 | Maximum number of changes to list on the changelog. Default is 10. | |
969 | ``maxfiles`` |
|
971 | ``maxfiles`` | |
970 | Maximum number of files to list per changeset. Default is 10. |
|
972 | Maximum number of files to list per changeset. Default is 10. | |
971 | ``port`` |
|
973 | ``port`` | |
972 | Port to listen on. Default is 8000. |
|
974 | Port to listen on. Default is 8000. | |
973 | ``prefix`` |
|
975 | ``prefix`` | |
974 | Prefix path to serve from. Default is '' (server root). |
|
976 | Prefix path to serve from. Default is '' (server root). | |
975 | ``push_ssl`` |
|
977 | ``push_ssl`` | |
976 | Whether to require that inbound pushes be transported over SSL to |
|
978 | Whether to require that inbound pushes be transported over SSL to | |
977 | prevent password sniffing. Default is True. |
|
979 | prevent password sniffing. Default is True. | |
978 | ``staticurl`` |
|
980 | ``staticurl`` | |
979 | Base URL to use for static files. If unset, static files (e.g. the |
|
981 | Base URL to use for static files. If unset, static files (e.g. the | |
980 | hgicon.png favicon) will be served by the CGI script itself. Use |
|
982 | hgicon.png favicon) will be served by the CGI script itself. Use | |
981 | this setting to serve them directly with the HTTP server. |
|
983 | this setting to serve them directly with the HTTP server. | |
982 | Example: ``http://hgserver/static/``. |
|
984 | Example: ``http://hgserver/static/``. | |
983 | ``stripes`` |
|
985 | ``stripes`` | |
984 | How many lines a "zebra stripe" should span in multiline output. |
|
986 | How many lines a "zebra stripe" should span in multiline output. | |
985 | Default is 1; set to 0 to disable. |
|
987 | Default is 1; set to 0 to disable. | |
986 | ``style`` |
|
988 | ``style`` | |
987 | Which template map style to use. |
|
989 | Which template map style to use. | |
988 | ``templates`` |
|
990 | ``templates`` | |
989 | Where to find the HTML templates. Default is install path. |
|
991 | Where to find the HTML templates. Default is install path. | |
990 |
|
992 | |||
991 |
|
993 | |||
992 | Author |
|
994 | Author | |
993 | ------ |
|
995 | ------ | |
994 | Bryan O'Sullivan <bos@serpentine.com>. |
|
996 | Bryan O'Sullivan <bos@serpentine.com>. | |
995 |
|
997 | |||
996 | Mercurial was written by Matt Mackall <mpm@selenic.com>. |
|
998 | Mercurial was written by Matt Mackall <mpm@selenic.com>. | |
997 |
|
999 | |||
998 | See Also |
|
1000 | See Also | |
999 | -------- |
|
1001 | -------- | |
1000 | |hg(1)|_, |hgignore(5)|_ |
|
1002 | |hg(1)|_, |hgignore(5)|_ | |
1001 |
|
1003 | |||
1002 | Copying |
|
1004 | Copying | |
1003 | ------- |
|
1005 | ------- | |
1004 | This manual page is copyright 2005 Bryan O'Sullivan. |
|
1006 | This manual page is copyright 2005 Bryan O'Sullivan. | |
1005 | Mercurial is copyright 2005-2010 Matt Mackall. |
|
1007 | Mercurial is copyright 2005-2010 Matt Mackall. | |
1006 | Free use of this software is granted under the terms of the GNU General |
|
1008 | Free use of this software is granted under the terms of the GNU General | |
1007 | Public License version 2 or any later version. |
|
1009 | Public License version 2 or any later version. | |
1008 |
|
1010 | |||
1009 | .. include:: common.txt |
|
1011 | .. include:: common.txt |
@@ -1,252 +1,259 | |||||
1 | # filemerge.py - file-level merge handling for Mercurial |
|
1 | # filemerge.py - file-level merge handling for Mercurial | |
2 | # |
|
2 | # | |
3 | # Copyright 2006, 2007, 2008 Matt Mackall <mpm@selenic.com> |
|
3 | # Copyright 2006, 2007, 2008 Matt Mackall <mpm@selenic.com> | |
4 | # |
|
4 | # | |
5 | # This software may be used and distributed according to the terms of the |
|
5 | # This software may be used and distributed according to the terms of the | |
6 | # GNU General Public License version 2 or any later version. |
|
6 | # GNU General Public License version 2 or any later version. | |
7 |
|
7 | |||
8 | from node import short |
|
8 | from node import short | |
9 | from i18n import _ |
|
9 | from i18n import _ | |
10 | import util, simplemerge, match, error |
|
10 | import util, simplemerge, match, error | |
11 | import os, tempfile, re, filecmp |
|
11 | import os, tempfile, re, filecmp | |
12 |
|
12 | |||
13 | def _toolstr(ui, tool, part, default=""): |
|
13 | def _toolstr(ui, tool, part, default=""): | |
14 | return ui.config("merge-tools", tool + "." + part, default) |
|
14 | return ui.config("merge-tools", tool + "." + part, default) | |
15 |
|
15 | |||
16 | def _toolbool(ui, tool, part, default=False): |
|
16 | def _toolbool(ui, tool, part, default=False): | |
17 | return ui.configbool("merge-tools", tool + "." + part, default) |
|
17 | return ui.configbool("merge-tools", tool + "." + part, default) | |
18 |
|
18 | |||
19 | def _toollist(ui, tool, part, default=[]): |
|
19 | def _toollist(ui, tool, part, default=[]): | |
20 | return ui.configlist("merge-tools", tool + "." + part, default) |
|
20 | return ui.configlist("merge-tools", tool + "." + part, default) | |
21 |
|
21 | |||
22 | _internal = ['internal:' + s |
|
22 | _internal = ['internal:' + s | |
23 | for s in 'fail local other merge prompt dump'.split()] |
|
23 | for s in 'fail local other merge prompt dump'.split()] | |
24 |
|
24 | |||
25 | def _findtool(ui, tool): |
|
25 | def _findtool(ui, tool): | |
26 | if tool in _internal: |
|
26 | if tool in _internal: | |
27 | return tool |
|
27 | return tool | |
28 | k = _toolstr(ui, tool, "regkey") |
|
28 | k = _toolstr(ui, tool, "regkey") | |
29 | if k: |
|
29 | if k: | |
30 | p = util.lookup_reg(k, _toolstr(ui, tool, "regname")) |
|
30 | p = util.lookup_reg(k, _toolstr(ui, tool, "regname")) | |
31 | if p: |
|
31 | if p: | |
32 | p = util.find_exe(p + _toolstr(ui, tool, "regappend")) |
|
32 | p = util.find_exe(p + _toolstr(ui, tool, "regappend")) | |
33 | if p: |
|
33 | if p: | |
34 | return p |
|
34 | return p | |
35 | return util.find_exe(_toolstr(ui, tool, "executable", tool)) |
|
35 | return util.find_exe(_toolstr(ui, tool, "executable", tool)) | |
36 |
|
36 | |||
37 | def _picktool(repo, ui, path, binary, symlink): |
|
37 | def _picktool(repo, ui, path, binary, symlink): | |
38 | def check(tool, pat, symlink, binary): |
|
38 | def check(tool, pat, symlink, binary): | |
39 | tmsg = tool |
|
39 | tmsg = tool | |
40 | if pat: |
|
40 | if pat: | |
41 | tmsg += " specified for " + pat |
|
41 | tmsg += " specified for " + pat | |
42 | if not _findtool(ui, tool): |
|
42 | if not _findtool(ui, tool): | |
43 | if pat: # explicitly requested tool deserves a warning |
|
43 | if pat: # explicitly requested tool deserves a warning | |
44 | ui.warn(_("couldn't find merge tool %s\n") % tmsg) |
|
44 | ui.warn(_("couldn't find merge tool %s\n") % tmsg) | |
45 | else: # configured but non-existing tools are more silent |
|
45 | else: # configured but non-existing tools are more silent | |
46 | ui.note(_("couldn't find merge tool %s\n") % tmsg) |
|
46 | ui.note(_("couldn't find merge tool %s\n") % tmsg) | |
47 | elif symlink and not _toolbool(ui, tool, "symlink"): |
|
47 | elif symlink and not _toolbool(ui, tool, "symlink"): | |
48 | ui.warn(_("tool %s can't handle symlinks\n") % tmsg) |
|
48 | ui.warn(_("tool %s can't handle symlinks\n") % tmsg) | |
49 | elif binary and not _toolbool(ui, tool, "binary"): |
|
49 | elif binary and not _toolbool(ui, tool, "binary"): | |
50 | ui.warn(_("tool %s can't handle binary\n") % tmsg) |
|
50 | ui.warn(_("tool %s can't handle binary\n") % tmsg) | |
51 | elif not util.gui() and _toolbool(ui, tool, "gui"): |
|
51 | elif not util.gui() and _toolbool(ui, tool, "gui"): | |
52 | ui.warn(_("tool %s requires a GUI\n") % tmsg) |
|
52 | ui.warn(_("tool %s requires a GUI\n") % tmsg) | |
53 | else: |
|
53 | else: | |
54 | return True |
|
54 | return True | |
55 | return False |
|
55 | return False | |
56 |
|
56 | |||
57 | # HGMERGE takes precedence |
|
57 | # HGMERGE takes precedence | |
58 | hgmerge = os.environ.get("HGMERGE") |
|
58 | hgmerge = os.environ.get("HGMERGE") | |
59 | if hgmerge: |
|
59 | if hgmerge: | |
60 | return (hgmerge, hgmerge) |
|
60 | return (hgmerge, hgmerge) | |
61 |
|
61 | |||
62 | # then patterns |
|
62 | # then patterns | |
63 | for pat, tool in ui.configitems("merge-patterns"): |
|
63 | for pat, tool in ui.configitems("merge-patterns"): | |
64 | mf = match.match(repo.root, '', [pat]) |
|
64 | mf = match.match(repo.root, '', [pat]) | |
65 | if mf(path) and check(tool, pat, symlink, False): |
|
65 | if mf(path) and check(tool, pat, symlink, False): | |
66 | toolpath = _findtool(ui, tool) |
|
66 | toolpath = _findtool(ui, tool) | |
67 | return (tool, '"' + toolpath + '"') |
|
67 | return (tool, '"' + toolpath + '"') | |
68 |
|
68 | |||
69 | # then merge tools |
|
69 | # then merge tools | |
70 | tools = {} |
|
70 | tools = {} | |
71 | for k, v in ui.configitems("merge-tools"): |
|
71 | for k, v in ui.configitems("merge-tools"): | |
72 | t = k.split('.')[0] |
|
72 | t = k.split('.')[0] | |
73 | if t not in tools: |
|
73 | if t not in tools: | |
74 | tools[t] = int(_toolstr(ui, t, "priority", "0")) |
|
74 | tools[t] = int(_toolstr(ui, t, "priority", "0")) | |
75 | names = tools.keys() |
|
75 | names = tools.keys() | |
76 | tools = sorted([(-p, t) for t, p in tools.items()]) |
|
76 | tools = sorted([(-p, t) for t, p in tools.items()]) | |
77 | uimerge = ui.config("ui", "merge") |
|
77 | uimerge = ui.config("ui", "merge") | |
78 | if uimerge: |
|
78 | if uimerge: | |
79 | if uimerge not in names: |
|
79 | if uimerge not in names: | |
80 | return (uimerge, uimerge) |
|
80 | return (uimerge, uimerge) | |
81 | tools.insert(0, (None, uimerge)) # highest priority |
|
81 | tools.insert(0, (None, uimerge)) # highest priority | |
82 | tools.append((None, "hgmerge")) # the old default, if found |
|
82 | tools.append((None, "hgmerge")) # the old default, if found | |
83 | for p, t in tools: |
|
83 | for p, t in tools: | |
84 | if check(t, None, symlink, binary): |
|
84 | if check(t, None, symlink, binary): | |
85 | toolpath = _findtool(ui, t) |
|
85 | toolpath = _findtool(ui, t) | |
86 | return (t, '"' + toolpath + '"') |
|
86 | return (t, '"' + toolpath + '"') | |
87 | # internal merge as last resort |
|
87 | # internal merge as last resort | |
88 | return (not (symlink or binary) and "internal:merge" or None, None) |
|
88 | return (not (symlink or binary) and "internal:merge" or None, None) | |
89 |
|
89 | |||
90 | def _eoltype(data): |
|
90 | def _eoltype(data): | |
91 | "Guess the EOL type of a file" |
|
91 | "Guess the EOL type of a file" | |
92 | if '\0' in data: # binary |
|
92 | if '\0' in data: # binary | |
93 | return None |
|
93 | return None | |
94 | if '\r\n' in data: # Windows |
|
94 | if '\r\n' in data: # Windows | |
95 | return '\r\n' |
|
95 | return '\r\n' | |
96 | if '\r' in data: # Old Mac |
|
96 | if '\r' in data: # Old Mac | |
97 | return '\r' |
|
97 | return '\r' | |
98 | if '\n' in data: # UNIX |
|
98 | if '\n' in data: # UNIX | |
99 | return '\n' |
|
99 | return '\n' | |
100 | return None # unknown |
|
100 | return None # unknown | |
101 |
|
101 | |||
102 | def _matcheol(file, origfile): |
|
102 | def _matcheol(file, origfile): | |
103 | "Convert EOL markers in a file to match origfile" |
|
103 | "Convert EOL markers in a file to match origfile" | |
104 | tostyle = _eoltype(open(origfile, "rb").read()) |
|
104 | tostyle = _eoltype(open(origfile, "rb").read()) | |
105 | if tostyle: |
|
105 | if tostyle: | |
106 | data = open(file, "rb").read() |
|
106 | data = open(file, "rb").read() | |
107 | style = _eoltype(data) |
|
107 | style = _eoltype(data) | |
108 | if style: |
|
108 | if style: | |
109 | newdata = data.replace(style, tostyle) |
|
109 | newdata = data.replace(style, tostyle) | |
110 | if newdata != data: |
|
110 | if newdata != data: | |
111 | open(file, "wb").write(newdata) |
|
111 | open(file, "wb").write(newdata) | |
112 |
|
112 | |||
113 | def filemerge(repo, mynode, orig, fcd, fco, fca): |
|
113 | def filemerge(repo, mynode, orig, fcd, fco, fca): | |
114 | """perform a 3-way merge in the working directory |
|
114 | """perform a 3-way merge in the working directory | |
115 |
|
115 | |||
116 | mynode = parent node before merge |
|
116 | mynode = parent node before merge | |
117 | orig = original local filename before merge |
|
117 | orig = original local filename before merge | |
118 | fco = other file context |
|
118 | fco = other file context | |
119 | fca = ancestor file context |
|
119 | fca = ancestor file context | |
120 | fcd = local file context for current/destination file |
|
120 | fcd = local file context for current/destination file | |
121 | """ |
|
121 | """ | |
122 |
|
122 | |||
123 | def temp(prefix, ctx): |
|
123 | def temp(prefix, ctx): | |
124 | pre = "%s~%s." % (os.path.basename(ctx.path()), prefix) |
|
124 | pre = "%s~%s." % (os.path.basename(ctx.path()), prefix) | |
125 | (fd, name) = tempfile.mkstemp(prefix=pre) |
|
125 | (fd, name) = tempfile.mkstemp(prefix=pre) | |
126 | data = repo.wwritedata(ctx.path(), ctx.data()) |
|
126 | data = repo.wwritedata(ctx.path(), ctx.data()) | |
127 | f = os.fdopen(fd, "wb") |
|
127 | f = os.fdopen(fd, "wb") | |
128 | f.write(data) |
|
128 | f.write(data) | |
129 | f.close() |
|
129 | f.close() | |
130 | return name |
|
130 | return name | |
131 |
|
131 | |||
132 | def isbin(ctx): |
|
132 | def isbin(ctx): | |
133 | try: |
|
133 | try: | |
134 | return util.binary(ctx.data()) |
|
134 | return util.binary(ctx.data()) | |
135 | except IOError: |
|
135 | except IOError: | |
136 | return False |
|
136 | return False | |
137 |
|
137 | |||
138 | if not fco.cmp(fcd.data()): # files identical? |
|
138 | if not fco.cmp(fcd.data()): # files identical? | |
139 | return None |
|
139 | return None | |
140 |
|
140 | |||
141 | if fca == fco: # backwards, use working dir parent as ancestor |
|
141 | if fca == fco: # backwards, use working dir parent as ancestor | |
142 | fca = fcd.parents()[0] |
|
142 | fca = fcd.parents()[0] | |
143 |
|
143 | |||
144 | ui = repo.ui |
|
144 | ui = repo.ui | |
145 | fd = fcd.path() |
|
145 | fd = fcd.path() | |
146 | binary = isbin(fcd) or isbin(fco) or isbin(fca) |
|
146 | binary = isbin(fcd) or isbin(fco) or isbin(fca) | |
147 | symlink = 'l' in fcd.flags() + fco.flags() |
|
147 | symlink = 'l' in fcd.flags() + fco.flags() | |
148 | tool, toolpath = _picktool(repo, ui, fd, binary, symlink) |
|
148 | tool, toolpath = _picktool(repo, ui, fd, binary, symlink) | |
149 | ui.debug("picked tool '%s' for %s (binary %s symlink %s)\n" % |
|
149 | ui.debug("picked tool '%s' for %s (binary %s symlink %s)\n" % | |
150 | (tool, fd, binary, symlink)) |
|
150 | (tool, fd, binary, symlink)) | |
151 |
|
151 | |||
152 | if not tool or tool == 'internal:prompt': |
|
152 | if not tool or tool == 'internal:prompt': | |
153 | tool = "internal:local" |
|
153 | tool = "internal:local" | |
154 | if ui.promptchoice(_(" no tool found to merge %s\n" |
|
154 | if ui.promptchoice(_(" no tool found to merge %s\n" | |
155 | "keep (l)ocal or take (o)ther?") % fd, |
|
155 | "keep (l)ocal or take (o)ther?") % fd, | |
156 | (_("&Local"), _("&Other")), 0): |
|
156 | (_("&Local"), _("&Other")), 0): | |
157 | tool = "internal:other" |
|
157 | tool = "internal:other" | |
158 | if tool == "internal:local": |
|
158 | if tool == "internal:local": | |
159 | return 0 |
|
159 | return 0 | |
160 | if tool == "internal:other": |
|
160 | if tool == "internal:other": | |
161 | repo.wwrite(fd, fco.data(), fco.flags()) |
|
161 | repo.wwrite(fd, fco.data(), fco.flags()) | |
162 | return 0 |
|
162 | return 0 | |
163 | if tool == "internal:fail": |
|
163 | if tool == "internal:fail": | |
164 | return 1 |
|
164 | return 1 | |
165 |
|
165 | |||
166 | # do the actual merge |
|
166 | # do the actual merge | |
167 | a = repo.wjoin(fd) |
|
167 | a = repo.wjoin(fd) | |
168 | b = temp("base", fca) |
|
168 | b = temp("base", fca) | |
169 | c = temp("other", fco) |
|
169 | c = temp("other", fco) | |
170 | out = "" |
|
170 | out = "" | |
171 | back = a + ".orig" |
|
171 | back = a + ".orig" | |
172 | util.copyfile(a, back) |
|
172 | util.copyfile(a, back) | |
173 |
|
173 | |||
174 | if orig != fco.path(): |
|
174 | if orig != fco.path(): | |
175 | ui.status(_("merging %s and %s to %s\n") % (orig, fco.path(), fd)) |
|
175 | ui.status(_("merging %s and %s to %s\n") % (orig, fco.path(), fd)) | |
176 | else: |
|
176 | else: | |
177 | ui.status(_("merging %s\n") % fd) |
|
177 | ui.status(_("merging %s\n") % fd) | |
178 |
|
178 | |||
179 | ui.debug("my %s other %s ancestor %s\n" % (fcd, fco, fca)) |
|
179 | ui.debug("my %s other %s ancestor %s\n" % (fcd, fco, fca)) | |
180 |
|
180 | |||
181 | # do we attempt to simplemerge first? |
|
181 | # do we attempt to simplemerge first? | |
182 | try: |
|
182 | try: | |
183 | premerge = _toolbool(ui, tool, "premerge", not (binary or symlink)) |
|
183 | premerge = _toolbool(ui, tool, "premerge", not (binary or symlink)) | |
184 | except error.ConfigError: |
|
184 | except error.ConfigError: | |
185 | premerge = _toolstr(ui, tool, "premerge").lower() |
|
185 | premerge = _toolstr(ui, tool, "premerge").lower() | |
186 | valid = 'keep'.split() |
|
186 | valid = 'keep'.split() | |
187 | if premerge not in valid: |
|
187 | if premerge not in valid: | |
188 | _valid = ', '.join(["'" + v + "'" for v in valid]) |
|
188 | _valid = ', '.join(["'" + v + "'" for v in valid]) | |
189 | raise error.ConfigError(_("%s.premerge not valid " |
|
189 | raise error.ConfigError(_("%s.premerge not valid " | |
190 | "('%s' is neither boolean nor %s)") % |
|
190 | "('%s' is neither boolean nor %s)") % | |
191 | (tool, premerge, _valid)) |
|
191 | (tool, premerge, _valid)) | |
192 |
|
192 | |||
193 | if premerge: |
|
193 | if premerge: | |
194 | r = simplemerge.simplemerge(ui, a, b, c, quiet=True) |
|
194 | r = simplemerge.simplemerge(ui, a, b, c, quiet=True) | |
195 | if not r: |
|
195 | if not r: | |
196 | ui.debug(" premerge successful\n") |
|
196 | ui.debug(" premerge successful\n") | |
197 | os.unlink(back) |
|
197 | os.unlink(back) | |
198 | os.unlink(b) |
|
198 | os.unlink(b) | |
199 | os.unlink(c) |
|
199 | os.unlink(c) | |
200 | return 0 |
|
200 | return 0 | |
201 | if premerge != 'keep': |
|
201 | if premerge != 'keep': | |
202 | util.copyfile(back, a) # restore from backup and try again |
|
202 | util.copyfile(back, a) # restore from backup and try again | |
203 |
|
203 | |||
204 | env = dict(HG_FILE=fd, |
|
204 | env = dict(HG_FILE=fd, | |
205 | HG_MY_NODE=short(mynode), |
|
205 | HG_MY_NODE=short(mynode), | |
206 | HG_OTHER_NODE=str(fco.changectx()), |
|
206 | HG_OTHER_NODE=str(fco.changectx()), | |
207 | HG_BASE_NODE=str(fca.changectx()), |
|
207 | HG_BASE_NODE=str(fca.changectx()), | |
208 | HG_MY_ISLINK='l' in fcd.flags(), |
|
208 | HG_MY_ISLINK='l' in fcd.flags(), | |
209 | HG_OTHER_ISLINK='l' in fco.flags(), |
|
209 | HG_OTHER_ISLINK='l' in fco.flags(), | |
210 | HG_BASE_ISLINK='l' in fca.flags()) |
|
210 | HG_BASE_ISLINK='l' in fca.flags()) | |
211 |
|
211 | |||
212 | if tool == "internal:merge": |
|
212 | if tool == "internal:merge": | |
213 | r = simplemerge.simplemerge(ui, a, b, c, label=['local', 'other']) |
|
213 | r = simplemerge.simplemerge(ui, a, b, c, label=['local', 'other']) | |
214 | elif tool == 'internal:dump': |
|
214 | elif tool == 'internal:dump': | |
215 | a = repo.wjoin(fd) |
|
215 | a = repo.wjoin(fd) | |
216 | util.copyfile(a, a + ".local") |
|
216 | util.copyfile(a, a + ".local") | |
217 | repo.wwrite(fd + ".other", fco.data(), fco.flags()) |
|
217 | repo.wwrite(fd + ".other", fco.data(), fco.flags()) | |
218 | repo.wwrite(fd + ".base", fca.data(), fca.flags()) |
|
218 | repo.wwrite(fd + ".base", fca.data(), fca.flags()) | |
219 | return 1 # unresolved |
|
219 | return 1 # unresolved | |
220 | else: |
|
220 | else: | |
221 | args = _toolstr(ui, tool, "args", '$local $base $other') |
|
221 | args = _toolstr(ui, tool, "args", '$local $base $other') | |
222 | if "$output" in args: |
|
222 | if "$output" in args: | |
223 | out, a = a, back # read input from backup, write to original |
|
223 | out, a = a, back # read input from backup, write to original | |
224 | replace = dict(local=a, base=b, other=c, output=out) |
|
224 | replace = dict(local=a, base=b, other=c, output=out) | |
225 | args = re.sub("\$(local|base|other|output)", |
|
225 | args = re.sub("\$(local|base|other|output)", | |
226 | lambda x: '"%s"' % util.localpath(replace[x.group()[1:]]), args) |
|
226 | lambda x: '"%s"' % util.localpath(replace[x.group()[1:]]), args) | |
227 | r = util.system(toolpath + ' ' + args, cwd=repo.root, environ=env) |
|
227 | r = util.system(toolpath + ' ' + args, cwd=repo.root, environ=env) | |
228 |
|
228 | |||
229 | if not r and (_toolbool(ui, tool, "checkconflicts") or |
|
229 | if not r and (_toolbool(ui, tool, "checkconflicts") or | |
230 | 'conflicts' in _toollist(ui, tool, "check")): |
|
230 | 'conflicts' in _toollist(ui, tool, "check")): | |
231 | if re.match("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcd.data()): |
|
231 | if re.match("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcd.data()): | |
232 | r = 1 |
|
232 | r = 1 | |
233 |
|
233 | |||
234 | if not r and (_toolbool(ui, tool, "checkchanged") or |
|
234 | checked = False | |
235 |
|
|
235 | if 'prompt' in _toollist(ui, tool, "check"): | |
|
236 | checked = True | |||
|
237 | if ui.promptchoice(_("was merge of '%s' successful (yn)?") % fd, | |||
|
238 | (_("&Yes"), _("&No")), 1): | |||
|
239 | r = 1 | |||
|
240 | ||||
|
241 | if not r and not checked and (_toolbool(ui, tool, "checkchanged") or | |||
|
242 | 'changed' in _toollist(ui, tool, "check")): | |||
236 | if filecmp.cmp(repo.wjoin(fd), back): |
|
243 | if filecmp.cmp(repo.wjoin(fd), back): | |
237 | if ui.promptchoice(_(" output file %s appears unchanged\n" |
|
244 | if ui.promptchoice(_(" output file %s appears unchanged\n" | |
238 | "was merge successful (yn)?") % fd, |
|
245 | "was merge successful (yn)?") % fd, | |
239 | (_("&Yes"), _("&No")), 1): |
|
246 | (_("&Yes"), _("&No")), 1): | |
240 | r = 1 |
|
247 | r = 1 | |
241 |
|
248 | |||
242 | if _toolbool(ui, tool, "fixeol"): |
|
249 | if _toolbool(ui, tool, "fixeol"): | |
243 | _matcheol(repo.wjoin(fd), back) |
|
250 | _matcheol(repo.wjoin(fd), back) | |
244 |
|
251 | |||
245 | if r: |
|
252 | if r: | |
246 | ui.warn(_("merging %s failed!\n") % fd) |
|
253 | ui.warn(_("merging %s failed!\n") % fd) | |
247 | else: |
|
254 | else: | |
248 | os.unlink(back) |
|
255 | os.unlink(back) | |
249 |
|
256 | |||
250 | os.unlink(b) |
|
257 | os.unlink(b) | |
251 | os.unlink(c) |
|
258 | os.unlink(c) | |
252 | return r |
|
259 | return r |
General Comments 0
You need to be logged in to leave comments.
Login now