~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_interbranch/test_push.py

  • Committer: Robert Collins
  • Date: 2010-04-08 04:34:03 UTC
  • mfrom: (5138 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5139.
  • Revision ID: robertc@robertcollins.net-20100408043403-56z0d07vdqrx7f3t
Update bugfix for 528114 to trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
    TestCaseWithInterBranch,
41
41
    )
42
42
from bzrlib.transport import get_transport
43
 
from bzrlib.transport.local import LocalURLServer
 
43
from bzrlib.tests import test_server
44
44
 
45
45
 
46
46
# These tests are based on similar tests in 
155
155
        try:
156
156
            tree = a_branch.bzrdir.create_workingtree()
157
157
        except errors.NotLocalUrl:
158
 
            if self.vfs_transport_factory is LocalURLServer:
 
158
            if self.vfs_transport_factory is test_server.LocalURLServer:
159
159
                # the branch is colocated on disk, we cannot create a checkout.
160
160
                # hopefully callers will expect this.
161
161
                local_controldir = bzrdir.BzrDir.open(self.get_vfs_only_url('repo/tree'))
280
280
    def disableOptimisticGetParentMap(self):
281
281
        # Tweak some class variables to stop remote get_parent_map calls asking
282
282
        # for or receiving more data than the caller asked for.
283
 
        old_flag = SmartServerRepositoryGetParentMap.no_extra_results
284
 
        inter_class = repository.InterRepository
285
 
        old_batch_size = inter_class._walk_to_common_revisions_batch_size
286
 
        inter_class._walk_to_common_revisions_batch_size = 1
287
 
        SmartServerRepositoryGetParentMap.no_extra_results = True
288
 
        def reset_values():
289
 
            SmartServerRepositoryGetParentMap.no_extra_results = old_flag
290
 
            inter_class._walk_to_common_revisions_batch_size = old_batch_size
291
 
        self.addCleanup(reset_values)
 
283
        self.overrideAttr(repository.InterRepository,
 
284
                          '_walk_to_common_revisions_batch_size', 1)
 
285
        self.overrideAttr(SmartServerRepositoryGetParentMap,
 
286
                            'no_extra_results', True)
292
287
 
293
288
 
294
289
class TestPushHook(TestCaseWithInterBranch):