/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_cat_revision.py

  • Committer: Martin
  • Date: 2010-05-25 17:27:52 UTC
  • mfrom: (5254 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5257.
  • Revision ID: gzlist@googlemail.com-20100525172752-amm089xcikv968sw
Merge bzr.dev to unite with similar changes already made

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005, 2007 Canonical Ltd
 
1
# Copyright (C) 2004-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
36
36
        wt.commit('Commit two', rev_id='a@r-0-2')
37
37
        wt.commit('Commit three', rev_id='a@r-0-3')
38
38
 
39
 
        revs = {
40
 
            1:r.get_revision_xml('a@r-0-1'),
41
 
            2:r.get_revision_xml('a@r-0-2'),
42
 
            3:r.get_revision_xml('a@r-0-3'),
43
 
        }
 
39
        r.lock_read()
 
40
        try:
 
41
            revs = {}
 
42
            for i in (1, 2, 3):
 
43
                revid = "a@r-0-%d" % i
 
44
                stream = r.revisions.get_record_stream([(revid,)], 'unordered', 
 
45
                                                       False) 
 
46
                revs[i] = stream.next().get_bytes_as('fulltext')
 
47
        finally:
 
48
            r.unlock()
44
49
 
45
50
        self.check_output(revs[1], 'cat-revision a@r-0-1')
46
51
        self.check_output(revs[2], 'cat-revision a@r-0-2')
59
64
        err = self.run_bzr('cat-revision abcd', retcode=3)[1]
60
65
        self.assertContainsRe(err, 'The repository .* contains no revision abcd.')
61
66
 
62
 
 
 
67
    def test_cat_revision_directory(self):
 
68
        """Test --directory option"""
 
69
        tree = self.make_branch_and_tree('a')
 
70
        tree.commit('This revision', rev_id='abcd')
 
71
        output, errors = self.run_bzr(['cat-revision', '-d', 'a', u'abcd'])
 
72
        self.assertContainsRe(output, 'This revision')
 
73
        self.assertEqual('', errors)