Part of bzrlib.tests.per_branch.test_revision_history View In Hierarchy
When locked, branches should avoid regenerating or rereading revision_history by caching the last value of it. This is safe because the branch is locked, so nothing can change the revision_history unexpectedly.
When not locked, obviously the revision_history will need to be regenerated or reread each time.
We test if revision_history is using the cache by instrumenting the branch's _gen_revision_history method, which is called by Branch.revision_history if the branch does not have a cache of the revision history.
Method | get_instrumented_branch | Get a branch and monkey patch it to log calls to |
Method | test_revision_history_when_unlocked | Repeated calls to revision history will call _gen_revision_history |
Method | test_revision_history_when_locked | Repeated calls to revision history will only call |
Method | test_set_revision_history_when_locked | When the branch is locked, calling set_revision_history should cache |
Method | test_set_revision_history_when_unlocked | When the branch is not locked, calling set_revision_history will not |
Method | test_set_last_revision_info_when_locked | When the branch is locked, calling set_last_revision_info should |
Method | test_set_last_revision_info_none | Passing None to set_last_revision_info raises an exception. |
Method | test_set_last_revision_info_uncaches_revision_history_for_format6 | On format 6 branches, set_last_revision_info invalidates the revision |
Method | test_cached_revision_history_not_accidentally_mutable | When there's a cached version of the history, revision_history |
Inherited from TestCaseWithBranch:
Method | setUp | Undocumented |
Method | get_branch | Undocumented |
Method | get_default_format | Undocumented |
Method | make_branch | Undocumented |
Method | create_tree_with_merge | Create a branch with a simple ancestry. |
Returns | a tuple of (the branch, list that calls will be logged to) |