[BUG] cannot merge bundle if standalone branch was in shared repo
John Arbash Meinel
john at arbash-meinel.com
Sun Jun 18 16:25:58 BST 2006
Aaron Bentley wrote:
> Alexander Belchenko wrote:
>
>>>>> bzr: ERROR: Testament did not match expected value.
>>>>> For revision_id {bialix at ukr.net-20060616045349-a5296e9401d2e6d3},
>>>>> expected {f843ee2b51d9e26cf0fa7c59154bc420749dcdde}, me
>>>>> asured
>>>>> {54b9467567f45b0040adc6b97200aa712f9c4243}
>>>>>
>>> I don't understand this error message. When I run command 'testament' in
>>> different derived branches I've got this info:
>
> Sorry for the confusion. Bundles use a stricter form of Testament
> called a StrictTestament. In addition to normal info, it also contains
> last-modified and the executable bit.
>
>>> Printed sha-1 does not match any number in error message. How I can
>>> debug this problem? What I need to inspect?
>
> Here is a patch for the testament command. If you run testament
> --strict --long against both copies, and diff the results, you should
> see how they differ.
>
> My guess is that these branches have different ghosts.
>
> Aaron
There are a few things that I've found while digging through this bug,
which give me a little bit of pause.
First, Testament.as_sha1() is not returning the sha1 hash of
as_text_lines, it is returning the sha1 hash of the short form. Which is
actually pretty bogus.
The issue is that the short text contains the sha1 hash of all of the
testament lines, and then adds revision_id and a header.
However, the long form (which is hashed for the short form) already
contains the revision id internally, so the short form isn't adding any
new information.
Which means that Testament.as_sha1() is creating another sha1 hash,
which doesn't have any direct correlation to any of the other hashes.
The only way to figure out if the sha hash is going to match right now
is to do:
bzr testament --strict -r revid:foo | sha1sum
Which will fail on Windows because '|' munges line endings (by default,
there are ways to fix this, but it takes some work).
Because hashing the short form doesn't add any information, I would like
to propose the attached patch. I realize this will break existing
bundles, so we probably need to fix some things on that end. We could
compute 2 sha1's at verification time. Or we could change the format
number, etc.
The current 'as_sha1()' isn't used in anything but bundles, so I think
it is okay to get it right before we continue too far.
I wish I had caught this earlier.
John
=:->
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fix-sha1.diff
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20060618/5bbedd14/attachment.diff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060618/5bbedd14/attachment.pgp
More information about the bazaar
mailing list