1
# Copyright (C) 2006, 2007 Canonical Ltd
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.
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.
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
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
"""Tests for the info command of bzr."""
27
from bzrlib.osutils import format_date
28
from bzrlib.tests import TestSkipped
29
from bzrlib.tests.blackbox import ExternalBase
32
class TestInfo(ExternalBase):
34
def test_info_non_existing(self):
35
if sys.platform == "win32":
36
location = "C:/i/do/not/exist/"
38
location = "/i/do/not/exist/"
39
out, err = self.runbzr('info '+location, retcode=3)
40
self.assertEqual(out, '')
41
self.assertEqual(err, 'bzr: ERROR: Not a branch: %s\n' % location)
43
def test_info_standalone(self):
44
transport = self.get_transport()
46
# Create initial standalone branch
47
tree1 = self.make_branch_and_tree('standalone', 'weave')
48
self.build_tree(['standalone/a'])
50
branch1 = tree1.branch
51
out, err = self.runbzr('info standalone')
57
control: All-in-one format 6
58
working tree: Working tree format 2
59
branch: Branch format 4
60
repository: Weave repository format 6
70
0 versioned subdirectories
78
""" % branch1.bzrdir.root_transport.base, out)
79
self.assertEqual('', err)
80
tree1.commit('commit one')
81
rev = branch1.repository.get_revision(branch1.revision_history()[0])
82
datestring_first = format_date(rev.timestamp, rev.timezone)
84
# Branch standalone with push location
85
branch2 = branch1.bzrdir.sprout('branch').open_branch()
86
branch2.set_push_location(branch1.bzrdir.root_transport.base)
87
out, err = self.runbzr('info branch --verbose')
97
control: All-in-one format 6
98
working tree: Working tree format 2
99
branch: Branch format 4
100
repository: Weave repository format 6
110
0 versioned subdirectories
122
""" % (branch2.bzrdir.root_transport.base,
123
branch1.bzrdir.root_transport.base,
124
branch1.bzrdir.root_transport.base,
125
datestring_first, datestring_first,
126
# poking at _revision_store isn't all that clean, but neither is
127
# having the ui test dependent on the exact overhead of a given store.
128
branch2.repository._revision_store.total_size(
129
branch2.repository.get_transaction())[1] / 1024,
131
self.assertEqual('', err)
133
# Branch and bind to standalone, needs upgrade to metadir
134
# (creates backup as unknown)
135
branch1.bzrdir.sprout('bound')
136
knit1_format = bzrdir.format_registry.make_bzrdir('knit')
137
bzrlib.upgrade.upgrade('bound', knit1_format)
138
branch3 = bzrlib.bzrdir.BzrDir.open('bound').open_branch()
139
branch3.bind(branch1)
140
bound_tree = branch3.bzrdir.open_workingtree()
141
out, err = self.runbzr('info bound')
142
self.assertEqualDiff(
145
checkout of branch: %s
151
control: Meta directory format 1
153
branch: Branch format 5
164
0 versioned subdirectories
175
""" % (branch3.bzrdir.root_transport.base,
176
branch1.bzrdir.root_transport.base,
177
branch1.bzrdir.root_transport.base,
178
bound_tree._format.get_format_description(),
179
branch3.repository._format.get_format_description(),
180
datestring_first, datestring_first,
181
# poking at _revision_store isn't all that clean, but neither is
182
# having the ui test dependent on the exact overhead of a given store.
183
branch3.repository._revision_store.total_size(
184
branch3.repository.get_transaction())[1] / 1024,
186
self.assertEqual('', err)
188
# Checkout standalone (same as above, but does not have parent set)
189
branch4 = bzrlib.bzrdir.BzrDir.create_branch_convenience('checkout',
191
branch4.bind(branch1)
192
branch4.bzrdir.open_workingtree().update()
193
out, err = self.runbzr('info checkout --verbose')
194
self.assertEqualDiff(
197
checkout of branch: %s
200
control: Meta directory format 1
201
working tree: Working tree format 3
202
branch: Branch format 5
213
0 versioned subdirectories
225
""" % (branch4.bzrdir.root_transport.base,
226
branch1.bzrdir.root_transport.base,
227
branch4.repository._format.get_format_description(),
228
datestring_first, datestring_first,
229
# poking at _revision_store isn't all that clean, but neither is
230
# having the ui test dependent on the exact overhead of a given store.
231
branch4.repository._revision_store.total_size(
232
branch4.repository.get_transaction())[1] / 1024,
234
self.assertEqual('', err)
236
# Lightweight checkout (same as above, different branch and repository)
237
tree5 = branch1.create_checkout('lightcheckout', lightweight=True)
238
branch5 = tree5.branch
239
out, err = self.runbzr('info lightcheckout')
240
self.assertEqualDiff(
242
light checkout root: %s
243
checkout of branch: %s
246
control: Meta directory format 1
247
working tree: Working tree format 3
248
branch: Branch format 4
249
repository: Weave repository format 6
259
0 versioned subdirectories
270
""" % (tree5.bzrdir.root_transport.base,
271
branch1.bzrdir.root_transport.base,
272
datestring_first, datestring_first,
274
self.assertEqual('', err)
276
# Update initial standalone branch
277
self.build_tree(['standalone/b'])
279
tree1.commit('commit two')
280
rev = branch1.repository.get_revision(branch1.revision_history()[-1])
281
datestring_last = format_date(rev.timestamp, rev.timezone)
283
# Out of date branched standalone branch will not be detected
284
out, err = self.runbzr('info branch')
285
self.assertEqualDiff(
291
publish to branch: %s
294
control: All-in-one format 6
295
working tree: Working tree format 2
296
branch: Branch format 4
297
repository: Weave repository format 6
307
0 versioned subdirectories
318
""" % (branch2.bzrdir.root_transport.base,
319
branch1.bzrdir.root_transport.base,
320
branch1.bzrdir.root_transport.base,
321
datestring_first, datestring_first,
323
self.assertEqual('', err)
325
# Out of date bound branch
326
out, err = self.runbzr('info bound')
327
self.assertEqualDiff(
330
checkout of branch: %s
336
control: Meta directory format 1
337
working tree: Working tree format 3
338
branch: Branch format 5
341
Branch is out of date: missing 1 revision.
351
0 versioned subdirectories
362
""" % (branch3.bzrdir.root_transport.base,
363
branch1.bzrdir.root_transport.base,
364
branch1.bzrdir.root_transport.base,
365
branch3.repository._format.get_format_description(),
366
datestring_first, datestring_first,
367
# poking at _revision_store isn't all that clean, but neither is
368
# having the ui test dependent on the exact overhead of a given store.
369
branch3.repository._revision_store.total_size(
370
branch3.repository.get_transaction())[1] / 1024,
372
self.assertEqual('', err)
374
# Out of date checkout
375
out, err = self.runbzr('info checkout')
376
self.assertEqualDiff(
379
checkout of branch: %s
382
control: Meta directory format 1
383
working tree: Working tree format 3
384
branch: Branch format 5
387
Branch is out of date: missing 1 revision.
397
0 versioned subdirectories
408
""" % (branch4.bzrdir.root_transport.base,
409
branch1.bzrdir.root_transport.base,
410
branch4.repository._format.get_format_description(),
411
datestring_first, datestring_first,
412
# poking at _revision_store isn't all that clean, but neither is
413
# having the ui test dependent on the exact overhead of a given store.
414
branch4.repository._revision_store.total_size(
415
branch4.repository.get_transaction())[1] / 1024,
417
self.assertEqual('', err)
419
# Out of date lightweight checkout
420
out, err = self.runbzr('info lightcheckout --verbose')
421
self.assertEqualDiff(
423
light checkout root: %s
424
checkout of branch: %s
427
control: Meta directory format 1
428
working tree: Working tree format 3
429
branch: Branch format 4
430
repository: Weave repository format 6
432
Working tree is out of date: missing 1 revision.
442
0 versioned subdirectories
454
""" % (tree5.bzrdir.root_transport.base,
455
branch1.bzrdir.root_transport.base,
456
datestring_first, datestring_last,
458
self.assertEqual('', err)
460
def test_info_standalone_no_tree(self):
461
# create standalone branch without a working tree
462
format = bzrdir.format_registry.make_bzrdir('default')
463
branch = self.make_branch('branch')
464
repo = branch.repository
465
out, err = self.runbzr('info branch')
466
self.assertEqualDiff(
471
control: Meta directory format 1
472
branch: Branch format 5
481
""" % (branch.bzrdir.root_transport.base,
482
format.repository_format.get_format_description(),
484
self.assertEqual('', err)
486
def test_info_shared_repository(self):
487
format = bzrdir.format_registry.make_bzrdir('knit')
488
transport = self.get_transport()
490
# Create shared repository
491
repo = self.make_repository('repo', shared=True, format=format)
492
repo.set_make_working_trees(False)
493
out, err = self.runbzr('info repo')
494
self.assertEqualDiff(
496
shared repository: %s
499
control: Meta directory format 1
505
""" % (repo.bzrdir.root_transport.base,
506
format.repository_format.get_format_description(),
508
self.assertEqual('', err)
510
# Create branch inside shared repository
511
repo.bzrdir.root_transport.mkdir('branch')
512
branch1 = repo.bzrdir.create_branch_convenience('repo/branch',
514
out, err = self.runbzr('info repo/branch')
515
self.assertEqualDiff(
517
shared repository: %s
518
repository branch: branch
521
control: Meta directory format 1
522
branch: Branch format 5
531
""" % (repo.bzrdir.root_transport.base,
532
format.repository_format.get_format_description(),
534
self.assertEqual('', err)
536
# Create lightweight checkout
537
transport.mkdir('tree')
538
transport.mkdir('tree/lightcheckout')
539
tree2 = branch1.create_checkout('tree/lightcheckout',
541
branch2 = tree2.branch
542
self.assertCheckoutStatusOutput('tree/lightcheckout', tree2,
545
# Create normal checkout
546
tree3 = branch1.create_checkout('tree/checkout')
547
self.assertCheckoutStatusOutput('tree/checkout --verbose', tree3,
549
light_checkout=False, repo_branch=branch1)
550
# Update lightweight checkout
551
self.build_tree(['tree/lightcheckout/a'])
553
tree2.commit('commit one')
554
rev = repo.get_revision(branch2.revision_history()[0])
555
datestring_first = format_date(rev.timestamp, rev.timezone)
556
out, err = self.runbzr('info tree/lightcheckout --verbose')
557
self.assertEqualDiff(
559
light checkout root: %s
560
shared repository: %s
561
repository branch: branch
564
control: Meta directory format 1
565
working tree: Working tree format 3
566
branch: Branch format 5
577
0 versioned subdirectories
589
""" % (tree2.bzrdir.root_transport.base,
590
repo.bzrdir.root_transport.base,
591
format.repository_format.get_format_description(),
592
datestring_first, datestring_first,
593
# poking at _revision_store isn't all that clean, but neither is
594
# having the ui test dependent on the exact overhead of a given store.
595
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
597
self.assertEqual('', err)
599
# Out of date checkout
600
out, err = self.runbzr('info tree/checkout')
601
self.assertEqualDiff(
604
checkout of branch: %s
607
control: Meta directory format 1
608
working tree: Working tree format 3
609
branch: Branch format 5
612
Branch is out of date: missing 1 revision.
622
0 versioned subdirectories
630
""" % (tree3.bzrdir.root_transport.base,
631
branch1.bzrdir.root_transport.base,
632
format.repository_format.get_format_description(),
634
self.assertEqual('', err)
638
self.build_tree(['tree/checkout/b'])
640
out, err = self.runbzr('info tree/checkout --verbose')
641
self.assertEqualDiff(
644
checkout of branch: %s
647
control: Meta directory format 1
648
working tree: Working tree format 3
649
branch: Branch format 5
660
0 versioned subdirectories
672
""" % (tree3.bzrdir.root_transport.base, branch1.bzrdir.root_transport.base,
673
format.repository_format.get_format_description(),
674
datestring_first, datestring_first,
675
# poking at _revision_store isn't all that clean, but neither is
676
# having the ui test dependent on the exact overhead of a given store.
677
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
679
self.assertEqual('', err)
680
tree3.commit('commit two')
682
# Out of date lightweight checkout
683
rev = repo.get_revision(branch1.revision_history()[-1])
684
datestring_last = format_date(rev.timestamp, rev.timezone)
685
out, err = self.runbzr('info tree/lightcheckout --verbose')
686
self.assertEqualDiff(
688
light checkout root: %s
689
shared repository: %s
690
repository branch: branch
693
control: Meta directory format 1
694
working tree: Working tree format 3
695
branch: Branch format 5
698
Working tree is out of date: missing 1 revision.
708
0 versioned subdirectories
720
""" % (tree2.bzrdir.root_transport.base,
721
repo.bzrdir.root_transport.base,
722
format.repository_format.get_format_description(),
723
datestring_first, datestring_last,
724
# poking at _revision_store isn't all that clean, but neither is
725
# having the ui test dependent on the exact overhead of a given store.
726
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
728
self.assertEqual('', err)
730
# Show info about shared branch
731
out, err = self.runbzr('info repo/branch --verbose')
732
self.assertEqualDiff(
734
shared repository: %s
735
repository branch: branch
738
control: Meta directory format 1
739
branch: Branch format 5
752
""" % (repo.bzrdir.root_transport.base,
753
format.repository_format.get_format_description(),
754
datestring_first, datestring_last,
755
# poking at _revision_store isn't all that clean, but neither is
756
# having the ui test dependent on the exact overhead of a given store.
757
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
759
self.assertEqual('', err)
761
# Show info about repository with revisions
762
out, err = self.runbzr('info repo')
763
self.assertEqualDiff(
765
shared repository: %s
768
control: Meta directory format 1
774
""" % (repo.bzrdir.root_transport.base,
775
format.repository_format.get_format_description(),
776
# poking at _revision_store isn't all that clean, but neither is
777
# having the ui test dependent on the exact overhead of a given store.
778
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
780
self.assertEqual('', err)
782
def test_info_shared_repository_with_trees(self):
783
format = bzrdir.format_registry.make_bzrdir('knit')
784
transport = self.get_transport()
786
# Create shared repository with working trees
787
repo = self.make_repository('repo', shared=True, format=format)
788
repo.set_make_working_trees(True)
789
out, err = self.runbzr('info repo')
790
self.assertEqualDiff(
792
shared repository: %s
795
control: Meta directory format 1
798
Create working tree for new branches inside the repository.
803
""" % (repo.bzrdir.root_transport.base,
804
format.repository_format.get_format_description(),
806
self.assertEqual('', err)
808
# Create two branches
809
repo.bzrdir.root_transport.mkdir('branch1')
810
branch1 = repo.bzrdir.create_branch_convenience('repo/branch1',
812
branch2 = branch1.bzrdir.sprout('repo/branch2').open_branch()
815
out, err = self.runbzr('info repo/branch1 --verbose')
816
self.assertEqualDiff(
818
shared repository: %s
819
repository checkout: branch1
822
control: Meta directory format 1
823
working tree: Working tree format 3
824
branch: Branch format 5
835
0 versioned subdirectories
844
""" % (repo.bzrdir.root_transport.base,
845
format.repository_format.get_format_description(),
847
self.assertEqual('', err)
849
# Update first branch
850
self.build_tree(['repo/branch1/a'])
851
tree1 = branch1.bzrdir.open_workingtree()
853
tree1.commit('commit one')
854
rev = repo.get_revision(branch1.revision_history()[0])
855
datestring_first = format_date(rev.timestamp, rev.timezone)
856
out, err = self.runbzr('info repo/branch1')
857
self.assertEqualDiff(
859
shared repository: %s
860
repository checkout: branch1
863
control: Meta directory format 1
864
working tree: Working tree format 3
865
branch: Branch format 5
876
0 versioned subdirectories
887
""" % (repo.bzrdir.root_transport.base,
888
format.repository_format.get_format_description(),
889
datestring_first, datestring_first,
890
# poking at _revision_store isn't all that clean, but neither is
891
# having the ui test dependent on the exact overhead of a given store.
892
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
894
self.assertEqual('', err)
896
# Out of date second branch
897
out, err = self.runbzr('info repo/branch2 --verbose')
898
self.assertEqualDiff(
900
shared repository: %s
901
repository checkout: branch2
907
control: Meta directory format 1
908
working tree: Working tree format 3
909
branch: Branch format 5
920
0 versioned subdirectories
929
""" % (repo.bzrdir.root_transport.base,
930
branch1.bzrdir.root_transport.base,
931
format.repository_format.get_format_description(),
932
# poking at _revision_store isn't all that clean, but neither is
933
# having the ui test dependent on the exact overhead of a given store.
934
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
936
self.assertEqual('', err)
938
# Update second branch
939
tree2 = branch2.bzrdir.open_workingtree()
941
out, err = self.runbzr('info repo/branch2')
942
self.assertEqualDiff(
944
shared repository: %s
945
repository checkout: branch2
951
control: Meta directory format 1
952
working tree: Working tree format 3
953
branch: Branch format 5
964
0 versioned subdirectories
975
""" % (repo.bzrdir.root_transport.base,
976
branch1.bzrdir.root_transport.base,
977
format.repository_format.get_format_description(),
978
datestring_first, datestring_first,
979
# poking at _revision_store isn't all that clean, but neither is
980
# having the ui test dependent on the exact overhead of a given store.
981
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
983
self.assertEqual('', err)
985
# Show info about repository with revisions
986
out, err = self.runbzr('info repo')
987
self.assertEqualDiff(
989
shared repository: %s
992
control: Meta directory format 1
995
Create working tree for new branches inside the repository.
1000
""" % (repo.bzrdir.root_transport.base,
1001
format.repository_format.get_format_description(),
1002
# poking at _revision_store isn't all that clean, but neither is
1003
# having the ui test dependent on the exact overhead of a given store.
1004
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
1007
self.assertEqual('', err)
1009
def test_info_shared_repository_with_tree_in_root(self):
1010
format = bzrdir.format_registry.make_bzrdir('knit')
1011
transport = self.get_transport()
1013
# Create shared repository with working trees
1014
repo = self.make_repository('repo', shared=True, format=format)
1015
repo.set_make_working_trees(True)
1016
out, err = self.runbzr('info repo')
1017
self.assertEqualDiff(
1019
shared repository: %s
1022
control: Meta directory format 1
1025
Create working tree for new branches inside the repository.
1030
""" % (repo.bzrdir.root_transport.base,
1031
format.repository_format.get_format_description(),
1033
self.assertEqual('', err)
1035
# Create branch in root of repository
1036
control = repo.bzrdir
1037
branch = control.create_branch()
1038
control.create_workingtree()
1039
out, err = self.runbzr('info repo')
1040
self.assertEqualDiff(
1042
shared repository: %s
1043
repository checkout: .
1046
control: Meta directory format 1
1047
working tree: Working tree format 3
1048
branch: Branch format 5
1051
In the working tree:
1059
0 versioned subdirectories
1067
""" % (repo.bzrdir.root_transport.base,
1068
format.repository_format.get_format_description(),
1070
self.assertEqual('', err)
1072
def assertCheckoutStatusOutput(self,
1073
command_string, lco_tree, shared_repo=None,
1076
branch_locked=False, repo_locked=False,
1078
light_checkout=True):
1079
"""Check the output of info in a light checkout tree.
1081
This is not quite a mirror of the info code: rather than using the
1082
tree being examined to predict output, it uses a bunch of flags which
1083
allow us, the test writers, to document what *should* be present in
1084
the output. Removing this separation would remove the value of the
1087
:param path: the path to the light checkout.
1088
:param lco_tree: the tree object for the light checkout.
1089
:param shared_repo: A shared repository is in use, expect that in
1091
:param repo_branch: A branch in a shared repository for non light
1093
:param tree_locked: If true, expect the tree to be locked.
1094
:param branch_locked: If true, expect the branch to be locked.
1095
:param repo_locked: If true, expect the repository to be locked.
1096
:param verbose: If true, expect verbose output
1098
out, err = self.runbzr('info %s' % command_string)
1099
if repo_locked or branch_locked or tree_locked:
1100
def locked_message(a_bool):
1105
expected_lock_output = (
1108
" working tree: %s\n"
1110
" repository: %s\n" % (
1111
locked_message(tree_locked),
1112
locked_message(branch_locked),
1113
locked_message(repo_locked)))
1115
expected_lock_output = ''
1117
tree_data = (" light checkout root: %s" %
1118
lco_tree.bzrdir.root_transport.base)
1120
tree_data = (" checkout root: %s" %
1121
lco_tree.bzrdir.root_transport.base)
1122
if shared_repo is not None:
1124
" shared repository: %s\n"
1125
" repository branch: branch\n" %
1126
shared_repo.bzrdir.root_transport.base)
1127
elif repo_branch is not None:
1129
" checkout of branch: %s\n" %
1130
repo_branch.bzrdir.root_transport.base)
1132
branch_data = (" checkout of branch: %s\n" %
1133
lco_tree.branch.bzrdir.root_transport.base)
1136
verbose_info = ' 0 committers\n'
1140
self.assertEqualDiff(
1145
control: Meta directory format 1
1147
branch: Branch format 5
1150
In the working tree:
1158
0 versioned subdirectories
1168
lco_tree._format.get_format_description(),
1169
lco_tree.branch.repository._format.get_format_description(),
1170
expected_lock_output,
1173
self.assertEqual('', err)
1175
def test_info_locking(self):
1176
transport = self.get_transport()
1177
# Create shared repository with a branch
1178
repo = self.make_repository('repo', shared=True,
1179
format=bzrlib.bzrdir.BzrDirMetaFormat1())
1180
repo.set_make_working_trees(False)
1181
repo.bzrdir.root_transport.mkdir('branch')
1182
repo_branch = repo.bzrdir.create_branch_convenience('repo/branch',
1183
format=bzrlib.bzrdir.BzrDirMetaFormat1())
1184
# Do a heavy checkout
1185
transport.mkdir('tree')
1186
transport.mkdir('tree/checkout')
1187
co_branch = bzrlib.bzrdir.BzrDir.create_branch_convenience('tree/checkout',
1188
format=bzrlib.bzrdir.BzrDirMetaFormat1())
1189
co_branch.bind(repo_branch)
1190
# Do a light checkout of the heavy one
1191
transport.mkdir('tree/lightcheckout')
1192
lco_dir = bzrlib.bzrdir.BzrDirMetaFormat1().initialize('tree/lightcheckout')
1193
bzrlib.branch.BranchReferenceFormat().initialize(lco_dir, co_branch)
1194
lco_dir.create_workingtree()
1195
lco_tree = lco_dir.open_workingtree()
1197
# Test all permutations of locking the working tree, branch and repository
1201
self.assertCheckoutStatusOutput('tree/lightcheckout', lco_tree)
1203
lco_tree.branch.repository.lock_write()
1205
self.assertCheckoutStatusOutput('tree/lightcheckout',
1209
lco_tree.branch.repository.unlock()
1211
lco_tree.branch.lock_write()
1213
self.assertCheckoutStatusOutput('tree/lightcheckout',
1218
lco_tree.branch.unlock()
1220
lco_tree.lock_write()
1222
self.assertCheckoutStatusOutput('tree/lightcheckout',
1230
lco_tree.lock_write()
1231
lco_tree.branch.repository.unlock()
1233
self.assertCheckoutStatusOutput('tree/lightcheckout',
1238
lco_tree.branch.repository.lock_write()
1241
lco_tree.lock_write()
1242
lco_tree.branch.unlock()
1244
self.assertCheckoutStatusOutput('tree/lightcheckout',
1248
lco_tree.branch.lock_write()
1251
lco_tree.lock_write()
1252
lco_tree.branch.unlock()
1253
lco_tree.branch.repository.lock_write()
1255
self.assertCheckoutStatusOutput('tree/lightcheckout',
1260
lco_tree.branch.repository.unlock()
1261
lco_tree.branch.lock_write()
1264
lco_tree.branch.lock_write()
1265
lco_tree.branch.repository.unlock()
1267
self.assertCheckoutStatusOutput('tree/lightcheckout',
1271
lco_tree.branch.repository.lock_write()
1272
lco_tree.branch.unlock()
1274
def test_info_locking_oslocks(self):
1275
if sys.platform == "win32":
1276
raise TestSkipped("don't use oslocks on win32 in unix manner")
1278
tree = self.make_branch_and_tree('branch',
1279
format=bzrlib.bzrdir.BzrDirFormat6())
1281
# Test all permutations of locking the working tree, branch and repository
1282
# XXX: Well not yet, as we can't query oslocks yet. Currently, it's
1283
# implemented by raising NotImplementedError and get_physical_lock_status()
1284
# always returns false. This makes bzr info hide the lock status. (Olaf)
1288
out, err = self.runbzr('info branch')
1289
self.assertEqualDiff(
1294
control: All-in-one format 6
1295
working tree: Working tree format 2
1296
branch: Branch format 4
1299
In the working tree:
1307
0 versioned subdirectories
1315
""" % (tree.bzrdir.root_transport.base,
1316
tree.branch.repository._format.get_format_description(),
1318
self.assertEqual('', err)
1321
out, err = self.runbzr('info branch')
1322
self.assertEqualDiff(
1327
control: All-in-one format 6
1328
working tree: Working tree format 2
1329
branch: Branch format 4
1332
In the working tree:
1340
0 versioned subdirectories
1348
""" % (tree.bzrdir.root_transport.base,
1349
tree.branch.repository._format.get_format_description(),
1351
self.assertEqual('', err)