branch | decodefilter |
changeset 4 | 7e618d820490 |
child 14 | b60345141aa5 |
3:b9f2c0853da3 | 4:7e618d820490 |
---|---|
1 # $Hg: hgkwdecode.py,v$ |
|
2 |
|
3 from mercurial.demandload import demandload |
|
4 demandload(globals(), 'hgkw:kwutil mercurial:localrepo re sys') |
|
5 |
|
6 def kwdecode(): |
|
7 '''Expands keywords into IO stream.''' |
|
8 |
|
9 lr = localrepo.localrepository(None) |
|
10 |
|
11 kword = kwutil.mkkw(lr, tip=False, node='') |
|
12 re_kw = kwutil.rekw() |
|
13 |
|
14 sys.stdout.write(re_kw.sub(kword, sys.stdin.read())) |