Merge lp:~jameinel/bzr/repack-missing-inventories-437003 into lp:bzr/2.0
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Vincent Ladeuil | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 4769 | ||||
Proposed branch: | lp:~jameinel/bzr/repack-missing-inventories-437003 | ||||
Merge into: | lp:bzr/2.0 | ||||
Diff against target: |
163 lines (+118/-5) 3 files modified
NEWS (+4/-0) bzrlib/repofmt/groupcompress_repo.py (+13/-4) bzrlib/tests/test_repository.py (+101/-1) |
||||
To merge this branch: | bzr merge lp:~jameinel/bzr/repack-missing-inventories-437003 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vincent Ladeuil | Approve | ||
Review via email: mp+52544@code.launchpad.net |
Commit message
Fix bug #437003. Don't abort an auto-pack if an inventory is in the repository, just not in the subset of packs we are handling.
Description of the change
This change was done against the 2.0 branch, so I'm proposing it first there, and we can 'merge up'. Though I'll be happy to skip and just propose the merge against newer branches if we prefer. (I'm not 100% sure how we decided the NEWS entries should go.)
Anyway, the proposed fix is pretty simple, and probably applicable all the way through the stack. When GCCHKPacker sees a missing inventory, it falls back to self._pack_
The test is pretty ugly. It involves a lot of poking at the exact state of the repository to set up the exact condition. I do a little more poking to then trigger a real failure (remove the pack file which contains the A inventory.)
The test also isn't a permutation test. It might apply vs most Pack based repositories, but I can't guarantee it.
I've also proven that the fix applies to bzr 2.4 without a problem (see lp:///~jameinel/bzr/2.4-repack-missing-inventories-437003). So we should be able to land it on any release we want. The only thing that has problems is the NEWS entries.
77 + def make_branch_ with_disjoint_ inventory_ and_revision( self):
This test is quite hard to understand (because of the bug it's addressing, not the way you wrote it), I wouldn't mind more comments on the individual steps and the associated assertions. (On a second read, I got it, so you may ignore this remark).
113 + else:
114 + self.fail('Could not find pack containing A\'s inventory')
a comment or a clearer message that THIS-SHOULD- NEVER-HAPPEN will do ;)
136 + (repo, rev_a_pack_name, inv_a_pack_name, rev_c_pack_name branch_ with_disjoint_ inventory_ and_revision( )
137 + ) = self.make_
Nice indentation !
Overall: nice TDD there ;)
I'm ok to land this as is.