hgkw/hgkwencode.py
changeset 3 b9f2c0853da3
parent 2 0bda12ebde94
child 14 b60345141aa5
child 18 0a57d4566be9
equal deleted inserted replaced
2:0bda12ebde94 3:b9f2c0853da3
     1 # $Hg: hgkwencode.py,v$
     1 # $Hg: hgkwencode.py,v$
     2 
     2 
     3 import re, sys
     3 import re, sys
     4 
     4 
     5 #re_kw = re.compile(r'[$]Hg.*?[$]')
     5 def kwencode():
     6 re_kw = re.compile(r'([$]Hg: .+?,v) [a-z0-9]{12} [^$]+? [$]')
     6     '''Truncates keywords in IO stream.'''
     7 
     7 
     8 def kwencode():
     8     re_kwtrunc = re.compile(r'([$]Hg: .+?,v) [a-z0-9]{12} [^$]+? \$')
     9     sys.stdout.write(
     9     sys.stdout.write(re_kwtrunc.sub(r'\1$', sys.stdin.read()))
    10             re_kw.sub(r'\1$', sys.stdin.read()))