monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Extensions to automation, again


From: Alvaro Herrera
Subject: Re: [Monotone-devel] Extensions to automation, again
Date: Wed, 18 Oct 2006 16:27:50 -0300
User-agent: Mutt/1.5.13 (2006-08-11)

Thomas Keller wrote:
> Alvaro Herrera schrieb:
> >>I've looked around in database.cc and found that out as well. The 
> >>problem here seems to be that a delta which comes as packet into a local 
> >>db has no size information attached for the new file version one is able 
> >>to create with it and of course, recreating a file locally just to find 
> >>out how big it is, is stupid. I wonder if it would be possible to 
> >>somehow smartly add up the sizes of the file deltas to get the complete 
> >>file size? If I look at the unified diff output I'd say yes, because one 
> >>could simply add up all bytes after a "-" prefixed line, and also those 
> >>after a "+" prefixed line, would calculate the difference of both and 
> >>add it up to the former file size.
> >
> >
> >Wouldn't it be easier to store in the database the size delta, for each
> >delta?  Then you just sum them all across the file history to get the
> >final size.
> 
> Would be possible as well (maybe I was thinking too much in unified diff 
> format today =), anyways what I meant to say with this is that the 
> package format is probably not "ready" to transport this additional info 
> over the wire as I'm unsure if one could easily find out the correct 
> "patch size" of a (binary?) delta later on.

Sombody will correct me if I'm wrong, but I seem to remember reading
that the storage format for deltas ("copy/insert") is not the same as
the display format (unidiff).  So you need to convert the storage format
to display format to calculate the byte length of each line, and then
sum them all across all lines, and then sum all the sums across all
deltas.  All in all it sounds a pretty expensive thing to do, if you
just want the final file size.

I don't know about package format, but I'd guess that with the automate
interface it should be a rather trivial thing to do ... I mean, I'm
thinking in having the database do it (a simple SQL query should do).

-- 
Alvaro Herrera                  http://www.amazon.com/gp/registry/5ZYLFMCVHXC
"Los románticos son seres que mueren de deseos de vida"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]