~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2007-04-24 05:02:04 UTC
  • mfrom: (2449 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2450.
  • Revision ID: mbp@sourcefrog.net-20070424050204-bfkc1qiq0axt5f14
Merge trunk & fix NEWS conflict

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import os
20
20
 
 
21
from bzrlib import bzrdir, errors
21
22
from bzrlib.branch import Branch
22
 
from bzrlib import errors
23
23
from bzrlib.memorytree import MemoryTree
 
24
from bzrlib.remote import RemoteBranch
24
25
from bzrlib.revision import NULL_REVISION
25
26
from bzrlib.tests.branch_implementations.test_branch import TestCaseWithBranch
 
27
from bzrlib.transport.local import LocalURLServer
26
28
 
27
29
 
28
30
class TestPush(TestCaseWithBranch):
132
134
        try:
133
135
            tree = a_branch.bzrdir.create_workingtree()
134
136
        except errors.NotLocalUrl:
135
 
            tree = a_branch.create_checkout('repo/tree', lightweight=True)
 
137
            if self.vfs_transport_factory is LocalURLServer:
 
138
                # the branch is colocated on disk, we cannot create a checkout.
 
139
                # hopefully callers will expect this.
 
140
                local_controldir= bzrdir.BzrDir.open(self.get_vfs_only_url('repo/tree'))
 
141
                tree = local_controldir.create_workingtree()
 
142
            else:
 
143
                tree = a_branch.create_checkout('repo/tree', lightweight=True)
136
144
        self.build_tree(['repo/tree/a'])
137
145
        tree.add(['a'])
138
146
        tree.commit('a')
177
185
        source.push(target)
178
186
        # with nothing there we should still get a notification, and
179
187
        # have both branches locked at the notification time.
 
188
        if isinstance(source, RemoteBranch):
 
189
            # XXX: at the moment, push on remote branches is just delegated to
 
190
            # the file-level branch object, so we adjust the expected result
 
191
            # accordingly.  In the future, when RemoteBranch implements push
 
192
            # directly, this should be unnecessary.
 
193
            source = source._real_branch
180
194
        self.assertEqual([
181
195
            ('post_push', source, None, target.base, 0, NULL_REVISION,
182
196
             0, NULL_REVISION, True, None, True)