30
36
class TestInfo(ExternalBase):
32
38
def test_info_non_existing(self):
33
out, err = self.runbzr('info /i/do/not/exist/', retcode=3)
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)
34
44
self.assertEqual(out, '')
35
self.assertEqual(err, 'bzr: ERROR: Not a branch: /i/do/not/exist/\n')
45
self.assertEqual(err, 'bzr: ERROR: Not a branch: "%s".\n' % location)
37
47
def test_info_standalone(self):
38
48
transport = self.get_transport()
40
50
# Create initial standalone branch
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)
51
tree1 = self.make_branch_and_tree('standalone', 'weave')
45
52
self.build_tree(['standalone/a'])
47
54
branch1 = tree1.branch
48
out, err = self.runbzr('info standalone')
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
54
71
control: All-in-one format 6
113
144
first revision: %s
114
145
latest revision: %s
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,
149
""" % (datestring_first, datestring_first,
128
151
self.assertEqual('', err)
130
153
# Branch and bind to standalone, needs upgrade to metadir
131
154
# (creates backup as unknown)
132
155
branch1.bzrdir.sprout('bound')
133
bzrlib.upgrade.upgrade('bound', bzrlib.bzrdir.BzrDirMetaFormat1())
134
branch3 = bzrlib.bzrdir.BzrDir.open('bound').open_branch()
156
knit1_format = bzrdir.format_registry.make_bzrdir('knit')
157
upgrade.upgrade('bound', knit1_format)
158
branch3 = bzrdir.BzrDir.open('bound').open_branch()
135
159
branch3.bind(branch1)
136
out, err = self.runbzr('info bound')
160
bound_tree = branch3.bzrdir.open_workingtree()
161
out, err = self.run_bzr('info -v bound')
137
162
self.assertEqualDiff(
140
checkout of branch: %s
163
"""Checkout (format: knit)
166
checkout of branch: standalone
142
168
Related branches:
169
parent branch: standalone
146
172
control: Meta directory format 1
147
working tree: Working tree format 3
148
branch: Branch format 5
151
177
In the working tree:
164
191
first revision: %s
165
192
latest revision: %s
170
""" % (branch3.bzrdir.root_transport.base,
171
branch1.bzrdir.root_transport.base,
172
branch1.bzrdir.root_transport.base,
196
""" % (bound_tree._format.get_format_description(),
197
branch3._format.get_format_description(),
173
198
branch3.repository._format.get_format_description(),
174
199
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,
180
201
self.assertEqual('', err)
182
203
# Checkout standalone (same as above, but does not have parent set)
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)
204
branch4 = bzrdir.BzrDir.create_branch_convenience('checkout',
187
206
branch4.bind(branch1)
188
207
branch4.bzrdir.open_workingtree().update()
189
out, err = self.runbzr('info checkout --verbose')
208
out, err = self.run_bzr('info checkout --verbose')
190
209
self.assertEqualDiff(
193
checkout of branch: %s
210
"""Checkout (format: knit)
212
checkout root: checkout
213
checkout of branch: standalone
196
216
control: Meta directory format 1
215
235
first revision: %s
216
236
latest revision: %s
221
""" % (branch4.bzrdir.root_transport.base,
222
branch1.bzrdir.root_transport.base,
223
branch4.repository._format.get_format_description(),
240
""" % (branch4.repository._format.get_format_description(),
224
241
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,
230
243
self.assertEqual('', err)
232
245
# Lightweight checkout (same as above, different branch and repository)
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)
246
tree5 = branch1.create_checkout('lightcheckout', lightweight=True)
241
247
branch5 = tree5.branch
242
out, err = self.runbzr('info lightcheckout')
248
out, err = self.run_bzr('info -v lightcheckout')
243
249
self.assertEqualDiff(
245
light checkout root: %s
246
checkout of branch: %s
250
"""Lightweight checkout (format: 1.6 or 1.6-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
249
258
control: Meta directory format 1
250
working tree: Working tree format 3
259
working tree: Working tree format 4
251
260
branch: Branch format 4
252
261
repository: Weave repository format 6
405
405
first revision: %s
406
406
latest revision: %s
411
""" % (branch4.bzrdir.root_transport.base,
412
branch1.bzrdir.root_transport.base,
413
branch4.repository._format.get_format_description(),
410
""" % (branch4.repository._format.get_format_description(),
414
411
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,
420
413
self.assertEqual('', err)
422
415
# Out of date lightweight checkout
423
out, err = self.runbzr('info lightcheckout --verbose')
416
out, err = self.run_bzr('info lightcheckout --verbose')
424
417
self.assertEqualDiff(
426
light checkout root: %s
427
checkout of branch: %s
418
"""Lightweight checkout (format: 1.6 or 1.6-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
430
426
control: Meta directory format 1
431
working tree: Working tree format 3
427
working tree: Working tree format 4
432
428
branch: Branch format 4
433
429
repository: Weave repository format 6
451
447
first revision: %s
452
448
latest revision: %s
457
""" % (tree5.bzrdir.root_transport.base,
458
branch1.bzrdir.root_transport.base,
459
datestring_first, datestring_last,
452
""" % (datestring_first, datestring_last,), out)
461
453
self.assertEqual('', err)
463
455
def test_info_standalone_no_tree(self):
464
456
# create standalone branch without a working tree
457
format = bzrdir.format_registry.make_bzrdir('default')
465
458
branch = self.make_branch('branch')
466
459
repo = branch.repository
467
out, err = self.runbzr('info branch')
460
out, err = self.run_bzr('info branch -v')
468
461
self.assertEqualDiff(
462
"""Standalone branch (format: %s)
473
467
control: Meta directory format 1
474
branch: Branch format 5
483
""" % (branch.bzrdir.root_transport.base,
484
repo._format.get_format_description(),
477
""" % (info.describe_format(repo.bzrdir, repo, branch, None),
478
format.get_branch_format().get_format_description(),
479
format.repository_format.get_format_description(),
486
481
self.assertEqual('', err)
488
483
def test_info_shared_repository(self):
489
old_format = bzrlib.bzrdir.BzrDirFormat.get_default_format()
490
bzrlib.bzrdir.BzrDirFormat.set_default_format(bzrlib.bzrdir.BzrDirMetaFormat1())
484
format = bzrdir.format_registry.make_bzrdir('knit')
491
485
transport = self.get_transport()
493
487
# Create shared repository
494
repo = self.make_repository('repo', shared=True)
488
repo = self.make_repository('repo', shared=True, format=format)
495
489
repo.set_make_working_trees(False)
496
out, err = self.runbzr('info repo')
490
out, err = self.run_bzr('info -v repo')
497
491
self.assertEqualDiff(
492
"""Shared repository (format: dirstate or dirstate-tags or knit)
499
494
shared repository: %s
502
497
control: Meta directory format 1
508
""" % (repo.bzrdir.root_transport.base,
509
repo._format.get_format_description(),
502
""" % ('repo', format.repository_format.get_format_description(),
511
504
self.assertEqual('', err)
513
506
# Create branch inside shared repository
514
507
repo.bzrdir.root_transport.mkdir('branch')
515
branch1 = repo.bzrdir.create_branch_convenience('repo/branch')
516
out, err = self.runbzr('info repo/branch')
508
branch1 = repo.bzrdir.create_branch_convenience('repo/branch',
510
out, err = self.run_bzr('info -v repo/branch')
517
511
self.assertEqualDiff(
519
shared repository: %s
520
repository branch: branch
512
"""Repository branch (format: dirstate or knit)
514
shared repository: repo
515
repository branch: repo/branch
523
518
control: Meta directory format 1
524
branch: Branch format 5
533
""" % (repo.bzrdir.root_transport.base,
534
repo._format.get_format_description(),
528
""" % (format.get_branch_format().get_format_description(),
529
format.repository_format.get_format_description(),
536
531
self.assertEqual('', err)
538
533
# Create lightweight checkout
539
534
transport.mkdir('tree')
540
535
transport.mkdir('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()
536
tree2 = branch1.create_checkout('tree/lightcheckout',
545
538
branch2 = tree2.branch
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)
539
self.assertCheckoutStatusOutput('-v tree/lightcheckout', tree2,
540
shared_repo=repo, repo_branch=branch1, verbose=True)
581
542
# Create normal checkout
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)
543
tree3 = branch1.create_checkout('tree/checkout')
544
self.assertCheckoutStatusOutput('tree/checkout --verbose', tree3,
546
light_checkout=False, repo_branch=branch1)
621
547
# Update lightweight checkout
622
548
self.build_tree(['tree/lightcheckout/a'])
624
550
tree2.commit('commit one')
625
551
rev = repo.get_revision(branch2.revision_history()[0])
626
552
datestring_first = format_date(rev.timestamp, rev.timezone)
627
out, err = self.runbzr('info tree/lightcheckout --verbose')
553
out, err = self.run_bzr('info tree/lightcheckout --verbose')
628
554
self.assertEqualDiff(
630
light checkout root: %s
631
shared repository: %s
632
repository branch: branch
555
"""Lightweight checkout (format: 1.6 or 1.6-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
635
564
control: Meta directory format 1
636
working tree: Working tree format 3
637
branch: Branch format 5
565
working tree: Working tree format 4
640
569
In the working tree:
654
583
first revision: %s
655
584
latest revision: %s
660
""" % (tree2.bzrdir.root_transport.base,
661
repo.bzrdir.root_transport.base,
662
repo._format.get_format_description(),
588
""" % (format.get_branch_format().get_format_description(),
589
format.repository_format.get_format_description(),
663
590
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,
668
592
self.assertEqual('', err)
670
594
# Out of date checkout
671
out, err = self.runbzr('info tree/checkout')
595
out, err = self.run_bzr('info -v tree/checkout')
672
596
self.assertEqualDiff(
675
checkout of branch: %s
597
"""Checkout (format: dirstate)
599
checkout root: tree/checkout
600
checkout of branch: repo/branch
678
603
control: Meta directory format 1
679
working tree: Working tree format 3
680
branch: Branch format 5
604
working tree: Working tree format 4
683
608
Branch is out of date: missing 1 revision.
817
737
first revision: %s
818
738
latest revision: %s
823
""" % (repo.bzrdir.root_transport.base,
824
repo._format.get_format_description(),
742
""" % (format.get_branch_format().get_format_description(),
743
format.repository_format.get_format_description(),
825
744
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,
830
746
self.assertEqual('', err)
832
748
# Show info about repository with revisions
833
out, err = self.runbzr('info repo')
749
out, err = self.run_bzr('info -v repo')
834
750
self.assertEqualDiff(
836
shared repository: %s
751
"""Shared repository (format: dirstate or dirstate-tags or knit)
753
shared repository: repo
839
756
control: Meta directory format 1
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,
761
""" % (format.repository_format.get_format_description(),
851
763
self.assertEqual('', err)
853
bzrlib.bzrdir.BzrDirFormat.set_default_format(old_format)
855
765
def test_info_shared_repository_with_trees(self):
856
old_format = bzrlib.bzrdir.BzrDirFormat.get_default_format()
857
bzrlib.bzrdir.BzrDirFormat.set_default_format(bzrlib.bzrdir.BzrDirMetaFormat1())
766
format = bzrdir.format_registry.make_bzrdir('knit')
858
767
transport = self.get_transport()
860
769
# Create shared repository with working trees
861
repo = self.make_repository('repo', shared=True)
770
repo = self.make_repository('repo', shared=True, format=format)
862
771
repo.set_make_working_trees(True)
863
out, err = self.runbzr('info repo')
772
out, err = self.run_bzr('info -v repo')
864
773
self.assertEqualDiff(
866
shared repository: %s
774
"""Shared repository with trees (format: dirstate or dirstate-tags or knit)
776
shared repository: repo
869
779
control: Meta directory format 1
1068
969
Create working tree for new branches inside the repository.
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,
973
""" % (format.repository_format.get_format_description(),
1080
976
self.assertEqual('', err)
1082
bzrlib.bzrdir.BzrDirFormat.set_default_format(old_format)
1084
978
def test_info_shared_repository_with_tree_in_root(self):
1085
old_format = bzrlib.bzrdir.BzrDirFormat.get_default_format()
1086
bzrlib.bzrdir.BzrDirFormat.set_default_format(bzrlib.bzrdir.BzrDirMetaFormat1())
979
format = bzrdir.format_registry.make_bzrdir('knit')
1087
980
transport = self.get_transport()
1089
982
# Create shared repository with working trees
1090
repo = self.make_repository('repo', shared=True)
983
repo = self.make_repository('repo', shared=True, format=format)
1091
984
repo.set_make_working_trees(True)
1092
out, err = self.runbzr('info repo')
985
out, err = self.run_bzr('info -v repo')
1093
986
self.assertEqualDiff(
1095
shared repository: %s
987
"""Shared repository with trees (format: dirstate or dirstate-tags or knit)
989
shared repository: repo
1098
992
control: Meta directory format 1
1137
1030
Branch history:
1143
""" % (repo.bzrdir.root_transport.base,
1144
repo._format.get_format_description(),
1036
""" % (format.get_branch_format().get_format_description(),
1037
format.repository_format.get_format_description(),
1146
1039
self.assertEqual('', err)
1148
bzrlib.bzrdir.BzrDirFormat.set_default_format(old_format)
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-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)
1150
1184
def test_info_locking(self):
1151
1185
transport = self.get_transport()
1152
1186
# Create shared repository with a branch
1153
1187
repo = self.make_repository('repo', shared=True,
1154
format=bzrlib.bzrdir.BzrDirMetaFormat1())
1188
format=bzrdir.BzrDirMetaFormat1())
1155
1189
repo.set_make_working_trees(False)
1156
1190
repo.bzrdir.root_transport.mkdir('branch')
1157
1191
repo_branch = repo.bzrdir.create_branch_convenience('repo/branch',
1158
format=bzrlib.bzrdir.BzrDirMetaFormat1())
1192
format=bzrdir.BzrDirMetaFormat1())
1159
1193
# Do a heavy checkout
1160
1194
transport.mkdir('tree')
1161
1195
transport.mkdir('tree/checkout')
1162
co_branch = bzrlib.bzrdir.BzrDir.create_branch_convenience('tree/checkout',
1163
format=bzrlib.bzrdir.BzrDirMetaFormat1())
1196
co_branch = bzrdir.BzrDir.create_branch_convenience('tree/checkout',
1197
format=bzrdir.BzrDirMetaFormat1())
1164
1198
co_branch.bind(repo_branch)
1165
1199
# Do a light checkout of the heavy one
1166
1200
transport.mkdir('tree/lightcheckout')
1167
lco_dir = bzrlib.bzrdir.BzrDirMetaFormat1().initialize('tree/lightcheckout')
1168
bzrlib.branch.BranchReferenceFormat().initialize(lco_dir, co_branch)
1201
lco_dir = bzrdir.BzrDirMetaFormat1().initialize('tree/lightcheckout')
1202
branch.BranchReferenceFormat().initialize(lco_dir, co_branch)
1169
1203
lco_dir.create_workingtree()
1170
1204
lco_tree = lco_dir.open_workingtree()
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)
1210
self.assertCheckoutStatusOutput('-v tree/lightcheckout', lco_tree,
1211
repo_branch=repo_branch,
1212
verbose=True, light_checkout=True)
1210
1214
lco_tree.branch.repository.lock_write()
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()
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()
1251
1222
lco_tree.branch.lock_write()
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()
1224
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1228
repo_branch=repo_branch,
1231
lco_tree.branch.unlock()
1292
1233
lco_tree.lock_write()
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)
1235
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1236
lco_tree, repo_branch=repo_branch,
1333
1244
lco_tree.lock_write()
1334
1245
lco_tree.branch.repository.unlock()
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()
1247
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1248
lco_tree, repo_branch=repo_branch,
1253
lco_tree.branch.repository.lock_write()
1376
1256
lco_tree.lock_write()
1377
1257
lco_tree.branch.unlock()
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()
1259
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1260
lco_tree, repo_branch=repo_branch,
1264
lco_tree.branch.lock_write()
1419
1267
lco_tree.lock_write()
1420
1268
lco_tree.branch.unlock()
1421
1269
lco_tree.branch.repository.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()
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()
1464
1281
lco_tree.branch.lock_write()
1465
1282
lco_tree.branch.repository.unlock()
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()
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.')
1507
1296
def test_info_locking_oslocks(self):
1297
if sys.platform == "win32":
1298
raise TestSkipped("don't use oslocks on win32 in unix manner")
1508
1300
tree = self.make_branch_and_tree('branch',
1509
format=bzrlib.bzrdir.BzrDirFormat6())
1301
format=bzrdir.BzrDirFormat6())
1511
1303
# Test all permutations of locking the working tree, branch and repository
1512
1304
# XXX: Well not yet, as we can't query oslocks yet. Currently, it's