/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_pull.py

  • Committer: Martin Pool
  • Date: 2007-05-04 08:46:39 UTC
  • mto: (2483.1.1 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 2484.
  • Revision ID: mbp@sourcefrog.net-20070504084639-8v8mzetmr1y74xer
Rename push/pull back to 'run_hooks' (jameinel)

Reorganize Branch.push into some template methods: public push,
_push_with_bound_branches, and _basic_push.  This fixes the case 
where the destination of push is bound, but the source branch
format doesn't support binding.

Run push and pull hook tests with a local branch that does support binding,
rather than skipping if the branch can't be bound to another of the same
format.

(broken) because the hooks are given the wrong parameters when 
pushing into something bound to a remote branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import os
20
20
 
21
 
from bzrlib.branch import Branch
 
21
from bzrlib.branch import Branch, BzrBranchFormat5
 
22
from bzrlib.bzrdir import BzrDir
22
23
from bzrlib import errors
23
24
from bzrlib.memorytree import MemoryTree
24
25
from bzrlib.revision import NULL_REVISION
 
26
from bzrlib.tests import TestSkipped
25
27
from bzrlib.tests.branch_implementations.test_branch import TestCaseWithBranch
26
28
 
27
29
 
142
144
        try:
143
145
            local.bind(target)
144
146
        except errors.UpgradeRequired:
145
 
            # cant bind this format, the test is irrelevant.
146
 
            return
 
147
            # We can't bind this format to itself- typically it is the local
 
148
            # branch that doesn't support binding.  As of May 2007
 
149
            # remotebranches can't be bound.  Let's instead make a new local
 
150
            # branch of the default type, which does allow binding.
 
151
            # See https://bugs.launchpad.net/bzr/+bug/112020
 
152
            local = BzrDir.create_branch_convenience('local2')
 
153
            local.bind(target)
147
154
        source = self.make_branch('source')
148
155
        Branch.hooks.install_hook('post_pull', self.capture_post_pull_hook)
149
156
        local.pull(source)