Custom Delta

Matt Mackall mpm at selenic.com
Mon Apr 30 20:32:42 UTC 2012


On Mon, 2012-04-30 at 13:22 -0700, josericardo.jr wrote:
> Hi Mads,
> 
> Thanks a lot for you help.
> 
> In fact, I have already a custom merge tool which is able to perform these
> operations for my custom file. It works perfectly.
> 
> I also have made my custom diff but I don't know how I can save my diff
> result inside mercurial repo. I'm doing this because I need to compare the
> size space required for my diff file in relation to the one used by hg diff,
> as it is a binary file.

You should probably go ahead and start reading the revlog source.

Mercurial deltas are pretty straight-forward. Given an original
character buffer [0:n], a Mercurial delta is a list of chunks with the
following data:

 - starting position
 - ending position
 - replacement length
 - replacement buffer

If you can adapt your delta to match this format, then it'll be
Mercurial-compatible and clients will be able to use it without
modification.

-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial mailing list