/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
5557.1.7 by John Arbash Meinel
Merge in the bzr.dev 5582
1
# Copyright (C) 2007-2011 Canonical Ltd
2745.6.7 by Aaron Bentley
Clean-up
2
#
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
4183.7.1 by Sabin Iacob
update FSF mailing address
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2745.6.7 by Aaron Bentley
Clean-up
16
17
18
"""Test operations that check the repository for corruption"""
19
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
20
from breezy import (
2745.6.1 by Aaron Bentley
Initial checking of knit graphs
21
    revision as _mod_revision,
22
    )
7490.120.3 by Jelmer Vernooij
Split out InventoryTreeChange from TreeChange.
23
from breezy.bzr.inventorytree import InventoryTreeChange
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
24
from breezy.tests.per_repository import TestCaseWithRepository
2819.2.1 by Andrew Bennetts
Implement KnitRepository._find_inconsistent_revision_parents.
25
26
4657.1.1 by Robert Collins
Do not add the root directory entry to the list of expected keys during check in non rich-root repositories. (#416732)
27
class TestCleanRepository(TestCaseWithRepository):
28
29
    def test_new_repo(self):
6127.1.1 by Jelmer Vernooij
Use Branch.get_commit_builder, as Repository.get_commit_builder without Branch breaks with bzr-svn.
30
        branch = self.make_branch('foo')
31
        branch.lock_write()
32
        self.addCleanup(branch.unlock)
6622.1.28 by Jelmer Vernooij
More renames; commands in output, environment variables.
33
        self.overrideEnv('BRZ_EMAIL', 'foo@sample.com')
6351.3.3 by Jelmer Vernooij
Convert more stuff to use config stacks.
34
        builder = branch.get_commit_builder([], branch.get_config_stack())
4657.1.1 by Robert Collins
Do not add the root directory entry to the list of expected keys during check in non rich-root repositories. (#416732)
35
        list(builder.record_iter_changes(None, _mod_revision.NULL_REVISION, [
7490.120.3 by Jelmer Vernooij
Split out InventoryTreeChange from TreeChange.
36
            InventoryTreeChange(
7322.1.7 by Jelmer Vernooij
Fix remaining tests.
37
                b'TREE_ROOT', (None, ''), True, (False, True), (None, None),
38
                (None, ''), (None, 'directory'), (None, False))]))
4657.1.1 by Robert Collins
Do not add the root directory entry to the list of expected keys during check in non rich-root repositories. (#416732)
39
        builder.finish_inventory()
40
        rev_id = builder.commit('first post')
6127.1.1 by Jelmer Vernooij
Use Branch.get_commit_builder, as Repository.get_commit_builder without Branch breaks with bzr-svn.
41
        result = branch.repository.check(None, check_repo=True)
4657.1.1 by Robert Collins
Do not add the root directory entry to the list of expected keys during check in non rich-root repositories. (#416732)
42
        result.report_results(True)
4794.1.15 by Robert Collins
Review feedback.
43
        log = self.get_log()
4657.1.1 by Robert Collins
Do not add the root directory entry to the list of expected keys during check in non rich-root repositories. (#416732)
44
        self.assertFalse('Missing' in log, "Something was missing in %r" % log)