~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2012-02-14 17:22:37 UTC
  • mfrom: (6466 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6468.
  • Revision ID: v.ladeuil+lp@free.fr-20120214172237-7dv7er3n4uy8d5m4
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
                    self.assertTrue(S_ISDIR(target.stat(path).st_mode))
126
126
                    directories.append(path)
127
127
                else:
128
 
                    self.assertEqualDiff(source.get(path).read(),
129
 
                                         target.get(path).read(),
 
128
                    self.assertEqualDiff(source.get_bytes(path),
 
129
                                         target.get_bytes(path),
130
130
                                         "text for file %r differs:\n" % path)
131
131
 
132
132
    def assertRepositoryHasSameItems(self, left_repo, right_repo):
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
687
685
 
688
686
    def test_get_branches(self):
689
687
        repo = self.make_repository('branch-1')
690
 
        try:
691
 
            target_branch = repo.bzrdir.create_branch(name='foo')
692
 
        except errors.NoColocatedBranchSupport:
 
688
        if not repo.bzrdir._format.colocated_branches:
693
689
            raise TestNotApplicable('Format does not support colocation')
694
 
        reference = branch.BranchReferenceFormat().initialize(
695
 
            repo.bzrdir, target_branch=target_branch)
696
 
        self.assertEqual(set([None, 'foo']),
 
690
        target_branch = repo.bzrdir.create_branch(name='foo')
 
691
        repo.bzrdir.set_branch_reference(target_branch)
 
692
        self.assertEqual(set(["", 'foo']),
697
693
                         set(repo.bzrdir.get_branches().keys()))