~ubuntu-branches/ubuntu/lucid/bzr/lucid-proposed

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jeff Bailey
  • Date: 2006-03-20 08:31:00 UTC
  • mfrom: (1.1.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20060320083100-ovdi2ssuw0epcx8s
Tags: 0.8~200603200831-0ubuntu1
* Snapshot uploaded to Dapper at Martin Pool's request.

* Disable testsuite for upload.  Fakeroot and the testsuite don't
  play along.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
import os
18
 
from bzrlib.tests import TestCaseInTempDir
 
18
 
19
19
from bzrlib.errors import BzrCommandError, NoSuchRevision
20
 
from bzrlib.branch import Branch
 
20
from bzrlib.tests import TestCaseWithTransport
21
21
from bzrlib.revisionspec import RevisionSpec
22
 
 
23
 
class TestRevisionInfo(TestCaseInTempDir):
 
22
from bzrlib.workingtree import WorkingTree
 
23
 
 
24
 
 
25
class TestRevisionInfo(TestCaseWithTransport):
24
26
    
25
27
    def check_error(self, output, *args):
26
28
        """Verify that the expected error matches what bzr says.
39
41
        self.assertEquals(self.run_bzr_captured(args)[0], output)
40
42
 
41
43
    def test_revision_info(self):
42
 
        """Test that 'bzr revision-info' reports the correct thing.
43
 
        """
44
 
 
45
 
        b = Branch.initialize(u'.')
46
 
 
47
 
        b.working_tree().commit('Commit one', rev_id='a@r-0-1')
48
 
        b.working_tree().commit('Commit two', rev_id='a@r-0-2')
49
 
        b.working_tree().commit('Commit three', rev_id='a@r-0-3')
 
44
        """Test that 'bzr revision-info' reports the correct thing."""
 
45
        wt = self.make_branch_and_tree('.')
 
46
 
 
47
        wt.commit('Commit one', rev_id='a@r-0-1')
 
48
        wt.commit('Commit two', rev_id='a@r-0-2')
 
49
        wt.commit('Commit three', rev_id='a@r-0-3')
50
50
 
51
51
        # Make sure revision-info without any arguments throws an exception
52
52
        self.check_error('bzr: ERROR: '
85
85
    def test_cat_revision(self):
86
86
        """Test bzr cat-revision.
87
87
        """
88
 
        b = Branch.initialize(u'.')
 
88
        wt = self.make_branch_and_tree('.')
 
89
        r = wt.branch.repository
89
90
 
90
 
        b.working_tree().commit('Commit one', rev_id='a@r-0-1')
91
 
        b.working_tree().commit('Commit two', rev_id='a@r-0-2')
92
 
        b.working_tree().commit('Commit three', rev_id='a@r-0-3')
 
91
        wt.commit('Commit one', rev_id='a@r-0-1')
 
92
        wt.commit('Commit two', rev_id='a@r-0-2')
 
93
        wt.commit('Commit three', rev_id='a@r-0-3')
93
94
 
94
95
        revs = {
95
 
            1:b.get_revision_xml('a@r-0-1'),
96
 
            2:b.get_revision_xml('a@r-0-2'),
97
 
            3:b.get_revision_xml('a@r-0-3')
 
96
            1:r.get_revision_xml('a@r-0-1'),
 
97
            2:r.get_revision_xml('a@r-0-2'),
 
98
            3:r.get_revision_xml('a@r-0-3'),
98
99
        }
99
100
 
100
101
        self.check_output(revs[1], 'cat-revision', 'a@r-0-1')