hgkw/hgkwencode.py
author Christian Ebert <blacktrash@gmx.net>
Tue, 12 Dec 2006 23:35:45 +0100
changeset 2 0bda12ebde94
parent 1 1d997ec7be86
child 3 b9f2c0853da3
permissions -rw-r--r--
Shorten variable and function names

# $Hg: hgkwencode.py,v$

import re, sys

#re_kw = re.compile(r'[$]Hg.*?[$]')
re_kw = re.compile(r'([$]Hg: .+?,v) [a-z0-9]{12} [^$]+? [$]')

def kwencode():
    sys.stdout.write(
            re_kw.sub(r'\1$', sys.stdin.read()))