The Mercurial system uses a set of configuration files to control
aspects of its behavior.
The configuration files use a simple ini-file format. A configuration
file consists of sections, led by a ``[section]`` header and followed
by ``name = value`` entries::
[ui]
username = Firstname Lastname <firstname.lastname@example.net>
verbose = True
The above entries will be referred to as ``ui.username`` and
``ui.verbose``, respectively. See the Syntax section below.
Files
=====
Mercurial reads configuration data from several files, if they exist.
These files do not exist by default and you will have to create the
appropriate configuration files yourself: global configuration like
the username setting is typically put into
``%USERPROFILE%\mercurial.ini`` or ``$HOME/.hgrc`` and local
configuration is put into the per-repository ``<repo>/.hg/hgrc`` file.
The names of these files depend on the system on which Mercurial is
installed. ``*.rc`` files from a single directory are read in
alphabetical order, later ones overriding earlier ones. Where multiple
paths are given below, settings from earlier paths override later
ones.
.. container:: verbose.unix
On Unix, the following files are consulted:
- ``<repo>/.hg/hgrc`` (per-repository)
- ``$HOME/.hgrc`` (per-user)
- ``<install-root>/etc/mercurial/hgrc`` (per-installation)
- ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation)
- ``/etc/mercurial/hgrc`` (per-system)
- ``/etc/mercurial/hgrc.d/*.rc`` (per-system)
.. container:: verbose.windows
On Windows, the following files are consulted:
- ``<repo>/.hg/hgrc`` (per-repository)
- ``%USERPROFILE%\.hgrc`` (per-user)
- ``%USERPROFILE%\Mercurial.ini`` (per-user)
- ``%HOME%\.hgrc`` (per-user)
- ``%HOME%\Mercurial.ini`` (per-user)
- ``<install-dir>\Mercurial.ini`` (per-installation)
- ``<install-dir>\hgrc.d\*.rc`` (per-installation)
- ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-installation)
.. note::
The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial``
is used when running 32-bit Python on 64-bit Windows.
.. container:: verbose.plan9
On Plan9, the following files are consulted:
- ``<repo>/.hg/hgrc`` (per-repository)
- ``$home/lib/hgrc`` (per-user)
- ``<install-root>/lib/mercurial/hgrc`` (per-installation)
- ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation)
- ``/lib/mercurial/hgrc`` (per-system)
- ``/lib/mercurial/hgrc.d/*.rc`` (per-system)
Per-repository configuration options only apply in a
particular repository. This file is not version-controlled, and
will not get transferred during a "clone" operation. Options in
this file override options in all other configuration files. On
Plan 9 and Unix, most of this file will be ignored if it doesn't
belong to a trusted user or to a trusted group. See the documentation
for the ``[trusted]`` section below for more details.
Per-user configuration file(s) are for the user running Mercurial. On
Windows 9x, ``%HOME%`` is replaced by ``%APPDATA%``. Options in these
files apply to all Mercurial commands executed by this user in any
directory. Options in these files override per-system and per-installation
options.
Per-installation configuration files are searched for in the
directory where Mercurial is installed. ``<install-root>`` is the
parent directory of the **hg** executable (or symlink) being run. For
example, if installed in ``/shared/tools/bin/hg``, Mercurial will look
in ``/shared/tools/etc/mercurial/hgrc``. Options in these files apply
to all Mercurial commands executed by any user in any directory.
Per-installation configuration files are for the system on
which Mercurial is running. Options in these files apply to all
Mercurial commands executed by any user in any directory. Registry
keys contain PATH-like strings, every part of which must reference
a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will
be read. Mercurial checks each of these locations in the specified
order until one or more configuration files are detected.
Per-system configuration files are for the system on which Mercurial
is running. Options in these files apply to all Mercurial commands
executed by any user in any directory. Options in these files
override per-installation options.
Syntax
======
A configuration file consists of sections, led by a ``[section]`` header
and followed by ``name = value`` entries (sometimes called
``configuration keys``)::
[spam]
eggs=ham
green=
eggs
Each line contains one entry. If the lines that follow are indented,
they are treated as continuations of that entry. Leading whitespace is
removed from values. Empty lines are skipped. Lines beginning with
``#`` or ``;`` are ignored and may be used to provide comments.
Configuration keys can be set multiple times, in which case Mercurial
will use the value that was configured last. As an example::
[spam]
eggs=large
ham=serrano
eggs=small
This would set the configuration key named ``eggs`` to ``small``.
It is also possible to define a section multiple times. A section can
be redefined on the same and/or on different configuration files. For
example::
[foo]
eggs=large
ham=serrano
eggs=small
[bar]
eggs=ham
green=
eggs
[foo]
ham=prosciutto
eggs=medium
bread=toasted
This would set the ``eggs``, ``ham``, and ``bread`` configuration keys
of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``,
respectively. As you can see there only thing that matters is the last
value that was set for each of the configuration keys.
If a configuration key is set multiple times in different
configuration files the final value will depend on the order in which
the different configuration files are read, with settings from earlier
paths overriding later ones as described on the ``Files`` section
above.
A line of the form ``%include file`` will include ``file`` into the
current configuration file. The inclusion is recursive, which means
that included files can include other files. Filenames are relative to
the configuration file in which the ``%include`` directive is found.
Environment variables and ``~user`` constructs are expanded in
``file``. This lets you do something like::
%include ~/.hgrc.d/$HOST.rc
to include a different configuration file on each computer you use.
A line with ``%unset name`` will remove ``name`` from the current
section, if it has been set previously.
The values are either free-form text strings, lists of text strings,
or Boolean values. Boolean values can be set to true using any of "1",
"yes", "true", or "on" and to false using "0", "no", "false", or "off"
(all case insensitive).
List values are separated by whitespace or comma, except when values are
placed in double quotation marks::
allow_read = "John Doe, PhD", brian, betty
Quotation marks can be escaped by prefixing them with a backslash. Only
quotation marks at the beginning of a word is counted as a quotation
(e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``).
Sections
========
This section describes the different sections that may appear in a
Mercurial configuration file, the purpose of each section, its possible
keys, and their possible values.
``alias``
---------
Defines command aliases.
Aliases allow you to define your own commands in terms of other
commands (or aliases), optionally including arguments. Positional
arguments in the form of ``$1``, ``$2``, etc in the alias definition
are expanded by Mercurial before execution. Positional arguments not
already used by ``$N`` in the definition are put at the end of the
command to be executed.
Alias definitions consist of lines of the form::
<alias> = <command> [<argument>]...
For example, this definition::
latest = log --limit 5
creates a new command ``latest`` that shows only the five most recent
changesets. You can define subsequent aliases using earlier ones::
stable5 =
没有合适的资源?快使用搜索试试~ 我知道了~
sourcetree客户端+许可证书
共2000个文件
nib:780个
pyc:221个
py:221个
需积分: 9 11 下载量 25 浏览量
2017-11-07
10:37:40
上传
评论
收藏 49.22MB ZIP 举报
温馨提示
sourcetree.app是客户端安装包,sourcetree.license是许可证书。sourcetree绿色版
资源推荐
资源详情
资源评论
收起资源包目录
sourcetree客户端+许可证书 (2000个子文件)
git-config.1 154KB
git-log.1 84KB
git-fast-import.1 61KB
git-diff-tree.1 60KB
git-rev-list.1 52KB
git-show.1 51KB
git-svn.1 47KB
git-diff.1 43KB
git-diff-index.1 42KB
git.1 41KB
git-diff-files.1 38KB
git-rebase.1 37KB
git-format-patch.1 36KB
git-pull.1 31KB
git-rev-parse.1 30KB
git-merge.1 30KB
git-push.1 30KB
gitweb.1 29KB
LGPL-2.1 26KB
git-p4.1 23KB
git-commit.1 23KB
git-fetch.1 21KB
git-send-email.1 21KB
git-filter-branch.1 21KB
gitremote-helpers.1 20KB
git-checkout.1 20KB
git-read-tree.1 20KB
git-submodule.1 19KB
git-blame.1 18KB
git-cvsserver.1 18KB
git-reset.1 18KB
git-update-index.1 17KB
git-add.1 16KB
git-notes.1 16KB
git-clone.1 16KB
git-bisect.1 15KB
git-subtree.1 15KB
git-daemon.1 14KB
git-tag.1 13KB
git-interpret-trailers.1 13KB
git-branch.1 13KB
git-apply.1 12KB
git-stash.1 11KB
git-status.1 11KB
git-http-backend.1 11KB
git-pack-objects.1 11KB
git-cat-file.1 10KB
git-cherry-pick.1 10KB
git-grep.1 10KB
git-cvsimport.1 10KB
git-receive-pack.1 10KB
git-remote.1 9KB
git-rerere.1 9KB
git-am.1 9KB
git-fast-export.1 9KB
git-commit-tree.1 9KB
gitk.1 9KB
git-bundle.1 9KB
git-worktree.1 8KB
git-ls-files.1 8KB
git-for-each-ref.1 8KB
git-show-branch.1 8KB
git-help.1 8KB
git-archive.1 8KB
git-describe.1 8KB
git-rm.1 8KB
git-merge-base.1 8KB
git-credential.1 7KB
git-gc.1 7KB
git-annotate.1 7KB
git-update-ref.1 7KB
git-checkout-index.1 7KB
git-show-ref.1 7KB
git-send-pack.1 7KB
git-check-ref-format.1 7KB
git-shortlog.1 7KB
git-repack.1 7KB
git-init.1 7KB
git-imap-send.1 6KB
git-replace.1 6KB
git-fsck.1 6KB
git-difftool.1 6KB
git-web--browse.1 6KB
git-revert.1 6KB
git-clean.1 6KB
git-reflog.1 6KB
git-remote-ext.1 5KB
git-archimport.1 5KB
git-check-ignore.1 5KB
git-gui.1 5KB
git-cherry.1 5KB
git-check-attr.1 5KB
git-check-mailmap.1 5KB
git-index-pack.1 5KB
git-fetch-pack.1 5KB
git-http-push.1 5KB
git-mailinfo.1 5KB
git-credential-store.1 5KB
git-cvsexportcommit.1 5KB
git-mergetool.1 5KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
qq_33882833
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功