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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
1d997ec7be86 Add simple [encode] filter in python
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     1
# $Hg: hgkwencode.py,v$
1d997ec7be86 Add simple [encode] filter in python
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     2
1d997ec7be86 Add simple [encode] filter in python
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     3
import re, sys
1d997ec7be86 Add simple [encode] filter in python
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     4
2
0bda12ebde94 Shorten variable and function names
Christian Ebert <blacktrash@gmx.net>
parents: 1
diff changeset
     5
#re_kw = re.compile(r'[$]Hg.*?[$]')
0bda12ebde94 Shorten variable and function names
Christian Ebert <blacktrash@gmx.net>
parents: 1
diff changeset
     6
re_kw = re.compile(r'([$]Hg: .+?,v) [a-z0-9]{12} [^$]+? [$]')
1
1d997ec7be86 Add simple [encode] filter in python
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     7
2
0bda12ebde94 Shorten variable and function names
Christian Ebert <blacktrash@gmx.net>
parents: 1
diff changeset
     8
def kwencode():
1
1d997ec7be86 Add simple [encode] filter in python
Christian Ebert <blacktrash@gmx.net>
parents:
diff changeset
     9
    sys.stdout.write(
2
0bda12ebde94 Shorten variable and function names
Christian Ebert <blacktrash@gmx.net>
parents: 1
diff changeset
    10
            re_kw.sub(r'\1$', sys.stdin.read()))