hgkw/keyword.py
branchkwmap-templates
changeset 114 09847a7eb5d7
parent 113 3412cbc77275
child 116 265714c59607
equal deleted inserted replaced
113:3412cbc77275 114:09847a7eb5d7
    12 not running a version control system.
    12 not running a version control system.
    13 
    13 
    14 For in-depth discussion refer to
    14 For in-depth discussion refer to
    15 <http://www.selenic.com/mercurial/wiki/index.cgi/KeywordPlan>.
    15 <http://www.selenic.com/mercurial/wiki/index.cgi/KeywordPlan>.
    16 
    16 
    17 You can either use the default cvs-like keywords or provide your
    17 Keywords are only expanded in local repositories and not logged by
    18 own in hgrc.
    18 Mercurial internally. The mechanism can be regarded as a convenience
    19 
    19 for the current user and may be turned off anytime.
    20 It is recommended to enable this extension on a per-repo basis only.
    20 
    21 You can still configure keywordmaps globally.
    21 Substitution takes place on every commit and update of the working
    22 
    22 repository.
    23 Expansions spanning more than one line are truncated to their first line.
    23 
    24 Incremental expansion (like CVS' $Log$) is not supported.
    24 Keyword expansion is based on Mercurial's changeset template mappings.
       
    25 The extension provides an additional UTC-date filter.
       
    26 
       
    27 The user has the choice either to create his own keywords and their
       
    28 expansions or to use the CVS-like default ones.
    25 
    29 
    26 Default $keywords$ and their $keyword: substition $ are:
    30 Default $keywords$ and their $keyword: substition $ are:
    27     Revision: changeset id
    31     Revision: changeset id
    28     Author:   username
    32     Author:   username
    29     Date:     %Y/%m/%d %H:%M:%S [UTC]
    33     Date:     %Y/%m/%d %H:%M:%S [UTC]
    30     RCSFile:  basename,v
    34     RCSFile:  basename,v
    31     Source:   /path/to/basename,v
    35     Source:   /path/to/basename,v
    32     Id:       basename,v csetid %Y/%m/%d %H:%M:%S username
    36     Id:       basename,v csetid %Y/%m/%d %H:%M:%S username
    33     Header:   /path/to/basename,v csetid %Y/%m/%d %H:%M:%S username
    37     Header:   /path/to/basename,v csetid %Y/%m/%d %H:%M:%S username
    34 
    38 
       
    39 Expansions spanning more than one line are truncated to their first line.
       
    40 Incremental expansion (like CVS' $Log$) is not supported.
       
    41 
    35 Simple setup in hgrc:
    42 Simple setup in hgrc:
    36 
    43 
    37     # enable extension
    44     # enable extension
    38     hgext.keyword = /full/path/to/script
    45     keyword = /full/path/to/keyword.py
    39     # or, if script in hgext folder:
    46     # or, if script in hgext folder:
    40     # hgext.keyword =
    47     # hgext.keyword =
    41     
    48     
    42     # filename patterns for expansion are configured in this section
    49     # filename patterns for expansion are configured in this section
    43     # files matching patterns with value 'ignore' are ignored
    50     # files matching patterns with value 'ignore' are ignored