1
from bzrlib import tests
3
class TestCatRevision(tests.TestCaseWithTransport):
5
def test_cat_revision(self):
1
from bzrlib.tests import blackbox
4
class TestCatRevision(blackbox.ExternalBase):
6
def test_cat_unicode_revision(self):
6
7
tree = self.make_branch_and_tree('.')
7
8
tree.commit('This revision', rev_id='abcd')
8
9
output, errors = self.run_bzr('cat-revision', u'abcd')
9
10
self.assertContainsRe(output, 'This revision')
10
11
self.assertEqual('', errors)
13
def test_cat_revision(self):
14
"""Test bzr cat-revision.
16
wt = self.make_branch_and_tree('.')
17
r = wt.branch.repository
19
wt.commit('Commit one', rev_id='a@r-0-1')
20
wt.commit('Commit two', rev_id='a@r-0-2')
21
wt.commit('Commit three', rev_id='a@r-0-3')
24
1:r.get_revision_xml('a@r-0-1'),
25
2:r.get_revision_xml('a@r-0-2'),
26
3:r.get_revision_xml('a@r-0-3'),
29
self.check_output(revs[1], 'cat-revision', 'a@r-0-1')
30
self.check_output(revs[2], 'cat-revision', 'a@r-0-2')
31
self.check_output(revs[3], 'cat-revision', 'a@r-0-3')
33
self.check_output(revs[1], 'cat-revision', '-r', '1')
34
self.check_output(revs[2], 'cat-revision', '-r', '2')
35
self.check_output(revs[3], 'cat-revision', '-r', '3')
37
self.check_output(revs[1], 'cat-revision', '-r', 'revid:a@r-0-1')
38
self.check_output(revs[2], 'cat-revision', '-r', 'revid:a@r-0-2')
39
self.check_output(revs[3], 'cat-revision', '-r', 'revid:a@r-0-3')