36
30
class TestInfo(ExternalBase):
38
32
def test_info_non_existing(self):
39
if sys.platform == "win32":
40
location = "C:/i/do/not/exist/"
42
location = "/i/do/not/exist/"
43
out, err = self.run_bzr('info '+location, retcode=3)
33
out, err = self.runbzr('info /i/do/not/exist/', retcode=3)
44
34
self.assertEqual(out, '')
45
self.assertEqual(err, 'bzr: ERROR: Not a branch: "%s".\n' % location)
35
self.assertEqual(err, 'bzr: ERROR: Not a branch: /i/do/not/exist/\n')
47
37
def test_info_standalone(self):
48
38
transport = self.get_transport()
50
40
# Create initial standalone branch
51
tree1 = self.make_branch_and_tree('standalone', 'weave')
41
old_format = bzrlib.bzrdir.BzrDirFormat.get_default_format()
42
bzrlib.bzrdir.BzrDirFormat.set_default_format(bzrlib.bzrdir.BzrDirFormat6())
43
tree1 = self.make_branch_and_tree('standalone')
44
bzrlib.bzrdir.BzrDirFormat.set_default_format(old_format)
52
45
self.build_tree(['standalone/a'])
54
47
branch1 = tree1.branch
56
out, err = self.run_bzr('info standalone')
58
"""Standalone tree (format: weave)
60
branch root: standalone
62
self.assertEqual('', err)
64
out, err = self.run_bzr('info standalone -v')
66
"""Standalone tree (format: weave)
68
branch root: standalone
48
out, err = self.runbzr('info standalone')
71
54
control: All-in-one format 6
144
113
first revision: %s
145
114
latest revision: %s
149
""" % (datestring_first, datestring_first,
119
""" % (branch2.bzrdir.root_transport.base,
120
branch1.bzrdir.root_transport.base,
121
branch1.bzrdir.root_transport.base,
122
datestring_first, datestring_first,
123
# poking at _revision_store isn't all that clean, but neither is
124
# having the ui test dependent on the exact overhead of a given store.
125
branch2.repository._revision_store.total_size(
126
branch2.repository.get_transaction())[1] / 1024,
151
128
self.assertEqual('', err)
153
130
# Branch and bind to standalone, needs upgrade to metadir
154
131
# (creates backup as unknown)
155
132
branch1.bzrdir.sprout('bound')
156
knit1_format = bzrdir.format_registry.make_bzrdir('knit')
157
upgrade.upgrade('bound', knit1_format)
158
branch3 = bzrdir.BzrDir.open('bound').open_branch()
133
bzrlib.upgrade.upgrade('bound', bzrlib.bzrdir.BzrDirMetaFormat1())
134
branch3 = bzrlib.bzrdir.BzrDir.open('bound').open_branch()
159
135
branch3.bind(branch1)
160
bound_tree = branch3.bzrdir.open_workingtree()
161
out, err = self.run_bzr('info -v bound')
136
out, err = self.runbzr('info bound')
162
137
self.assertEqualDiff(
163
"""Checkout (format: knit)
166
checkout of branch: standalone
140
checkout of branch: %s
168
142
Related branches:
169
parent branch: standalone
172
146
control: Meta directory format 1
147
working tree: Working tree format 3
148
branch: Branch format 5
177
151
In the working tree:
191
164
first revision: %s
192
165
latest revision: %s
196
""" % (bound_tree._format.get_format_description(),
197
branch3._format.get_format_description(),
170
""" % (branch3.bzrdir.root_transport.base,
171
branch1.bzrdir.root_transport.base,
172
branch1.bzrdir.root_transport.base,
198
173
branch3.repository._format.get_format_description(),
199
174
datestring_first, datestring_first,
175
# poking at _revision_store isn't all that clean, but neither is
176
# having the ui test dependent on the exact overhead of a given store.
177
branch3.repository._revision_store.total_size(
178
branch3.repository.get_transaction())[1] / 1024,
201
180
self.assertEqual('', err)
203
182
# Checkout standalone (same as above, but does not have parent set)
204
branch4 = bzrdir.BzrDir.create_branch_convenience('checkout',
183
old_format = bzrlib.bzrdir.BzrDirFormat.get_default_format()
184
bzrlib.bzrdir.BzrDirFormat.set_default_format(bzrlib.bzrdir.BzrDirMetaFormat1())
185
branch4 = bzrlib.bzrdir.BzrDir.create_branch_convenience('checkout')
186
bzrlib.bzrdir.BzrDirFormat.set_default_format(old_format)
206
187
branch4.bind(branch1)
207
188
branch4.bzrdir.open_workingtree().update()
208
out, err = self.run_bzr('info checkout --verbose')
189
out, err = self.runbzr('info checkout --verbose')
209
190
self.assertEqualDiff(
210
"""Checkout (format: knit)
212
checkout root: checkout
213
checkout of branch: standalone
193
checkout of branch: %s
216
196
control: Meta directory format 1
235
215
first revision: %s
236
216
latest revision: %s
240
""" % (branch4.repository._format.get_format_description(),
221
""" % (branch4.bzrdir.root_transport.base,
222
branch1.bzrdir.root_transport.base,
223
branch4.repository._format.get_format_description(),
241
224
datestring_first, datestring_first,
225
# poking at _revision_store isn't all that clean, but neither is
226
# having the ui test dependent on the exact overhead of a given store.
227
branch4.repository._revision_store.total_size(
228
branch4.repository.get_transaction())[1] / 1024,
243
230
self.assertEqual('', err)
245
232
# Lightweight checkout (same as above, different branch and repository)
246
tree5 = branch1.create_checkout('lightcheckout', lightweight=True)
233
old_format = bzrlib.bzrdir.BzrDirFormat.get_default_format()
234
bzrlib.bzrdir.BzrDirFormat.set_default_format(bzrlib.bzrdir.BzrDirMetaFormat1())
235
transport.mkdir('lightcheckout')
236
dir5 = bzrlib.bzrdir.BzrDirMetaFormat1().initialize('lightcheckout')
237
bzrlib.branch.BranchReferenceFormat().initialize(dir5, branch1)
238
dir5.create_workingtree()
239
tree5 = dir5.open_workingtree()
240
bzrlib.bzrdir.BzrDirFormat.set_default_format(old_format)
247
241
branch5 = tree5.branch
248
out, err = self.run_bzr('info -v lightcheckout')
242
out, err = self.runbzr('info lightcheckout')
249
243
self.assertEqualDiff(
250
"""Lightweight checkout (format: 1.6 or 1.6.1-rich-root \
251
or dirstate or dirstate-tags or \
252
pack-0.92 or rich-root or rich-root-pack)
254
light checkout root: lightcheckout
255
checkout of branch: standalone
245
light checkout root: %s
246
checkout of branch: %s
258
249
control: Meta directory format 1
259
working tree: Working tree format 4
250
working tree: Working tree format 3
260
251
branch: Branch format 4
261
252
repository: Weave repository format 6
405
405
first revision: %s
406
406
latest revision: %s
410
""" % (branch4.repository._format.get_format_description(),
411
""" % (branch4.bzrdir.root_transport.base,
412
branch1.bzrdir.root_transport.base,
413
branch4.repository._format.get_format_description(),
411
414
datestring_first, datestring_first,
415
# poking at _revision_store isn't all that clean, but neither is
416
# having the ui test dependent on the exact overhead of a given store.
417
branch4.repository._revision_store.total_size(
418
branch4.repository.get_transaction())[1] / 1024,
413
420
self.assertEqual('', err)
415
422
# Out of date lightweight checkout
416
out, err = self.run_bzr('info lightcheckout --verbose')
423
out, err = self.runbzr('info lightcheckout --verbose')
417
424
self.assertEqualDiff(
418
"""Lightweight checkout (format: 1.6 or 1.6.1-rich-root or \
419
dirstate or dirstate-tags or \
420
pack-0.92 or rich-root or rich-root-pack)
422
light checkout root: lightcheckout
423
checkout of branch: standalone
426
light checkout root: %s
427
checkout of branch: %s
426
430
control: Meta directory format 1
427
working tree: Working tree format 4
431
working tree: Working tree format 3
428
432
branch: Branch format 4
429
433
repository: Weave repository format 6
447
451
first revision: %s
448
452
latest revision: %s
452
""" % (datestring_first, datestring_last,), out)
457
""" % (tree5.bzrdir.root_transport.base,
458
branch1.bzrdir.root_transport.base,
459
datestring_first, datestring_last,
453
461
self.assertEqual('', err)
455
463
def test_info_standalone_no_tree(self):
456
464
# create standalone branch without a working tree
457
format = bzrdir.format_registry.make_bzrdir('default')
458
465
branch = self.make_branch('branch')
459
466
repo = branch.repository
460
out, err = self.run_bzr('info branch -v')
467
out, err = self.runbzr('info branch')
461
468
self.assertEqualDiff(
462
"""Standalone branch (format: %s)
467
473
control: Meta directory format 1
474
branch: Branch format 5
477
""" % (info.describe_format(repo.bzrdir, repo, branch, None),
478
format.get_branch_format().get_format_description(),
479
format.repository_format.get_format_description(),
483
""" % (branch.bzrdir.root_transport.base,
484
repo._format.get_format_description(),
481
486
self.assertEqual('', err)
483
488
def test_info_shared_repository(self):
484
format = bzrdir.format_registry.make_bzrdir('knit')
489
old_format = bzrlib.bzrdir.BzrDirFormat.get_default_format()
490
bzrlib.bzrdir.BzrDirFormat.set_default_format(bzrlib.bzrdir.BzrDirMetaFormat1())
485
491
transport = self.get_transport()
487
493
# Create shared repository
488
repo = self.make_repository('repo', shared=True, format=format)
494
repo = self.make_repository('repo', shared=True)
489
495
repo.set_make_working_trees(False)
490
out, err = self.run_bzr('info -v repo')
496
out, err = self.runbzr('info repo')
491
497
self.assertEqualDiff(
492
"""Shared repository (format: dirstate or dirstate-tags or knit)
494
499
shared repository: %s
497
502
control: Meta directory format 1
502
""" % ('repo', format.repository_format.get_format_description(),
508
""" % (repo.bzrdir.root_transport.base,
509
repo._format.get_format_description(),
504
511
self.assertEqual('', err)
506
513
# Create branch inside shared repository
507
514
repo.bzrdir.root_transport.mkdir('branch')
508
branch1 = repo.bzrdir.create_branch_convenience('repo/branch',
510
out, err = self.run_bzr('info -v repo/branch')
515
branch1 = repo.bzrdir.create_branch_convenience('repo/branch')
516
out, err = self.runbzr('info repo/branch')
511
517
self.assertEqualDiff(
512
"""Repository branch (format: dirstate or knit)
514
shared repository: repo
515
repository branch: repo/branch
519
shared repository: %s
520
repository branch: branch
518
523
control: Meta directory format 1
524
branch: Branch format 5
528
""" % (format.get_branch_format().get_format_description(),
529
format.repository_format.get_format_description(),
533
""" % (repo.bzrdir.root_transport.base,
534
repo._format.get_format_description(),
531
536
self.assertEqual('', err)
533
538
# Create lightweight checkout
534
539
transport.mkdir('tree')
535
540
transport.mkdir('tree/lightcheckout')
536
tree2 = branch1.create_checkout('tree/lightcheckout',
541
dir2 = bzrlib.bzrdir.BzrDirMetaFormat1().initialize('tree/lightcheckout')
542
bzrlib.branch.BranchReferenceFormat().initialize(dir2, branch1)
543
dir2.create_workingtree()
544
tree2 = dir2.open_workingtree()
538
545
branch2 = tree2.branch
539
self.assertCheckoutStatusOutput('-v tree/lightcheckout', tree2,
540
shared_repo=repo, repo_branch=branch1, verbose=True)
546
out, err = self.runbzr('info tree/lightcheckout')
547
self.assertEqualDiff(
549
light checkout root: %s
550
shared repository: %s
551
repository branch: branch
554
control: Meta directory format 1
555
working tree: Working tree format 3
556
branch: Branch format 5
567
0 versioned subdirectories
575
""" % (tree2.bzrdir.root_transport.base,
576
repo.bzrdir.root_transport.base,
577
repo._format.get_format_description(),
579
self.assertEqual('', err)
542
581
# Create normal checkout
543
tree3 = branch1.create_checkout('tree/checkout')
544
self.assertCheckoutStatusOutput('tree/checkout --verbose', tree3,
546
light_checkout=False, repo_branch=branch1)
582
branch3 = bzrlib.bzrdir.BzrDir.create_branch_convenience('tree/checkout')
583
branch3.bind(branch1)
584
tree3 = branch3.bzrdir.open_workingtree()
586
out, err = self.runbzr('info tree/checkout --verbose')
587
self.assertEqualDiff(
590
checkout of branch: %s
593
control: Meta directory format 1
594
working tree: Working tree format 3
595
branch: Branch format 5
606
0 versioned subdirectories
615
""" % (branch3.bzrdir.root_transport.base,
616
branch1.bzrdir.root_transport.base,
617
repo._format.get_format_description(),
619
self.assertEqual('', err)
547
621
# Update lightweight checkout
548
622
self.build_tree(['tree/lightcheckout/a'])
550
624
tree2.commit('commit one')
551
625
rev = repo.get_revision(branch2.revision_history()[0])
552
626
datestring_first = format_date(rev.timestamp, rev.timezone)
553
out, err = self.run_bzr('info tree/lightcheckout --verbose')
627
out, err = self.runbzr('info tree/lightcheckout --verbose')
554
628
self.assertEqualDiff(
555
"""Lightweight checkout (format: 1.6 or 1.6.1-rich-root or \
556
dirstate or dirstate-tags or \
557
pack-0.92 or rich-root or rich-root-pack)
559
light checkout root: tree/lightcheckout
560
checkout of branch: repo/branch
561
shared repository: repo
630
light checkout root: %s
631
shared repository: %s
632
repository branch: branch
564
635
control: Meta directory format 1
565
working tree: Working tree format 4
636
working tree: Working tree format 3
637
branch: Branch format 5
569
640
In the working tree:
583
654
first revision: %s
584
655
latest revision: %s
588
""" % (format.get_branch_format().get_format_description(),
589
format.repository_format.get_format_description(),
660
""" % (tree2.bzrdir.root_transport.base,
661
repo.bzrdir.root_transport.base,
662
repo._format.get_format_description(),
590
663
datestring_first, datestring_first,
664
# poking at _revision_store isn't all that clean, but neither is
665
# having the ui test dependent on the exact overhead of a given store.
666
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
592
668
self.assertEqual('', err)
594
670
# Out of date checkout
595
out, err = self.run_bzr('info -v tree/checkout')
671
out, err = self.runbzr('info tree/checkout')
596
672
self.assertEqualDiff(
597
"""Checkout (format: dirstate)
599
checkout root: tree/checkout
600
checkout of branch: repo/branch
675
checkout of branch: %s
603
678
control: Meta directory format 1
604
working tree: Working tree format 4
679
working tree: Working tree format 3
680
branch: Branch format 5
608
683
Branch is out of date: missing 1 revision.
737
817
first revision: %s
738
818
latest revision: %s
742
""" % (format.get_branch_format().get_format_description(),
743
format.repository_format.get_format_description(),
823
""" % (repo.bzrdir.root_transport.base,
824
repo._format.get_format_description(),
744
825
datestring_first, datestring_last,
826
# poking at _revision_store isn't all that clean, but neither is
827
# having the ui test dependent on the exact overhead of a given store.
828
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
746
830
self.assertEqual('', err)
748
832
# Show info about repository with revisions
749
out, err = self.run_bzr('info -v repo')
833
out, err = self.runbzr('info repo')
750
834
self.assertEqualDiff(
751
"""Shared repository (format: dirstate or dirstate-tags or knit)
753
shared repository: repo
836
shared repository: %s
756
839
control: Meta directory format 1
761
""" % (format.repository_format.get_format_description(),
845
""" % (repo.bzrdir.root_transport.base,
846
repo._format.get_format_description(),
847
# poking at _revision_store isn't all that clean, but neither is
848
# having the ui test dependent on the exact overhead of a given store.
849
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
763
851
self.assertEqual('', err)
853
bzrlib.bzrdir.BzrDirFormat.set_default_format(old_format)
765
855
def test_info_shared_repository_with_trees(self):
766
format = bzrdir.format_registry.make_bzrdir('knit')
856
old_format = bzrlib.bzrdir.BzrDirFormat.get_default_format()
857
bzrlib.bzrdir.BzrDirFormat.set_default_format(bzrlib.bzrdir.BzrDirMetaFormat1())
767
858
transport = self.get_transport()
769
860
# Create shared repository with working trees
770
repo = self.make_repository('repo', shared=True, format=format)
861
repo = self.make_repository('repo', shared=True)
771
862
repo.set_make_working_trees(True)
772
out, err = self.run_bzr('info -v repo')
863
out, err = self.runbzr('info repo')
773
864
self.assertEqualDiff(
774
"""Shared repository with trees (format: dirstate or dirstate-tags or knit)
776
shared repository: repo
866
shared repository: %s
779
869
control: Meta directory format 1
969
1068
Create working tree for new branches inside the repository.
973
""" % (format.repository_format.get_format_description(),
1073
""" % (repo.bzrdir.root_transport.base,
1074
repo._format.get_format_description(),
1075
# poking at _revision_store isn't all that clean, but neither is
1076
# having the ui test dependent on the exact overhead of a given store.
1077
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
976
1080
self.assertEqual('', err)
1082
bzrlib.bzrdir.BzrDirFormat.set_default_format(old_format)
978
1084
def test_info_shared_repository_with_tree_in_root(self):
979
format = bzrdir.format_registry.make_bzrdir('knit')
1085
old_format = bzrlib.bzrdir.BzrDirFormat.get_default_format()
1086
bzrlib.bzrdir.BzrDirFormat.set_default_format(bzrlib.bzrdir.BzrDirMetaFormat1())
980
1087
transport = self.get_transport()
982
1089
# Create shared repository with working trees
983
repo = self.make_repository('repo', shared=True, format=format)
1090
repo = self.make_repository('repo', shared=True)
984
1091
repo.set_make_working_trees(True)
985
out, err = self.run_bzr('info -v repo')
1092
out, err = self.runbzr('info repo')
986
1093
self.assertEqualDiff(
987
"""Shared repository with trees (format: dirstate or dirstate-tags or knit)
989
shared repository: repo
1095
shared repository: %s
992
1098
control: Meta directory format 1
1030
1137
Branch history:
1036
""" % (format.get_branch_format().get_format_description(),
1037
format.repository_format.get_format_description(),
1143
""" % (repo.bzrdir.root_transport.base,
1144
repo._format.get_format_description(),
1039
1146
self.assertEqual('', err)
1041
def assertCheckoutStatusOutput(self,
1042
command_string, lco_tree, shared_repo=None,
1045
branch_locked=False, repo_locked=False,
1047
light_checkout=True,
1048
checkout_root=None):
1049
"""Check the output of info in a checkout.
1051
This is not quite a mirror of the info code: rather than using the
1052
tree being examined to predict output, it uses a bunch of flags which
1053
allow us, the test writers, to document what *should* be present in
1054
the output. Removing this separation would remove the value of the
1057
:param path: the path to the light checkout.
1058
:param lco_tree: the tree object for the light checkout.
1059
:param shared_repo: A shared repository is in use, expect that in
1061
:param repo_branch: A branch in a shared repository for non light
1063
:param tree_locked: If true, expect the tree to be locked.
1064
:param branch_locked: If true, expect the branch to be locked.
1065
:param repo_locked: If true, expect the repository to be locked.
1066
Note that the lco_tree.branch.repository is inspected, and if is not
1067
actually locked then this parameter is overridden. This is because
1068
pack repositories do not have any public API for obtaining an
1069
exclusive repository wide lock.
1070
:param verbose: If true, expect verbose output
1072
def friendly_location(url):
1073
path = urlutils.unescape_for_display(url, 'ascii')
1075
return osutils.relpath(osutils.getcwd(), path)
1076
except errors.PathNotChild:
1080
# We expect this to fail because of locking errors.
1081
# (A write-locked file cannot be read-locked
1082
# in the different process -- either on win32 or on linux).
1083
# This should be removed when the locking errors are fixed.
1084
self.expectFailure('OS locks are exclusive '
1085
'for different processes (Bug #174055)',
1086
self.run_bzr_subprocess,
1087
'info ' + command_string)
1088
out, err = self.run_bzr('info %s' % command_string)
1090
(True, True): 'Lightweight checkout',
1091
(True, False): 'Repository checkout',
1092
(False, True): 'Lightweight checkout',
1093
(False, False): 'Checkout',
1094
}[(shared_repo is not None, light_checkout)]
1095
format = {True: '1.6 or 1.6.1-rich-root'
1096
' or dirstate or dirstate-tags or pack-0.92'
1097
' or rich-root or rich-root-pack',
1098
False: 'dirstate'}[light_checkout]
1100
repo_locked = lco_tree.branch.repository.get_physical_lock_status()
1101
if repo_locked or branch_locked or tree_locked:
1102
def locked_message(a_bool):
1107
expected_lock_output = (
1110
" working tree: %s\n"
1112
" repository: %s\n" % (
1113
locked_message(tree_locked),
1114
locked_message(branch_locked),
1115
locked_message(repo_locked)))
1117
expected_lock_output = ''
1121
tree_data = (" light checkout root: %s\n" %
1122
friendly_location(lco_tree.bzrdir.root_transport.base))
1124
if lco_tree.branch.get_bound_location() is not None:
1125
tree_data += ("%s checkout root: %s\n" % (extra_space,
1126
friendly_location(lco_tree.branch.bzrdir.root_transport.base)))
1127
if shared_repo is not None:
1129
" checkout of branch: %s\n"
1130
" shared repository: %s\n" %
1131
(friendly_location(repo_branch.bzrdir.root_transport.base),
1132
friendly_location(shared_repo.bzrdir.root_transport.base)))
1133
elif repo_branch is not None:
1135
"%s checkout of branch: %s\n" %
1137
friendly_location(repo_branch.bzrdir.root_transport.base)))
1139
branch_data = (" checkout of branch: %s\n" %
1140
lco_tree.branch.bzrdir.root_transport.base)
1143
verbose_info = ' 0 committers\n'
1147
self.assertEqualDiff(
1152
control: Meta directory format 1
1157
In the working tree:
1165
0 versioned subdirectories
1176
lco_tree._format.get_format_description(),
1177
lco_tree.branch._format.get_format_description(),
1178
lco_tree.branch.repository._format.get_format_description(),
1179
expected_lock_output,
1182
self.assertEqual('', err)
1148
bzrlib.bzrdir.BzrDirFormat.set_default_format(old_format)
1184
1150
def test_info_locking(self):
1185
1151
transport = self.get_transport()
1186
1152
# Create shared repository with a branch
1187
1153
repo = self.make_repository('repo', shared=True,
1188
format=bzrdir.BzrDirMetaFormat1())
1154
format=bzrlib.bzrdir.BzrDirMetaFormat1())
1189
1155
repo.set_make_working_trees(False)
1190
1156
repo.bzrdir.root_transport.mkdir('branch')
1191
1157
repo_branch = repo.bzrdir.create_branch_convenience('repo/branch',
1192
format=bzrdir.BzrDirMetaFormat1())
1158
format=bzrlib.bzrdir.BzrDirMetaFormat1())
1193
1159
# Do a heavy checkout
1194
1160
transport.mkdir('tree')
1195
1161
transport.mkdir('tree/checkout')
1196
co_branch = bzrdir.BzrDir.create_branch_convenience('tree/checkout',
1197
format=bzrdir.BzrDirMetaFormat1())
1162
co_branch = bzrlib.bzrdir.BzrDir.create_branch_convenience('tree/checkout',
1163
format=bzrlib.bzrdir.BzrDirMetaFormat1())
1198
1164
co_branch.bind(repo_branch)
1199
1165
# Do a light checkout of the heavy one
1200
1166
transport.mkdir('tree/lightcheckout')
1201
lco_dir = bzrdir.BzrDirMetaFormat1().initialize('tree/lightcheckout')
1202
branch.BranchReferenceFormat().initialize(lco_dir, co_branch)
1167
lco_dir = bzrlib.bzrdir.BzrDirMetaFormat1().initialize('tree/lightcheckout')
1168
bzrlib.branch.BranchReferenceFormat().initialize(lco_dir, co_branch)
1203
1169
lco_dir.create_workingtree()
1204
1170
lco_tree = lco_dir.open_workingtree()
1210
self.assertCheckoutStatusOutput('-v tree/lightcheckout', lco_tree,
1211
repo_branch=repo_branch,
1212
verbose=True, light_checkout=True)
1176
out, err = self.runbzr('info tree/lightcheckout')
1177
self.assertEqualDiff(
1179
light checkout root: %s
1180
checkout of branch: %s
1183
control: Meta directory format 1
1184
working tree: Working tree format 3
1185
branch: Branch format 5
1188
In the working tree:
1196
0 versioned subdirectories
1204
""" % (lco_tree.bzrdir.root_transport.base,
1205
lco_tree.branch.bzrdir.root_transport.base,
1206
lco_tree.branch.repository._format.get_format_description(),
1208
self.assertEqual('', err)
1214
1210
lco_tree.branch.repository.lock_write()
1216
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1217
lco_tree, repo_branch=repo_branch,
1218
repo_locked=True, verbose=True, light_checkout=True)
1220
lco_tree.branch.repository.unlock()
1211
out, err = self.runbzr('info tree/lightcheckout')
1212
self.assertEqualDiff(
1214
light checkout root: %s
1215
checkout of branch: %s
1218
control: Meta directory format 1
1219
working tree: Working tree format 3
1220
branch: Branch format 5
1224
working tree: unlocked
1228
In the working tree:
1236
0 versioned subdirectories
1244
""" % (lco_tree.bzrdir.root_transport.base,
1245
lco_tree.branch.bzrdir.root_transport.base,
1246
lco_tree.branch.repository._format.get_format_description(),
1248
self.assertEqual('', err)
1249
lco_tree.branch.repository.unlock()
1222
1251
lco_tree.branch.lock_write()
1224
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1228
repo_branch=repo_branch,
1231
lco_tree.branch.unlock()
1252
out, err = self.runbzr('info tree/lightcheckout')
1253
self.assertEqualDiff(
1255
light checkout root: %s
1256
checkout of branch: %s
1259
control: Meta directory format 1
1260
working tree: Working tree format 3
1261
branch: Branch format 5
1265
working tree: unlocked
1269
In the working tree:
1277
0 versioned subdirectories
1285
""" % (lco_tree.bzrdir.root_transport.base,
1286
lco_tree.branch.bzrdir.root_transport.base,
1287
lco_tree.branch.repository._format.get_format_description(),
1289
self.assertEqual('', err)
1290
lco_tree.branch.unlock()
1233
1292
lco_tree.lock_write()
1235
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1236
lco_tree, repo_branch=repo_branch,
1293
out, err = self.runbzr('info tree/lightcheckout')
1294
self.assertEqualDiff(
1296
light checkout root: %s
1297
checkout of branch: %s
1300
control: Meta directory format 1
1301
working tree: Working tree format 3
1302
branch: Branch format 5
1306
working tree: locked
1310
In the working tree:
1318
0 versioned subdirectories
1326
""" % (lco_tree.bzrdir.root_transport.base,
1327
lco_tree.branch.bzrdir.root_transport.base,
1328
lco_tree.branch.repository._format.get_format_description(),
1330
self.assertEqual('', err)
1244
1333
lco_tree.lock_write()
1245
1334
lco_tree.branch.repository.unlock()
1247
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1248
lco_tree, repo_branch=repo_branch,
1253
lco_tree.branch.repository.lock_write()
1335
out, err = self.runbzr('info tree/lightcheckout')
1336
self.assertEqualDiff(
1338
light checkout root: %s
1339
checkout of branch: %s
1342
control: Meta directory format 1
1343
working tree: Working tree format 3
1344
branch: Branch format 5
1348
working tree: locked
1350
repository: unlocked
1352
In the working tree:
1360
0 versioned subdirectories
1368
""" % (lco_tree.bzrdir.root_transport.base,
1369
lco_tree.branch.bzrdir.root_transport.base,
1370
lco_tree.branch.repository._format.get_format_description(),
1372
self.assertEqual('', err)
1373
lco_tree.branch.repository.lock_write()
1256
1376
lco_tree.lock_write()
1257
1377
lco_tree.branch.unlock()
1259
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1260
lco_tree, repo_branch=repo_branch,
1264
lco_tree.branch.lock_write()
1378
out, err = self.runbzr('info tree/lightcheckout')
1379
self.assertEqualDiff(
1381
light checkout root: %s
1382
checkout of branch: %s
1385
control: Meta directory format 1
1386
working tree: Working tree format 3
1387
branch: Branch format 5
1391
working tree: locked
1393
repository: unlocked
1395
In the working tree:
1403
0 versioned subdirectories
1411
""" % (lco_tree.bzrdir.root_transport.base,
1412
lco_tree.branch.bzrdir.root_transport.base,
1413
lco_tree.branch.repository._format.get_format_description(),
1415
self.assertEqual('', err)
1416
lco_tree.branch.lock_write()
1267
1419
lco_tree.lock_write()
1268
1420
lco_tree.branch.unlock()
1269
1421
lco_tree.branch.repository.lock_write()
1271
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1272
lco_tree, repo_branch=repo_branch,
1277
lco_tree.branch.repository.unlock()
1278
lco_tree.branch.lock_write()
1422
out, err = self.runbzr('info tree/lightcheckout')
1423
self.assertEqualDiff(
1425
light checkout root: %s
1426
checkout of branch: %s
1429
control: Meta directory format 1
1430
working tree: Working tree format 3
1431
branch: Branch format 5
1435
working tree: locked
1439
In the working tree:
1447
0 versioned subdirectories
1455
""" % (lco_tree.bzrdir.root_transport.base,
1456
lco_tree.branch.bzrdir.root_transport.base,
1457
lco_tree.branch.repository._format.get_format_description(),
1459
self.assertEqual('', err)
1460
lco_tree.branch.repository.unlock()
1461
lco_tree.branch.lock_write()
1281
1464
lco_tree.branch.lock_write()
1282
1465
lco_tree.branch.repository.unlock()
1284
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1285
lco_tree, repo_branch=repo_branch,
1289
lco_tree.branch.repository.lock_write()
1290
lco_tree.branch.unlock()
1292
if sys.platform == 'win32':
1293
self.knownFailure('Win32 cannot run "bzr info"'
1294
' when the tree is locked.')
1466
out, err = self.runbzr('info tree/lightcheckout')
1467
self.assertEqualDiff(
1469
light checkout root: %s
1470
checkout of branch: %s
1473
control: Meta directory format 1
1474
working tree: Working tree format 3
1475
branch: Branch format 5
1479
working tree: unlocked
1481
repository: unlocked
1483
In the working tree:
1491
0 versioned subdirectories
1499
""" % (lco_tree.bzrdir.root_transport.base,
1500
lco_tree.branch.bzrdir.root_transport.base,
1501
lco_tree.branch.repository._format.get_format_description(),
1503
self.assertEqual('', err)
1504
lco_tree.branch.repository.lock_write()
1505
lco_tree.branch.unlock()
1296
1507
def test_info_locking_oslocks(self):
1297
if sys.platform == "win32":
1298
raise TestSkipped("don't use oslocks on win32 in unix manner")
1300
1508
tree = self.make_branch_and_tree('branch',
1301
format=bzrdir.BzrDirFormat6())
1509
format=bzrlib.bzrdir.BzrDirFormat6())
1303
1511
# Test all permutations of locking the working tree, branch and repository
1304
1512
# XXX: Well not yet, as we can't query oslocks yet. Currently, it's