/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Martin
  • Date: 2010-05-25 17:27:52 UTC
  • mfrom: (5254 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5257.
  • Revision ID: gzlist@googlemail.com-20100525172752-amm089xcikv968sw
Merge bzr.dev to unite with similar changes already made

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005, 2007, 2009 Canonical Ltd
 
1
# Copyright (C) 2009, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
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'))
255
255
        builder.build_snapshot('third', ['second'], [])
256
256
        builder.build_snapshot('fourth', ['third'], [])
257
257
        builder.finish_series()
258
 
        local = builder.get_branch()
259
258
        local = branch.Branch.open(self.get_vfs_only_url('local'))
260
259
        # Initial push of three revisions
261
260
        remote_bzrdir = local.bzrdir.sprout(
281
280
    def disableOptimisticGetParentMap(self):
282
281
        # Tweak some class variables to stop remote get_parent_map calls asking
283
282
        # for or receiving more data than the caller asked for.
284
 
        old_flag = SmartServerRepositoryGetParentMap.no_extra_results
285
 
        inter_class = repository.InterRepository
286
 
        old_batch_size = inter_class._walk_to_common_revisions_batch_size
287
 
        inter_class._walk_to_common_revisions_batch_size = 1
288
 
        SmartServerRepositoryGetParentMap.no_extra_results = True
289
 
        def reset_values():
290
 
            SmartServerRepositoryGetParentMap.no_extra_results = old_flag
291
 
            inter_class._walk_to_common_revisions_batch_size = old_batch_size
292
 
        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)
293
287
 
294
288
 
295
289
class TestPushHook(TestCaseWithInterBranch):