~bzr/ubuntu/maverick/bzr/sru-2.2.4

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2010-08-07 00:54:52 UTC
  • mfrom: (1.4.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100807005452-g4zb99ezl3xn44r4
Tags: 2.2.0-1
* New upstream release.
 + Adds support for setting timestamps to originating revisions.
   Closes: #473450
 + Removes remaining string exception. Closes: #585193, LP: #586926
 + Add C extension to work around Python issue 1628205. LP: #583941,
   Closes: #577110
 + Avoids showing progress bars when --quiet is used. Closes: #542105,
   LP: #320035
 + No longer creates ~/.bazaar as root when run under sudo. LP: #376388
 + 'bzr commit' now supports -p as alternative for --show-diff. LP: #571467
 + 'bzr add' no longer adds .THIS/.BASE/.THEIRS files unless
   explicitly requested. LP: #322767
 + When parsing patch files, Bazaar now supports diff lines before each
   patch. LP: #502076
 + WorkingTrees now no longer requires using signal.signal, so can
   be used in a threaded environment. LP: #521989
 + An assertion error is no longer triggered when pushing to a pre-1.6
   Bazaar server. LP: #528041
* Bump standards version to 3.9.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from cStringIO import StringIO
20
20
import os
21
21
 
 
22
from testtools.matchers import (
 
23
    Equals,
 
24
    MatchesAny,
 
25
    )
 
26
 
22
27
from bzrlib import (
23
28
    branch,
24
29
    builtins,
39
44
from bzrlib.tests.per_interbranch import (
40
45
    TestCaseWithInterBranch,
41
46
    )
42
 
from bzrlib.transport import get_transport
43
 
from bzrlib.transport.local import LocalURLServer
 
47
from bzrlib.tests import test_server
44
48
 
45
49
 
46
50
# These tests are based on similar tests in 
145
149
        except (errors.IncompatibleFormat, errors.UninitializableFormat):
146
150
            # This Branch format cannot create shared repositories
147
151
            return
148
 
        # This is a little bit trickier because make_branch_and_tree will not
 
152
        # This is a little bit trickier because make_from_branch_and_tree will not
149
153
        # re-use a shared repository.
150
154
        try:
151
155
            a_branch = self.make_from_branch('repo/tree')
155
159
        try:
156
160
            tree = a_branch.bzrdir.create_workingtree()
157
161
        except errors.NotLocalUrl:
158
 
            if self.vfs_transport_factory is LocalURLServer:
 
162
            if self.vfs_transport_factory is test_server.LocalURLServer:
159
163
                # the branch is colocated on disk, we cannot create a checkout.
160
164
                # hopefully callers will expect this.
161
165
                local_controldir = bzrdir.BzrDir.open(self.get_vfs_only_url('repo/tree'))
272
276
        calls_after_insert_stream = hpss_call_names[insert_stream_idx:]
273
277
        # After inserting the stream the client has no reason to query the
274
278
        # remote graph any further.
275
 
        self.assertEqual(
276
 
            ['Repository.insert_stream_1.19', 'Repository.insert_stream_1.19',
277
 
             'get', 'Branch.set_last_revision_info', 'Branch.unlock'],
278
 
            calls_after_insert_stream)
 
279
        bzr_core_trace = Equals(
 
280
            ['Repository.insert_stream_1.19', 'Repository.insert_stream_1.19',
 
281
             'get', 'Branch.set_last_revision_info', 'Branch.unlock'])
 
282
        bzr_loom_trace = Equals(
 
283
            ['Repository.insert_stream_1.19', 'Repository.insert_stream_1.19',
 
284
             'get', 'Branch.set_last_revision_info', 'get', 'Branch.unlock'])
 
285
        self.assertThat(calls_after_insert_stream,
 
286
            MatchesAny(bzr_core_trace, bzr_loom_trace))
279
287
 
280
288
    def disableOptimisticGetParentMap(self):
281
289
        # Tweak some class variables to stop remote get_parent_map calls asking
282
290
        # 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)
 
291
        self.overrideAttr(repository.InterRepository,
 
292
                          '_walk_to_common_revisions_batch_size', 1)
 
293
        self.overrideAttr(SmartServerRepositoryGetParentMap,
 
294
                            'no_extra_results', True)
292
295
 
293
296
 
294
297
class TestPushHook(TestCaseWithInterBranch):