~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_info.py

  • Committer: Jelmer Vernooij
  • Date: 2012-04-16 11:08:11 UTC
  • mfrom: (6521 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6522.
  • Revision ID: jelmer@samba.org-20120416110811-0y996ihqy9o2bb1t
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006-2012 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
57
57
            '  control directory: ctrl\n')
58
58
        self.assertEquals(err, '')
59
59
 
 
60
    def test_info_empty_controldir_verbose(self):
 
61
        self.make_bzrdir('ctrl')
 
62
        out, err = self.run_bzr('info -v ctrl')
 
63
        self.assertEqualDiff(out,
 
64
            'Empty control directory (format: 2a or pack-0.92)\n'
 
65
            'Location:\n'
 
66
            '  control directory: ctrl\n\n'
 
67
            'Format:\n'
 
68
            '       control: Meta directory format 1\n\n'
 
69
            'Control directory:\n'
 
70
            '         0 branches\n')
 
71
        self.assertEquals(err, '')
 
72
 
60
73
    def test_info_dangling_branch_reference(self):
61
74
        br = self.make_branch('target')
62
75
        br.create_checkout('from', lightweight=True)
218
231
        # Branch and bind to standalone, needs upgrade to metadir
219
232
        # (creates backup as unknown)
220
233
        branch1.bzrdir.sprout('bound')
221
 
        knit1_format = bzrdir.format_registry.make_bzrdir('knit')
 
234
        knit1_format = controldir.format_registry.make_bzrdir('knit')
222
235
        upgrade.upgrade('bound', knit1_format)
223
236
        branch3 = controldir.ControlDir.open('bound').open_branch()
224
237
        branch3.bind(branch1)
315
328
        tree5 = branch1.create_checkout('lightcheckout', lightweight=True)
316
329
        branch5 = tree5.branch
317
330
        out, err = self.run_bzr('info -v lightcheckout')
318
 
        if "metaweave" in bzrdir.format_registry:
 
331
        if "metaweave" in controldir.format_registry:
319
332
            format_description = "knit or metaweave"
320
333
        else:
321
334
            format_description = "knit"
533
546
 
534
547
    def test_info_standalone_no_tree(self):
535
548
        # create standalone branch without a working tree
536
 
        format = bzrdir.format_registry.make_bzrdir('default')
 
549
        format = controldir.format_registry.make_bzrdir('default')
537
550
        branch = self.make_branch('branch')
538
551
        repo = branch.repository
539
552
        out, err = self.run_bzr('info branch -v')
562
575
        self.assertEqual('', err)
563
576
 
564
577
    def test_info_shared_repository(self):
565
 
        format = bzrdir.format_registry.make_bzrdir('knit')
 
578
        format = controldir.format_registry.make_bzrdir('knit')
566
579
        transport = self.get_transport()
567
580
 
568
581
        # Create shared repository
858
871
        self.assertEqual('', err)
859
872
 
860
873
    def test_info_shared_repository_with_trees(self):
861
 
        format = bzrdir.format_registry.make_bzrdir('knit')
 
874
        format = controldir.format_registry.make_bzrdir('knit')
862
875
        transport = self.get_transport()
863
876
 
864
877
        # Create shared repository with working trees
1085
1098
        self.assertEqual('', err)
1086
1099
 
1087
1100
    def test_info_shared_repository_with_tree_in_root(self):
1088
 
        format = bzrdir.format_registry.make_bzrdir('knit')
 
1101
        format = controldir.format_registry.make_bzrdir('knit')
1089
1102
        transport = self.get_transport()
1090
1103
 
1091
1104
        # Create shared repository with working trees
1153
1166
        self.assertEqual('', err)
1154
1167
 
1155
1168
    def test_info_repository_hook(self):
1156
 
        format = bzrdir.format_registry.make_bzrdir('knit')
 
1169
        format = controldir.format_registry.make_bzrdir('knit')
1157
1170
        def repo_info(repo, stats, outf):
1158
1171
            outf.write("more info\n")
1159
1172
        info.hooks.install_named_hook('repository', repo_info, None)
1182
1195
        self.assertEqual('', err)
1183
1196
 
1184
1197
    def test_info_unshared_repository_with_colocated_branches(self):
1185
 
        format = bzrdir.format_registry.make_bzrdir('development-colo')
 
1198
        format = controldir.format_registry.make_bzrdir('development-colo')
1186
1199
        transport = self.get_transport()
1187
1200
 
1188
1201
        # Create unshared repository
1548
1561
        # being too low. If rpc_count increases, more network roundtrips have
1549
1562
        # become necessary for this use case. Please do not adjust this number
1550
1563
        # upwards without agreement from bzr's network support maintainers.
1551
 
        self.assertLength(12, self.hpss_calls)
 
1564
        self.assertLength(10, self.hpss_calls)
1552
1565
        self.assertLength(1, self.hpss_connections)
1553
1566
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
1554
1567
 
1565
1578
        # being too low. If rpc_count increases, more network roundtrips have
1566
1579
        # become necessary for this use case. Please do not adjust this number
1567
1580
        # upwards without agreement from bzr's network support maintainers.
1568
 
        self.assertLength(16, self.hpss_calls)
 
1581
        self.assertLength(14, self.hpss_calls)
1569
1582
        self.assertLength(1, self.hpss_connections)
1570
1583
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)