~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_bzrdir/test_bzrdir.py

  • Committer: Jelmer Vernooij
  • Date: 2012-01-18 17:47:06 UTC
  • mto: (6437.3.9 2.5)
  • mto: This revision was merged to the branch mainline in revision 6444.
  • Revision ID: jelmer@samba.org-20120118174706-33pxrecbgbfd8ryx
UseĀ ControlDir.set_branch_reference.

Show diffs side-by-side

added added

removed removed

Lines of Context:
376
376
        referenced_branch = self.make_branch('referencced')
377
377
        dir = self.make_bzrdir('source')
378
378
        try:
379
 
            reference = bzrlib.branch.BranchReferenceFormat().initialize(dir,
380
 
                target_branch=referenced_branch)
 
379
            dir.set_branch_reference(referenced_branch)
381
380
        except errors.IncompatibleFormat:
382
381
            # this is ok too, not all formats have to support references.
383
382
            return
420
419
        referenced_branch = self.make_branch('referencced')
421
420
        dir = self.make_bzrdir('source')
422
421
        try:
423
 
            reference = bzrlib.branch.BranchReferenceFormat().initialize(dir,
424
 
                target_branch=referenced_branch)
 
422
            dir.set_branch_reference(referenced_branch)
425
423
        except errors.IncompatibleFormat:
426
424
            # this is ok too, not all formats have to support references.
427
425
            return
691
689
            target_branch = repo.bzrdir.create_branch(name='foo')
692
690
        except errors.NoColocatedBranchSupport:
693
691
            raise TestNotApplicable('Format does not support colocation')
694
 
        reference = branch.BranchReferenceFormat().initialize(
695
 
            repo.bzrdir, target_branch=target_branch)
 
692
        repo.bzrdir.set_branch_reference(target_branch)
696
693
        self.assertEqual(set(["", 'foo']),
697
694
                         set(repo.bzrdir.get_branches().keys()))