tests/test-keyword
author Thomas Arendsen Hein <thomas@intevation.de>
Wed, 07 Mar 2007 23:39:55 +0100
branchkwmap-templates
changeset 153 7e97ea52335a
parent 151 5f3856a6ce56
permissions -rwxr-xr-x
Make keyword extension compatible with python2.3
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
151
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
     9
c = archive
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    10
EOF
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    11
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    12
echo % help
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    13
hg help keyword
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    14
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    15
hg init Test
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    16
cd Test
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    17
echo 'expand $Id$' > a
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    18
echo 'ignore $Id$' > b
151
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    19
echo 'archive $Id$' > c
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    20
ln -s a sym
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    21
echo % cat
151
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    22
cat a b c sym
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    23
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    24
echo % default keyword expansion
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    25
echo % commit
151
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    26
hg --debug commit -A -mabcsym -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
    27
echo % status
23a1e1bdf62b Check dirstate after commits in test
Christian Ebert <blacktrash@gmx.net>
parents: 121
diff changeset
    28
hg status
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    29
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    30
echo % cat
151
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    31
cat a b c sym
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    32
echo % hg cat
151
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    33
hg cat a b c sym
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    34
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    35
echo
151
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    36
rm a b c sym
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    37
echo % update
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    38
hg update
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    39
echo % cat
151
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    40
cat a b c sym
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    41
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    42
echo % archive
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    43
hg archive ../Archive
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    44
cd ../Archive
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    45
echo % cat
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    46
cat a b c sym
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    47
echo
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    48
cd -
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    49
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    50
echo % custom keyword expansion
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    51
cat <<EOF >>$HGRCPATH
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    52
[keywordmaps]
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    53
Id = {file} {node|short} {date|rfc822date} {author|user}
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    54
Xinfo = {author}: {desc}
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    55
EOF
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    56
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    57
echo % cat
151
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    58
cat a b c sym
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    59
echo % hg cat
151
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    60
hg cat a b c sym
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    61
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    62
echo
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    63
echo '$Xinfo$' >> a
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    64
cat <<EOF >> log
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    65
firstline
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    66
secondline
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    67
EOF
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    68
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    69
echo % commit
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    70
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
    71
rm log
23a1e1bdf62b Check dirstate after commits in test
Christian Ebert <blacktrash@gmx.net>
parents: 121
diff changeset
    72
echo % status
23a1e1bdf62b Check dirstate after commits in test
Christian Ebert <blacktrash@gmx.net>
parents: 121
diff changeset
    73
hg status
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    74
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    75
echo % cat
151
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    76
cat a b c sym
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    77
echo % hg cat
151
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    78
hg cat a b c sym
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    79
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    80
echo
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    81
cd ..
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    82
hg clone -r0 Test Test-a
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    83
cd Test-a
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    84
cat <<EOF >> .hg/hgrc
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    85
[paths]
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    86
default = ../Test
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    87
EOF
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    88
echo % incoming
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    89
hg incoming
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    90
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    91
echo % switch off expansion
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    92
rm $HGRCPATH
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    93
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
    94
cd ../Test
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    95
echo % cat
151
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    96
cat a b c sym
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    97
echo % hg cat
151
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
    98
hg cat a b c sym
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    99
148
c0baa881d90a Extend test for symlink
Christian Ebert <blacktrash@gmx.net>
parents: 131
diff changeset
   100
echo
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
   101
echo % update
151
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
   102
rm a b c sym
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
   103
hg update
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
   104
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
   105
echo % cat
151
5f3856a6ce56 Extend test for archive mode
Christian Ebert <blacktrash@gmx.net>
parents: 148
diff changeset
   106
cat a b c sym