tests/test-keyword
author Christian Ebert <blacktrash@gmx.net>
Wed, 14 Feb 2007 03:03:16 +0100
branchkwmap-templates
changeset 144 19b3d1de3db0
parent 131 23a1e1bdf62b
child 148 c0baa881d90a
permissions -rwxr-xr-x
Move kwfilelog out of reposetup; only use kwfilelog if file matches Again: Message-ID: <20070213102701.GC30656@cecm.usp.br> This foremost obsoletes ugly attribute checks for kwfmatcher. We check whether we need kwfilelog in kwrepo's file(). That way kwtemplater is always an attribute of kwfilelog. Repo references are gone from kwfilelog. reposetup doc more verbose.
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