tests/test-keyword
author Christian Ebert <blacktrash@gmx.net>
Wed, 21 Feb 2007 02:27:15 +0100
branchkwmap-templates
changeset 148 c0baa881d90a
parent 131 23a1e1bdf62b
child 151 5f3856a6ce56
permissions -rwxr-xr-x
Extend test for symlink
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     1
#!/bin/sh
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     2
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     3
cat <<EOF >> $HGRCPATH
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     4
[extensions]
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     5
hgext.keyword =
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     6
[keyword]
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
     7
a =
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
     8
b = ignore
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     9
EOF
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    10
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    11
echo % help
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    12
hg help keyword
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    13
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    14
hg init Test
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    15
cd Test
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    16
echo 'expand $Id$' > a
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    17
echo 'ignore $Id$' > b
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    18
ln -s a sym
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    19
echo % cat
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    20
cat sym a b
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    21
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    22
echo % default keyword expansion
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    23
echo % commit
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    24
hg --debug commit -A -mabsym -d '0 0' -u 'User Name <user@example.com>'
131
23a1e1bdf62b Check dirstate after commits in test
Christian Ebert <blacktrash@gmx.net>
parents: 121
diff changeset
    25
echo % status
23a1e1bdf62b Check dirstate after commits in test
Christian Ebert <blacktrash@gmx.net>
parents: 121
diff changeset
    26
hg status
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    27
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    28
echo % cat
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    29
cat sym a b
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    30
echo % hg cat
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    31
hg cat sym a b
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    32
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    33
echo
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    34
rm sym a b
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    35
echo % update
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    36
hg update
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    37
echo % cat
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    38
cat sym a b
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    39
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    40
echo % custom keyword expansion
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    41
cat <<EOF >>$HGRCPATH
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    42
[keywordmaps]
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    43
Id = {file} {node|short} {date|rfc822date} {author|user}
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    44
Xinfo = {author}: {desc}
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    45
EOF
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    46
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    47
echo % cat
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    48
cat sym a b
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    49
echo % hg cat
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    50
hg cat sym a b
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    51
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    52
echo
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    53
echo '$Xinfo$' >> a
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    54
cat <<EOF >> log
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    55
firstline
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    56
secondline
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    57
EOF
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    58
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    59
echo % commit
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    60
hg --debug commit -l log -d '1 0' -u 'User Name <user@example.com>'
131
23a1e1bdf62b Check dirstate after commits in test
Christian Ebert <blacktrash@gmx.net>
parents: 121
diff changeset
    61
rm log
23a1e1bdf62b Check dirstate after commits in test
Christian Ebert <blacktrash@gmx.net>
parents: 121
diff changeset
    62
echo % status
23a1e1bdf62b Check dirstate after commits in test
Christian Ebert <blacktrash@gmx.net>
parents: 121
diff changeset
    63
hg status
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    64
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    65
echo % cat
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    66
cat sym a b
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    67
echo % hg cat
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    68
hg cat sym a b
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    69
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    70
echo
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    71
cd ..
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    72
hg clone -r0 Test Test-a
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    73
cd Test-a
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    74
cat <<EOF >> .hg/hgrc
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    75
[paths]
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    76
default = ../Test
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    77
EOF
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    78
echo % incoming
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    79
hg incoming
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    80
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    81
echo % switch off expansion
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    82
rm $HGRCPATH
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    83
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    84
cd ../Test
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    85
echo % cat
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    86
cat sym a b
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    87
echo % hg cat
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    88
hg cat sym a b
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    89
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    90
echo
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    91
echo % update
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    92
rm sym a b
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    93
hg update
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    94
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    95
echo % cat
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    96
cat sym a b