tests/test-keyword.out
branchkwmap-templates
changeset 151 5f3856a6ce56
parent 148 c0baa881d90a
child 152 7ca8e7661609
equal deleted inserted replaced
150:ba5cb61db7a0 151:5f3856a6ce56
     6 
     6 
     7 Keywords are only expanded in local repositories and not logged by
     7 Keywords are only expanded in local repositories and not logged by
     8 Mercurial internally. The mechanism can be regarded as a convenience
     8 Mercurial internally. The mechanism can be regarded as a convenience
     9 for the current user and may be turned off anytime.
     9 for the current user and may be turned off anytime.
    10 
    10 
    11 Substitution takes place on every commit and update of the working
    11 The exansion works in 2 modes:
    12 repository.
    12     1) working mode: substitution takes place on every commit and
       
    13        update of the working repository.
       
    14     2) archive mode: substitution is only triggered by "hg archive".
    13 
    15 
    14 Caveat: "hg import" might fail if the patches were exported from a
    16 Caveat: "hg import" might fail if the patches were exported from a
    15 repo with a different/no keyword setup, whereas "hg unbundle" is
    17 repo with a different/no keyword setup, whereas "hg unbundle" is
    16 safe.
    18 safe.
    17 
    19 
    22      [keyword]
    24      [keyword]
    23      # filename patterns for expansion are configured in this section
    25      # filename patterns for expansion are configured in this section
    24      # files matching patterns with value 'ignore' are ignored
    26      # files matching patterns with value 'ignore' are ignored
    25      **.py =          ## expand keywords in all python files
    27      **.py =          ## expand keywords in all python files
    26      x* = ignore      ## but ignore files matching "x*"
    28      x* = ignore      ## but ignore files matching "x*"
       
    29      ** = archive     ## keywords in all textfiles are expanded
       
    30                       ## when creating a distribution
       
    31      y* = noarchive   ## keywords in files matching "y*" are not expanded
       
    32                       ## on archive creation
    27      ...
    33      ...
    28      [keywordmaps]
    34      [keywordmaps]
    29      # custom hg template maps _replace_ the CVS-like default ones
    35      # custom hg template maps _replace_ the CVS-like default ones
    30      HGdate = {date|rfc822date}
    36      HGdate = {date|rfc822date}
    31      lastlog = {desc} ## same as {desc|firstline} in this context
    37      lastlog = {desc} ## same as {desc|firstline} in this context
    44      Header: /path/to/basename,v csetid %Y/%m/%d %H:%M:%S username
    50      Header: /path/to/basename,v csetid %Y/%m/%d %H:%M:%S username
    45 
    51 
    46 no commands defined
    52 no commands defined
    47 % cat
    53 % cat
    48 expand $Id$
    54 expand $Id$
       
    55 ignore $Id$
       
    56 archive $Id$
    49 expand $Id$
    57 expand $Id$
    50 ignore $Id$
       
    51 % default keyword expansion
    58 % default keyword expansion
    52 % commit
    59 % commit
    53 adding a
    60 adding a
    54 adding b
    61 adding b
       
    62 adding c
    55 adding sym
    63 adding sym
    56 a
    64 a
    57 b
    65 b
       
    66 c
    58 sym
    67 sym
    59 overwriting a expanding keywords
    68 overwriting a expanding keywords
    60 % status
    69 % status
    61 % cat
    70 % cat
    62 expand $Id: a,v 126ec311add6 1970/01/01 00:00:00 user $
    71 expand $Id: a,v 99e97605039e 1970/01/01 00:00:00 user $
    63 expand $Id: a,v 126ec311add6 1970/01/01 00:00:00 user $
       
    64 ignore $Id$
    72 ignore $Id$
       
    73 archive $Id$
       
    74 expand $Id: a,v 99e97605039e 1970/01/01 00:00:00 user $
    65 % hg cat
    75 % hg cat
    66 expand $Id: a,v 126ec311add6 1970/01/01 00:00:00 user $
    76 expand $Id: a,v 99e97605039e 1970/01/01 00:00:00 user $
       
    77 archive $Id$
    67 ignore $Id$
    78 ignore $Id$
    68 a
    79 a
    69 % update
    80 % update
    70 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
    81 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
    71 % cat
    82 % cat
    72 expand $Id: a,v 126ec311add6 1970/01/01 00:00:00 user $
    83 expand $Id: a,v 99e97605039e 1970/01/01 00:00:00 user $
    73 expand $Id: a,v 126ec311add6 1970/01/01 00:00:00 user $
       
    74 ignore $Id$
    84 ignore $Id$
       
    85 archive $Id$
       
    86 expand $Id: a,v 99e97605039e 1970/01/01 00:00:00 user $
       
    87 % archive
       
    88 % cat
       
    89 expand $Id$
       
    90 ignore $Id$
       
    91 archive $Id: c,v 99e97605039e 1970/01/01 00:00:00 user $
       
    92 a
    75 % custom keyword expansion
    93 % custom keyword expansion
    76 % cat
    94 % cat
    77 expand $Id: a,v 126ec311add6 1970/01/01 00:00:00 user $
    95 expand $Id: a,v 99e97605039e 1970/01/01 00:00:00 user $
    78 expand $Id: a,v 126ec311add6 1970/01/01 00:00:00 user $
       
    79 ignore $Id$
    96 ignore $Id$
       
    97 archive $Id$
       
    98 expand $Id: a,v 99e97605039e 1970/01/01 00:00:00 user $
    80 % hg cat
    99 % hg cat
    81 expand $Id: a 126ec311add6 Thu, 01 Jan 1970 00:00:00 +0000 user $
   100 expand $Id: a 99e97605039e Thu, 01 Jan 1970 00:00:00 +0000 user $
       
   101 archive $Id$
    82 ignore $Id$
   102 ignore $Id$
    83 a
   103 a
    84 % commit
   104 % commit
    85 a
   105 a
    86 overwriting a expanding keywords
   106 overwriting a expanding keywords
    87 % status
   107 % status
    88 % cat
   108 % cat
    89 expand $Id: a 6022c13396d3 Thu, 01 Jan 1970 00:00:01 +0000 user $
   109 expand $Id: a 001dbcdc5258 Thu, 01 Jan 1970 00:00:01 +0000 user $
    90 $Xinfo: User Name <user@example.com>: firstline $
       
    91 expand $Id: a 6022c13396d3 Thu, 01 Jan 1970 00:00:01 +0000 user $
       
    92 $Xinfo: User Name <user@example.com>: firstline $
   110 $Xinfo: User Name <user@example.com>: firstline $
    93 ignore $Id$
   111 ignore $Id$
       
   112 archive $Id$
       
   113 expand $Id: a 001dbcdc5258 Thu, 01 Jan 1970 00:00:01 +0000 user $
       
   114 $Xinfo: User Name <user@example.com>: firstline $
    94 % hg cat
   115 % hg cat
    95 expand $Id: a 6022c13396d3 Thu, 01 Jan 1970 00:00:01 +0000 user $
   116 expand $Id: a 001dbcdc5258 Thu, 01 Jan 1970 00:00:01 +0000 user $
    96 $Xinfo: User Name <user@example.com>: firstline $
   117 $Xinfo: User Name <user@example.com>: firstline $
       
   118 archive $Id$
    97 ignore $Id$
   119 ignore $Id$
    98 a
   120 a
    99 requesting all changes
   121 requesting all changes
   100 adding changesets
   122 adding changesets
   101 adding manifests
   123 adding manifests
   102 adding file changes
   124 adding file changes
   103 added 1 changesets with 3 changes to 3 files
   125 added 1 changesets with 4 changes to 4 files
   104 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   126 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   105 % incoming
   127 % incoming
   106 searching for changes
   128 searching for changes
   107 changeset:   1:6022c13396d3
   129 changeset:   1:001dbcdc5258
   108 tag:         tip
   130 tag:         tip
   109 user:        User Name <user@example.com>
   131 user:        User Name <user@example.com>
   110 date:        Thu Jan 01 00:00:01 1970 +0000
   132 date:        Thu Jan 01 00:00:01 1970 +0000
   111 summary:     firstline
   133 summary:     firstline
   112 
   134 
   113 % switch off expansion
   135 % switch off expansion
   114 % cat
   136 % cat
   115 expand $Id: a 6022c13396d3 Thu, 01 Jan 1970 00:00:01 +0000 user $
   137 expand $Id: a 001dbcdc5258 Thu, 01 Jan 1970 00:00:01 +0000 user $
   116 $Xinfo: User Name <user@example.com>: firstline $
       
   117 expand $Id: a 6022c13396d3 Thu, 01 Jan 1970 00:00:01 +0000 user $
       
   118 $Xinfo: User Name <user@example.com>: firstline $
   138 $Xinfo: User Name <user@example.com>: firstline $
   119 ignore $Id$
   139 ignore $Id$
       
   140 archive $Id$
       
   141 expand $Id: a 001dbcdc5258 Thu, 01 Jan 1970 00:00:01 +0000 user $
       
   142 $Xinfo: User Name <user@example.com>: firstline $
   120 % hg cat
   143 % hg cat
   121 expand $Id$
   144 expand $Id$
   122 $Xinfo$
   145 $Xinfo$
       
   146 archive $Id$
   123 ignore $Id$
   147 ignore $Id$
   124 a
   148 a
   125 % update
   149 % update
   126 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   150 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   127 % cat
   151 % cat
   128 expand $Id$
   152 expand $Id$
   129 $Xinfo$
   153 $Xinfo$
       
   154 ignore $Id$
       
   155 archive $Id$
   130 expand $Id$
   156 expand $Id$
   131 $Xinfo$
   157 $Xinfo$
   132 ignore $Id$