/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/branch_implementations/test_push.py

  • Committer: Robert Collins
  • Date: 2007-04-23 02:29:35 UTC
  • mfrom: (2441 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2442.
  • Revision ID: robertc@robertcollins.net-20070423022935-9hhongamvk6bfdso
Resolve conflicts with bzr.dev.

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):
129
131
        except (errors.UninitializableFormat):
130
132
            # Cannot create these branches
131
133
            return
132
 
        tree = a_branch.bzrdir.create_workingtree()
 
134
        try:
 
135
            tree = a_branch.bzrdir.create_workingtree()
 
136
        except errors.NotLocalUrl:
 
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)
133
144
        self.build_tree(['repo/tree/a'])
134
145
        tree.add(['a'])
135
146
        tree.commit('a')
174
185
        source.push(target)
175
186
        # with nothing there we should still get a notification, and
176
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
177
194
        self.assertEqual([
178
195
            ('post_push', source, None, target.base, 0, NULL_REVISION,
179
196
             0, NULL_REVISION, True, None, True)