~ubuntu-branches/debian/sid/bzr/sid

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_repository_vf/test_repository.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij, Jelmer Vernooij, Max Bowsher
  • Date: 2011-07-14 15:35:42 UTC
  • mfrom: (1.5.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20110714153542-7m3m8jpt6c167g2a
Tags: 2.4.0~beta5-1
[ Jelmer Vernooij ]
* Fix typo in package description. Thanks Paul Stewart.
* Mark python-bzrlib as breaking with older versions of bzr that
  predate python-bzrlib. LP: #803362

[ Max Bowsher ]
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    vf_repository,
28
28
    )
29
29
 
 
30
from bzrlib.symbol_versioning import deprecated_in
 
31
from bzrlib.tests.matchers import MatchesAncestry
30
32
from bzrlib.tests.per_repository_vf import (
31
33
    TestCaseWithRepository,
32
34
    all_repository_vf_format_scenarios,
384
386
    def test_get_ancestry_missing_revision(self):
385
387
        # get_ancestry(revision that is in some data but not fully installed
386
388
        # -> NoSuchRevision
 
389
        repo = self.bzrdir.open_repository()
387
390
        self.assertRaises(errors.NoSuchRevision,
388
 
                          self.bzrdir.open_repository().get_ancestry, 'orphan')
 
391
            self.applyDeprecated, deprecated_in((2, 4, 0)),
 
392
            repo.get_ancestry, 'orphan')
389
393
 
390
394
    def test_get_unordered_ancestry(self):
391
395
        repo = self.bzrdir.open_repository()
392
 
        self.assertEqual(set(repo.get_ancestry('rev3')),
393
 
                         set(repo.get_ancestry('rev3', topo_sorted=False)))
 
396
        self.assertEqual(
 
397
            set(self.applyDeprecated(deprecated_in((2, 4, 0)),
 
398
                repo.get_ancestry, 'rev3')),
 
399
            set(self.applyDeprecated(deprecated_in((2, 4, 0)),
 
400
                repo.get_ancestry, 'rev3', topo_sorted=False)))
394
401
 
395
402
    def test_reserved_id(self):
396
403
        repo = self.make_repository('repository')
457
464
    def test_corrupt_revision_access_asserts_if_reported_wrong(self):
458
465
        repo_url = self.get_url('inventory_with_unnecessary_ghost')
459
466
        repo = _mod_repository.Repository.open(repo_url)
 
467
        m = MatchesAncestry(repo, 'ghost')
460
468
        reported_wrong = False
461
469
        try:
462
 
            if repo.get_ancestry('ghost') != [None, 'the_ghost', 'ghost']:
 
470
            if m.match(['the_ghost', 'ghost']) is not None:
463
471
                reported_wrong = True
464
472
        except errors.CorruptRepository:
465
473
            # caught the bad data: