~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_info.py

  • Committer: Vincent Ladeuil
  • Date: 2011-12-16 16:38:33 UTC
  • mto: This revision was merged to the branch mainline in revision 6387.
  • Revision ID: v.ladeuil+lp@free.fr-20111216163833-4igwmwi1dmxbbebw
Migrate add.maximum_file_size to the new config scheme

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2012 Canonical Ltd
 
1
# Copyright (C) 2007-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
31
31
    def test_describe_standalone_layout(self):
32
32
        tree = self.make_branch_and_tree('tree')
33
33
        self.assertEqual('Empty control directory', info.describe_layout())
34
 
        self.assertEqual(
35
 
            'Unshared repository with trees and colocated branches',
36
 
            info.describe_layout(tree.branch.repository, control=tree.bzrdir))
 
34
        self.assertEqual('Unshared repository with trees',
 
35
            info.describe_layout(tree.branch.repository))
37
36
        tree.branch.repository.set_make_working_trees(False)
38
 
        self.assertEqual('Unshared repository with colocated branches',
39
 
            info.describe_layout(tree.branch.repository, control=tree.bzrdir))
 
37
        self.assertEqual('Unshared repository',
 
38
            info.describe_layout(tree.branch.repository))
40
39
        self.assertEqual('Standalone branch',
41
 
            info.describe_layout(tree.branch.repository, tree.branch,
42
 
                control=tree.bzrdir))
 
40
            info.describe_layout(tree.branch.repository, tree.branch))
43
41
        self.assertEqual('Standalone branchless tree',
44
 
            info.describe_layout(tree.branch.repository, None, tree,
45
 
                control=tree.bzrdir))
 
42
            info.describe_layout(tree.branch.repository, None, tree))
46
43
        self.assertEqual('Standalone tree',
47
 
            info.describe_layout(tree.branch.repository, tree.branch, tree,
48
 
                control=tree.bzrdir))
 
44
            info.describe_layout(tree.branch.repository, tree.branch, tree))
49
45
        tree.branch.bind(tree.branch)
50
46
        self.assertEqual('Bound branch',
51
 
            info.describe_layout(tree.branch.repository, tree.branch,
52
 
                control=tree.bzrdir))
 
47
            info.describe_layout(tree.branch.repository, tree.branch))
53
48
        self.assertEqual('Checkout',
54
 
            info.describe_layout(tree.branch.repository, tree.branch, tree,
55
 
                control=tree.bzrdir))
 
49
            info.describe_layout(tree.branch.repository, tree.branch, tree))
56
50
        checkout = tree.branch.create_checkout('checkout', lightweight=True)
57
51
        self.assertEqual('Lightweight checkout',
58
52
            info.describe_layout(checkout.branch.repository, checkout.branch,
59
 
                                 checkout, control=tree.bzrdir))
 
53
                                 checkout))
60
54
 
61
55
    def test_describe_repository_layout(self):
62
56
        repository = self.make_repository('.', shared=True)
63
57
        tree = controldir.ControlDir.create_branch_convenience('tree',
64
58
            force_new_tree=True).bzrdir.open_workingtree()
65
 
        self.assertEqual('Shared repository with trees and colocated branches',
66
 
            info.describe_layout(tree.branch.repository, control=tree.bzrdir))
 
59
        self.assertEqual('Shared repository with trees',
 
60
            info.describe_layout(tree.branch.repository))
67
61
        repository.set_make_working_trees(False)
68
 
        self.assertEqual('Shared repository with colocated branches',
69
 
            info.describe_layout(tree.branch.repository, control=tree.bzrdir))
 
62
        self.assertEqual('Shared repository',
 
63
            info.describe_layout(tree.branch.repository))
70
64
        self.assertEqual('Repository branch',
71
 
            info.describe_layout(tree.branch.repository, tree.branch,
72
 
                control=tree.bzrdir))
 
65
            info.describe_layout(tree.branch.repository, tree.branch))
73
66
        self.assertEqual('Repository branchless tree',
74
 
            info.describe_layout(tree.branch.repository, None, tree,
75
 
                control=tree.bzrdir))
 
67
            info.describe_layout(tree.branch.repository, None, tree))
76
68
        self.assertEqual('Repository tree',
77
 
            info.describe_layout(tree.branch.repository, tree.branch, tree,
78
 
                control=tree.bzrdir))
 
69
            info.describe_layout(tree.branch.repository, tree.branch, tree))
79
70
        tree.branch.bind(tree.branch)
80
71
        self.assertEqual('Repository checkout',
81
 
            info.describe_layout(tree.branch.repository, tree.branch, tree,
82
 
                control=tree.bzrdir))
 
72
            info.describe_layout(tree.branch.repository, tree.branch, tree))
83
73
        checkout = tree.branch.create_checkout('checkout', lightweight=True)
84
74
        self.assertEqual('Lightweight checkout',
85
75
            info.describe_layout(checkout.branch.repository, checkout.branch,
86
 
                                 checkout, control=tree.bzrdir))
 
76
                                 checkout))
87
77
 
88
78
    def assertTreeDescription(self, format):
89
79
        """Assert a tree's format description matches expectations"""
322
312
 
323
313
    def test_gather_related_braches(self):
324
314
        branch = self.make_branch('.')
325
 
        branch.lock_write()
326
 
        try:
327
 
            branch.set_public_branch('baz')
328
 
            branch.set_push_location('bar')
329
 
            branch.set_parent('foo')
330
 
            branch.set_submit_branch('qux')
331
 
        finally:
332
 
            branch.unlock()
 
315
        branch.set_public_branch('baz')
 
316
        branch.set_push_location('bar')
 
317
        branch.set_parent('foo')
 
318
        branch.set_submit_branch('qux')
333
319
        self.assertEqual(
334
320
            [('public branch', 'baz'), ('push branch', 'bar'),
335
321
             ('parent branch', 'foo'), ('submit branch', 'qux')],