encode/decode filter hooks (was: Fun stuff in tip)
bos at serpentine.com
Fri Sep 23 10:40:32 CDT 2005
On Thu, 2005-09-15 at 08:55 -0400, Kevin Smith wrote:
> Also, is it true that these rules can only be applied via filename
> pattern matching?
At the top level, yes. However, you can write a filter extension that
matches on all file names (using a pattern of "**") and then tries to do
something more clever.
The Windows standalone package uses this to try to do sensible line
ending conversion, for example. It's installed with a filter extension
that, if it finds a NUL character in a file, treats it as binary,
otherwise converts to Windows line endings on update, and Unix line
endings on commit.
More information about the Mercurial