Merge lp:~dcaro/bzr/fix-1008223 into lp:bzr
Proposed by
David Caro
Status: | Rejected |
---|---|
Rejected by: | Martin Packman |
Proposed branch: | lp:~dcaro/bzr/fix-1008223 |
Merge into: | lp:bzr |
Diff against target: |
12 lines (+1/-1) 1 file modified
bzrlib/repofmt/pack_repo.py (+1/-1) |
To merge this branch: | bzr merge lp:~dcaro/bzr/fix-1008223 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
David Caro (community) | Disapprove | ||
Martin Packman (community) | Needs Information | ||
Review via email: mp+108501@code.launchpad.net |
Description of the change
Just changed the file bzrlib/
Please review the changes and check that it does not break something more.
thanks,
David
To post a comment you must log in.
Unmerged revisions
- 6525. By David Caro
-
Fix for bug lp-1008223
Thanks for the contribution!
Clearly this _parse_index_sizes helper method isn't terribly robust which isn't great. However, the pack-names file should only have space separated integer values, and is already aware of general corruption or truncation thanks being in btree index format. That means for the string "None" to have snuck in, there has to have been a logic bug somewhere in the code passing values in.
It would be great to work out how that happened, but may well not be possible. I've not seen any other reports of this issue, so it's likely not present in the current bzr codebase.
So, I'm not sure it's worthwhile adding logic here, especially without a test validating that it doesn't result in a broken pack reference anyway.
Perhaps a better code change would be:
* Test that passing a list including None to that helper raises that more useful exception. ollection. _parse_ index_sizes in try/except ValueError and re-raise as a BzrError mentioning broken pack-names file. Could be @staticmethod too.
* Wrap the contents of RepositoryPackC
And maybe as well:
* Test that passing a NewPack with bad indexes raises an error. ollection. allocate assert that every object in a_new_pack. index_sizes is actually an integer.
* In RepositoryPackC