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

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