hgkw/hgkwencode.py
branchupdatehook
changeset 18 0a57d4566be9
parent 3 b9f2c0853da3
--- a/hgkw/hgkwencode.py	Sat Dec 16 15:22:56 2006 +0100
+++ b/hgkw/hgkwencode.py	Sat Dec 16 15:28:42 2006 +0100
@@ -1,9 +1,13 @@
-# $Hg: hgkwencode.py,v$
+# $Hg$
 
 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()))
+    '''Truncates hg keywords in IO stream
+    from
+    <Dollar>Hg: <filename> <cset id> <stuff> <Dollar>
+    to
+    <Dollar>Hg<Dollar>.'''
+    kwrepl = r'%sHg$' % '$'
+    re_kwtrunc = re.compile(r'[$]Hg: .+?,v [a-z0-9]{12} [^$]+? \$')
+    sys.stdout.write(re_kwtrunc.sub(kwrepl, sys.stdin.read()))