Differences between revisions 6 and 9 (spanning 3 versions)
Revision 6 as of 2008-11-26 13:30:41
Size: 2438
Comment:
Revision 9 as of 2008-11-28 16:16:27
Size: 2833
Comment: use of diff to get rcpath names not in use
Deletions are marked like this. Additions are marked like this.
Line 37: Line 37:
To perform the above configuration you will need to know at least one `.hgrc` or `mercurial.ini` pathname. The information for this can be found at [http://www.selenic.com/hg/?f=-1;style=raw;file=doc/hgrc.5.txt hgrc.5.txt]. To perform the above configuration you will need to know at least one `.hgrc` or `mercurial.ini` pathname.  The information for this can be found at [http://www.selenic.com/hg/?f=-1;style=raw;file=doc/hgrc.5.txt hgrc.5.txt] and includes locations such as `~/.hgrc` and usually `/etc/mercurial/hgrc` on UNIX/Linux and `%USERPROFILE%\.hgrc` (e.g. `C:\Users\JoeDoe\.hgrc`) on Windows.
Line 39: Line 39:
If you can't figure it out from there then the following shows how to get a list of the pathnames without previously installing rcpath. Make sure that you have a working tar (Windows users can download and install Rtools from http://www.murdoch-sutherland.com/Rtools/ which contains `tar.exe` that can be placed on the `PATH` or in the current directory or get tar.exe from one of any of a number of other free sources on the net) and Python: If you can't figure it out from that then the following shows how to get a list of the pathnames without previously installing rcpath. Make sure that you have a working tar (Windows users can download and install Rtools from http://www.murdoch-sutherland.com/Rtools/ which contains `tar.exe` that can be placed on the `PATH` or in the current directory or get tar.exe from one of any of a number of other free sources on the net) and Python:
Line 45: Line 45:
2. run the following console/shell commands (except the last two lines
are entered into the python command line and also note that the
2. run the following console/shell commands except the last two lines
are entered into the python command line. Also note that the
Line 48: Line 48:
each line): each line. The example here uses Mercurial 1.0.2 but replace that with
whatever is the latest version:
Line 59: Line 60:
Here is an example of use. The first shows the two rc files that are currently being used. Here is an example of the use of the rcpath extension. The first shows the two rc files that are currently being used.
Line 74: Line 75:
To explicitly get those rcpath names not in use:
{{{
hg rcpath > rcpath.txt
hg rcpath -a | diff - rcpath.txt
}}}

RcpathExtension

This extension is not distributed with Mercurial.

Author: G. Grothendieck

Download site: Download direct from this page - attachment:rcpath.py

Overview

This extension displays Mercurial configuration file paths and names.

hg rcpath

show path/file names to startup files

options:

 -a --all         all path/names that could be used
 -d --duplicates  retain duplicates

use "hg -v help rcpath" to show global options

Configuration

Configure your .hgrc to enable the extension by adding following lines:

[extensions]
hgext.rcpath =
#or, if rcpath.py is not in the hgext folder:
#rpcath = /path/to/rcpath.py

To perform the above configuration you will need to know at least one .hgrc or mercurial.ini pathname. The information for this can be found at [http://www.selenic.com/hg/?f=-1;style=raw;file=doc/hgrc.5.txt hgrc.5.txt] and includes locations such as ~/.hgrc and usually /etc/mercurial/hgrc on UNIX/Linux and %USERPROFILE%\.hgrc (e.g. C:\Users\JoeDoe\.hgrc) on Windows.

If you can't figure it out from that then the following shows how to get a list of the pathnames without previously installing rcpath. Make sure that you have a working tar (Windows users can download and install Rtools from http://www.murdoch-sutherland.com/Rtools/ which contains tar.exe that can be placed on the PATH or in the current directory or get tar.exe from one of any of a number of other free sources on the net) and Python:

1. download mercurial source from:

http://www.selenic.com/mercurial/release

2. run the following console/shell commands except the last two lines are entered into the python command line. Also note that the portion typed by the user is the portion after the last > on each line. The example here uses Mercurial 1.0.2 but replace that with whatever is the latest version:

C:\tmp> tar xvfz mercurial-1.0.2.tar.gz
C:\tmp> cd mercurial-1.0.2/mercurial
C:\tmp\mercurial-1.0.2\mercurial> python
>>> from util import *
>>> rcpath() 

Examples

Here is an example of the use of the rcpath extension. The first shows the two rc files that are currently being used.

C:\>hg rcpath
C:\Program Files\TortoiseHg\mercurial.ini
C:\Users\Jones\.hgrc

The second output line of the following example did not appear in the previous example showing that in addition to the pathnames that are being used that C:\Users\Jones\mercurial.ini could potentially be used as well.

C:\>hg rcpath -a
C:\Program Files\TortoiseHg\mercurial.ini
C:\Users\Jones\mercurial.ini
C:\Users\Jones\.hgrc

To explicitly get those rcpath names not in use:

hg rcpath > rcpath.txt
hg rcpath -a | diff - rcpath.txt


CategoryExtension

RcpathExtension (last edited 2013-04-15 14:49:55 by fw-tnat)