/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2018-11-16 23:15:15 UTC
  • mfrom: (7180 work)
  • mto: This revision was merged to the branch mainline in revision 7183.
  • Revision ID: jelmer@jelmer.uk-20181116231515-zqd2yn6kj8lfydyp
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
    def test_info_non_existing(self):
47
47
        self.vfs_transport_factory = memory.MemoryServer
48
48
        location = self.get_url()
49
 
        out, err = self.run_bzr('info '+location, retcode=3)
 
49
        out, err = self.run_bzr('info ' + location, retcode=3)
50
50
        self.assertEqual(out, '')
51
51
        self.assertEqual(err, 'brz: ERROR: Not a branch: "%s".\n' % location)
52
52
 
54
54
        self.make_controldir('ctrl')
55
55
        out, err = self.run_bzr('info ctrl')
56
56
        self.assertEqual(out,
57
 
            'Empty control directory (format: 2a)\n'
58
 
            'Location:\n'
59
 
            '  control directory: ctrl\n')
 
57
                         'Empty control directory (format: 2a)\n'
 
58
                         'Location:\n'
 
59
                         '  control directory: ctrl\n')
60
60
        self.assertEqual(err, '')
61
61
 
62
62
    def test_info_empty_controldir_verbose(self):
63
63
        self.make_controldir('ctrl')
64
64
        out, err = self.run_bzr('info -v ctrl')
65
65
        self.assertEqualDiff(out,
66
 
            'Empty control directory (format: 2a)\n'
67
 
            'Location:\n'
68
 
            '  control directory: ctrl\n\n'
69
 
            'Format:\n'
70
 
            '       control: Meta directory format 1\n\n'
71
 
            'Control directory:\n'
72
 
            '         0 branches\n')
 
66
                             'Empty control directory (format: 2a)\n'
 
67
                             'Location:\n'
 
68
                             '  control directory: ctrl\n\n'
 
69
                             'Format:\n'
 
70
                             '       control: Meta directory format 1\n\n'
 
71
                             'Control directory:\n'
 
72
                             '         0 branches\n')
73
73
        self.assertEqual(err, '')
74
74
 
75
75
    def test_info_dangling_branch_reference(self):
78
78
        shutil.rmtree('target')
79
79
        out, err = self.run_bzr('info from')
80
80
        self.assertEqual(out,
81
 
            'Dangling branch reference (format: 2a)\n'
82
 
            'Location:\n'
83
 
            '   control directory: from\n'
84
 
            '  checkout of branch: target\n')
 
81
                         'Dangling branch reference (format: 2a)\n'
 
82
                         'Location:\n'
 
83
                         '   control directory: from\n'
 
84
                         '  checkout of branch: target\n')
85
85
        self.assertEqual(err, '')
86
86
 
87
87
    def test_info_standalone(self):
95
95
 
96
96
        out, err = self.run_bzr('info standalone')
97
97
        self.assertEqualDiff(
98
 
"""Standalone tree (format: knit)
 
98
            """Standalone tree (format: knit)
99
99
Location:
100
100
  branch root: standalone
101
101
""", out)
104
104
        # Standalone branch - verbose mode
105
105
        out, err = self.run_bzr('info standalone -v')
106
106
        self.assertEqualDiff(
107
 
"""Standalone tree (format: knit)
 
107
            """Standalone tree (format: knit)
108
108
Location:
109
109
  branch root: standalone
110
110
 
138
138
        # Standalone branch - really verbose mode
139
139
        out, err = self.run_bzr('info standalone -vv')
140
140
        self.assertEqualDiff(
141
 
"""Standalone tree (format: knit)
 
141
            """Standalone tree (format: knit)
142
142
Location:
143
143
  branch root: standalone
144
144
 
179
179
 
180
180
        out, err = self.run_bzr('info branch')
181
181
        self.assertEqualDiff(
182
 
"""Standalone tree (format: knit)
 
182
            """Standalone tree (format: knit)
183
183
Location:
184
184
  branch root: branch
185
185
 
191
191
 
192
192
        out, err = self.run_bzr('info branch --verbose')
193
193
        self.assertEqualDiff(
194
 
"""Standalone tree (format: knit)
 
194
            """Standalone tree (format: knit)
195
195
Location:
196
196
  branch root: branch
197
197
 
240
240
        bound_tree = branch3.controldir.open_workingtree()
241
241
        out, err = self.run_bzr('info -v bound')
242
242
        self.assertEqualDiff(
243
 
"""Checkout (format: knit)
 
243
            """Checkout (format: knit)
244
244
Location:
245
245
       checkout root: bound
246
246
  checkout of branch: standalone
276
276
Repository:
277
277
         1 revision
278
278
""" % (bound_tree._format.get_format_description(),
279
 
       branch3._format.get_format_description(),
280
 
       branch3.repository._format.get_format_description(),
281
 
       datestring_first, datestring_first,
 
279
                branch3._format.get_format_description(),
 
280
                branch3.repository._format.get_format_description(),
 
281
                datestring_first, datestring_first,
282
282
       ), out)
283
283
        self.assertEqual('', err)
284
284
 
285
285
        # Checkout standalone (same as above, but does not have parent set)
286
286
        branch4 = controldir.ControlDir.create_branch_convenience('checkout',
287
 
            format=knit1_format)
 
287
                                                                  format=knit1_format)
288
288
        branch4.bind(branch1)
289
289
        branch4.controldir.open_workingtree().update()
290
290
        out, err = self.run_bzr('info checkout --verbose')
291
291
        self.assertEqualDiff(
292
 
"""Checkout (format: knit)
 
292
            """Checkout (format: knit)
293
293
Location:
294
294
       checkout root: checkout
295
295
  checkout of branch: standalone
322
322
Repository:
323
323
         1 revision
324
324
""" % (branch4.repository._format.get_format_description(),
325
 
       datestring_first, datestring_first,
 
325
                datestring_first, datestring_first,
326
326
       ), out)
327
327
        self.assertEqual('', err)
328
328
 
335
335
        else:
336
336
            format_description = "knit"
337
337
        self.assertEqualDiff(
338
 
"""Lightweight checkout (format: %s)
 
338
            """Lightweight checkout (format: %s)
339
339
Location:
340
340
  light checkout root: lightcheckout
341
341
   checkout of branch: standalone
380
380
        # Out of date branched standalone branch will not be detected
381
381
        out, err = self.run_bzr('info -v branch')
382
382
        self.assertEqualDiff(
383
 
"""Standalone tree (format: knit)
 
383
            """Standalone tree (format: knit)
384
384
Location:
385
385
  branch root: branch
386
386
 
422
422
        # Out of date bound branch
423
423
        out, err = self.run_bzr('info -v bound')
424
424
        self.assertEqualDiff(
425
 
"""Checkout (format: knit)
 
425
            """Checkout (format: knit)
426
426
Location:
427
427
       checkout root: bound
428
428
  checkout of branch: standalone
460
460
Repository:
461
461
         1 revision
462
462
""" % (branch3.repository._format.get_format_description(),
463
 
       datestring_first, datestring_first,
 
463
                datestring_first, datestring_first,
464
464
       ), out)
465
465
        self.assertEqual('', err)
466
466
 
467
467
        # Out of date checkout
468
468
        out, err = self.run_bzr('info -v checkout')
469
469
        self.assertEqualDiff(
470
 
"""Checkout (format: knit)
 
470
            """Checkout (format: knit)
471
471
Location:
472
472
       checkout root: checkout
473
473
  checkout of branch: standalone
502
502
Repository:
503
503
         1 revision
504
504
""" % (branch4.repository._format.get_format_description(),
505
 
       datestring_first, datestring_first,
 
505
                datestring_first, datestring_first,
506
506
       ), out)
507
507
        self.assertEqual('', err)
508
508
 
509
509
        # Out of date lightweight checkout
510
510
        out, err = self.run_bzr('info lightcheckout --verbose')
511
511
        self.assertEqualDiff(
512
 
"""Lightweight checkout (format: %s)
 
512
            """Lightweight checkout (format: %s)
513
513
Location:
514
514
  light checkout root: lightcheckout
515
515
   checkout of branch: standalone
553
553
        repo = branch.repository
554
554
        out, err = self.run_bzr('info branch -v')
555
555
        self.assertEqualDiff(
556
 
"""Standalone branch (format: %s)
 
556
            """Standalone branch (format: %s)
557
557
Location:
558
558
  branch root: branch
559
559
 
571
571
Repository:
572
572
         0 revisions
573
573
""" % (info.describe_format(repo.controldir, repo, branch, None),
574
 
       format.get_branch_format().get_format_description(),
575
 
       format.repository_format.get_format_description(),
 
574
                format.get_branch_format().get_format_description(),
 
575
                format.repository_format.get_format_description(),
576
576
       ), out)
577
577
        self.assertEqual('', err)
578
578
 
585
585
        repo.set_make_working_trees(False)
586
586
        out, err = self.run_bzr('info -v repo')
587
587
        self.assertEqualDiff(
588
 
"""Shared repository (format: dirstate or dirstate-tags or knit)
 
588
            """Shared repository (format: dirstate or dirstate-tags or knit)
589
589
Location:
590
590
  shared repository: %s
591
591
 
608
608
            'repo/branch', format=format)
609
609
        out, err = self.run_bzr('info -v repo/branch')
610
610
        self.assertEqualDiff(
611
 
"""Repository branch (format: dirstate or knit)
 
611
            """Repository branch (format: dirstate or knit)
612
612
Location:
613
613
  shared repository: repo
614
614
  repository branch: repo/branch
627
627
Repository:
628
628
         0 revisions
629
629
""" % (format.get_branch_format().get_format_description(),
630
 
       format.repository_format.get_format_description(),
 
630
                format.repository_format.get_format_description(),
631
631
       ), out)
632
632
        self.assertEqual('', err)
633
633
 
635
635
        transport.mkdir('tree')
636
636
        transport.mkdir('tree/lightcheckout')
637
637
        tree2 = branch1.create_checkout('tree/lightcheckout',
638
 
            lightweight=True)
 
638
                                        lightweight=True)
639
639
        branch2 = tree2.branch
640
640
        self.assertCheckoutStatusOutput('-v tree/lightcheckout', tree2,
641
 
                   shared_repo=repo, repo_branch=branch1, verbose=True)
 
641
                                        shared_repo=repo, repo_branch=branch1, verbose=True)
642
642
 
643
643
        # Create normal checkout
644
644
        tree3 = branch1.create_checkout('tree/checkout')
645
645
        self.assertCheckoutStatusOutput('tree/checkout --verbose', tree3,
646
 
            verbose=True,
647
 
            light_checkout=False, repo_branch=branch1)
 
646
                                        verbose=True,
 
647
                                        light_checkout=False, repo_branch=branch1)
648
648
        # Update lightweight checkout
649
649
        self.build_tree(['tree/lightcheckout/a'])
650
650
        tree2.add('a')
653
653
        datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
654
654
        out, err = self.run_bzr('info tree/lightcheckout --verbose')
655
655
        self.assertEqualDiff(
656
 
"""Lightweight checkout (format: %s)
 
656
            """Lightweight checkout (format: %s)
657
657
Location:
658
658
  light checkout root: tree/lightcheckout
659
659
   checkout of branch: repo/branch
687
687
Repository:
688
688
         1 revision
689
689
""" % (self._repo_strings, format.get_branch_format().get_format_description(),
690
 
       format.repository_format.get_format_description(),
691
 
       datestring_first, datestring_first,
 
690
                format.repository_format.get_format_description(),
 
691
                datestring_first, datestring_first,
692
692
       ), out)
693
693
        self.assertEqual('', err)
694
694
 
695
695
        # Out of date checkout
696
696
        out, err = self.run_bzr('info -v tree/checkout')
697
697
        self.assertEqualDiff(
698
 
"""Checkout (format: unnamed)
 
698
            """Checkout (format: unnamed)
699
699
Location:
700
700
       checkout root: tree/checkout
701
701
  checkout of branch: repo/branch
727
727
Repository:
728
728
         0 revisions
729
729
""" % (format.get_branch_format().get_format_description(),
730
 
       format.repository_format.get_format_description(),
 
730
                format.repository_format.get_format_description(),
731
731
       ), out)
732
732
        self.assertEqual('', err)
733
733
 
737
737
        tree3.add('b')
738
738
        out, err = self.run_bzr('info tree/checkout --verbose')
739
739
        self.assertEqualDiff(
740
 
"""Checkout (format: unnamed)
 
740
            """Checkout (format: unnamed)
741
741
Location:
742
742
       checkout root: tree/checkout
743
743
  checkout of branch: repo/branch
770
770
Repository:
771
771
         1 revision
772
772
""" % (format.get_branch_format().get_format_description(),
773
 
       format.repository_format.get_format_description(),
774
 
       datestring_first, datestring_first,
 
773
                format.repository_format.get_format_description(),
 
774
                datestring_first, datestring_first,
775
775
       ), out)
776
776
        self.assertEqual('', err)
777
777
        tree3.commit('commit two')
781
781
        datestring_last = osutils.format_date(rev.timestamp, rev.timezone)
782
782
        out, err = self.run_bzr('info tree/lightcheckout --verbose')
783
783
        self.assertEqualDiff(
784
 
"""Lightweight checkout (format: %s)
 
784
            """Lightweight checkout (format: %s)
785
785
Location:
786
786
  light checkout root: tree/lightcheckout
787
787
   checkout of branch: repo/branch
817
817
Repository:
818
818
         2 revisions
819
819
""" % (self._repo_strings, format.get_branch_format().get_format_description(),
820
 
       format.repository_format.get_format_description(),
821
 
       datestring_first, datestring_last,
 
820
                format.repository_format.get_format_description(),
 
821
                datestring_first, datestring_last,
822
822
       ), out)
823
823
        self.assertEqual('', err)
824
824
 
825
825
        # Show info about shared branch
826
826
        out, err = self.run_bzr('info repo/branch --verbose')
827
827
        self.assertEqualDiff(
828
 
"""Repository branch (format: dirstate or knit)
 
828
            """Repository branch (format: dirstate or knit)
829
829
Location:
830
830
  shared repository: repo
831
831
  repository branch: repo/branch
847
847
Repository:
848
848
         2 revisions
849
849
""" % (format.get_branch_format().get_format_description(),
850
 
       format.repository_format.get_format_description(),
851
 
       datestring_first, datestring_last,
 
850
                format.repository_format.get_format_description(),
 
851
                datestring_first, datestring_last,
852
852
       ), out)
853
853
        self.assertEqual('', err)
854
854
 
855
855
        # Show info about repository with revisions
856
856
        out, err = self.run_bzr('info -v repo')
857
857
        self.assertEqualDiff(
858
 
"""Shared repository (format: dirstate or dirstate-tags or knit)
 
858
            """Shared repository (format: dirstate or dirstate-tags or knit)
859
859
Location:
860
860
  shared repository: repo
861
861
 
881
881
        repo.set_make_working_trees(True)
882
882
        out, err = self.run_bzr('info -v repo')
883
883
        self.assertEqualDiff(
884
 
"""Shared repository with trees (format: dirstate or dirstate-tags or knit)
 
884
            """Shared repository with trees (format: dirstate or dirstate-tags or knit)
885
885
Location:
886
886
  shared repository: repo
887
887
 
903
903
        # Create two branches
904
904
        repo.controldir.root_transport.mkdir('branch1')
905
905
        branch1 = controldir.ControlDir.create_branch_convenience('repo/branch1',
906
 
            format=format)
 
906
                                                                  format=format)
907
907
        branch2 = branch1.controldir.sprout('repo/branch2').open_branch()
908
908
 
909
909
        # Empty first branch
910
910
        out, err = self.run_bzr('info repo/branch1 --verbose')
911
911
        self.assertEqualDiff(
912
 
"""Repository tree (format: knit)
 
912
            """Repository tree (format: knit)
913
913
Location:
914
914
  shared repository: repo
915
915
  repository branch: repo/branch1
939
939
Repository:
940
940
         0 revisions
941
941
""" % (format.get_branch_format().get_format_description(),
942
 
       format.repository_format.get_format_description(),
 
942
                format.repository_format.get_format_description(),
943
943
       ), out)
944
944
        self.assertEqual('', err)
945
945
 
952
952
        datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
953
953
        out, err = self.run_bzr('info -v repo/branch1')
954
954
        self.assertEqualDiff(
955
 
"""Repository tree (format: knit)
 
955
            """Repository tree (format: knit)
956
956
Location:
957
957
  shared repository: repo
958
958
  repository branch: repo/branch1
985
985
Repository:
986
986
         1 revision
987
987
""" % (format.get_branch_format().get_format_description(),
988
 
       format.repository_format.get_format_description(),
989
 
       datestring_first, datestring_first,
 
988
                format.repository_format.get_format_description(),
 
989
                datestring_first, datestring_first,
990
990
       ), out)
991
991
        self.assertEqual('', err)
992
992
 
993
993
        # Out of date second branch
994
994
        out, err = self.run_bzr('info repo/branch2 --verbose')
995
995
        self.assertEqualDiff(
996
 
"""Repository tree (format: knit)
 
996
            """Repository tree (format: knit)
997
997
Location:
998
998
  shared repository: repo
999
999
  repository branch: repo/branch2
1026
1026
Repository:
1027
1027
         1 revision
1028
1028
""" % (format.get_branch_format().get_format_description(),
1029
 
       format.repository_format.get_format_description(),
 
1029
                format.repository_format.get_format_description(),
1030
1030
       ), out)
1031
1031
        self.assertEqual('', err)
1032
1032
 
1035
1035
        tree2.pull(branch1)
1036
1036
        out, err = self.run_bzr('info -v repo/branch2')
1037
1037
        self.assertEqualDiff(
1038
 
"""Repository tree (format: knit)
 
1038
            """Repository tree (format: knit)
1039
1039
Location:
1040
1040
  shared repository: repo
1041
1041
  repository branch: repo/branch2
1071
1071
Repository:
1072
1072
         1 revision
1073
1073
""" % (format.get_branch_format().get_format_description(),
1074
 
       format.repository_format.get_format_description(),
1075
 
       datestring_first, datestring_first,
 
1074
                format.repository_format.get_format_description(),
 
1075
                datestring_first, datestring_first,
1076
1076
       ), out)
1077
1077
        self.assertEqual('', err)
1078
1078
 
1079
1079
        # Show info about repository with revisions
1080
1080
        out, err = self.run_bzr('info -v repo')
1081
1081
        self.assertEqualDiff(
1082
 
"""Shared repository with trees (format: dirstate or dirstate-tags or knit)
 
1082
            """Shared repository with trees (format: dirstate or dirstate-tags or knit)
1083
1083
Location:
1084
1084
  shared repository: repo
1085
1085
 
1096
1096
         1 revision
1097
1097
""" % (format.repository_format.get_format_description(),
1098
1098
       ),
1099
 
       out)
 
1099
            out)
1100
1100
        self.assertEqual('', err)
1101
1101
 
1102
1102
    def test_info_shared_repository_with_tree_in_root(self):
1108
1108
        repo.set_make_working_trees(True)
1109
1109
        out, err = self.run_bzr('info -v repo')
1110
1110
        self.assertEqualDiff(
1111
 
"""Shared repository with trees (format: dirstate or dirstate-tags or knit)
 
1111
            """Shared repository with trees (format: dirstate or dirstate-tags or knit)
1112
1112
Location:
1113
1113
  shared repository: repo
1114
1114
 
1133
1133
        control.create_workingtree()
1134
1134
        out, err = self.run_bzr('info -v repo')
1135
1135
        self.assertEqualDiff(
1136
 
"""Repository tree (format: knit)
 
1136
            """Repository tree (format: knit)
1137
1137
Location:
1138
1138
  shared repository: repo
1139
1139
  repository branch: repo
1163
1163
Repository:
1164
1164
         0 revisions
1165
1165
""" % (format.get_branch_format().get_format_description(),
1166
 
       format.repository_format.get_format_description(),
 
1166
                format.repository_format.get_format_description(),
1167
1167
       ), out)
1168
1168
        self.assertEqual('', err)
1169
1169
 
1170
1170
    def test_info_repository_hook(self):
1171
1171
        format = controldir.format_registry.make_controldir('knit')
 
1172
 
1172
1173
        def repo_info(repo, stats, outf):
1173
1174
            outf.write(u"more info\n")
1174
1175
        info.hooks.install_named_hook('repository', repo_info, None)
1176
1177
        repo = self.make_repository('repo', shared=True, format=format)
1177
1178
        out, err = self.run_bzr('info -v repo')
1178
1179
        self.assertEqualDiff(
1179
 
"""Shared repository with trees (format: dirstate or dirstate-tags or knit)
 
1180
            """Shared repository with trees (format: dirstate or dirstate-tags or knit)
1180
1181
Location:
1181
1182
  shared repository: repo
1182
1183
 
1206
1207
        repo.controldir.create_branch(name='foo')
1207
1208
        out, err = self.run_bzr('info repo')
1208
1209
        self.assertEqualDiff(
1209
 
"""Unshared repository with trees and colocated branches (format: development-colo)
 
1210
            """Unshared repository with trees and colocated branches (format: development-colo)
1210
1211
Location:
1211
1212
  repository: repo
1212
1213
""", out)
1213
1214
        self.assertEqual('', err)
1214
1215
 
1215
1216
    def assertCheckoutStatusOutput(self,
1216
 
        command_string, lco_tree, shared_repo=None,
1217
 
        repo_branch=None,
1218
 
        tree_locked=False,
1219
 
        branch_locked=False, repo_locked=False,
1220
 
        verbose=False,
1221
 
        light_checkout=True,
1222
 
        checkout_root=None):
 
1217
                                   command_string, lco_tree, shared_repo=None,
 
1218
                                   repo_branch=None,
 
1219
                                   tree_locked=False,
 
1220
                                   branch_locked=False, repo_locked=False,
 
1221
                                   verbose=False,
 
1222
                                   light_checkout=True,
 
1223
                                   checkout_root=None):
1223
1224
        """Check the output of info in a checkout.
1224
1225
 
1225
1226
        This is not quite a mirror of the info code: rather than using the
1256
1257
            # in the different process -- either on win32 or on linux).
1257
1258
            # This should be removed when the locking errors are fixed.
1258
1259
            self.expectFailure('OS locks are exclusive '
1259
 
                'for different processes (Bug #174055)',
1260
 
                self.run_bzr_subprocess,
1261
 
                'info ' + command_string)
 
1260
                               'for different processes (Bug #174055)',
 
1261
                               self.run_bzr_subprocess,
 
1262
                               'info ' + command_string)
1262
1263
        out, err = self.run_bzr('info %s' % command_string)
1263
1264
        description = {
1264
1265
            (True, True): 'Lightweight checkout',
1291
1292
        extra_space = ''
1292
1293
        if light_checkout:
1293
1294
            tree_data = ("  light checkout root: %s\n" %
1294
 
                friendly_location(lco_tree.controldir.root_transport.base))
 
1295
                         friendly_location(lco_tree.controldir.root_transport.base))
1295
1296
            extra_space = ' '
1296
1297
        if lco_tree.branch.get_bound_location() is not None:
1297
1298
            tree_data += ("%s       checkout root: %s\n" % (extra_space,
1298
 
                friendly_location(lco_tree.branch.controldir.root_transport.base)))
 
1299
                                                            friendly_location(lco_tree.branch.controldir.root_transport.base)))
1299
1300
        if shared_repo is not None:
1300
1301
            branch_data = (
1301
1302
                "   checkout of branch: %s\n"
1309
1310
                 friendly_location(repo_branch.controldir.root_transport.base)))
1310
1311
        else:
1311
1312
            branch_data = ("   checkout of branch: %s\n" %
1312
 
                lco_tree.branch.controldir.root_transport.base)
 
1313
                           lco_tree.branch.controldir.root_transport.base)
1313
1314
 
1314
1315
        if verbose >= 2:
1315
1316
            verbose_info = '         0 committers\n'
1317
1318
            verbose_info = ''
1318
1319
 
1319
1320
        self.assertEqualDiff(
1320
 
"""%s (format: %s)
 
1321
            """%s (format: %s)
1321
1322
Location:
1322
1323
%s%s
1323
1324
Format:
1344
1345
%s
1345
1346
Repository:
1346
1347
         0 revisions
1347
 
""" %  (description,
1348
 
        format,
1349
 
        tree_data,
1350
 
        branch_data,
1351
 
        lco_tree._format.get_format_description(),
1352
 
        lco_tree.branch._format.get_format_description(),
1353
 
        lco_tree.branch.repository._format.get_format_description(),
1354
 
        expected_lock_output,
1355
 
        verbose_info,
1356
 
        ), out)
 
1348
""" % (description,
 
1349
                format,
 
1350
                tree_data,
 
1351
                branch_data,
 
1352
                lco_tree._format.get_format_description(),
 
1353
                lco_tree.branch._format.get_format_description(),
 
1354
                lco_tree.branch.repository._format.get_format_description(),
 
1355
                expected_lock_output,
 
1356
                verbose_info,
 
1357
       ), out)
1357
1358
        self.assertEqual('', err)
1358
1359
 
1359
1360
    def test_info_locking(self):
1389
1390
        lco_tree.branch.repository.lock_write()
1390
1391
        try:
1391
1392
            self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1392
 
            lco_tree, repo_branch=repo_branch,
1393
 
            repo_locked=True, verbose=True, light_checkout=True)
 
1393
                                            lco_tree, repo_branch=repo_branch,
 
1394
                                            repo_locked=True, verbose=True, light_checkout=True)
1394
1395
        finally:
1395
1396
            lco_tree.branch.repository.unlock()
1396
1397
        # U L L
1397
1398
        lco_tree.branch.lock_write()
1398
1399
        try:
1399
1400
            self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1400
 
            lco_tree,
1401
 
            branch_locked=True,
1402
 
            repo_locked=True,
1403
 
            repo_branch=repo_branch,
1404
 
            verbose=True)
 
1401
                                            lco_tree,
 
1402
                                            branch_locked=True,
 
1403
                                            repo_locked=True,
 
1404
                                            repo_branch=repo_branch,
 
1405
                                            verbose=True)
1405
1406
        finally:
1406
1407
            lco_tree.branch.unlock()
1407
1408
        # L L L
1408
1409
        lco_tree.lock_write()
1409
1410
        try:
1410
1411
            self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1411
 
            lco_tree, repo_branch=repo_branch,
1412
 
            tree_locked=True,
1413
 
            branch_locked=True,
1414
 
            repo_locked=True,
1415
 
            verbose=True)
 
1412
                                            lco_tree, repo_branch=repo_branch,
 
1413
                                            tree_locked=True,
 
1414
                                            branch_locked=True,
 
1415
                                            repo_locked=True,
 
1416
                                            verbose=True)
1416
1417
        finally:
1417
1418
            lco_tree.unlock()
1418
1419
        # L L U
1420
1421
        lco_tree.branch.repository.unlock()
1421
1422
        try:
1422
1423
            self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1423
 
            lco_tree, repo_branch=repo_branch,
1424
 
            tree_locked=True,
1425
 
            branch_locked=True,
1426
 
            verbose=True)
 
1424
                                            lco_tree, repo_branch=repo_branch,
 
1425
                                            tree_locked=True,
 
1426
                                            branch_locked=True,
 
1427
                                            verbose=True)
1427
1428
        finally:
1428
1429
            lco_tree.branch.repository.lock_write()
1429
1430
            lco_tree.unlock()
1432
1433
        lco_tree.branch.unlock()
1433
1434
        try:
1434
1435
            self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1435
 
            lco_tree, repo_branch=repo_branch,
1436
 
            tree_locked=True,
1437
 
            verbose=True)
 
1436
                                            lco_tree, repo_branch=repo_branch,
 
1437
                                            tree_locked=True,
 
1438
                                            verbose=True)
1438
1439
        finally:
1439
1440
            lco_tree.branch.lock_write()
1440
1441
            lco_tree.unlock()
1444
1445
        lco_tree.branch.repository.lock_write()
1445
1446
        try:
1446
1447
            self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1447
 
            lco_tree, repo_branch=repo_branch,
1448
 
            tree_locked=True,
1449
 
            repo_locked=True,
1450
 
            verbose=True)
 
1448
                                            lco_tree, repo_branch=repo_branch,
 
1449
                                            tree_locked=True,
 
1450
                                            repo_locked=True,
 
1451
                                            verbose=True)
1451
1452
        finally:
1452
1453
            lco_tree.branch.repository.unlock()
1453
1454
            lco_tree.branch.lock_write()
1457
1458
        lco_tree.branch.repository.unlock()
1458
1459
        try:
1459
1460
            self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1460
 
            lco_tree, repo_branch=repo_branch,
1461
 
            branch_locked=True,
1462
 
            verbose=True)
 
1461
                                            lco_tree, repo_branch=repo_branch,
 
1462
                                            branch_locked=True,
 
1463
                                            verbose=True)
1463
1464
        finally:
1464
1465
            lco_tree.branch.repository.lock_write()
1465
1466
            lco_tree.branch.unlock()
1471
1472
    def test_info_stacked(self):
1472
1473
        # We have a mainline
1473
1474
        trunk_tree = self.make_branch_and_tree('mainline',
1474
 
            format='1.6')
 
1475
                                               format='1.6')
1475
1476
        trunk_tree.commit('mainline')
1476
1477
        # and a branch from it which is stacked
1477
1478
        new_dir = trunk_tree.controldir.sprout('newbranch', stacked=True)
1478
1479
        out, err = self.run_bzr('info newbranch')
1479
1480
        self.assertEqual(
1480
 
"""Standalone tree (format: 1.6)
 
1481
            """Standalone tree (format: 1.6)
1481
1482
Location:
1482
1483
  branch root: newbranch
1483
1484
 
1489
1490
 
1490
1491
    def test_info_revinfo_optional(self):
1491
1492
        tree = self.make_branch_and_tree('.')
 
1493
 
1492
1494
        def last_revision_info(self):
1493
1495
            raise errors.UnsupportedOperation(last_revision_info, self)
1494
1496
        self.overrideAttr(
1495
1497
            branch.Branch, "last_revision_info", last_revision_info)
1496
1498
        out, err = self.run_bzr('info -v .')
1497
1499
        self.assertEqual(
1498
 
"""Standalone tree (format: 2a)
 
1500
            """Standalone tree (format: 2a)
1499
1501
Location:
1500
1502
  branch root: .
1501
1503
 
1527
1529
        bzrdir.create_branch(name="colo3")
1528
1530
        out, err = self.run_bzr('info -v .')
1529
1531
        self.assertEqualDiff(
1530
 
"""Standalone branch (format: development-colo)
 
1532
            """Standalone branch (format: development-colo)
1531
1533
Location:
1532
1534
  branch root: .
1533
1535