Merge lp:~eric97/bzr/dump-btree-api into lp:bzr
Status: | Work in progress |
---|---|
Proposed branch: | lp:~eric97/bzr/dump-btree-api |
Merge into: | lp:bzr |
Diff against target: |
410 lines (+202/-139) 4 files modified
bzrlib/btree_index.py (+50/-0) bzrlib/builtins.py (+4/-56) bzrlib/tests/blackbox/test_dump_btree.py (+35/-83) bzrlib/tests/test_btree_index.py (+113/-0) |
To merge this branch: | bzr merge lp:~eric97/bzr/dump-btree-api |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jelmer Vernooij (community) | code | Approve | |
Vincent Ladeuil | Approve | ||
Review via email: mp+50107@code.launchpad.net |
Commit message
Create a public API for generating (quasi-)text dumps of B-Tree index files, by turning two private methods in builtins.py into public methods on bzrlib.
Description of the change
A review comment for another MP of mine (https:/
This MP moves those methods to bzrlib.
Unmerged revisions
- 5672. By Eric Siegerman <email address hidden>
-
Remove another blackbox test that's now redundant.
- 5671. By Eric Siegerman <email address hidden>
-
Factor test data out of the blackbox tests too.
- 5670. By Eric Siegerman <email address hidden>
-
Don't need empty-btree blackbox tests, now that we have them as unit tests.
- 5669. By Eric Siegerman <email address hidden>
-
A little code-formatting cleanup.
- 5668. By Eric Siegerman <email address hidden>
-
Factor out the test data.
- 5667. By Eric Siegerman <email address hidden>
-
Adapt the new test_btree_index btree-dumping tests to use the new API
instead of calling run_bzr(). - 5666. By Eric Siegerman <email address hidden>
-
Delete a redundant test.
There's no need to test over multiple transports that the methods can
cope with a no-leaf-nodes B-Tree; local transport will suffice. - 5665. By Eric Siegerman <email address hidden>
-
Add docstrings.
- 5664. By Eric Siegerman <email address hidden>
-
Move dump_raw_bytes() and dump_entries() from cmd_dump_btree to btree_index,
and adapt them to their new location. - 5663. By Eric Siegerman <email address hidden>
-
Copy all tests verbatim from blackbox/
test_dump_ btree.py to test_btree_ index.py.
Nicely done !
Just one tweak from me but good to land otherwise:
151 + test_raw_ output_ 3nodes = (
152 + 'Root node:\n'
153 + 'B+Tree Graph Index 2\n'
You can just use:
test_raw_ output_ 3nodes = '''Root node:
B+Tree Graph Index 2
...
'''
Or even:
test_raw_ output_ 3nodes = '''\
Root node:
B+Tree Graph Index 2
...
'''
Easier to copy/paste (all rules have exceptions, copy/paste is bad, but copying an expected result from a failed test is way faster than typing it from scratch).
Nice to see tests going from blackbox to unit !
I let our PP do the second review ;)