1
# Copyright (C) 2006 Canonical Ltd
2
# -*- coding: utf-8 -*-
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 2 of the License, or
7
# (at your option) any later version.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
"""Tests for the info command of bzr."""
28
from bzrlib.osutils import format_date
29
from bzrlib.tests import TestSkipped
30
from bzrlib.tests.blackbox import ExternalBase
33
class TestInfo(ExternalBase):
35
def test_info_non_existing(self):
36
if sys.platform == "win32":
37
location = "C:/i/do/not/exist/"
39
location = "/i/do/not/exist/"
40
out, err = self.runbzr('info '+location, retcode=3)
41
self.assertEqual(out, '')
42
self.assertEqual(err, 'bzr: ERROR: Not a branch: %s\n' % location)
44
def test_info_standalone(self):
45
transport = self.get_transport()
47
# Create initial standalone branch
48
tree1 = self.make_branch_and_tree('standalone', 'weave')
49
self.build_tree(['standalone/a'])
51
branch1 = tree1.branch
52
out, err = self.runbzr('info standalone')
58
control: All-in-one format 6
59
working tree: Working tree format 2
60
branch: Branch format 4
61
repository: Weave repository format 6
71
0 versioned subdirectories
79
""" % branch1.bzrdir.root_transport.base, out)
80
self.assertEqual('', err)
81
tree1.commit('commit one')
82
rev = branch1.repository.get_revision(branch1.revision_history()[0])
83
datestring_first = format_date(rev.timestamp, rev.timezone)
85
# Branch standalone with push location
86
branch2 = branch1.bzrdir.sprout('branch').open_branch()
87
branch2.set_push_location(branch1.bzrdir.root_transport.base)
88
out, err = self.runbzr('info branch --verbose')
98
control: All-in-one format 6
99
working tree: Working tree format 2
100
branch: Branch format 4
101
repository: Weave repository format 6
111
0 versioned subdirectories
123
""" % (branch2.bzrdir.root_transport.base,
124
branch1.bzrdir.root_transport.base,
125
branch1.bzrdir.root_transport.base,
126
datestring_first, datestring_first,
127
# poking at _revision_store isn't all that clean, but neither is
128
# having the ui test dependent on the exact overhead of a given store.
129
branch2.repository._revision_store.total_size(
130
branch2.repository.get_transaction())[1] / 1024,
132
self.assertEqual('', err)
134
# Branch and bind to standalone, needs upgrade to metadir
135
# (creates backup as unknown)
136
branch1.bzrdir.sprout('bound')
137
knit1_format = bzrdir.format_registry.make_bzrdir('knit')
138
bzrlib.upgrade.upgrade('bound', knit1_format)
139
branch3 = bzrlib.bzrdir.BzrDir.open('bound').open_branch()
140
branch3.bind(branch1)
141
bound_tree = branch3.bzrdir.open_workingtree()
142
out, err = self.runbzr('info bound')
143
self.assertEqualDiff(
146
checkout of branch: %s
152
control: Meta directory format 1
165
0 versioned subdirectories
176
""" % (branch3.bzrdir.root_transport.base,
177
branch1.bzrdir.root_transport.base,
178
branch1.bzrdir.root_transport.base,
179
bound_tree._format.get_format_description(),
180
branch3._format.get_format_description(),
181
branch3.repository._format.get_format_description(),
182
datestring_first, datestring_first,
183
# poking at _revision_store isn't all that clean, but neither is
184
# having the ui test dependent on the exact overhead of a given store.
185
branch3.repository._revision_store.total_size(
186
branch3.repository.get_transaction())[1] / 1024,
188
self.assertEqual('', err)
190
# Checkout standalone (same as above, but does not have parent set)
191
branch4 = bzrlib.bzrdir.BzrDir.create_branch_convenience('checkout',
193
branch4.bind(branch1)
194
branch4.bzrdir.open_workingtree().update()
195
out, err = self.runbzr('info checkout --verbose')
196
self.assertEqualDiff(
199
checkout of branch: %s
202
control: Meta directory format 1
203
working tree: Working tree format 3
204
branch: Branch format 5
215
0 versioned subdirectories
227
""" % (branch4.bzrdir.root_transport.base,
228
branch1.bzrdir.root_transport.base,
229
branch4.repository._format.get_format_description(),
230
datestring_first, datestring_first,
231
# poking at _revision_store isn't all that clean, but neither is
232
# having the ui test dependent on the exact overhead of a given store.
233
branch4.repository._revision_store.total_size(
234
branch4.repository.get_transaction())[1] / 1024,
236
self.assertEqual('', err)
238
# Lightweight checkout (same as above, different branch and repository)
239
tree5 = branch1.create_checkout('lightcheckout', lightweight=True)
240
branch5 = tree5.branch
241
out, err = self.runbzr('info lightcheckout')
242
self.assertEqualDiff(
244
light checkout root: %s
245
checkout of branch: %s
248
control: Meta directory format 1
249
working tree: Working tree format 3
250
branch: Branch format 4
251
repository: Weave repository format 6
261
0 versioned subdirectories
272
""" % (tree5.bzrdir.root_transport.base,
273
branch1.bzrdir.root_transport.base,
274
datestring_first, datestring_first,
276
self.assertEqual('', err)
278
# Update initial standalone branch
279
self.build_tree(['standalone/b'])
281
tree1.commit('commit two')
282
rev = branch1.repository.get_revision(branch1.revision_history()[-1])
283
datestring_last = format_date(rev.timestamp, rev.timezone)
285
# Out of date branched standalone branch will not be detected
286
out, err = self.runbzr('info branch')
287
self.assertEqualDiff(
293
publish to branch: %s
296
control: All-in-one format 6
297
working tree: Working tree format 2
298
branch: Branch format 4
299
repository: Weave repository format 6
309
0 versioned subdirectories
320
""" % (branch2.bzrdir.root_transport.base,
321
branch1.bzrdir.root_transport.base,
322
branch1.bzrdir.root_transport.base,
323
datestring_first, datestring_first,
325
self.assertEqual('', err)
327
# Out of date bound branch
328
out, err = self.runbzr('info bound')
329
self.assertEqualDiff(
332
checkout of branch: %s
338
control: Meta directory format 1
339
working tree: Working tree format 3
340
branch: Branch format 5
343
Branch is out of date: missing 1 revision.
353
0 versioned subdirectories
364
""" % (branch3.bzrdir.root_transport.base,
365
branch1.bzrdir.root_transport.base,
366
branch1.bzrdir.root_transport.base,
367
branch3.repository._format.get_format_description(),
368
datestring_first, datestring_first,
369
# poking at _revision_store isn't all that clean, but neither is
370
# having the ui test dependent on the exact overhead of a given store.
371
branch3.repository._revision_store.total_size(
372
branch3.repository.get_transaction())[1] / 1024,
374
self.assertEqual('', err)
376
# Out of date checkout
377
out, err = self.runbzr('info checkout')
378
self.assertEqualDiff(
381
checkout of branch: %s
384
control: Meta directory format 1
385
working tree: Working tree format 3
386
branch: Branch format 5
389
Branch is out of date: missing 1 revision.
399
0 versioned subdirectories
410
""" % (branch4.bzrdir.root_transport.base,
411
branch1.bzrdir.root_transport.base,
412
branch4.repository._format.get_format_description(),
413
datestring_first, datestring_first,
414
# poking at _revision_store isn't all that clean, but neither is
415
# having the ui test dependent on the exact overhead of a given store.
416
branch4.repository._revision_store.total_size(
417
branch4.repository.get_transaction())[1] / 1024,
419
self.assertEqual('', err)
421
# Out of date lightweight checkout
422
out, err = self.runbzr('info lightcheckout --verbose')
423
self.assertEqualDiff(
425
light checkout root: %s
426
checkout of branch: %s
429
control: Meta directory format 1
430
working tree: Working tree format 3
431
branch: Branch format 4
432
repository: Weave repository format 6
434
Working tree is out of date: missing 1 revision.
444
0 versioned subdirectories
456
""" % (tree5.bzrdir.root_transport.base,
457
branch1.bzrdir.root_transport.base,
458
datestring_first, datestring_last,
460
self.assertEqual('', err)
462
def test_info_standalone_no_tree(self):
463
# create standalone branch without a working tree
464
format = bzrdir.format_registry.make_bzrdir('default')
465
branch = self.make_branch('branch')
466
repo = branch.repository
467
out, err = self.runbzr('info branch')
468
self.assertEqualDiff(
473
control: Meta directory format 1
483
""" % (branch.bzrdir.root_transport.base,
484
format.branch_format.get_format_description(),
485
format.repository_format.get_format_description(),
487
self.assertEqual('', err)
489
def test_info_shared_repository(self):
490
format = bzrdir.format_registry.make_bzrdir('metaweave')
491
transport = self.get_transport()
493
# Create shared repository
494
repo = self.make_repository('repo', shared=True, format=format)
495
repo.set_make_working_trees(False)
496
out, err = self.runbzr('info repo')
497
self.assertEqualDiff(
499
shared repository: %s
502
control: Meta directory format 1
508
""" % (repo.bzrdir.root_transport.base,
509
format.repository_format.get_format_description(),
511
self.assertEqual('', err)
513
# Create branch inside shared repository
514
repo.bzrdir.root_transport.mkdir('branch')
515
branch1 = repo.bzrdir.create_branch_convenience('repo/branch',
517
out, err = self.runbzr('info repo/branch')
518
self.assertEqualDiff(
520
shared repository: %s
521
repository branch: branch
524
control: Meta directory format 1
534
""" % (repo.bzrdir.root_transport.base,
535
format.branch_format.get_format_description(),
536
format.repository_format.get_format_description(),
538
self.assertEqual('', err)
540
# Create lightweight checkout
541
transport.mkdir('tree')
542
transport.mkdir('tree/lightcheckout')
543
tree2 = branch1.create_checkout('tree/lightcheckout',
545
branch2 = tree2.branch
546
self.assertCheckoutStatusOutput('tree/lightcheckout', tree2,
549
# Create normal checkout
550
tree3 = branch1.create_checkout('tree/checkout')
551
self.assertCheckoutStatusOutput('tree/checkout --verbose', tree3,
553
light_checkout=False, repo_branch=branch1)
554
# Update lightweight checkout
555
self.build_tree(['tree/lightcheckout/a'])
557
tree2.commit('commit one')
558
rev = repo.get_revision(branch2.revision_history()[0])
559
datestring_first = format_date(rev.timestamp, rev.timezone)
560
out, err = self.runbzr('info tree/lightcheckout --verbose')
561
self.assertEqualDiff(
563
light checkout root: %s
564
shared repository: %s
565
repository branch: branch
568
control: Meta directory format 1
569
working tree: Working tree format 3
581
0 versioned subdirectories
593
""" % (tree2.bzrdir.root_transport.base,
594
repo.bzrdir.root_transport.base,
595
format.branch_format.get_format_description(),
596
format.repository_format.get_format_description(),
597
datestring_first, datestring_first,
598
# poking at _revision_store isn't all that clean, but neither is
599
# having the ui test dependent on the exact overhead of a given store.
600
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
602
self.assertEqual('', err)
604
# Out of date checkout
605
out, err = self.runbzr('info tree/checkout')
606
self.assertEqualDiff(
609
checkout of branch: %s
612
control: Meta directory format 1
613
working tree: Working tree format 3
617
Branch is out of date: missing 1 revision.
627
0 versioned subdirectories
635
""" % (tree3.bzrdir.root_transport.base,
636
branch1.bzrdir.root_transport.base,
637
format.branch_format.get_format_description(),
638
format.repository_format.get_format_description(),
640
self.assertEqual('', err)
644
self.build_tree(['tree/checkout/b'])
646
out, err = self.runbzr('info tree/checkout --verbose')
647
self.assertEqualDiff(
650
checkout of branch: %s
653
control: Meta directory format 1
654
working tree: Working tree format 3
666
0 versioned subdirectories
678
""" % (tree3.bzrdir.root_transport.base, branch1.bzrdir.root_transport.base,
679
format.branch_format.get_format_description(),
680
format.repository_format.get_format_description(),
681
datestring_first, datestring_first,
682
# poking at _revision_store isn't all that clean, but neither is
683
# having the ui test dependent on the exact overhead of a given store.
684
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
686
self.assertEqual('', err)
687
tree3.commit('commit two')
689
# Out of date lightweight checkout
690
rev = repo.get_revision(branch1.revision_history()[-1])
691
datestring_last = format_date(rev.timestamp, rev.timezone)
692
out, err = self.runbzr('info tree/lightcheckout --verbose')
693
self.assertEqualDiff(
695
light checkout root: %s
696
shared repository: %s
697
repository branch: branch
700
control: Meta directory format 1
701
working tree: Working tree format 3
705
Working tree is out of date: missing 1 revision.
715
0 versioned subdirectories
727
""" % (tree2.bzrdir.root_transport.base,
728
repo.bzrdir.root_transport.base,
729
format.branch_format.get_format_description(),
730
format.repository_format.get_format_description(),
731
datestring_first, datestring_last,
732
# poking at _revision_store isn't all that clean, but neither is
733
# having the ui test dependent on the exact overhead of a given store.
734
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
736
self.assertEqual('', err)
738
# Show info about shared branch
739
out, err = self.runbzr('info repo/branch --verbose')
740
self.assertEqualDiff(
742
shared repository: %s
743
repository branch: branch
746
control: Meta directory format 1
760
""" % (repo.bzrdir.root_transport.base,
761
format.branch_format.get_format_description(),
762
format.repository_format.get_format_description(),
763
datestring_first, datestring_last,
764
# poking at _revision_store isn't all that clean, but neither is
765
# having the ui test dependent on the exact overhead of a given store.
766
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
768
self.assertEqual('', err)
770
# Show info about repository with revisions
771
out, err = self.runbzr('info repo')
772
self.assertEqualDiff(
774
shared repository: %s
777
control: Meta directory format 1
783
""" % (repo.bzrdir.root_transport.base,
784
format.repository_format.get_format_description(),
785
# poking at _revision_store isn't all that clean, but neither is
786
# having the ui test dependent on the exact overhead of a given store.
787
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
789
self.assertEqual('', err)
791
def test_info_shared_repository_with_trees(self):
792
format = bzrdir.format_registry.make_bzrdir('metaweave')
793
transport = self.get_transport()
795
# Create shared repository with working trees
796
repo = self.make_repository('repo', shared=True, format=format)
797
repo.set_make_working_trees(True)
798
out, err = self.runbzr('info repo')
799
self.assertEqualDiff(
801
shared repository: %s
804
control: Meta directory format 1
807
Create working tree for new branches inside the repository.
812
""" % (repo.bzrdir.root_transport.base,
813
format.repository_format.get_format_description(),
815
self.assertEqual('', err)
817
# Create two branches
818
repo.bzrdir.root_transport.mkdir('branch1')
819
branch1 = repo.bzrdir.create_branch_convenience('repo/branch1',
821
branch2 = branch1.bzrdir.sprout('repo/branch2').open_branch()
824
out, err = self.runbzr('info repo/branch1 --verbose')
825
self.assertEqualDiff(
827
shared repository: %s
828
repository checkout: branch1
831
control: Meta directory format 1
832
working tree: Working tree format 3
844
0 versioned subdirectories
853
""" % (repo.bzrdir.root_transport.base,
854
format.branch_format.get_format_description(),
855
format.repository_format.get_format_description(),
857
self.assertEqual('', err)
859
# Update first branch
860
self.build_tree(['repo/branch1/a'])
861
tree1 = branch1.bzrdir.open_workingtree()
863
tree1.commit('commit one')
864
rev = repo.get_revision(branch1.revision_history()[0])
865
datestring_first = format_date(rev.timestamp, rev.timezone)
866
out, err = self.runbzr('info repo/branch1')
867
self.assertEqualDiff(
869
shared repository: %s
870
repository checkout: branch1
873
control: Meta directory format 1
874
working tree: Working tree format 3
886
0 versioned subdirectories
897
""" % (repo.bzrdir.root_transport.base,
898
format.branch_format.get_format_description(),
899
format.repository_format.get_format_description(),
900
datestring_first, datestring_first,
901
# poking at _revision_store isn't all that clean, but neither is
902
# having the ui test dependent on the exact overhead of a given store.
903
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
905
self.assertEqual('', err)
907
# Out of date second branch
908
out, err = self.runbzr('info repo/branch2 --verbose')
909
self.assertEqualDiff(
911
shared repository: %s
912
repository checkout: branch2
918
control: Meta directory format 1
919
working tree: Working tree format 3
931
0 versioned subdirectories
940
""" % (repo.bzrdir.root_transport.base,
941
branch1.bzrdir.root_transport.base,
942
format.branch_format.get_format_description(),
943
format.repository_format.get_format_description(),
944
# poking at _revision_store isn't all that clean, but neither is
945
# having the ui test dependent on the exact overhead of a given store.
946
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
948
self.assertEqual('', err)
950
# Update second branch
951
tree2 = branch2.bzrdir.open_workingtree()
953
out, err = self.runbzr('info repo/branch2')
954
self.assertEqualDiff(
956
shared repository: %s
957
repository checkout: branch2
963
control: Meta directory format 1
964
working tree: Working tree format 3
976
0 versioned subdirectories
987
""" % (repo.bzrdir.root_transport.base,
988
branch1.bzrdir.root_transport.base,
989
format.branch_format.get_format_description(),
990
format.repository_format.get_format_description(),
991
datestring_first, datestring_first,
992
# poking at _revision_store isn't all that clean, but neither is
993
# having the ui test dependent on the exact overhead of a given store.
994
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
996
self.assertEqual('', err)
998
# Show info about repository with revisions
999
out, err = self.runbzr('info repo')
1000
self.assertEqualDiff(
1002
shared repository: %s
1005
control: Meta directory format 1
1008
Create working tree for new branches inside the repository.
1013
""" % (repo.bzrdir.root_transport.base,
1014
format.repository_format.get_format_description(),
1015
# poking at _revision_store isn't all that clean, but neither is
1016
# having the ui test dependent on the exact overhead of a given store.
1017
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
1020
self.assertEqual('', err)
1022
def test_info_shared_repository_with_tree_in_root(self):
1023
format = bzrdir.format_registry.make_bzrdir('metaweave')
1024
transport = self.get_transport()
1026
# Create shared repository with working trees
1027
repo = self.make_repository('repo', shared=True, format=format)
1028
repo.set_make_working_trees(True)
1029
out, err = self.runbzr('info repo')
1030
self.assertEqualDiff(
1032
shared repository: %s
1035
control: Meta directory format 1
1038
Create working tree for new branches inside the repository.
1043
""" % (repo.bzrdir.root_transport.base,
1044
format.repository_format.get_format_description(),
1046
self.assertEqual('', err)
1048
# Create branch in root of repository
1049
control = repo.bzrdir
1050
branch = control.create_branch()
1051
control.create_workingtree()
1052
out, err = self.runbzr('info repo')
1053
self.assertEqualDiff(
1055
shared repository: %s
1056
repository checkout: .
1059
control: Meta directory format 1
1060
working tree: Working tree format 3
1064
In the working tree:
1072
0 versioned subdirectories
1080
""" % (repo.bzrdir.root_transport.base,
1081
format.branch_format.get_format_description(),
1082
format.repository_format.get_format_description(),
1084
self.assertEqual('', err)
1086
def assertCheckoutStatusOutput(self,
1087
command_string, lco_tree, shared_repo=None,
1090
branch_locked=False, repo_locked=False,
1092
light_checkout=True):
1093
"""Check the output of info in a light checkout tree.
1095
This is not quite a mirror of the info code: rather than using the
1096
tree being examined to predict output, it uses a bunch of flags which
1097
allow us, the test writers, to document what *should* be present in
1098
the output. Removing this separation would remove the value of the
1101
:param path: the path to the light checkout.
1102
:param lco_tree: the tree object for the light checkout.
1103
:param shared_repo: A shared repository is in use, expect that in
1105
:param repo_branch: A branch in a shared repository for non light
1107
:param tree_locked: If true, expect the tree to be locked.
1108
:param branch_locked: If true, expect the branch to be locked.
1109
:param repo_locked: If true, expect the repository to be locked.
1110
:param verbose: If true, expect verbose output
1112
out, err = self.runbzr('info %s' % command_string)
1113
if repo_locked or branch_locked or tree_locked:
1114
def locked_message(a_bool):
1119
expected_lock_output = (
1122
" working tree: %s\n"
1124
" repository: %s\n" % (
1125
locked_message(tree_locked),
1126
locked_message(branch_locked),
1127
locked_message(repo_locked)))
1129
expected_lock_output = ''
1131
tree_data = (" light checkout root: %s" %
1132
lco_tree.bzrdir.root_transport.base)
1134
tree_data = (" checkout root: %s" %
1135
lco_tree.bzrdir.root_transport.base)
1136
if shared_repo is not None:
1138
" shared repository: %s\n"
1139
" repository branch: branch\n" %
1140
shared_repo.bzrdir.root_transport.base)
1141
elif repo_branch is not None:
1143
" checkout of branch: %s\n" %
1144
repo_branch.bzrdir.root_transport.base)
1146
branch_data = (" checkout of branch: %s\n" %
1147
lco_tree.branch.bzrdir.root_transport.base)
1150
verbose_info = ' 0 committers\n'
1154
self.assertEqualDiff(
1159
control: Meta directory format 1
1164
In the working tree:
1172
0 versioned subdirectories
1182
lco_tree._format.get_format_description(),
1183
lco_tree.branch._format.get_format_description(),
1184
lco_tree.branch.repository._format.get_format_description(),
1185
expected_lock_output,
1188
self.assertEqual('', err)
1190
def test_info_locking(self):
1191
transport = self.get_transport()
1192
# Create shared repository with a branch
1193
repo = self.make_repository('repo', shared=True,
1194
format=bzrlib.bzrdir.BzrDirMetaFormat1())
1195
repo.set_make_working_trees(False)
1196
repo.bzrdir.root_transport.mkdir('branch')
1197
repo_branch = repo.bzrdir.create_branch_convenience('repo/branch',
1198
format=bzrlib.bzrdir.BzrDirMetaFormat1())
1199
# Do a heavy checkout
1200
transport.mkdir('tree')
1201
transport.mkdir('tree/checkout')
1202
co_branch = bzrlib.bzrdir.BzrDir.create_branch_convenience('tree/checkout',
1203
format=bzrlib.bzrdir.BzrDirMetaFormat1())
1204
co_branch.bind(repo_branch)
1205
# Do a light checkout of the heavy one
1206
transport.mkdir('tree/lightcheckout')
1207
lco_dir = bzrlib.bzrdir.BzrDirMetaFormat1().initialize('tree/lightcheckout')
1208
bzrlib.branch.BranchReferenceFormat().initialize(lco_dir, co_branch)
1209
lco_dir.create_workingtree()
1210
lco_tree = lco_dir.open_workingtree()
1212
# Test all permutations of locking the working tree, branch and repository
1216
self.assertCheckoutStatusOutput('tree/lightcheckout', lco_tree)
1218
lco_tree.branch.repository.lock_write()
1220
self.assertCheckoutStatusOutput('tree/lightcheckout',
1224
lco_tree.branch.repository.unlock()
1226
lco_tree.branch.lock_write()
1228
self.assertCheckoutStatusOutput('tree/lightcheckout',
1233
lco_tree.branch.unlock()
1235
lco_tree.lock_write()
1237
self.assertCheckoutStatusOutput('tree/lightcheckout',
1245
lco_tree.lock_write()
1246
lco_tree.branch.repository.unlock()
1248
self.assertCheckoutStatusOutput('tree/lightcheckout',
1253
lco_tree.branch.repository.lock_write()
1256
lco_tree.lock_write()
1257
lco_tree.branch.unlock()
1259
self.assertCheckoutStatusOutput('tree/lightcheckout',
1263
lco_tree.branch.lock_write()
1266
lco_tree.lock_write()
1267
lco_tree.branch.unlock()
1268
lco_tree.branch.repository.lock_write()
1270
self.assertCheckoutStatusOutput('tree/lightcheckout',
1275
lco_tree.branch.repository.unlock()
1276
lco_tree.branch.lock_write()
1279
lco_tree.branch.lock_write()
1280
lco_tree.branch.repository.unlock()
1282
self.assertCheckoutStatusOutput('tree/lightcheckout',
1286
lco_tree.branch.repository.lock_write()
1287
lco_tree.branch.unlock()
1289
def test_info_locking_oslocks(self):
1290
if sys.platform == "win32":
1291
raise TestSkipped("don't use oslocks on win32 in unix manner")
1293
tree = self.make_branch_and_tree('branch',
1294
format=bzrlib.bzrdir.BzrDirFormat6())
1296
# Test all permutations of locking the working tree, branch and repository
1297
# XXX: Well not yet, as we can't query oslocks yet. Currently, it's
1298
# implemented by raising NotImplementedError and get_physical_lock_status()
1299
# always returns false. This makes bzr info hide the lock status. (Olaf)
1303
out, err = self.runbzr('info branch')
1304
self.assertEqualDiff(
1309
control: All-in-one format 6
1310
working tree: Working tree format 2
1311
branch: Branch format 4
1314
In the working tree:
1322
0 versioned subdirectories
1330
""" % (tree.bzrdir.root_transport.base,
1331
tree.branch.repository._format.get_format_description(),
1333
self.assertEqual('', err)
1336
out, err = self.runbzr('info branch')
1337
self.assertEqualDiff(
1342
control: All-in-one format 6
1343
working tree: Working tree format 2
1344
branch: Branch format 4
1347
In the working tree:
1355
0 versioned subdirectories
1363
""" % (tree.bzrdir.root_transport.base,
1364
tree.branch.repository._format.get_format_description(),
1366
self.assertEqual('', err)