49
49
transport = self.get_transport()
51
51
# Create initial standalone branch
52
tree1 = self.make_branch_and_tree('standalone', 'weave')
52
tree1 = self.make_branch_and_tree('standalone', 'knit')
53
53
self.build_tree(['standalone/a'])
55
55
branch1 = tree1.branch
57
57
out, err = self.run_bzr('info standalone')
58
58
self.assertEqualDiff(
59
"""Standalone tree (format: weave)
59
"""Standalone tree (format: knit)
61
61
branch root: standalone
65
65
# Standalone branch - verbose mode
66
66
out, err = self.run_bzr('info standalone -v')
67
67
self.assertEqualDiff(
68
"""Standalone tree (format: weave)
68
"""Standalone tree (format: knit)
70
70
branch root: standalone
73
control: All-in-one format 6
74
working tree: Working tree format 2
75
branch: Branch format 4
76
repository: Weave repository format 6
73
control: Meta directory format 1
74
working tree: Working tree format 3
75
branch: Branch format 5
76
repository: Knit repository format 1
78
78
In the working tree:
96
96
# Standalone branch - really verbose mode
97
97
out, err = self.run_bzr('info standalone -vv')
98
98
self.assertEqualDiff(
99
"""Standalone tree (format: weave)
99
"""Standalone tree (format: knit)
101
101
branch root: standalone
104
control: All-in-one format 6
105
working tree: Working tree format 2
106
branch: Branch format 4
107
repository: Weave repository format 6
104
control: Meta directory format 1
105
working tree: Working tree format 3
106
branch: Branch format 5
107
repository: Knit repository format 1
109
109
In the working tree:
126
126
self.assertEqual('', err)
127
127
tree1.commit('commit one')
128
rev = branch1.repository.get_revision(branch1.revision_history()[0])
128
rev = branch1.repository.get_revision(branch1.last_revision())
129
129
datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
131
131
# Branch standalone with push location
155
155
parent branch: standalone
158
control: All-in-one format 6
159
working tree: Working tree format 2
160
branch: Branch format 4
161
repository: Weave repository format 6
158
control: Meta directory format 1
159
working tree: Working tree format 3
160
branch: Branch format 5
161
repository: Knit repository format 1
163
163
In the working tree:
276
276
tree5 = branch1.create_checkout('lightcheckout', lightweight=True)
277
277
branch5 = tree5.branch
278
278
out, err = self.run_bzr('info -v lightcheckout')
279
if "metaweave" in bzrdir.format_registry:
280
format_description = "knit or metaweave"
282
format_description = "knit"
279
283
self.assertEqualDiff(
280
284
"""Lightweight checkout (format: %s)
286
290
control: Meta directory format 1
287
working tree: Working tree format 6
288
branch: Branch format 4
289
repository: Weave repository format 6
291
working tree: Working tree format 3
292
branch: Branch format 5
293
repository: Knit repository format 1
291
295
In the working tree:
309
""" % (self._repo_strings, datestring_first, datestring_first,), out)
313
""" % (format_description, datestring_first, datestring_first,), out)
310
314
self.assertEqual('', err)
312
316
# Update initial standalone branch
313
317
self.build_tree(['standalone/b'])
315
319
tree1.commit('commit two')
316
rev = branch1.repository.get_revision(branch1.revision_history()[-1])
320
rev = branch1.repository.get_revision(branch1.last_revision())
317
321
datestring_last = osutils.format_date(rev.timestamp, rev.timezone)
319
323
# Out of date branched standalone branch will not be detected
320
324
out, err = self.run_bzr('info -v branch')
321
325
self.assertEqualDiff(
322
"""Standalone tree (format: weave)
326
"""Standalone tree (format: knit)
324
328
branch root: branch
328
332
parent branch: standalone
331
control: All-in-one format 6
332
working tree: Working tree format 2
333
branch: Branch format 4
334
repository: Weave repository format 6
335
control: Meta directory format 1
336
working tree: Working tree format 3
337
branch: Branch format 5
338
repository: Knit repository format 1
336
340
In the working tree:
448
452
control: Meta directory format 1
449
working tree: Working tree format 6
450
branch: Branch format 4
451
repository: Weave repository format 6
453
working tree: Working tree format 3
454
branch: Branch format 5
455
repository: Knit repository format 1
453
457
Working tree is out of date: missing 1 revision.
473
""" % (self._repo_strings, datestring_first, datestring_last,), out)
477
""" % (format_description, datestring_first, datestring_last,), out)
474
478
self.assertEqual('', err)
476
480
def test_info_standalone_no_tree(self):
567
571
self.build_tree(['tree/lightcheckout/a'])
569
573
tree2.commit('commit one')
570
rev = repo.get_revision(branch2.revision_history()[0])
574
rev = repo.get_revision(branch2.last_revision())
571
575
datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
572
576
out, err = self.run_bzr('info tree/lightcheckout --verbose')
573
577
self.assertEqualDiff(
686
690
tree3.commit('commit two')
688
692
# Out of date lightweight checkout
689
rev = repo.get_revision(branch1.revision_history()[-1])
693
rev = repo.get_revision(branch1.last_revision())
690
694
datestring_last = osutils.format_date(rev.timestamp, rev.timezone)
691
695
out, err = self.run_bzr('info tree/lightcheckout --verbose')
692
696
self.assertEqualDiff(
842
846
tree1 = branch1.bzrdir.open_workingtree()
844
848
tree1.commit('commit one')
845
rev = repo.get_revision(branch1.revision_history()[0])
849
rev = repo.get_revision(branch1.last_revision())
846
850
datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
847
851
out, err = self.run_bzr('info -v repo/branch1')
848
852
self.assertEqualDiff(
1323
1327
self.knownFailure('Win32 cannot run "bzr info"'
1324
1328
' when the tree is locked.')
1326
def test_info_locking_oslocks(self):
1327
if sys.platform == "win32":
1328
self.skip("don't use oslocks on win32 in unix manner")
1329
# This test tests old (all-in-one, OS lock using) behaviour which
1330
# simply cannot work on windows (and is indeed why we changed our
1331
# design. As such, don't try to remove the thisFailsStrictLockCheck
1333
self.thisFailsStrictLockCheck()
1335
tree = self.make_branch_and_tree('branch',
1336
format=bzrdir.BzrDirFormat6())
1338
# Test all permutations of locking the working tree, branch and repository
1339
# XXX: Well not yet, as we can't query oslocks yet. Currently, it's
1340
# implemented by raising NotImplementedError and get_physical_lock_status()
1341
# always returns false. This makes bzr info hide the lock status. (Olaf)
1345
out, err = self.run_bzr('info -v branch')
1346
self.assertEqualDiff(
1347
"""Standalone tree (format: weave)
1352
control: All-in-one format 6
1353
working tree: Working tree format 2
1354
branch: Branch format 4
1357
In the working tree:
1365
0 versioned subdirectories
1372
""" % ('branch', tree.branch.repository._format.get_format_description(),
1374
self.assertEqual('', err)
1377
out, err = self.run_bzr('info -v branch')
1378
self.assertEqualDiff(
1379
"""Standalone tree (format: weave)
1384
control: All-in-one format 6
1385
working tree: Working tree format 2
1386
branch: Branch format 4
1389
In the working tree:
1397
0 versioned subdirectories
1404
""" % ('branch', tree.branch.repository._format.get_format_description(),
1406
self.assertEqual('', err)
1409
1330
def test_info_stacked(self):
1410
1331
# We have a mainline
1411
1332
trunk_tree = self.make_branch_and_tree('mainline',
1424
1345
stacked on: mainline
1426
1347
self.assertEqual("", err)
1349
def test_info_revinfo_optional(self):
1350
tree = self.make_branch_and_tree('.')
1351
def last_revision_info(self):
1352
raise errors.UnsupportedOperation(last_revision_info, self)
1354
branch.Branch, "last_revision_info", last_revision_info)
1355
out, err = self.run_bzr('info -v .')
1357
"""Standalone tree (format: 2a)
1362
control: Meta directory format 1
1363
working tree: Working tree format 6
1364
branch: Branch format 7
1365
repository: Repository format 2a - rich roots, group compression and chk inventories
1367
In the working tree:
1375
0 versioned subdirectories
1377
self.assertEqual("", err)