User name and email: where are they stored ?
Thomas Arendsen Hein
thomas at intevation.de
Thu Aug 18 15:36:57 CDT 2005
* Anthony Liguori <aliguori at us.ibm.com> [20050818 18:33]:
> You can have an hgrc file either in the repository (.hg/hgrc) or per
> user (~/.hgrc).
Today I did a system-wide install of Mercurial and wanted to change
it so 'hgeditor' is used by all users. This patch (pullable from me)
adds this, and while being there, fixes loading ~/.hgrc on windows.
Settings are read from /etc/mercurial/hgrc and can be overridden in
~/.hgrc and in repo/.hg/hgrc as usual.
Thomas
# HG changeset patch
# User Thomas Arendsen Hein <thomas at intevation.de>
# Node ID 859de3ebc041d275d38444f6aa5f0b71ae8adf50
# Parent fbaf0380efd1097b3e6d7f02f69d8ad483d1b5d6
Read global config file /etc/mercurial/hgrc and fix reading hgrc on Windows.
diff -r fbaf0380efd1097b3e6d7f02f69d8ad483d1b5d6 -r 859de3ebc041d275d38444f6aa5f0b71ae8adf50 doc/hg.1.txt
--- a/doc/hg.1.txt Thu Aug 18 12:55:45 2005
+++ b/doc/hg.1.txt Thu Aug 18 20:35:36 2005
@@ -273,9 +273,8 @@
Show definition of symbolic path name NAME. If no name is given, show
definition of available names.
- Path names are defined in the [paths] section of the $HOME/.hgrc and
- <repo>/.hg/hgrc configuration files. If run outside a repo, 'paths'
- queries only $HOME/.hgrc.
+ Path names are defined in the [paths] section of /etc/mercurial/hgrc
+ and $HOME/.hgrc. If run inside a repository, .hg/hgrc is used, too.
pull <repository path>::
Pull changes from a remote repository to a local one.
@@ -589,10 +588,11 @@
seperated by spaces) that correspond to tagged versions of the repository
contents.
- $HOME/.hgrc, .hg/hgrc::
+ /etc/mercurial/hgrc, $HOME/.hgrc, .hg/hgrc::
This file contains defaults and configuration. Values in .hg/hgrc
- override those in .hgrc. See hgrc(5) for details of the contents
- and format of these files.
+ override those in $HOME/.hgrc, and these override settings made in the
+ global /etc/mercurial/hgrc configuration. See hgrc(5) for details of
+ the contents and format of these files.
BUGS
----
diff -r fbaf0380efd1097b3e6d7f02f69d8ad483d1b5d6 -r 859de3ebc041d275d38444f6aa5f0b71ae8adf50 doc/hgrc.5.txt
--- a/doc/hgrc.5.txt Thu Aug 18 12:55:45 2005
+++ b/doc/hgrc.5.txt Thu Aug 18 20:35:36 2005
@@ -15,17 +15,22 @@
FILES
-----
-Mercurial reads configuration data from two files:
+Mercurial reads configuration data from three files:
+
+/etc/mercurial/hgrc::
+ Options in this global configuration file apply to all Mercurial
+ commands executed by any user in any directory.
$HOME/.hgrc::
- Global configuration options that apply to all Mercurial commands,
- no matter where they are run.
+ Per-user configuration options that apply to all Mercurial commands,
+ no matter from which directory they are run. Values in this file
+ override global settings.
<repo>/.hg/hgrc::
Per-repository configuration options that only apply in a
particular repository. This file is not version-controlled, and
will not get transferred during a "clone" operation. Values in
- this file override global values.
+ this file override global and per-user settings.
SYNTAX
------
diff -r fbaf0380efd1097b3e6d7f02f69d8ad483d1b5d6 -r 859de3ebc041d275d38444f6aa5f0b71ae8adf50 mercurial/ui.py
--- a/mercurial/ui.py Thu Aug 18 12:55:45 2005
+++ b/mercurial/ui.py Thu Aug 18 20:35:36 2005
@@ -13,7 +13,8 @@
def __init__(self, verbose=False, debug=False, quiet=False,
interactive=True):
self.cdata = ConfigParser.SafeConfigParser()
- self.cdata.read(os.path.expanduser("~/.hgrc"))
+ self.cdata.read([os.path.normpath(hgrc) for hgrc in
+ "/etc/mercurial/hgrc", os.path.expanduser("~/.hgrc")])
self.quiet = self.configbool("ui", "quiet")
self.verbose = self.configbool("ui", "verbose")
--
Email: thomas at intevation.de
http://intevation.de/~thomas/
More information about the Mercurial
mailing list