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