~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2006-02-12 09:40:15 UTC
  • mto: (1534.1.22 integration)
  • mto: This revision was merged to the branch mainline in revision 1554.
  • Revision ID: robertc@robertcollins.net-20060212094015-0fba37745716a3d9
Implement -r limit for checkout command.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    
32
32
    def setUp(self):
33
33
        super(TestCheckout, self).setUp()
34
 
        bzrdir.BzrDir.create_standalone_workingtree('branch')
 
34
        tree = bzrdir.BzrDir.create_standalone_workingtree('branch')
 
35
        tree.commit('1', rev_id='1', allow_pointless=True)
 
36
        self.build_tree(['branch/added_in_2'])
 
37
        tree.add('added_in_2')
 
38
        tree.commit('2', rev_id='2')
35
39
 
36
40
    def test_checkout_makes_checkout(self):
37
41
        self.runbzr('checkout branch checkout')
40
44
        result = bzrdir.BzrDir.open('checkout')
41
45
        self.assertEqual(source.open_branch().bzrdir.root_transport.base,
42
46
                         result.open_branch().bzrdir.root_transport.base)
 
47
 
 
48
    def test_checkout_dash_r(self):
 
49
        self.runbzr('checkout -r -2 branch checkout')
 
50
        # the working tree should now be at revision '1' with the content
 
51
        # from 1.
 
52
        result = bzrdir.BzrDir.open('checkout')
 
53
        self.assertEqual('1', result.open_workingtree().last_revision())
 
54
        self.failIfExists('checkout/added_in_2')
 
55