~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2007-05-08 20:00:50 UTC
  • mfrom: (2477.1.13 0.16-release)
  • mto: This revision was merged to the branch mainline in revision 2484.
  • Revision ID: john@arbash-meinel.com-20070508200050-4imwmtzep8fx5v7w
Merge the 0.16 release fixes back into bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Tests for branch.push behaviour."""
18
18
 
19
19
import os
20
 
 
 
20
 
21
21
from bzrlib import bzrdir, errors
22
22
from bzrlib.branch import Branch
 
23
from bzrlib.bzrdir import BzrDir
23
24
from bzrlib.memorytree import MemoryTree
24
25
from bzrlib.remote import RemoteBranch
25
26
from bzrlib.revision import NULL_REVISION
 
27
from bzrlib.tests import TestSkipped
26
28
from bzrlib.tests.branch_implementations.test_branch import TestCaseWithBranch
27
29
from bzrlib.transport.local import LocalURLServer
28
30
 
185
187
        source.push(target)
186
188
        # with nothing there we should still get a notification, and
187
189
        # 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
194
190
        self.assertEqual([
195
191
            ('post_push', source, None, target.base, 0, NULL_REVISION,
196
192
             0, NULL_REVISION, True, None, True)
207
203
        try:
208
204
            local.bind(target)
209
205
        except errors.UpgradeRequired:
210
 
            # cant bind this format, the test is irrelevant.
211
 
            return
 
206
            # We can't bind this format to itself- typically it is the local
 
207
            # branch that doesn't support binding.  As of May 2007
 
208
            # remotebranches can't be bound.  Let's instead make a new local
 
209
            # branch of the default type, which does allow binding.
 
210
            # See https://bugs.launchpad.net/bzr/+bug/112020
 
211
            local = BzrDir.create_branch_convenience('local2')
 
212
            local.bind(target)
212
213
        source = self.make_branch('source')
213
214
        Branch.hooks.install_hook('post_push', self.capture_post_push_hook)
214
215
        source.push(local)