Show More
@@ -15,26 +15,38 b' aspects of its behaviour.' | |||||
15 | FILES |
|
15 | FILES | |
16 | ----- |
|
16 | ----- | |
17 |
|
17 | |||
18 |
Mercurial reads configuration data from |
|
18 | Mercurial reads configuration data from several files, if they exist. | |
19 |
|
|
19 | The names of these files depend on the system on which Mercurial is | |
20 |
|
|
20 | installed. | |
21 |
|
21 | |||
|
22 | (Unix) <install-root>/etc/mercurial/hgrc.d/*.rc:: | |||
|
23 | (Unix) <install-root>/etc/mercurial/hgrc:: | |||
|
24 | Per-installation configuration files, searched for in the | |||
|
25 | directory where Mercurial is installed. For example, if installed | |||
|
26 | in /shared/tools, Mercurial will look in | |||
|
27 | /shared/tools/etc/mercurial/hgrc. Options in these files apply to | |||
|
28 | all Mercurial commands executed by any user in any directory. | |||
|
29 | ||||
|
30 | (Unix) /etc/mercurial/hgrc.d/*.rc:: | |||
22 | (Unix) /etc/mercurial/hgrc:: |
|
31 | (Unix) /etc/mercurial/hgrc:: | |
23 | (Windows) C:\Mercurial\Mercurial.ini:: |
|
32 | (Windows) C:\Mercurial\Mercurial.ini:: | |
24 | Options in this global configuration file apply to all Mercurial |
|
33 | Per-system configuration files, for the system on which Mercurial | |
25 | commands executed by any user in any directory. |
|
34 | is running. Options in these files apply to all Mercurial | |
|
35 | commands executed by any user in any directory. Options in these | |||
|
36 | files override per-installation options. | |||
26 |
|
37 | |||
27 | (Unix) $HOME/.hgrc:: |
|
38 | (Unix) $HOME/.hgrc:: | |
28 | (Windows) C:\Documents and Settings\USERNAME\Mercurial.ini |
|
39 | (Windows) C:\Documents and Settings\USERNAME\Mercurial.ini | |
29 |
Per-user configuration |
|
40 | Per-user configuration file, for the user running Mercurial. | |
30 | no matter from which directory they are run. Values in this file |
|
41 | Options in this file apply to all Mercurial commands executed by | |
31 | override global settings. |
|
42 | any user in any directory. Options in this file override | |
|
43 | per-installation and per-system options. | |||
32 |
|
44 | |||
33 | (Unix, Windows) <repo>/.hg/hgrc:: |
|
45 | (Unix, Windows) <repo>/.hg/hgrc:: | |
34 | Per-repository configuration options that only apply in a |
|
46 | Per-repository configuration options that only apply in a | |
35 | particular repository. This file is not version-controlled, and |
|
47 | particular repository. This file is not version-controlled, and | |
36 |
will not get transferred during a "clone" operation. |
|
48 | will not get transferred during a "clone" operation. Options in | |
37 |
this file override |
|
49 | this file override options in all other configuration files. | |
38 |
|
50 | |||
39 | SYNTAX |
|
51 | SYNTAX | |
40 | ------ |
|
52 | ------ |
@@ -13,7 +13,7 b' platform-specific details from the core.' | |||||
13 | import os, errno |
|
13 | import os, errno | |
14 | from i18n import gettext as _ |
|
14 | from i18n import gettext as _ | |
15 | from demandload import * |
|
15 | from demandload import * | |
16 | demandload(globals(), "re cStringIO shutil popen2 tempfile threading time") |
|
16 | demandload(globals(), "re cStringIO shutil popen2 sys tempfile threading time") | |
17 |
|
17 | |||
18 | def pipefilter(s, cmd): |
|
18 | def pipefilter(s, cmd): | |
19 | '''filter string S through command CMD, returning its output''' |
|
19 | '''filter string S through command CMD, returning its output''' | |
@@ -483,12 +483,18 b" if os.name == 'nt':" | |||||
483 | else: |
|
483 | else: | |
484 | nulldev = '/dev/null' |
|
484 | nulldev = '/dev/null' | |
485 |
|
485 | |||
486 | hgrcd = '/etc/mercurial/hgrc.d' |
|
486 | def rcfiles(path): | |
487 | hgrcs = [] |
|
487 | rcs = [os.path.join(path, 'hgrc')] | |
488 |
|
|
488 | rcdir = os.path.join(path, 'hgrc.d') | |
489 | hgrcs = [f for f in os.listdir(hgrcd) if f.endswith(".rc")] |
|
489 | try: | |
490 | rcpath = map(os.path.normpath, hgrcs + |
|
490 | rcs.extend([os.path.join(rcdir, f) for f in os.listdir(rcdir) | |
491 | ['/etc/mercurial/hgrc', os.path.expanduser('~/.hgrc')]) |
|
491 | if f.endswith(".rc")]) | |
|
492 | except OSError, inst: pass | |||
|
493 | return rcs | |||
|
494 | rcpath = rcfiles(os.path.dirname(sys.argv[0]) + '/../etc/mercurial') | |||
|
495 | rcpath.extend(rcfiles('/etc/mercurial')) | |||
|
496 | rcpath.append(os.path.expanduser('~/.hgrc')) | |||
|
497 | rcpath = [os.path.normpath(f) for f in rcpath] | |||
492 |
|
498 | |||
493 | def parse_patch_output(output_line): |
|
499 | def parse_patch_output(output_line): | |
494 | """parses the output produced by patch and returns the file name""" |
|
500 | """parses the output produced by patch and returns the file name""" |
General Comments 0
You need to be logged in to leave comments.
Login now