39
36
location = "C:/i/do/not/exist/"
41
38
location = "/i/do/not/exist/"
42
out, err = self.run_bzr('info '+location, retcode=3)
39
out, err = self.runbzr('info '+location, retcode=3)
43
40
self.assertEqual(out, '')
44
41
self.assertEqual(err, 'bzr: ERROR: Not a branch: %s\n' % location)
51
48
self.build_tree(['standalone/a'])
53
50
branch1 = tree1.branch
55
out, err = self.run_bzr('info standalone')
57
"""Standalone tree (format: weave)
59
branch root: standalone
61
self.assertEqual('', err)
63
out, err = self.run_bzr('info standalone -v')
65
"""Standalone tree (format: weave)
67
branch root: standalone
51
out, err = self.runbzr('info standalone')
70
57
control: All-in-one format 6
78
""" % branch1.bzrdir.root_transport.base, out)
93
79
self.assertEqual('', err)
94
80
tree1.commit('commit one')
95
81
rev = branch1.repository.get_revision(branch1.revision_history()[0])
98
84
# Branch standalone with push location
99
85
branch2 = branch1.bzrdir.sprout('branch').open_branch()
100
86
branch2.set_push_location(branch1.bzrdir.root_transport.base)
102
out, err = self.run_bzr('info branch')
103
self.assertEqualDiff(
104
"""Standalone tree (format: weave)
109
push branch: standalone
110
parent branch: standalone
112
self.assertEqual('', err)
114
out, err = self.run_bzr('info branch --verbose')
115
self.assertEqualDiff(
116
"""Standalone tree (format: weave)
121
push branch: standalone
122
parent branch: standalone
87
out, err = self.runbzr('info branch --verbose')
125
97
control: All-in-one format 6
144
116
first revision: %s
145
117
latest revision: %s
150
""" % (datestring_first, datestring_first,
122
""" % (branch2.bzrdir.root_transport.base,
123
branch1.bzrdir.root_transport.base,
124
branch1.bzrdir.root_transport.base,
125
datestring_first, datestring_first,
151
126
# poking at _revision_store isn't all that clean, but neither is
152
127
# having the ui test dependent on the exact overhead of a given store.
153
128
branch2.repository._revision_store.total_size(
163
138
branch3 = bzrlib.bzrdir.BzrDir.open('bound').open_branch()
164
139
branch3.bind(branch1)
165
140
bound_tree = branch3.bzrdir.open_workingtree()
166
out, err = self.run_bzr('info -v bound')
141
out, err = self.runbzr('info bound')
167
142
self.assertEqualDiff(
168
"""Checkout (format: knit)
171
checkout of branch: standalone
145
checkout of branch: %s
173
147
Related branches:
174
parent branch: standalone
177
151
control: Meta directory format 1
196
169
first revision: %s
197
170
latest revision: %s
202
""" % (bound_tree._format.get_format_description(),
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(),
203
179
branch3._format.get_format_description(),
204
180
branch3.repository._format.get_format_description(),
205
181
datestring_first, datestring_first,
215
191
format=knit1_format)
216
192
branch4.bind(branch1)
217
193
branch4.bzrdir.open_workingtree().update()
218
out, err = self.run_bzr('info checkout --verbose')
194
out, err = self.runbzr('info checkout --verbose')
219
195
self.assertEqualDiff(
220
"""Checkout (format: knit)
222
checkout root: checkout
223
checkout of branch: standalone
198
checkout of branch: %s
226
201
control: Meta directory format 1
245
220
first revision: %s
246
221
latest revision: %s
251
""" % (branch4.repository._format.get_format_description(),
226
""" % (branch4.bzrdir.root_transport.base,
227
branch1.bzrdir.root_transport.base,
228
branch4.repository._format.get_format_description(),
252
229
datestring_first, datestring_first,
253
230
# poking at _revision_store isn't all that clean, but neither is
254
231
# having the ui test dependent on the exact overhead of a given store.
260
237
# Lightweight checkout (same as above, different branch and repository)
261
238
tree5 = branch1.create_checkout('lightcheckout', lightweight=True)
262
239
branch5 = tree5.branch
263
out, err = self.run_bzr('info -v lightcheckout')
240
out, err = self.runbzr('info lightcheckout')
264
241
self.assertEqualDiff(
265
"""Lightweight checkout (format: dirstate or dirstate-tags)
267
light checkout root: lightcheckout
268
checkout of branch: standalone
243
light checkout root: %s
244
checkout of branch: %s
271
247
control: Meta directory format 1
290
265
first revision: %s
291
266
latest revision: %s
296
""" % (datestring_first, datestring_first,), out)
271
""" % (tree5.bzrdir.root_transport.base,
272
branch1.bzrdir.root_transport.base,
273
datestring_first, datestring_first,
297
275
self.assertEqual('', err)
299
277
# Update initial standalone branch
304
282
datestring_last = format_date(rev.timestamp, rev.timezone)
306
284
# Out of date branched standalone branch will not be detected
307
out, err = self.run_bzr('info -v branch')
285
out, err = self.runbzr('info branch')
308
286
self.assertEqualDiff(
309
"""Standalone tree (format: weave)
313
290
Related branches:
314
push branch: standalone
315
parent branch: standalone
292
publish to branch: %s
318
295
control: All-in-one format 6
337
313
first revision: %s
338
314
latest revision: %s
343
""" % (datestring_first, datestring_first,
319
""" % (branch2.bzrdir.root_transport.base,
320
branch1.bzrdir.root_transport.base,
321
branch1.bzrdir.root_transport.base,
322
datestring_first, datestring_first,
345
324
self.assertEqual('', err)
347
326
# Out of date bound branch
348
out, err = self.run_bzr('info -v bound')
327
out, err = self.runbzr('info bound')
349
328
self.assertEqualDiff(
350
"""Checkout (format: knit)
353
checkout of branch: standalone
331
checkout of branch: %s
355
333
Related branches:
356
parent branch: standalone
359
337
control: Meta directory format 1
380
357
first revision: %s
381
358
latest revision: %s
386
""" % (branch3.repository._format.get_format_description(),
363
""" % (branch3.bzrdir.root_transport.base,
364
branch1.bzrdir.root_transport.base,
365
branch1.bzrdir.root_transport.base,
366
branch3.repository._format.get_format_description(),
387
367
datestring_first, datestring_first,
388
368
# poking at _revision_store isn't all that clean, but neither is
389
369
# having the ui test dependent on the exact overhead of a given store.
393
373
self.assertEqual('', err)
395
375
# Out of date checkout
396
out, err = self.run_bzr('info -v checkout')
376
out, err = self.runbzr('info checkout')
397
377
self.assertEqualDiff(
398
"""Checkout (format: knit)
400
checkout root: checkout
401
checkout of branch: standalone
380
checkout of branch: %s
404
383
control: Meta directory format 1
425
403
first revision: %s
426
404
latest revision: %s
431
""" % (branch4.repository._format.get_format_description(),
409
""" % (branch4.bzrdir.root_transport.base,
410
branch1.bzrdir.root_transport.base,
411
branch4.repository._format.get_format_description(),
432
412
datestring_first, datestring_first,
433
413
# poking at _revision_store isn't all that clean, but neither is
434
414
# having the ui test dependent on the exact overhead of a given store.
438
418
self.assertEqual('', err)
440
420
# Out of date lightweight checkout
441
out, err = self.run_bzr('info lightcheckout --verbose')
421
out, err = self.runbzr('info lightcheckout --verbose')
442
422
self.assertEqualDiff(
443
"""Lightweight checkout (format: dirstate or dirstate-tags)
445
light checkout root: lightcheckout
446
checkout of branch: standalone
424
light checkout root: %s
425
checkout of branch: %s
449
428
control: Meta directory format 1
470
449
first revision: %s
471
450
latest revision: %s
476
""" % (datestring_first, datestring_last,), out)
455
""" % (tree5.bzrdir.root_transport.base,
456
branch1.bzrdir.root_transport.base,
457
datestring_first, datestring_last,
477
459
self.assertEqual('', err)
479
461
def test_info_standalone_no_tree(self):
481
463
format = bzrdir.format_registry.make_bzrdir('default')
482
464
branch = self.make_branch('branch')
483
465
repo = branch.repository
484
out, err = self.run_bzr('info branch -v')
466
out, err = self.runbzr('info branch')
485
467
self.assertEqualDiff(
486
"""Standalone branch (format: dirstate or knit)
491
472
control: Meta directory format 1
502
""" % (format.get_branch_format().get_format_description(),
482
""" % (branch.bzrdir.root_transport.base,
483
format.get_branch_format().get_format_description(),
503
484
format.repository_format.get_format_description(),
505
486
self.assertEqual('', err)
511
492
# Create shared repository
512
493
repo = self.make_repository('repo', shared=True, format=format)
513
494
repo.set_make_working_trees(False)
514
out, err = self.run_bzr('info -v repo')
495
out, err = self.runbzr('info repo')
515
496
self.assertEqualDiff(
516
"""Shared repository (format: dirstate or dirstate-tags or knit)
518
498
shared repository: %s
521
501
control: Meta directory format 1
527
""" % ('repo', format.repository_format.get_format_description(),
507
""" % (repo.bzrdir.root_transport.base,
508
format.repository_format.get_format_description(),
529
510
self.assertEqual('', err)
532
513
repo.bzrdir.root_transport.mkdir('branch')
533
514
branch1 = repo.bzrdir.create_branch_convenience('repo/branch',
535
out, err = self.run_bzr('info -v repo/branch')
516
out, err = self.runbzr('info repo/branch')
536
517
self.assertEqualDiff(
537
"""Repository branch (format: dirstate or knit)
539
shared repository: repo
540
repository branch: repo/branch
519
shared repository: %s
520
repository branch: branch
543
523
control: Meta directory format 1
554
""" % (format.get_branch_format().get_format_description(),
533
""" % (repo.bzrdir.root_transport.base,
534
format.get_branch_format().get_format_description(),
555
535
format.repository_format.get_format_description(),
557
537
self.assertEqual('', err)
562
542
tree2 = branch1.create_checkout('tree/lightcheckout',
563
543
lightweight=True)
564
544
branch2 = tree2.branch
565
self.assertCheckoutStatusOutput('-v tree/lightcheckout', tree2,
566
shared_repo=repo, repo_branch=branch1, verbose=True)
545
self.assertCheckoutStatusOutput('tree/lightcheckout', tree2,
568
548
# Create normal checkout
569
549
tree3 = branch1.create_checkout('tree/checkout')
576
556
tree2.commit('commit one')
577
557
rev = repo.get_revision(branch2.revision_history()[0])
578
558
datestring_first = format_date(rev.timestamp, rev.timezone)
579
out, err = self.run_bzr('info tree/lightcheckout --verbose')
559
out, err = self.runbzr('info tree/lightcheckout --verbose')
580
560
self.assertEqualDiff(
581
"""Lightweight checkout (format: dirstate or dirstate-tags)
583
light checkout root: tree/lightcheckout
584
checkout of branch: repo/branch
585
shared repository: repo
562
light checkout root: %s
563
shared repository: %s
564
repository branch: branch
588
567
control: Meta directory format 1
607
586
first revision: %s
608
587
latest revision: %s
613
""" % (format.get_branch_format().get_format_description(),
592
""" % (tree2.bzrdir.root_transport.base,
593
repo.bzrdir.root_transport.base,
594
format.get_branch_format().get_format_description(),
614
595
format.repository_format.get_format_description(),
615
596
datestring_first, datestring_first,
616
597
# poking at _revision_store isn't all that clean, but neither is
620
601
self.assertEqual('', err)
622
603
# Out of date checkout
623
out, err = self.run_bzr('info -v tree/checkout')
604
out, err = self.runbzr('info tree/checkout')
624
605
self.assertEqualDiff(
625
"""Checkout (format: dirstate)
627
checkout root: tree/checkout
628
checkout of branch: repo/branch
608
checkout of branch: %s
631
611
control: Meta directory format 1
655
""" % (format.get_branch_format().get_format_description(),
634
""" % (tree3.bzrdir.root_transport.base,
635
branch1.bzrdir.root_transport.base,
636
format.get_branch_format().get_format_description(),
656
637
format.repository_format.get_format_description(),
658
639
self.assertEqual('', err)
662
643
self.build_tree(['tree/checkout/b'])
664
out, err = self.run_bzr('info tree/checkout --verbose')
645
out, err = self.runbzr('info tree/checkout --verbose')
665
646
self.assertEqualDiff(
666
"""Checkout (format: dirstate)
668
checkout root: tree/checkout
669
checkout of branch: repo/branch
649
checkout of branch: %s
672
652
control: Meta directory format 1
691
671
first revision: %s
692
672
latest revision: %s
697
""" % (format.get_branch_format().get_format_description(),
677
""" % (tree3.bzrdir.root_transport.base, branch1.bzrdir.root_transport.base,
678
format.get_branch_format().get_format_description(),
698
679
format.repository_format.get_format_description(),
699
680
datestring_first, datestring_first,
700
681
# poking at _revision_store isn't all that clean, but neither is
707
688
# Out of date lightweight checkout
708
689
rev = repo.get_revision(branch1.revision_history()[-1])
709
690
datestring_last = format_date(rev.timestamp, rev.timezone)
710
out, err = self.run_bzr('info tree/lightcheckout --verbose')
691
out, err = self.runbzr('info tree/lightcheckout --verbose')
711
692
self.assertEqualDiff(
712
"""Lightweight checkout (format: dirstate or dirstate-tags)
714
light checkout root: tree/lightcheckout
715
checkout of branch: repo/branch
716
shared repository: repo
694
light checkout root: %s
695
shared repository: %s
696
repository branch: branch
719
699
control: Meta directory format 1
740
720
first revision: %s
741
721
latest revision: %s
746
""" % (format.get_branch_format().get_format_description(),
726
""" % (tree2.bzrdir.root_transport.base,
727
repo.bzrdir.root_transport.base,
728
format.get_branch_format().get_format_description(),
747
729
format.repository_format.get_format_description(),
748
730
datestring_first, datestring_last,
749
731
# poking at _revision_store isn't all that clean, but neither is
753
735
self.assertEqual('', err)
755
737
# Show info about shared branch
756
out, err = self.run_bzr('info repo/branch --verbose')
738
out, err = self.runbzr('info repo/branch --verbose')
757
739
self.assertEqualDiff(
758
"""Repository branch (format: dirstate or knit)
760
shared repository: repo
761
repository branch: repo/branch
741
shared repository: %s
742
repository branch: branch
764
745
control: Meta directory format 1
772
753
first revision: %s
773
754
latest revision: %s
778
""" % (format.get_branch_format().get_format_description(),
759
""" % (repo.bzrdir.root_transport.base,
760
format.get_branch_format().get_format_description(),
779
761
format.repository_format.get_format_description(),
780
762
datestring_first, datestring_last,
781
763
# poking at _revision_store isn't all that clean, but neither is
785
767
self.assertEqual('', err)
787
769
# Show info about repository with revisions
788
out, err = self.run_bzr('info -v repo')
770
out, err = self.runbzr('info repo')
789
771
self.assertEqualDiff(
790
"""Shared repository (format: dirstate or dirstate-tags or knit)
792
shared repository: repo
773
shared repository: %s
795
776
control: Meta directory format 1
801
""" % (format.repository_format.get_format_description(),
782
""" % (repo.bzrdir.root_transport.base,
783
format.repository_format.get_format_description(),
802
784
# poking at _revision_store isn't all that clean, but neither is
803
785
# having the ui test dependent on the exact overhead of a given store.
804
786
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
812
794
# Create shared repository with working trees
813
795
repo = self.make_repository('repo', shared=True, format=format)
814
796
repo.set_make_working_trees(True)
815
out, err = self.run_bzr('info -v repo')
797
out, err = self.runbzr('info repo')
816
798
self.assertEqualDiff(
817
"""Shared repository with trees (format: dirstate or dirstate-tags or knit)
819
shared repository: repo
800
shared repository: %s
822
803
control: Meta directory format 1
825
806
Create working tree for new branches inside the repository.
830
""" % (format.repository_format.get_format_description(),
811
""" % (repo.bzrdir.root_transport.base,
812
format.repository_format.get_format_description(),
832
814
self.assertEqual('', err)
838
820
branch2 = branch1.bzrdir.sprout('repo/branch2').open_branch()
840
822
# Empty first branch
841
out, err = self.run_bzr('info repo/branch1 --verbose')
823
out, err = self.runbzr('info repo/branch1 --verbose')
842
824
self.assertEqualDiff(
843
"""Repository tree (format: knit)
845
shared repository: repo
846
repository branch: repo/branch1
826
shared repository: %s
827
repository checkout: branch1
849
830
control: Meta directory format 1
871
""" % (format.get_branch_format().get_format_description(),
852
""" % (repo.bzrdir.root_transport.base,
853
format.get_branch_format().get_format_description(),
872
854
format.repository_format.get_format_description(),
874
856
self.assertEqual('', err)
880
862
tree1.commit('commit one')
881
863
rev = repo.get_revision(branch1.revision_history()[0])
882
864
datestring_first = format_date(rev.timestamp, rev.timezone)
883
out, err = self.run_bzr('info -v repo/branch1')
865
out, err = self.runbzr('info repo/branch1')
884
866
self.assertEqualDiff(
885
"""Repository tree (format: knit)
887
shared repository: repo
888
repository branch: repo/branch1
868
shared repository: %s
869
repository checkout: branch1
891
872
control: Meta directory format 1
910
890
first revision: %s
911
891
latest revision: %s
916
""" % (format.get_branch_format().get_format_description(),
896
""" % (repo.bzrdir.root_transport.base,
897
format.get_branch_format().get_format_description(),
917
898
format.repository_format.get_format_description(),
918
899
datestring_first, datestring_first,
919
900
# poking at _revision_store isn't all that clean, but neither is
923
904
self.assertEqual('', err)
925
906
# Out of date second branch
926
out, err = self.run_bzr('info repo/branch2 --verbose')
907
out, err = self.runbzr('info repo/branch2 --verbose')
927
908
self.assertEqualDiff(
928
"""Repository tree (format: knit)
930
shared repository: repo
931
repository branch: repo/branch2
910
shared repository: %s
911
repository checkout: branch2
933
913
Related branches:
934
parent branch: repo/branch1
937
917
control: Meta directory format 1
959
""" % (format.get_branch_format().get_format_description(),
939
""" % (repo.bzrdir.root_transport.base,
940
branch1.bzrdir.root_transport.base,
941
format.get_branch_format().get_format_description(),
960
942
format.repository_format.get_format_description(),
961
943
# poking at _revision_store isn't all that clean, but neither is
962
944
# having the ui test dependent on the exact overhead of a given store.
967
949
# Update second branch
968
950
tree2 = branch2.bzrdir.open_workingtree()
969
951
tree2.pull(branch1)
970
out, err = self.run_bzr('info -v repo/branch2')
952
out, err = self.runbzr('info repo/branch2')
971
953
self.assertEqualDiff(
972
"""Repository tree (format: knit)
974
shared repository: repo
975
repository branch: repo/branch2
955
shared repository: %s
956
repository checkout: branch2
977
958
Related branches:
978
parent branch: repo/branch1
981
962
control: Meta directory format 1
1000
980
first revision: %s
1001
981
latest revision: %s
1006
""" % (format.get_branch_format().get_format_description(),
986
""" % (repo.bzrdir.root_transport.base,
987
branch1.bzrdir.root_transport.base,
988
format.get_branch_format().get_format_description(),
1007
989
format.repository_format.get_format_description(),
1008
990
datestring_first, datestring_first,
1009
991
# poking at _revision_store isn't all that clean, but neither is
1013
995
self.assertEqual('', err)
1015
997
# Show info about repository with revisions
1016
out, err = self.run_bzr('info -v repo')
998
out, err = self.runbzr('info repo')
1017
999
self.assertEqualDiff(
1018
"""Shared repository with trees (format: dirstate or dirstate-tags or knit)
1020
shared repository: repo
1001
shared repository: %s
1023
1004
control: Meta directory format 1
1026
1007
Create working tree for new branches inside the repository.
1031
""" % (format.repository_format.get_format_description(),
1012
""" % (repo.bzrdir.root_transport.base,
1013
format.repository_format.get_format_description(),
1032
1014
# poking at _revision_store isn't all that clean, but neither is
1033
1015
# having the ui test dependent on the exact overhead of a given store.
1034
1016
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
1043
1025
# Create shared repository with working trees
1044
1026
repo = self.make_repository('repo', shared=True, format=format)
1045
1027
repo.set_make_working_trees(True)
1046
out, err = self.run_bzr('info -v repo')
1028
out, err = self.runbzr('info repo')
1047
1029
self.assertEqualDiff(
1048
"""Shared repository with trees (format: dirstate or dirstate-tags or knit)
1050
shared repository: repo
1031
shared repository: %s
1053
1034
control: Meta directory format 1
1056
1037
Create working tree for new branches inside the repository.
1061
""" % (format.repository_format.get_format_description(),
1042
""" % (repo.bzrdir.root_transport.base,
1043
format.repository_format.get_format_description(),
1063
1045
self.assertEqual('', err)
1066
1048
control = repo.bzrdir
1067
1049
branch = control.create_branch()
1068
1050
control.create_workingtree()
1069
out, err = self.run_bzr('info -v repo')
1051
out, err = self.runbzr('info repo')
1070
1052
self.assertEqualDiff(
1071
"""Repository tree (format: knit)
1073
shared repository: repo
1074
repository branch: repo
1054
shared repository: %s
1055
repository checkout: .
1077
1058
control: Meta directory format 1
1092
1073
Branch history:
1099
""" % (format.get_branch_format().get_format_description(),
1079
""" % (repo.bzrdir.root_transport.base,
1080
format.get_branch_format().get_format_description(),
1100
1081
format.repository_format.get_format_description(),
1102
1083
self.assertEqual('', err)
1107
1088
tree_locked=False,
1108
1089
branch_locked=False, repo_locked=False,
1110
light_checkout=True,
1111
checkout_root=None):
1112
"""Check the output of info in a checkout.
1091
light_checkout=True):
1092
"""Check the output of info in a light checkout tree.
1114
1094
This is not quite a mirror of the info code: rather than using the
1115
1095
tree being examined to predict output, it uses a bunch of flags which
1128
1108
:param repo_locked: If true, expect the repository to be locked.
1129
1109
:param verbose: If true, expect verbose output
1131
def friendly_location(url):
1132
path = urlutils.unescape_for_display(url, 'ascii')
1134
return osutils.relpath(os.getcwd(), path)
1135
except errors.PathNotChild:
1138
if tree_locked and sys.platform == 'win32':
1139
# We expect this to fail because of locking errors. (A write-locked
1140
# file cannot be read-locked in the same process).
1141
# This should be removed when the locking errors are fixed.
1142
args = command_string.split(' ')
1143
self.run_bzr_error([], 'info', *args)
1145
out, err = self.run_bzr('info %s' % command_string)
1147
(True, True): 'Lightweight checkout',
1148
(True, False): 'Repository checkout',
1149
(False, True): 'Lightweight checkout',
1150
(False, False): 'Checkout',
1151
}[(shared_repo is not None, light_checkout)]
1152
format = {True: 'dirstate or dirstate-tags',
1153
False: 'dirstate'}[light_checkout]
1111
out, err = self.runbzr('info %s' % command_string)
1154
1112
if repo_locked or branch_locked or tree_locked:
1155
1113
def locked_message(a_bool):
1168
1126
locked_message(repo_locked)))
1170
1128
expected_lock_output = ''
1173
1129
if light_checkout:
1174
tree_data = (" light checkout root: %s\n" %
1175
friendly_location(lco_tree.bzrdir.root_transport.base))
1177
if lco_tree.branch.get_bound_location() is not None:
1178
tree_data += ("%s checkout root: %s\n" % (extra_space,
1179
friendly_location(lco_tree.branch.bzrdir.root_transport.base)))
1130
tree_data = (" light checkout root: %s" %
1131
lco_tree.bzrdir.root_transport.base)
1133
tree_data = (" checkout root: %s" %
1134
lco_tree.bzrdir.root_transport.base)
1180
1135
if shared_repo is not None:
1181
1136
branch_data = (
1182
" checkout of branch: %s\n"
1183
" shared repository: %s\n" %
1184
(friendly_location(repo_branch.bzrdir.root_transport.base),
1185
friendly_location(shared_repo.bzrdir.root_transport.base)))
1137
" shared repository: %s\n"
1138
" repository branch: branch\n" %
1139
shared_repo.bzrdir.root_transport.base)
1186
1140
elif repo_branch is not None:
1187
1141
branch_data = (
1188
"%s checkout of branch: %s\n" %
1190
friendly_location(repo_branch.bzrdir.root_transport.base)))
1142
" checkout of branch: %s\n" %
1143
repo_branch.bzrdir.root_transport.base)
1192
branch_data = (" checkout of branch: %s\n" %
1145
branch_data = (" checkout of branch: %s\n" %
1193
1146
lco_tree.branch.bzrdir.root_transport.base)
1264
self.assertCheckoutStatusOutput('-v tree/lightcheckout', lco_tree,
1265
repo_branch=repo_branch,
1266
verbose=True, light_checkout=True)
1215
self.assertCheckoutStatusOutput('tree/lightcheckout', lco_tree)
1268
1217
lco_tree.branch.repository.lock_write()
1270
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1271
lco_tree, repo_branch=repo_branch,
1272
repo_locked=True, verbose=True, light_checkout=True)
1219
self.assertCheckoutStatusOutput('tree/lightcheckout',
1274
1223
lco_tree.branch.repository.unlock()
1276
1225
lco_tree.branch.lock_write()
1278
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1227
self.assertCheckoutStatusOutput('tree/lightcheckout',
1280
1229
branch_locked=True,
1282
repo_branch=repo_branch,
1285
1232
lco_tree.branch.unlock()
1287
1234
lco_tree.lock_write()
1289
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1290
lco_tree, repo_branch=repo_branch,
1236
self.assertCheckoutStatusOutput('tree/lightcheckout',
1291
1238
tree_locked=True,
1292
1239
branch_locked=True,
1296
1242
lco_tree.unlock()
1298
1244
lco_tree.lock_write()
1299
1245
lco_tree.branch.repository.unlock()
1301
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1302
lco_tree, repo_branch=repo_branch,
1247
self.assertCheckoutStatusOutput('tree/lightcheckout',
1303
1249
tree_locked=True,
1307
1252
lco_tree.branch.repository.lock_write()
1308
1253
lco_tree.unlock()
1310
1255
lco_tree.lock_write()
1311
1256
lco_tree.branch.unlock()
1313
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1314
lco_tree, repo_branch=repo_branch,
1258
self.assertCheckoutStatusOutput('tree/lightcheckout',
1318
1262
lco_tree.branch.lock_write()
1319
1263
lco_tree.unlock()
1322
1266
lco_tree.branch.unlock()
1323
1267
lco_tree.branch.repository.lock_write()
1325
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1326
lco_tree, repo_branch=repo_branch,
1269
self.assertCheckoutStatusOutput('tree/lightcheckout',
1327
1271
tree_locked=True,
1331
1274
lco_tree.branch.repository.unlock()
1332
1275
lco_tree.branch.lock_write()
1335
1278
lco_tree.branch.lock_write()
1336
1279
lco_tree.branch.repository.unlock()
1338
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1339
lco_tree, repo_branch=repo_branch,
1281
self.assertCheckoutStatusOutput('tree/lightcheckout',
1343
1285
lco_tree.branch.repository.lock_write()
1344
1286
lco_tree.branch.unlock()
1346
if sys.platform == 'win32':
1347
self.knownFailure('Win32 cannot run "bzr info"'
1348
' when the tree is locked.')
1350
1288
def test_info_locking_oslocks(self):
1351
1289
if sys.platform == "win32":
1352
1290
raise TestSkipped("don't use oslocks on win32 in unix manner")
1386
1323
Branch history:
1393
""" % ('branch', tree.branch.repository._format.get_format_description(),
1329
""" % (tree.bzrdir.root_transport.base,
1330
tree.branch.repository._format.get_format_description(),
1395
1332
self.assertEqual('', err)
1397
1334
tree.lock_write()
1398
out, err = self.run_bzr('info -v branch')
1335
out, err = self.runbzr('info branch')
1399
1336
self.assertEqualDiff(
1400
"""Standalone tree (format: weave)
1402
1338
branch root: %s
1420
1356
Branch history:
1427
""" % ('branch', tree.branch.repository._format.get_format_description(),
1362
""" % (tree.bzrdir.root_transport.base,
1363
tree.branch.repository._format.get_format_description(),
1429
1365
self.assertEqual('', err)