Position of merge/diff in en/decode chain

Matt Mackall mpm at selenic.com
Mon Apr 19 11:14:57 CDT 2010


On Mon, 2010-04-19 at 16:42 +0200, Hans-Peter Oeri wrote:
> I intend to use hg for repositories with lots of big 'pseudo binary'
> files. 'Pseudo' because they are actually mainly compressed text files,
> like ODF or OOXML. In hg's docs I found en/decode filters, which would
> be great for this purpose. However, the documentation only mentions line
> endings and keywords as scope for filter operations, which drastly
> limits their scope. It does not define WHERE in the chain different hg
> operations take place. Please accept me presenting my thoughts as I
> didn't find anything on that topic:

Filters are applied when reading or writing file data to the working
directory. Mercurial never 'sees' the form stored on disk. So wherever
Mercurial reports contents (diff, cat, etc.), it's doing so in the form
stored in history as opposed to the working directory form.

The one exception to this rule is file merge, which is generally
performed by an external tool directly on the file in the working
directory. Thus, the premerge code also works on files in the working
directory form for consistency.

Generally speaking, I don't think it's a great idea to use filters for
much beyond line-ending conversion convenience, mostly due to the
confusion that can result if everyone doesn't have matching
configuration and the difficulty in synchronizing such config in a
system intrinsically lacking trust and authority. 

-- 
http://selenic.com : development and support for Mercurial and Linux




More information about the Mercurial mailing list