hgkw/hgkwencode.py
changeset 3 b9f2c0853da3
parent 2 0bda12ebde94
child 14 b60345141aa5
child 18 0a57d4566be9
--- a/hgkw/hgkwencode.py	Tue Dec 12 23:35:45 2006 +0100
+++ b/hgkw/hgkwencode.py	Thu Dec 14 08:17:01 2006 +0100
@@ -2,9 +2,8 @@
 
 import re, sys
 
-#re_kw = re.compile(r'[$]Hg.*?[$]')
-re_kw = re.compile(r'([$]Hg: .+?,v) [a-z0-9]{12} [^$]+? [$]')
+def kwencode():
+    '''Truncates keywords in IO stream.'''
 
-def kwencode():
-    sys.stdout.write(
-            re_kw.sub(r'\1$', sys.stdin.read()))
+    re_kwtrunc = re.compile(r'([$]Hg: .+?,v) [a-z0-9]{12} [^$]+? \$')
+    sys.stdout.write(re_kwtrunc.sub(r'\1$', sys.stdin.read()))