[MERGE] be stricter in knit record serialisation, and bundle-generation-cornercase
Robert Collins
robertc at robertcollins.net
Fri May 30 03:25:16 BST 2008
I encountered a possible knit corruption issue with mpdiffs during the
versionedfiles work. It occurred because I had not ported over an
optimised code path, which caused an error, and pulling on this thread I
uncovered the following, which is pithily reproducible via the test in
the patch at the end of this mail (which fails on bzr.dev). It turns out
that what I describe below was caused by bug 234748, which Martin was
already working on - so I've just committed my tests and the correctness
changes, to be integrated with his work.
I chatted with Aaron to learn more about mpdiffs and he helped me get a
handle on this, and sanity checked the early test cases - thanks!
Firstly the corruption. It happens when generating the knit record for
an annotated knit, for a fulltext, on top of a delta, with the last line
unchanged, and the last line has no trailing eol. We get the wrong
output from lower_fulltext() because the content's internal
representation after merging annotations has no trailing newline (but it
needs one for serialisation).
Secondly, we have a glitch in make_mpdiffs (rooted in
VF._extract_blocks) where noeol files do not reuse as much as possible -
I haven't dug into this as it is quite orthogonal to what I'm working
towards (by having better mpdiffs I discovered this though:)). To
reproduce, just inspect the output in the make_mpdiffs test case of the
'noeoldup' version - we should reuse the parent:
MultiParent([ParentText(0, 0, 1, 1)])
but instead we create from scratch:
MultiParent([NewText(['line\n'])])
I was going to say that we can't fix the bundle generation because there
are bzr's out there that will handle the tighter mpdiffs badly; but that
was before it turned out to be a much more general and common issue - I
now believe it is possible/likely to cause this just by editing and
committing files as normal, and thus we won't significantly reduce the
likelyhood of triggering it by not allowing bundles with the same
changes.
-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpdiff-3461.patch
Type: text/x-patch
Size: 8047 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080530/db0305fa/attachment-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080530/db0305fa/attachment-0001.pgp
More information about the bazaar
mailing list