149
152
""" % (datestring_first, datestring_first,
153
# poking at _revision_store isn't all that clean, but neither is
154
# having the ui test dependent on the exact overhead of a given store.
155
branch2.repository._revision_store.total_size(
156
branch2.repository.get_transaction())[1] / 1024,
151
158
self.assertEqual('', err)
154
161
# (creates backup as unknown)
155
162
branch1.bzrdir.sprout('bound')
156
163
knit1_format = bzrdir.format_registry.make_bzrdir('knit')
157
upgrade.upgrade('bound', knit1_format)
158
branch3 = bzrdir.BzrDir.open('bound').open_branch()
164
bzrlib.upgrade.upgrade('bound', knit1_format)
165
branch3 = bzrlib.bzrdir.BzrDir.open('bound').open_branch()
159
166
branch3.bind(branch1)
160
167
bound_tree = branch3.bzrdir.open_workingtree()
161
168
out, err = self.run_bzr('info -v bound')
196
204
""" % (bound_tree._format.get_format_description(),
197
205
branch3._format.get_format_description(),
198
206
branch3.repository._format.get_format_description(),
199
207
datestring_first, datestring_first,
208
# poking at _revision_store isn't all that clean, but neither is
209
# having the ui test dependent on the exact overhead of a given store.
210
branch3.repository._revision_store.total_size(
211
branch3.repository.get_transaction())[1] / 1024,
201
213
self.assertEqual('', err)
203
215
# Checkout standalone (same as above, but does not have parent set)
204
branch4 = bzrdir.BzrDir.create_branch_convenience('checkout',
216
branch4 = bzrlib.bzrdir.BzrDir.create_branch_convenience('checkout',
205
217
format=knit1_format)
206
218
branch4.bind(branch1)
207
219
branch4.bzrdir.open_workingtree().update()
240
253
""" % (branch4.repository._format.get_format_description(),
241
254
datestring_first, datestring_first,
255
# poking at _revision_store isn't all that clean, but neither is
256
# having the ui test dependent on the exact overhead of a given store.
257
branch4.repository._revision_store.total_size(
258
branch4.repository.get_transaction())[1] / 1024,
243
260
self.assertEqual('', err)
247
264
branch5 = tree5.branch
248
265
out, err = self.run_bzr('info -v lightcheckout')
249
266
self.assertEqualDiff(
250
"""Lightweight checkout (format: 1.6 or 1.6.1-rich-root \
251
or dirstate or dirstate-tags or \
267
"""Lightweight checkout (format: dirstate or dirstate-tags or \
252
268
pack-0.92 or rich-root or rich-root-pack)
254
270
light checkout root: lightcheckout
370
389
""" % (branch3.repository._format.get_format_description(),
371
390
datestring_first, datestring_first,
391
# poking at _revision_store isn't all that clean, but neither is
392
# having the ui test dependent on the exact overhead of a given store.
393
branch3.repository._revision_store.total_size(
394
branch3.repository.get_transaction())[1] / 1024,
373
396
self.assertEqual('', err)
410
434
""" % (branch4.repository._format.get_format_description(),
411
435
datestring_first, datestring_first,
436
# poking at _revision_store isn't all that clean, but neither is
437
# having the ui test dependent on the exact overhead of a given store.
438
branch4.repository._revision_store.total_size(
439
branch4.repository.get_transaction())[1] / 1024,
413
441
self.assertEqual('', err)
415
443
# Out of date lightweight checkout
416
444
out, err = self.run_bzr('info lightcheckout --verbose')
417
445
self.assertEqualDiff(
418
"""Lightweight checkout (format: 1.6 or 1.6.1-rich-root or \
419
dirstate or dirstate-tags or \
446
"""Lightweight checkout (format: dirstate or dirstate-tags or \
420
447
pack-0.92 or rich-root or rich-root-pack)
422
449
light checkout root: lightcheckout
477
506
""" % (info.describe_format(repo.bzrdir, repo, branch, None),
478
507
format.get_branch_format().get_format_description(),
479
508
format.repository_format.get_format_description(),
552
583
datestring_first = format_date(rev.timestamp, rev.timezone)
553
584
out, err = self.run_bzr('info tree/lightcheckout --verbose')
554
585
self.assertEqualDiff(
555
"""Lightweight checkout (format: 1.6 or 1.6.1-rich-root or \
556
dirstate or dirstate-tags or \
586
"""Lightweight checkout (format: dirstate or dirstate-tags or \
557
587
pack-0.92 or rich-root or rich-root-pack)
559
589
light checkout root: tree/lightcheckout
588
619
""" % (format.get_branch_format().get_format_description(),
589
620
format.repository_format.get_format_description(),
590
621
datestring_first, datestring_first,
622
# poking at _revision_store isn't all that clean, but neither is
623
# having the ui test dependent on the exact overhead of a given store.
624
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
592
626
self.assertEqual('', err)
667
703
""" % (format.get_branch_format().get_format_description(),
668
704
format.repository_format.get_format_description(),
669
705
datestring_first, datestring_first,
706
# poking at _revision_store isn't all that clean, but neither is
707
# having the ui test dependent on the exact overhead of a given store.
708
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
671
710
self.assertEqual('', err)
672
711
tree3.commit('commit two')
676
715
datestring_last = format_date(rev.timestamp, rev.timezone)
677
716
out, err = self.run_bzr('info tree/lightcheckout --verbose')
678
717
self.assertEqualDiff(
679
"""Lightweight checkout (format: 1.6 or 1.6.1-rich-root or \
680
dirstate or dirstate-tags or \
718
"""Lightweight checkout (format: dirstate or dirstate-tags or \
681
719
pack-0.92 or rich-root or rich-root-pack)
683
721
light checkout root: tree/lightcheckout
714
753
""" % (format.get_branch_format().get_format_description(),
715
754
format.repository_format.get_format_description(),
716
755
datestring_first, datestring_last,
756
# poking at _revision_store isn't all that clean, but neither is
757
# having the ui test dependent on the exact overhead of a given store.
758
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
718
760
self.assertEqual('', err)
742
785
""" % (format.get_branch_format().get_format_description(),
743
786
format.repository_format.get_format_description(),
744
787
datestring_first, datestring_last,
788
# poking at _revision_store isn't all that clean, but neither is
789
# having the ui test dependent on the exact overhead of a given store.
790
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
746
792
self.assertEqual('', err)
761
808
""" % (format.repository_format.get_format_description(),
809
# poking at _revision_store isn't all that clean, but neither is
810
# having the ui test dependent on the exact overhead of a given store.
811
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
763
813
self.assertEqual('', err)
870
923
""" % (format.get_branch_format().get_format_description(),
871
924
format.repository_format.get_format_description(),
872
925
datestring_first, datestring_first,
926
# poking at _revision_store isn't all that clean, but neither is
927
# having the ui test dependent on the exact overhead of a given store.
928
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
874
930
self.assertEqual('', err)
909
966
""" % (format.get_branch_format().get_format_description(),
910
967
format.repository_format.get_format_description(),
968
# poking at _revision_store isn't all that clean, but neither is
969
# having the ui test dependent on the exact overhead of a given store.
970
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
912
972
self.assertEqual('', err)
952
1013
""" % (format.get_branch_format().get_format_description(),
953
1014
format.repository_format.get_format_description(),
954
1015
datestring_first, datestring_first,
1016
# poking at _revision_store isn't all that clean, but neither is
1017
# having the ui test dependent on the exact overhead of a given store.
1018
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
956
1020
self.assertEqual('', err)
973
1038
""" % (format.repository_format.get_format_description(),
1039
# poking at _revision_store isn't all that clean, but neither is
1040
# having the ui test dependent on the exact overhead of a given store.
1041
repo._revision_store.total_size(repo.get_transaction())[1] / 1024,
976
1044
self.assertEqual('', err)
1092
1162
(False, True): 'Lightweight checkout',
1093
1163
(False, False): 'Checkout',
1094
1164
}[(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'
1165
format = {True: 'dirstate or dirstate-tags or pack-0.92'
1097
1166
' or rich-root or rich-root-pack',
1098
1167
False: 'dirstate'}[light_checkout]
1099
1168
if repo_locked:
1185
1255
transport = self.get_transport()
1186
1256
# Create shared repository with a branch
1187
1257
repo = self.make_repository('repo', shared=True,
1188
format=bzrdir.BzrDirMetaFormat1())
1258
format=bzrlib.bzrdir.BzrDirMetaFormat1())
1189
1259
repo.set_make_working_trees(False)
1190
1260
repo.bzrdir.root_transport.mkdir('branch')
1191
1261
repo_branch = repo.bzrdir.create_branch_convenience('repo/branch',
1192
format=bzrdir.BzrDirMetaFormat1())
1262
format=bzrlib.bzrdir.BzrDirMetaFormat1())
1193
1263
# Do a heavy checkout
1194
1264
transport.mkdir('tree')
1195
1265
transport.mkdir('tree/checkout')
1196
co_branch = bzrdir.BzrDir.create_branch_convenience('tree/checkout',
1197
format=bzrdir.BzrDirMetaFormat1())
1266
co_branch = bzrlib.bzrdir.BzrDir.create_branch_convenience('tree/checkout',
1267
format=bzrlib.bzrdir.BzrDirMetaFormat1())
1198
1268
co_branch.bind(repo_branch)
1199
1269
# Do a light checkout of the heavy one
1200
1270
transport.mkdir('tree/lightcheckout')
1201
lco_dir = bzrdir.BzrDirMetaFormat1().initialize('tree/lightcheckout')
1202
branch.BranchReferenceFormat().initialize(lco_dir, co_branch)
1271
lco_dir = bzrlib.bzrdir.BzrDirMetaFormat1().initialize('tree/lightcheckout')
1272
bzrlib.branch.BranchReferenceFormat().initialize(lco_dir, co_branch)
1203
1273
lco_dir.create_workingtree()
1204
1274
lco_tree = lco_dir.open_workingtree()
1298
1368
raise TestSkipped("don't use oslocks on win32 in unix manner")
1300
1370
tree = self.make_branch_and_tree('branch',
1301
format=bzrdir.BzrDirFormat6())
1371
format=bzrlib.bzrdir.BzrDirFormat6())
1303
1373
# Test all permutations of locking the working tree, branch and repository
1304
1374
# XXX: Well not yet, as we can't query oslocks yet. Currently, it's
1371
1443
""" % ('branch', tree.branch.repository._format.get_format_description(),
1373
1445
self.assertEqual('', err)
1376
def test_info_stacked(self):
1377
# We have a mainline
1378
trunk_tree = self.make_branch_and_tree('mainline',
1380
trunk_tree.commit('mainline')
1381
# and a branch from it which is stacked
1382
new_dir = trunk_tree.bzrdir.sprout('newbranch', stacked=True)
1383
out, err = self.run_bzr('info newbranch')
1385
"""Standalone tree (format: 1.6)
1387
branch root: newbranch
1390
parent branch: mainline
1391
stacked on: mainline
1393
self.assertEqual("", err)