hgkw/keyword.py
branchkwmap-templates
changeset 165 01c42124151a
parent 164 d16332759801
child 166 849e28e03fb4
equal deleted inserted replaced
164:d16332759801 165:01c42124151a
    42 
    42 
    43 Keywords are only expanded in local repositories and not logged by
    43 Keywords are only expanded in local repositories and not logged by
    44 Mercurial internally. The mechanism can be regarded as a convenience
    44 Mercurial internally. The mechanism can be regarded as a convenience
    45 for the current user and may be turned off anytime.
    45 for the current user and may be turned off anytime.
    46 
    46 
    47 The exansion works in 2 modes:
       
    48     1) working mode: substitution takes place on every commit and
       
    49        update of the working repository.
       
    50     2) archive mode: substitution is only triggered by "hg archive".
       
    51 
       
    52 Caveat: "hg import" might fail if the patches were exported from a
    47 Caveat: "hg import" might fail if the patches were exported from a
    53 repo with a different/no keyword setup, whereas "hg unbundle" is
    48 repo with a different/no keyword setup, whereas "hg unbundle" is
    54 safe.
    49 safe.
    55 
    50 
    56 Configuration is done in the [keyword] and [keywordmaps] sections of
    51 Configuration is done in the [keyword] and [keywordmaps] sections of
    57 hgrc files.
    52 hgrc files.
    58 
    53 
    59 Example:
    54 Example:
    60      [keyword]
    55      [keyword]
    61      # filename patterns for expansion are configured in this section
    56      # filename patterns for expansion are configured in this section
       
    57      # files matching patterns with value 'ignore' are ignored
    62      **.py =          ## expand keywords in all python files
    58      **.py =          ## expand keywords in all python files
    63      x* = ignore      ## but ignore files matching "x*"
    59      x* = ignore      ## but ignore files matching "x*"
    64      ** = archive     ## keywords in all textfiles are expanded
       
    65                       ## when creating a distribution
       
    66      y* = noarchive   ## keywords in files matching "y*" are not expanded
       
    67                       ## on archive creation
       
    68      ...
    60      ...
    69      [keywordmaps]
    61      [keywordmaps]
    70      # custom hg template maps _replace_ the CVS-like default ones
    62      # custom hg template maps _replace_ the CVS-like default ones
    71      HGdate = {date|rfc822date}
    63      HGdate = {date|rfc822date}
    72      lastlog = {desc} ## same as {desc|firstline} in this context
    64      lastlog = {desc} ## same as {desc|firstline} in this context