1
# Copyright (C) 2006 by Canonical Ltd
2
# -*- coding: utf-8 -*-
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 2 of the License, or
7
# (at your option) any later version.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
"""Tests for the info command of bzr."""
25
from bzrlib.osutils import format_date
26
from bzrlib.tests import TestSkipped
27
from bzrlib.tests.blackbox import ExternalBase
30
class TestInfo(ExternalBase):
32
def test_info_non_existing(self):
33
out, err = self.runbzr('info /i/do/not/exist/', retcode=3)
34
self.assertEqual(out, '')
35
self.assertEqual(err, 'bzr: ERROR: Not a branch: /i/do/not/exist/\n')
37
def test_info_standalone(self):
38
transport = self.get_transport()
40
# 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)
45
self.build_tree(['standalone/a'])
47
branch1 = tree1.branch
48
out, err = self.runbzr('info standalone')
54
control: All-in-one format 6
55
working tree: Working tree format 2
56
branch: Branch format 4
57
repository: Weave repository format 6
67
0 versioned subdirectories
75
""" % branch1.bzrdir.root_transport.base, out)
76
self.assertEqual('', err)
77
tree1.commit('commit one')
78
rev = branch1.repository.get_revision(branch1.revision_history()[0])
79
datestring_first = format_date(rev.timestamp, rev.timezone)
81
# Branch standalone with push location
82
branch2 = branch1.bzrdir.sprout('branch').open_branch()
83
branch2.set_push_location(branch1.bzrdir.root_transport.base)
84
out, err = self.runbzr('info branch --verbose')
94
control: All-in-one format 6
95
working tree: Working tree format 2
96
branch: Branch format 4
97
repository: Weave repository format 6
107
0 versioned subdirectories
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,
128
self.assertEqual('', err)
130
# Branch and bind to standalone, needs upgrade to metadir
131
# (creates backup as unknown)
132
branch1.bzrdir.sprout('bound')
133
bzrlib.upgrade.upgrade('bound', bzrlib.bzrdir.BzrDirMetaFormat1())
134
branch3 = bzrlib.bzrdir.BzrDir.open('bound').open_branch()
135
branch3.bind(branch1)
136
out, err = self.runbzr('info bound')
137
self.assertEqualDiff(
140
checkout of branch: %s
146
control: Meta directory format 1
147
working tree: Working tree format 3
148
branch: Branch format 5
159
0 versioned subdirectories
170
""" % (branch3.bzrdir.root_transport.base,
171
branch1.bzrdir.root_transport.base,
172
branch1.bzrdir.root_transport.base,
173
branch3.repository._format.get_format_description(),
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,
180
self.assertEqual('', err)
182
# 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)
187
branch4.bind(branch1)
188
branch4.bzrdir.open_workingtree().update()
189
out, err = self.runbzr('info checkout --verbose')
190
self.assertEqualDiff(
193
checkout of branch: %s
196
control: Meta directory format 1
197
working tree: Working tree format 3
198
branch: Branch format 5
209
0 versioned subdirectories
221
""" % (branch4.bzrdir.root_transport.base,
222
branch1.bzrdir.root_transport.base,
223
branch4.repository._format.get_format_description(),
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,
230
self.assertEqual('', err)
232
# 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)
241
branch5 = tree5.branch
242
out, err = self.runbzr('info lightcheckout')
243
self.assertEqualDiff(
245
light checkout root: %s
246
checkout of branch: %s
249
control: Meta directory format 1
250
working tree: Working tree format 3
251
branch: Branch format 4
252
repository: Weave repository format 6
262
0 versioned subdirectories
273
""" % (tree5.bzrdir.root_transport.base,
274
branch1.bzrdir.root_transport.base,
275
datestring_first, datestring_first,
277
self.assertEqual('', err)
279
# Update initial standalone branch
280
self.build_tree(['standalone/b'])
282
tree1.commit('commit two')
283
rev = branch1.repository.get_revision(branch1.revision_history()[-1])
284
datestring_last = format_date(rev.timestamp, rev.timezone)
286
# Out of date branched standalone branch will not be detected
287
out, err = self.runbzr('info branch')
288
self.assertEqualDiff(
294
publish to branch: %s
297
control: All-in-one format 6
298
working tree: Working tree format 2
299
branch: Branch format 4
300
repository: Weave repository format 6
310
0 versioned subdirectories
321
""" % (branch2.bzrdir.root_transport.base,
322
branch1.bzrdir.root_transport.base,
323
branch1.bzrdir.root_transport.base,
324
datestring_first, datestring_first,
326
self.assertEqual('', err)
328
# Out of date bound branch
329
out, err = self.runbzr('info bound')
330
self.assertEqualDiff(
333
checkout of branch: %s
339
control: Meta directory format 1
340
working tree: Working tree format 3
341
branch: Branch format 5
344
Branch is out of date: missing 1 revision.
354
0 versioned subdirectories
365
""" % (branch3.bzrdir.root_transport.base,
366
branch1.bzrdir.root_transport.base,
367
branch1.bzrdir.root_transport.base,
368
branch3.repository._format.get_format_description(),
369
datestring_first, datestring_first,
370
# poking at _revision_store isn't all that clean, but neither is
371
# having the ui test dependent on the exact overhead of a given store.
372
branch3.repository._revision_store.total_size(
373
branch3.repository.get_transaction())[1] / 1024,
375
self.assertEqual('', err)
377
# Out of date checkout
378
out, err = self.runbzr('info checkout')
379
self.assertEqualDiff(
382
checkout of branch: %s
385
control: Meta directory format 1
386
working tree: Working tree format 3
387
branch: Branch format 5
390
Branch is out of date: missing 1 revision.
400
0 versioned subdirectories
411
""" % (branch4.bzrdir.root_transport.base,
412
branch1.bzrdir.root_transport.base,
413
branch4.repository._format.get_format_description(),
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,
420
self.assertEqual('', err)
422
# Out of date lightweight checkout
423
out, err = self.runbzr('info lightcheckout --verbose')
424
self.assertEqualDiff(
426
light checkout root: %s
427
checkout of branch: %s
430
control: Meta directory format 1
431
working tree: Working tree format 3
432
branch: Branch format 4
433
repository: Weave repository format 6
435
Working tree is out of date: missing 1 revision.
445
0 versioned subdirectories
457
""" % (tree5.bzrdir.root_transport.base,
458
branch1.bzrdir.root_transport.base,
459
datestring_first, datestring_last,
461
self.assertEqual('', err)
463
def test_info_standalone_no_tree(self):
464
# create standalone branch without a working tree
465
branch = self.make_branch('branch')
466
repo = branch.repository
467
out, err = self.runbzr('info branch')
468
self.assertEqualDiff(
473
control: Meta directory format 1
474
branch: Branch format 5
483
""" % (branch.bzrdir.root_transport.base,
484
repo._format.get_format_description(),
486
self.assertEqual('', err)
488
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())
491
transport = self.get_transport()
493
# Create shared repository
494
repo = self.make_repository('repo', shared=True)
495
repo.set_make_working_trees(False)
496
out, err = self.runbzr('info repo')
497
self.assertEqualDiff(
499
shared repository: %s
502
control: Meta directory format 1
508
""" % (repo.bzrdir.root_transport.base,
509
repo._format.get_format_description(),
511
self.assertEqual('', err)
513
# Create branch inside shared repository
514
repo.bzrdir.root_transport.mkdir('branch')
515
branch1 = repo.bzrdir.create_branch_convenience('repo/branch')
516
out, err = self.runbzr('info repo/branch')
517
self.assertEqualDiff(
519
shared repository: %s
520
repository branch: branch
523
control: Meta directory format 1
524
branch: Branch format 5
533
""" % (repo.bzrdir.root_transport.base,
534
repo._format.get_format_description(),
536
self.assertEqual('', err)
538
# Create lightweight checkout
539
transport.mkdir('tree')
540
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()
545
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)
581
# 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)
621
# Update lightweight checkout
622
self.build_tree(['tree/lightcheckout/a'])
624
tree2.commit('commit one')
625
rev = repo.get_revision(branch2.revision_history()[0])
626
datestring_first = format_date(rev.timestamp, rev.timezone)
627
out, err = self.runbzr('info tree/lightcheckout --verbose')
628
self.assertEqualDiff(
630
light checkout root: %s
631
shared repository: %s
632
repository branch: branch
635
control: Meta directory format 1
636
working tree: Working tree format 3
637
branch: Branch format 5
648
0 versioned subdirectories
660
""" % (tree2.bzrdir.root_transport.base,
661
repo.bzrdir.root_transport.base,
662
repo._format.get_format_description(),
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,
668
self.assertEqual('', err)
670
# Out of date checkout
671
out, err = self.runbzr('info tree/checkout')
672
self.assertEqualDiff(
675
checkout of branch: %s
678
control: Meta directory format 1
679
working tree: Working tree format 3
680
branch: Branch format 5
683
Branch is out of date: missing 1 revision.
693
0 versioned subdirectories
701
""" % (tree3.bzrdir.root_transport.base,
702
branch1.bzrdir.root_transport.base,
703
repo._format.get_format_description(),
705
self.assertEqual('', err)
709
self.build_tree(['tree/checkout/b'])
711
out, err = self.runbzr('info tree/checkout --verbose')
712
self.assertEqualDiff(
715
checkout of branch: %s
718
control: Meta directory format 1
719
working tree: Working tree format 3
720
branch: Branch format 5
731
0 versioned subdirectories
743
""" % (tree3.bzrdir.root_transport.base, branch1.bzrdir.root_transport.base,
744
repo._format.get_format_description(),
745
datestring_first, datestring_first,
746
# poking at _revision_store isn't all that clean, but neither is
747
# having the ui test dependent on the exact overhead of a given store.
748
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
750
self.assertEqual('', err)
751
tree3.commit('commit two')
753
# Out of date lightweight checkout
754
rev = repo.get_revision(branch1.revision_history()[-1])
755
datestring_last = format_date(rev.timestamp, rev.timezone)
756
out, err = self.runbzr('info tree/lightcheckout --verbose')
757
self.assertEqualDiff(
759
light checkout root: %s
760
shared repository: %s
761
repository branch: branch
764
control: Meta directory format 1
765
working tree: Working tree format 3
766
branch: Branch format 5
769
Working tree is out of date: missing 1 revision.
779
0 versioned subdirectories
791
""" % (tree2.bzrdir.root_transport.base,
792
repo.bzrdir.root_transport.base,
793
repo._format.get_format_description(),
794
datestring_first, datestring_last,
795
# poking at _revision_store isn't all that clean, but neither is
796
# having the ui test dependent on the exact overhead of a given store.
797
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
799
self.assertEqual('', err)
801
# Show info about shared branch
802
out, err = self.runbzr('info repo/branch --verbose')
803
self.assertEqualDiff(
805
shared repository: %s
806
repository branch: branch
809
control: Meta directory format 1
810
branch: Branch format 5
823
""" % (repo.bzrdir.root_transport.base,
824
repo._format.get_format_description(),
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,
830
self.assertEqual('', err)
832
# Show info about repository with revisions
833
out, err = self.runbzr('info repo')
834
self.assertEqualDiff(
836
shared repository: %s
839
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,
851
self.assertEqual('', err)
853
bzrlib.bzrdir.BzrDirFormat.set_default_format(old_format)
855
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())
858
transport = self.get_transport()
860
# Create shared repository with working trees
861
repo = self.make_repository('repo', shared=True)
862
repo.set_make_working_trees(True)
863
out, err = self.runbzr('info repo')
864
self.assertEqualDiff(
866
shared repository: %s
869
control: Meta directory format 1
872
Create working tree for new branches inside the repository.
877
""" % (repo.bzrdir.root_transport.base,
878
repo._format.get_format_description(),
880
self.assertEqual('', err)
882
# Create two branches
883
repo.bzrdir.root_transport.mkdir('branch1')
884
branch1 = repo.bzrdir.create_branch_convenience('repo/branch1')
885
branch2 = branch1.bzrdir.sprout('repo/branch2').open_branch()
888
out, err = self.runbzr('info repo/branch1 --verbose')
889
self.assertEqualDiff(
891
shared repository: %s
892
repository checkout: branch1
895
control: Meta directory format 1
896
working tree: Working tree format 3
897
branch: Branch format 5
908
0 versioned subdirectories
917
""" % (repo.bzrdir.root_transport.base,
918
repo._format.get_format_description(),
920
self.assertEqual('', err)
922
# Update first branch
923
self.build_tree(['repo/branch1/a'])
924
tree1 = branch1.bzrdir.open_workingtree()
926
tree1.commit('commit one')
927
rev = repo.get_revision(branch1.revision_history()[0])
928
datestring_first = format_date(rev.timestamp, rev.timezone)
929
out, err = self.runbzr('info repo/branch1')
930
self.assertEqualDiff(
932
shared repository: %s
933
repository checkout: branch1
936
control: Meta directory format 1
937
working tree: Working tree format 3
938
branch: Branch format 5
949
0 versioned subdirectories
960
""" % (repo.bzrdir.root_transport.base,
961
repo._format.get_format_description(),
962
datestring_first, datestring_first,
963
# poking at _revision_store isn't all that clean, but neither is
964
# having the ui test dependent on the exact overhead of a given store.
965
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
967
self.assertEqual('', err)
969
# Out of date second branch
970
out, err = self.runbzr('info repo/branch2 --verbose')
971
self.assertEqualDiff(
973
shared repository: %s
974
repository checkout: branch2
980
control: Meta directory format 1
981
working tree: Working tree format 3
982
branch: Branch format 5
993
0 versioned subdirectories
1002
""" % (repo.bzrdir.root_transport.base,
1003
branch1.bzrdir.root_transport.base,
1004
repo._format.get_format_description(),
1005
# poking at _revision_store isn't all that clean, but neither is
1006
# having the ui test dependent on the exact overhead of a given store.
1007
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
1009
self.assertEqual('', err)
1011
# Update second branch
1012
tree2 = branch2.bzrdir.open_workingtree()
1014
out, err = self.runbzr('info repo/branch2')
1015
self.assertEqualDiff(
1017
shared repository: %s
1018
repository checkout: branch2
1024
control: Meta directory format 1
1025
working tree: Working tree format 3
1026
branch: Branch format 5
1029
In the working tree:
1037
0 versioned subdirectories
1048
""" % (repo.bzrdir.root_transport.base,
1049
branch1.bzrdir.root_transport.base,
1050
repo._format.get_format_description(),
1051
datestring_first, datestring_first,
1052
# poking at _revision_store isn't all that clean, but neither is
1053
# having the ui test dependent on the exact overhead of a given store.
1054
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
1056
self.assertEqual('', err)
1058
# Show info about repository with revisions
1059
out, err = self.runbzr('info repo')
1060
self.assertEqualDiff(
1062
shared repository: %s
1065
control: Meta directory format 1
1068
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,
1080
self.assertEqual('', err)
1082
bzrlib.bzrdir.BzrDirFormat.set_default_format(old_format)
1084
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())
1087
transport = self.get_transport()
1089
# Create shared repository with working trees
1090
repo = self.make_repository('repo', shared=True)
1091
repo.set_make_working_trees(True)
1092
out, err = self.runbzr('info repo')
1093
self.assertEqualDiff(
1095
shared repository: %s
1098
control: Meta directory format 1
1101
Create working tree for new branches inside the repository.
1106
""" % (repo.bzrdir.root_transport.base,
1107
repo._format.get_format_description(),
1109
self.assertEqual('', err)
1111
# Create branch in root of repository
1112
control = repo.bzrdir
1113
branch = control.create_branch()
1114
control.create_workingtree()
1115
out, err = self.runbzr('info repo')
1116
self.assertEqualDiff(
1118
shared repository: %s
1119
repository checkout: .
1122
control: Meta directory format 1
1123
working tree: Working tree format 3
1124
branch: Branch format 5
1127
In the working tree:
1135
0 versioned subdirectories
1143
""" % (repo.bzrdir.root_transport.base,
1144
repo._format.get_format_description(),
1146
self.assertEqual('', err)
1148
bzrlib.bzrdir.BzrDirFormat.set_default_format(old_format)
1150
def test_info_locking(self):
1151
transport = self.get_transport()
1152
# Create shared repository with a branch
1153
repo = self.make_repository('repo', shared=True,
1154
format=bzrlib.bzrdir.BzrDirMetaFormat1())
1155
repo.set_make_working_trees(False)
1156
repo.bzrdir.root_transport.mkdir('branch')
1157
repo_branch = repo.bzrdir.create_branch_convenience('repo/branch',
1158
format=bzrlib.bzrdir.BzrDirMetaFormat1())
1159
# Do a heavy checkout
1160
transport.mkdir('tree')
1161
transport.mkdir('tree/checkout')
1162
co_branch = bzrlib.bzrdir.BzrDir.create_branch_convenience('tree/checkout',
1163
format=bzrlib.bzrdir.BzrDirMetaFormat1())
1164
co_branch.bind(repo_branch)
1165
# Do a light checkout of the heavy one
1166
transport.mkdir('tree/lightcheckout')
1167
lco_dir = bzrlib.bzrdir.BzrDirMetaFormat1().initialize('tree/lightcheckout')
1168
bzrlib.branch.BranchReferenceFormat().initialize(lco_dir, co_branch)
1169
lco_dir.create_workingtree()
1170
lco_tree = lco_dir.open_workingtree()
1172
# Test all permutations of locking the working tree, branch and repository
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
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()
1251
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()
1292
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)
1333
lco_tree.lock_write()
1334
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()
1376
lco_tree.lock_write()
1377
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()
1419
lco_tree.lock_write()
1420
lco_tree.branch.unlock()
1421
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()
1464
lco_tree.branch.lock_write()
1465
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()
1507
def test_info_locking_oslocks(self):
1508
tree = self.make_branch_and_tree('branch',
1509
format=bzrlib.bzrdir.BzrDirFormat6())
1511
# Test all permutations of locking the working tree, branch and repository
1512
# XXX: Well not yet, as we can't query oslocks yet. Currently, it's
1513
# implemented by raising NotImplementedError and get_physical_lock_status()
1514
# always returns false. This makes bzr info hide the lock status. (Olaf)
1518
out, err = self.runbzr('info branch')
1519
self.assertEqualDiff(
1524
control: All-in-one format 6
1525
working tree: Working tree format 2
1526
branch: Branch format 4
1529
In the working tree:
1537
0 versioned subdirectories
1545
""" % (tree.bzrdir.root_transport.base,
1546
tree.branch.repository._format.get_format_description(),
1548
self.assertEqual('', err)
1551
out, err = self.runbzr('info branch')
1552
self.assertEqualDiff(
1557
control: All-in-one format 6
1558
working tree: Working tree format 2
1559
branch: Branch format 4
1562
In the working tree:
1570
0 versioned subdirectories
1578
""" % (tree.bzrdir.root_transport.base,
1579
tree.branch.repository._format.get_format_description(),
1581
self.assertEqual('', err)