[RFC] Reworking 'commit' internals to work in texts rather than 'lines'

John Arbash Meinel john at arbash-meinel.com
Mon Apr 27 23:00:53 BST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Aaron Bentley wrote:
> John Arbash Meinel wrote:
>> The main change is to avoid "KnitVersionedFile.add_lines()" and instead
>> go for something along the lines of "KVF.add_text()" which takes a
>> single string.
> 
> Maybe it's too early to worry about this, but since you are proposing a
> reimplementation, what about a chunked interface instead?
> 

I would be okay with that. At the moment, we don't have anything that
actually thinks in terms of real 'chunks'. At one point Groupcompress
was going to, but then it turned out to be much better to write a C
extension that thinks in terms of fulltexts.

Knits think of pretty much everything as lines, GC as fulltexts. I'm
happy enough with chunks, especially if we can get them pushed a bit
deeper into the code.

For example, it would be nice if you could do a Diff between two sets of
chunks, and possibly get the line-based result without having to turn
both sides into intermediate lines.

> I think chunked interfaces are a great compromise between whole-text and
> line-based interfaces.  Like line-based interfaces, they don't require a
> whole copy of the file to be loaded into memory.  (Better than
> line-based interfaces, they don't even require you to load a whole line
> into memory.)  Like whole-text interfaces, you can read a lot of data at
> once, without any parsing.  And it's trivial to use either lines or
> fulltexts with a chunked interface.
> 
> Aaron

I guess the only concern is that most end-products aren't in terms of
'chunks'. (Annotations are line-based, the delta code is line based,
groupcompress in fulltext based, etc.)

I guess as much as we can push chunks down farther, the better things
get, though. Considering with chunks you at least don't have to double
cast to go from fulltext => lines => fulltext.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkn2KxUACgkQJdeBCYSNAAMUYQCfUxKPkAz6fKlgI+GlULmOJ8Pf
06wAnjJ4D+cgEpADHd/4Qvt0tLjvSzcH
=OscX
-----END PGP SIGNATURE-----



More information about the bazaar mailing list