tests/test-keyword
author Christian Ebert <blacktrash@gmx.net>
Mon, 12 Feb 2007 00:40:49 +0100
branchkwmap-templates
changeset 140 cade80b9d83d
parent 131 23a1e1bdf62b
child 148 c0baa881d90a
permissions -rwxr-xr-x
FIX: make repo keyword arg to kwfilelog hg incoming breaks otherwise as only 3 arguments are passed to init.
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]
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     7
* =
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     8
b* = ignore
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
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    14
hg init a
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    15
cd a
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    16
echo '$Id$' > a
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    17
echo '$Id$' > b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    18
echo % cat
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    19
cat a b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    20
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    21
echo % default keyword expansion
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    22
echo % commit
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    23
hg --debug commit -A -m ab -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
    24
echo % status
23a1e1bdf62b Check dirstate after commits in test
Christian Ebert <blacktrash@gmx.net>
parents: 121
diff changeset
    25
hg status
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    26
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    27
echo % cat
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    28
cat a b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    29
echo % hg cat
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    30
hg cat a b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    31
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    32
rm a b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    33
echo % update
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    34
hg update
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    35
echo % cat
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    36
cat a b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    37
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    38
echo % custom keyword expansion
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    39
cat <<EOF >>$HGRCPATH
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    40
[keywordmaps]
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    41
Id = {file} {node|short} {date|rfc822date} {author|user}
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    42
Xinfo = {author}: {desc}
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    43
EOF
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    44
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    45
echo % cat
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    46
cat a b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    47
echo % hg cat
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    48
hg cat a b
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 '$Xinfo$' >> a
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    51
cat <<EOF >> log
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    52
firstline
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    53
secondline
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    54
EOF
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    55
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    56
echo % commit
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    57
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
    58
rm log
23a1e1bdf62b Check dirstate after commits in test
Christian Ebert <blacktrash@gmx.net>
parents: 121
diff changeset
    59
echo % status
23a1e1bdf62b Check dirstate after commits in test
Christian Ebert <blacktrash@gmx.net>
parents: 121
diff changeset
    60
hg status
121
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    61
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    62
echo % cat
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    63
cat a b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    64
echo % hg cat
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    65
hg cat a b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    66
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    67
echo % switch off expansion
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    68
rm $HGRCPATH
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    69
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    70
echo % cat
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    71
cat a b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    72
echo % hg cat
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    73
hg cat a b
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 % update
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    76
rm a b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    77
hg update
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    78
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    79
echo % cat
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    80
cat a b