hgkw/hgkwencode.py
author Christian Ebert <blacktrash@gmx.net>
Fri, 15 Dec 2006 01:14:58 +0100
branchdecodefilter
changeset 15 4bd44185f781
parent 14 b60345141aa5
permissions -rw-r--r--
Rename lr variable to repo

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

import re, sys

def kwencode():
    '''Truncates keywords in IO stream.'''

    re_kwtrunc = re.compile(r'([$]Hg: .+?,v) [a-z0-9]{12} [^$]+? \$')
    sys.stdout.write(re_kwtrunc.sub(r'\1$', sys.stdin.read()))