Merge lp://qastaging/~jameinel/bzr/2.5-remote-wt-tests-1046697 into lp://qastaging/bzr/2.5

Proposed by John A Meinel
Status: Merged
Approved by: John A Meinel
Approved revision: no longer in the source branch.
Merged at revision: 6509
Proposed branch: lp://qastaging/~jameinel/bzr/2.5-remote-wt-tests-1046697
Merge into: lp://qastaging/bzr/2.5
Diff against target: 596 lines (+189/-76)
14 files modified
bzrlib/remote.py (+15/-6)
bzrlib/smart/repository.py (+12/-9)
bzrlib/tests/per_tree/__init__.py (+18/-4)
bzrlib/tests/per_workingtree/__init__.py (+39/-6)
bzrlib/tests/per_workingtree/test_commit.py (+3/-2)
bzrlib/tests/per_workingtree/test_executable.py (+1/-2)
bzrlib/tests/per_workingtree/test_parents.py (+5/-3)
bzrlib/tests/per_workingtree/test_remove.py (+1/-1)
bzrlib/tests/per_workingtree/test_smart_add.py (+3/-0)
bzrlib/tests/per_workingtree/test_views.py (+2/-2)
bzrlib/tests/per_workingtree/test_workingtree.py (+24/-29)
bzrlib/tests/test_selftest.py (+39/-9)
bzrlib/workingtree_4.py (+19/-3)
doc/en/release-notes/bzr-2.5.txt (+8/-0)
To merge this branch: bzr merge lp://qastaging/~jameinel/bzr/2.5-remote-wt-tests-1046697
Reviewer Review Type Date Requested Status
Richard Wilbur Approve
Review via email: mp+123061@code.qastaging.launchpad.net

Commit message

Add per_workingtree test scenario for a lightweight checkout of a RemoteRepository (bug #1046697) and cleanup all associated fallout.

Description of the change

This branch aggregates most of the branches I proposed today.
It adds a test permutation of a lightweight WT6 checkout of a remote repository.
That resulted in a fair number of tests failing for various reasons.

1) RemoteBranch.initialize not preserving the Repository. bzrdir.sprout() creates the repo, fetches into it, and then passes the locked repo to the branch. The branch then wants to write_lock itself to initialize, but it can't write lock an already locked repository (and we don't want it to). RemoteBranch was using ._vfs_initialize() when the target was local, but wasn't passing down the repository.

2) RemoteBranch.peek_lock_mode() wasn't implemented. This is trivial to implement, so I just did so.

3) Repository.record_stream() was not always finalizing its progress bar. It takes out a progress bar in a generator. However, the generator is often run in sync with some other stepper, which means it isn't always run to completion. I just put it into a try/finally so if the generator gets garbage collected, we pop off the nested progress bar. This only works in python ? (2.5 maybe?) but I've been testing it with python2.6 which I'm pretty sure is our min requirement for newer bzr.

4) Lots of test suite fixups. Quite a few tests
 a) assumed that WT.branch was in the same location as WT
 b) assumed that make_branch().bzrdir.create_workingtree() would work. It doesn't when the Branch created is on a remote location, and you want a local workingtree.
 c) WorkingTreeFormat6._matchingbzrdir did *not* create a WorkingTreeFormat6 tree. It would create a Format4 tree because it just inherited the attribute from there. This adds a _get_matchingbzrdir attribute that returns the right thing. (the symptom here is that stuff like views and filters would check self.workingtree_format.supports_views but then self.bzrdir_format.make_workingtree wouldn't actually create a WT that supported views.)

I only ran the per_workingtree tests, but that should be enough since that is the only new permutations that were added.

To post a comment you must log in.
Revision history for this message
Richard Wilbur (richard-wilbur) wrote :

Lots of good fixes for working trees and tests. This looks like good stuff for the baseline. +1

Interesting behaviour from .iter_files_bytes() in get_file_text(): yielding empty results until the last result which contains the full contents of the file.

Nice cleanup on the progress bars.

review: Approve
Revision history for this message
John A Meinel (jameinel) wrote :

sent to pqm by email

Revision history for this message
John A Meinel (jameinel) wrote :

sent to pqm by email

Revision history for this message
John A Meinel (jameinel) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches