~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-05-08 20:32:56 UTC
  • mfrom: (2483.1.2 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070508203256-wcxwdphd1y2psezh
(John Arbash Meinel) Merge fixes from 0.16 into bzr.dev and update for 0.17 development

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)