hgkw/hgkwdecode.py
author Christian Ebert <blacktrash@gmx.net>
Thu, 14 Dec 2006 12:55:52 +0100
branchdecodefilter
changeset 8 180d8484503a
parent 4 7e618d820490
child 14 b60345141aa5
permissions -rw-r--r--
FIX: range of status selection; copyfile using absolute path

# $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()))