hgkw/hgkwdecode.py
author Christian Ebert <blacktrash@gmx.net>
Fri, 15 Dec 2006 01:21:56 +0100
branchdecodefilter
changeset 16 e29cf107baf2
parent 15 4bd44185f781
permissions -rw-r--r--
Rename parent1 to p

# $Hg: hgkw/hgkwdecode.py,v$

from mercurial.demandload import demandload
demandload(globals(), 'hgkw:kwutil mercurial:localrepo re sys')

def kwdecode():
    '''Expands keywords into IO stream.'''

    repo = localrepo.localrepository(None)

    kword = kwutil.mkkw(repo, tip=False, node='')
    re_kw = kwutil.rekw()

    sys.stdout.write(re_kw.sub(kword, sys.stdin.read()))