Git has a "filter" feature, which makes it possible to check in a processed version of files. E.g., this answer shows how IPython notebook files can be filtered so that embedded output data is excluded from commits. Basically:
Create a filter script, e.g.,
dropoutput
, and put it in your path.Create the file
~/.gitattributes
, with the following content*.ipynb filter=ipynb_filter
Run some more configuration commands to put it all together ("ipynb_filter" is just a symbolic name, so it needs to be pointed to the filter script.)
The effect is that when you try to check in a .ipynb
file, you actually check in the filtered version. The file in the working directory is not altered (but presumably has status "clean" since it has just been committed).
So: Is there a way to get the same functionality in mercurial? I googled and dug around the help a little but nothing came up.