Differences between revisions 1 and 10 (spanning 9 versions)
Revision 1 as of 2007-01-17 20:41:39
Size: 1330
Comment: Add keyword expansion page
Revision 10 as of 2007-02-25 11:43:16
Size: 1845
Comment: document "archive mode"; minor corrections
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
It's being developed by Christian Ebert and can be downloaded from its [http://www.blacktrash.org/cgi-bin/hgwebdir.cgi/hgkeyword/ keyword expansion repository]. ''Author: Christian Ebert''

Download site: [http://www.blacktrash.org/cgi-bin/mercurial/hgkeyword/ keyword expansion repository].

Mirror of crew repo plus keyword extension: [http://www.blacktrash.org/cgi-bin/mercurial/hg-crew-keyword/ Mercurial crew + keyword].
Line 8: Line 12:
This extension allows the expansion of RCS/CVS-like and user defined keys in Mercurial repositories. This extension allows the expansion of RCS/CVS-like and user defined keys in text files tracked by Mercurial.
Ex
pansion takes place in the working directory or/and when creating a distribution using "hg archive".
Line 15: Line 20:
hgext.keyword = path/to/keyword.py
#or, if keyword.py is in the hgext folder:
#hgext.keyword=
hgext.keyword=
#or, if keyword.py is not in the hgext folder:
#keyword=/path/to/keyword.py
Line 20: Line 25:
Additional configuration is dones in they [keyword] and [keywordmaps] sections in your configuration file: Additional configuration is done in the [keyword] and [keywordmaps] sections in your configuration file:
Line 23: Line 28:
# files matching patterns with value 'ignore' are ignored
Line 25: Line 29:
# expand keywords in all python files in working dir
Line 26: Line 31:
# do not expand keywords in files matching "x*" in working dir
Line 27: Line 33:
# expand keywords in all text files when creating a distribution
** = archive
# but exclude files matching "y*"
y* = noarchive
Line 29: Line 39:
# using {{{key-to-be-expanded = value}}} lines, where values are taken from the avaliable Mercurial template names. # using "key-to-be-expanded = value" lines, where values are taken from the available Mercurial template names.
# an additional filter "utcdate" is provided to get "%Y/%m/%d %H:%M:%S" date format.
Line 38: Line 49:

----
CategoryExtension

Keyword Expansion extension

This extension is not being distributed along with Mercurial.

Author: Christian Ebert

Download site: [http://www.blacktrash.org/cgi-bin/mercurial/hgkeyword/ keyword expansion repository].

Mirror of crew repo plus keyword extension: [http://www.blacktrash.org/cgi-bin/mercurial/hg-crew-keyword/ Mercurial crew + keyword].

Overview

This extension allows the expansion of RCS/CVS-like and user defined keys in text files tracked by Mercurial. Expansion takes place in the working directory or/and when creating a distribution using "hg archive".

Configuration

To enable this extension add it to the '[extensions]' stanza in the hgrc file:

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

Additional configuration is done in the [keyword] and [keywordmaps] sections in your configuration file:

# filename patterns for expansion are configured in this section
[keyword]
# expand keywords in all python files in working dir
**.py =
# do not expand keywords in files matching "x*" in working dir
x* = ignore
# expand keywords in all text files when creating a distribution
** = archive
# but exclude files matching "y*"
y* = noarchive
...
# in case you prefer your own keyword maps over the cvs-like defaults:
# using "key-to-be-expanded = value" lines, where values are taken from the available Mercurial template names.
# an additional filter "utcdate" is provided to get "%Y/%m/%d %H:%M:%S" date format.
[keywordmaps]
HGdate = {date|rfc822date}
lastlog = {desc} ## same as {desc|firstline} in this context
checked in by = {author}

Usage

The defined keys (or default ones) are automatically expanded, without user interaction.


CategoryExtension

KeywordExtension (last edited 2024-03-06 12:11:11 by ChristianEbert)