Add simple [encode] filter in python
The aim is to go for $Hg$ without basename.
Perhaps this is feasable with update hooks &Co.
No way to detect a filename while stream writing.
Even though hg /knows/ the filenames, but does not provide
an API or hook, unfortunately.
# $Hg: hgkwencode.py,v$
import re, sys
#re_kwencode = re.compile(r'[$]Hg.*?[$]')
re_kwencode = re.compile(r'([$]Hg: .+?,v) [a-z0-9]{12} [^$]+? [$]')
def hgkwencode():
sys.stdout.write(
re_kwencode.sub(r'\1$', sys.stdin.read())
)