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