author | Christian Ebert <blacktrash@gmx.net> |
Thu, 14 Dec 2006 16:28:38 +0100 | |
branch | decodefilter |
changeset 14 | b60345141aa5 |
parent 4 | 7e618d820490 |
child 15 | 4bd44185f781 |
permissions | -rw-r--r-- |
14
b60345141aa5
Adapt to filename instead of basename style
Christian Ebert <blacktrash@gmx.net>
parents:
4
diff
changeset
|
1 |
# $Hg: hgkw/hgkwdecode.py,v$ |
4
7e618d820490
decodefilter branch: add decode filter with kwutil module
Christian Ebert <blacktrash@gmx.net>
parents:
diff
changeset
|
2 |
|
7e618d820490
decodefilter branch: add decode filter with kwutil module
Christian Ebert <blacktrash@gmx.net>
parents:
diff
changeset
|
3 |
from mercurial.demandload import demandload |
7e618d820490
decodefilter branch: add decode filter with kwutil module
Christian Ebert <blacktrash@gmx.net>
parents:
diff
changeset
|
4 |
demandload(globals(), 'hgkw:kwutil mercurial:localrepo re sys') |
7e618d820490
decodefilter branch: add decode filter with kwutil module
Christian Ebert <blacktrash@gmx.net>
parents:
diff
changeset
|
5 |
|
7e618d820490
decodefilter branch: add decode filter with kwutil module
Christian Ebert <blacktrash@gmx.net>
parents:
diff
changeset
|
6 |
def kwdecode(): |
7e618d820490
decodefilter branch: add decode filter with kwutil module
Christian Ebert <blacktrash@gmx.net>
parents:
diff
changeset
|
7 |
'''Expands keywords into IO stream.''' |
7e618d820490
decodefilter branch: add decode filter with kwutil module
Christian Ebert <blacktrash@gmx.net>
parents:
diff
changeset
|
8 |
|
7e618d820490
decodefilter branch: add decode filter with kwutil module
Christian Ebert <blacktrash@gmx.net>
parents:
diff
changeset
|
9 |
lr = localrepo.localrepository(None) |
7e618d820490
decodefilter branch: add decode filter with kwutil module
Christian Ebert <blacktrash@gmx.net>
parents:
diff
changeset
|
10 |
|
7e618d820490
decodefilter branch: add decode filter with kwutil module
Christian Ebert <blacktrash@gmx.net>
parents:
diff
changeset
|
11 |
kword = kwutil.mkkw(lr, tip=False, node='') |
7e618d820490
decodefilter branch: add decode filter with kwutil module
Christian Ebert <blacktrash@gmx.net>
parents:
diff
changeset
|
12 |
re_kw = kwutil.rekw() |
7e618d820490
decodefilter branch: add decode filter with kwutil module
Christian Ebert <blacktrash@gmx.net>
parents:
diff
changeset
|
13 |
|
7e618d820490
decodefilter branch: add decode filter with kwutil module
Christian Ebert <blacktrash@gmx.net>
parents:
diff
changeset
|
14 |
sys.stdout.write(re_kw.sub(kword, sys.stdin.read())) |