36
37
self.build_tree(['branch/b'])
38
39
wt.commit('adding b', rev_id='r2')
40
self.revisions = wt.branch.revision_history()
43
42
def test_basic(self):
43
wt = self.create_tree()
46
45
txt = self.run_bzr('version-info branch')[0]
47
46
self.assertContainsRe(txt, 'date:')
48
47
self.assertContainsRe(txt, 'build-date:')
49
48
self.assertContainsRe(txt, 'revno: 2')
50
self.assertContainsRe(txt, 'revision-id: ' + self.revisions[-1])
49
self.assertContainsRe(txt, 'revision-id: ' + wt.branch.last_revision())
52
51
def test_all(self):
53
52
"""'--all' includes clean, revision history, and file revisions"""
53
wt = self.create_tree()
55
54
txt = self.run_bzr('version-info branch --all')[0]
56
55
self.assertContainsRe(txt, 'date:')
57
56
self.assertContainsRe(txt, 'revno: 2')
58
self.assertContainsRe(txt, 'revision-id: ' + self.revisions[-1])
57
self.assertContainsRe(txt, 'revision-id: ' + wt.branch.last_revision())
59
58
self.assertContainsRe(txt, 'clean: True')
60
59
self.assertContainsRe(txt, 'revisions:')
61
for rev_id in self.revisions:
60
for rev_id in wt.branch.repository.all_revision_ids():
62
61
self.assertContainsRe(txt, 'id: ' + rev_id)
63
62
self.assertContainsRe(txt, 'message: adding a')
64
63
self.assertContainsRe(txt, 'message: adding b')
167
166
self.assertContainsString(out, commit_message.encode('utf-8'))
168
def test_revision(self):
169
tree = self.create_tree()
170
branch = self.make_branch('just_branch')
171
branch.pull(tree.branch)
173
txt = self.run_bzr('version-info -r1 just_branch')[0]
174
self.assertStartsWith(txt, 'revision-id: r1\n')