tests/test-keyword
branchkwmap-templates
changeset 121 85ed7d71ba0f
child 131 23a1e1bdf62b
equal deleted inserted replaced
120:4a8a861da58c 121:85ed7d71ba0f
       
     1 #!/bin/sh
       
     2 
       
     3 cat <<EOF >> $HGRCPATH
       
     4 [extensions]
       
     5 hgext.keyword =
       
     6 [keyword]
       
     7 * =
       
     8 b* = ignore
       
     9 EOF
       
    10 
       
    11 echo % help
       
    12 hg help keyword
       
    13 
       
    14 hg init a
       
    15 cd a
       
    16 echo '$Id$' > a
       
    17 echo '$Id$' > b
       
    18 echo % cat
       
    19 cat a b
       
    20 
       
    21 echo % default keyword expansion
       
    22 echo % commit
       
    23 hg --debug commit -A -m ab -d '0 0' -u 'User Name <user@example.com>'
       
    24 
       
    25 echo % cat
       
    26 cat a b
       
    27 echo % hg cat
       
    28 hg cat a b
       
    29 
       
    30 rm a b
       
    31 echo % update
       
    32 hg update
       
    33 echo % cat
       
    34 cat a b
       
    35 
       
    36 echo % custom keyword expansion
       
    37 cat <<EOF >>$HGRCPATH
       
    38 [keywordmaps]
       
    39 Id = {file} {node|short} {date|rfc822date} {author|user}
       
    40 Xinfo = {author}: {desc}
       
    41 EOF
       
    42 
       
    43 echo % cat
       
    44 cat a b
       
    45 echo % hg cat
       
    46 hg cat a b
       
    47 
       
    48 echo '$Xinfo$' >> a
       
    49 cat <<EOF >> log
       
    50 firstline
       
    51 secondline
       
    52 EOF
       
    53 
       
    54 echo % commit
       
    55 hg --debug commit -l log -d '1 0' -u 'User Name <user@example.com>'
       
    56 
       
    57 echo % cat
       
    58 cat a b
       
    59 echo % hg cat
       
    60 hg cat a b
       
    61 
       
    62 echo % switch off expansion
       
    63 rm $HGRCPATH
       
    64 
       
    65 echo % cat
       
    66 cat a b
       
    67 echo % hg cat
       
    68 hg cat a b
       
    69 
       
    70 echo % update
       
    71 rm a b
       
    72 hg update
       
    73 
       
    74 echo % cat
       
    75 cat a b