83 keys contain PATH-like strings, every part of which must reference |
83 keys contain PATH-like strings, every part of which must reference |
84 a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will |
84 a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will |
85 be read. Mercurial checks each of these locations in the specified |
85 be read. Mercurial checks each of these locations in the specified |
86 order until one or more configuration files are detected. |
86 order until one or more configuration files are detected. |
87 |
87 |
88 .. note:: The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial`` |
88 .. note:: |
|
89 |
|
90 The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial`` |
89 is used when running 32-bit Python on 64-bit Windows. |
91 is used when running 32-bit Python on 64-bit Windows. |
90 |
92 |
91 Syntax |
93 Syntax |
92 ====== |
94 ====== |
93 |
95 |
202 creates a new command ``latest`` that shows only the five most recent |
204 creates a new command ``latest`` that shows only the five most recent |
203 changesets. You can define subsequent aliases using earlier ones:: |
205 changesets. You can define subsequent aliases using earlier ones:: |
204 |
206 |
205 stable5 = latest -b stable |
207 stable5 = latest -b stable |
206 |
208 |
207 .. note:: It is possible to create aliases with the same names as |
209 .. note:: |
|
210 |
|
211 It is possible to create aliases with the same names as |
208 existing commands, which will then override the original |
212 existing commands, which will then override the original |
209 definitions. This is almost always a bad idea! |
213 definitions. This is almost always a bad idea! |
210 |
214 |
211 An alias can start with an exclamation point (``!``) to make it a |
215 An alias can start with an exclamation point (``!``) to make it a |
212 shell alias. A shell alias is executed with the shell and will let you |
216 shell alias. A shell alias is executed with the shell and will let you |
233 useful when you want to call further Mercurial commands in a shell |
237 useful when you want to call further Mercurial commands in a shell |
234 alias, as was done above for the purge alias. In addition, |
238 alias, as was done above for the purge alias. In addition, |
235 ``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg |
239 ``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg |
236 echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``. |
240 echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``. |
237 |
241 |
238 .. note:: Some global configuration options such as ``-R`` are |
242 .. note:: |
|
243 |
|
244 Some global configuration options such as ``-R`` are |
239 processed before shell aliases and will thus not be passed to |
245 processed before shell aliases and will thus not be passed to |
240 aliases. |
246 aliases. |
241 |
247 |
242 |
248 |
243 ``annotate`` |
249 ``annotate`` |
360 with the name of a temporary file that contains the data to be |
366 with the name of a temporary file that contains the data to be |
361 filtered by the command. The string ``OUTFILE`` is replaced with the name |
367 filtered by the command. The string ``OUTFILE`` is replaced with the name |
362 of an empty temporary file, where the filtered data must be written by |
368 of an empty temporary file, where the filtered data must be written by |
363 the command. |
369 the command. |
364 |
370 |
365 .. note:: The tempfile mechanism is recommended for Windows systems, |
371 .. note:: |
|
372 |
|
373 The tempfile mechanism is recommended for Windows systems, |
366 where the standard shell I/O redirection operators often have |
374 where the standard shell I/O redirection operators often have |
367 strange effects and may corrupt the contents of your files. |
375 strange effects and may corrupt the contents of your files. |
368 |
376 |
369 This filter mechanism is used internally by the ``eol`` extension to |
377 This filter mechanism is used internally by the ``eol`` extension to |
370 translate line ending characters between Windows (CRLF) and Unix (LF) |
378 translate line ending characters between Windows (CRLF) and Unix (LF) |
706 Run after updating the working directory. Changeset ID of first |
714 Run after updating the working directory. Changeset ID of first |
707 new parent is in ``$HG_PARENT1``. If merge, ID of second new parent is |
715 new parent is in ``$HG_PARENT1``. If merge, ID of second new parent is |
708 in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the |
716 in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the |
709 update failed (e.g. because conflicts not resolved), ``$HG_ERROR=1``. |
717 update failed (e.g. because conflicts not resolved), ``$HG_ERROR=1``. |
710 |
718 |
711 .. note:: It is generally better to use standard hooks rather than the |
719 .. note:: |
|
720 |
|
721 It is generally better to use standard hooks rather than the |
712 generic pre- and post- command hooks as they are guaranteed to be |
722 generic pre- and post- command hooks as they are guaranteed to be |
713 called in the appropriate contexts for influencing transactions. |
723 called in the appropriate contexts for influencing transactions. |
714 Also, hooks like "commit" will be called in all contexts that |
724 Also, hooks like "commit" will be called in all contexts that |
715 generate a commit (e.g. tag) and not just the commit command. |
725 generate a commit (e.g. tag) and not just the commit command. |
716 |
726 |
717 .. note:: Environment variables with empty values may not be passed to |
727 .. note:: |
|
728 |
|
729 Environment variables with empty values may not be passed to |
718 hooks on platforms such as Windows. As an example, ``$HG_PARENT2`` |
730 hooks on platforms such as Windows. As an example, ``$HG_PARENT2`` |
719 will have an empty value under Unix-like platforms for non-merge |
731 will have an empty value under Unix-like platforms for non-merge |
720 changesets, while it will not be available at all under Windows. |
732 changesets, while it will not be available at all under Windows. |
721 |
733 |
722 The syntax for Python hooks is as follows:: |
734 The syntax for Python hooks is as follows:: |