tests/test-keyword
author Christian Ebert <blacktrash@gmx.net>
Wed, 07 Feb 2007 15:50:57 +0100
branchkwmap-templates
changeset 123 6cf933de685a
parent 121 85ed7d71ba0f
child 131 23a1e1bdf62b
permissions -rwxr-xr-x
Make all ui config and kwfmatcher a local repo attribute See Mercurial changeset: 5d9ede002453
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>'
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    24
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    25
echo % cat
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    26
cat a b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    27
echo % hg cat
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    28
hg cat a b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    29
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    30
rm a b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    31
echo % update
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    32
hg update
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    33
echo % cat
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    34
cat a b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    35
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    36
echo % custom keyword expansion
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    37
cat <<EOF >>$HGRCPATH
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    38
[keywordmaps]
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    39
Id = {file} {node|short} {date|rfc822date} {author|user}
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    40
Xinfo = {author}: {desc}
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    41
EOF
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    42
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    43
echo % cat
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    44
cat a b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    45
echo % hg cat
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    46
hg cat a b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    47
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    48
echo '$Xinfo$' >> a
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    49
cat <<EOF >> log
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    50
firstline
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    51
secondline
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    52
EOF
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    53
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    54
echo % commit
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    55
hg --debug commit -l log -d '1 0' -u 'User Name <user@example.com>'
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
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    58
cat a b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    59
echo % hg cat
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    60
hg cat a b
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 % switch off expansion
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    63
rm $HGRCPATH
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
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    66
cat a b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    67
echo % hg cat
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    68
hg cat a b
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 % update
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    71
rm a b
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    72
hg update
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    73
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    74
echo % cat
85ed7d71ba0f Add test
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
    75
cat a b