tests/test-keyword
branchkwmap-templates
changeset 154 1e856223aa06
parent 153 7e97ea52335a
child 155 b62dacbd2166
equal deleted inserted replaced
153:7e97ea52335a 154:1e856223aa06
     1 #!/bin/sh
       
     2 
       
     3 cat <<EOF >> $HGRCPATH
       
     4 [extensions]
       
     5 hgext.keyword =
       
     6 [keyword]
       
     7 a =
       
     8 b = ignore
       
     9 c = archive
       
    10 EOF
       
    11 
       
    12 echo % help
       
    13 hg help keyword
       
    14 
       
    15 hg init Test
       
    16 cd Test
       
    17 echo 'expand $Id$' > a
       
    18 echo 'ignore $Id$' > b
       
    19 echo 'archive $Id$' > c
       
    20 ln -s a sym
       
    21 echo % cat
       
    22 cat a b c sym
       
    23 
       
    24 echo % default keyword expansion
       
    25 echo % commit
       
    26 hg --debug commit -A -mabcsym -d '0 0' -u 'User Name <user@example.com>'
       
    27 echo % status
       
    28 hg status
       
    29 
       
    30 echo % cat
       
    31 cat a b c sym
       
    32 echo % hg cat
       
    33 hg cat a b c sym
       
    34 
       
    35 echo
       
    36 rm a b c sym
       
    37 echo % update
       
    38 hg update
       
    39 echo % cat
       
    40 cat a b c sym
       
    41 
       
    42 echo % archive
       
    43 hg archive ../Archive
       
    44 cd ../Archive
       
    45 echo % cat
       
    46 cat a b c sym
       
    47 echo
       
    48 cd -
       
    49 
       
    50 echo % custom keyword expansion
       
    51 cat <<EOF >>$HGRCPATH
       
    52 [keywordmaps]
       
    53 Id = {file} {node|short} {date|rfc822date} {author|user}
       
    54 Xinfo = {author}: {desc}
       
    55 EOF
       
    56 
       
    57 echo % cat
       
    58 cat a b c sym
       
    59 echo % hg cat
       
    60 hg cat a b c sym
       
    61 
       
    62 echo
       
    63 echo '$Xinfo$' >> a
       
    64 cat <<EOF >> log
       
    65 firstline
       
    66 secondline
       
    67 EOF
       
    68 
       
    69 echo % commit
       
    70 hg --debug commit -l log -d '1 0' -u 'User Name <user@example.com>'
       
    71 rm log
       
    72 echo % status
       
    73 hg status
       
    74 
       
    75 echo % cat
       
    76 cat a b c sym
       
    77 echo % hg cat
       
    78 hg cat a b c sym
       
    79 
       
    80 echo
       
    81 cd ..
       
    82 hg clone -r0 Test Test-a
       
    83 cd Test-a
       
    84 cat <<EOF >> .hg/hgrc
       
    85 [paths]
       
    86 default = ../Test
       
    87 EOF
       
    88 echo % incoming
       
    89 hg incoming
       
    90 
       
    91 echo % switch off expansion
       
    92 rm $HGRCPATH
       
    93 
       
    94 cd ../Test
       
    95 echo % cat
       
    96 cat a b c sym
       
    97 echo % hg cat
       
    98 hg cat a b c sym
       
    99 
       
   100 echo
       
   101 echo % update
       
   102 rm a b c sym
       
   103 hg update
       
   104 
       
   105 echo % cat
       
   106 cat a b c sym