~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_repository/test_check.py

  • Committer: John Arbash Meinel
  • Date: 2011-09-12 18:40:02 UTC
  • mfrom: (6132 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6133.
  • Revision ID: john@arbash-meinel.com-20110912184002-o23eu21fdgp35h2q
Merge bzr.dev, resolve release-notes (aka NEWS) conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
"""Test operations that check the repository for corruption"""
19
19
 
20
20
from bzrlib import (
21
 
    config as _mod_config,
22
21
    revision as _mod_revision,
23
22
    )
24
23
from bzrlib.tests.per_repository import TestCaseWithRepository
43
42
class TestCleanRepository(TestCaseWithRepository):
44
43
 
45
44
    def test_new_repo(self):
46
 
        repo = self.make_repository('foo')
47
 
        repo.lock_write()
48
 
        self.addCleanup(repo.unlock)
49
 
        config = _mod_config.Config()
 
45
        branch = self.make_branch('foo')
 
46
        branch.lock_write()
 
47
        self.addCleanup(branch.unlock)
50
48
        self.overrideEnv('BZR_EMAIL', 'foo@sample.com')
51
 
        builder = repo.get_commit_builder(None, [], config)
 
49
        builder = branch.get_commit_builder([], branch.get_config())
52
50
        list(builder.record_iter_changes(None, _mod_revision.NULL_REVISION, [
53
51
            ('TREE_ROOT', (None, ''), True, (False, True), (None, None),
54
52
            (None, ''), (None, 'directory'), (None, False))]))
55
53
        builder.finish_inventory()
56
54
        rev_id = builder.commit('first post')
57
 
        result = repo.check(None, check_repo=True)
 
55
        result = branch.repository.check(None, check_repo=True)
58
56
        result.report_results(True)
59
57
        log = self.get_log()
60
58
        self.assertFalse('Missing' in log, "Something was missing in %r" % log)