hgkw/hgkwencode.py
author Christian Ebert <blacktrash@gmx.net>
Thu, 14 Dec 2006 16:25:12 +0100
branchdecodefilter
changeset 12 d9c4fc735963
parent 3 b9f2c0853da3
child 14 b60345141aa5
child 18 0a57d4566be9
permissions -rw-r--r--
Added tag filename for changeset 56a61a5c696d

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