diff -r b9f2c0853da3 -r 7e618d820490 hgkw/hgkwdecode.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hgkw/hgkwdecode.py Thu Dec 14 08:35:24 2006 +0100 @@ -0,0 +1,14 @@ +# $Hg: hgkwdecode.py,v$ + +from mercurial.demandload import demandload +demandload(globals(), 'hgkw:kwutil mercurial:localrepo re sys') + +def kwdecode(): + '''Expands keywords into IO stream.''' + + lr = localrepo.localrepository(None) + + kword = kwutil.mkkw(lr, tip=False, node='') + re_kw = kwutil.rekw() + + sys.stdout.write(re_kw.sub(kword, sys.stdin.read()))