/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

Fix more tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from bzrlib.branch import Branch
22
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
26
27
 
100
101
        source = self.make_branch_and_tree('source')
101
102
        target = self.make_branch('target')
102
103
 
103
 
        self.build_tree(['source/a'])
 
104
        self.build_tree(['a'], transport=source.bzrdir.root_transport)
104
105
        source.add(['a'])
105
106
        source.commit('a')
106
107
 
129
130
        except (errors.UninitializableFormat):
130
131
            # Cannot create these branches
131
132
            return
132
 
        tree = a_branch.bzrdir.create_workingtree()
133
 
        self.build_tree(['repo/tree/a'])
 
133
        try:
 
134
            tree = a_branch.bzrdir.create_workingtree()
 
135
        except errors.NotLocalUrl:
 
136
            tree = a_branch.create_checkout('checkout', lightweight=True)
 
137
        self.build_tree(['a'], transport=tree.bzrdir.root_transport)
134
138
        tree.add(['a'])
135
139
        tree.commit('a')
136
140
 
174
178
        source.push(target)
175
179
        # with nothing there we should still get a notification, and
176
180
        # have both branches locked at the notification time.
 
181
        if isinstance(source, RemoteBranch):
 
182
            # XXX: at the moment, push on remote branches is just delegated to
 
183
            # the file-level branch object, so we adjust the expected result
 
184
            # accordingly.  In the future, when RemoteBranch implements push
 
185
            # directly, this should be unnecessary.
 
186
            source = source._real_branch
177
187
        self.assertEqual([
178
188
            ('post_push', source, None, target.base, 0, NULL_REVISION,
179
189
             0, NULL_REVISION, True, None, True)