~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_uncommit.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-02-24 14:43:00 UTC
  • mfrom: (1558.1.12 Aaron's integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060224144300-16a30ef3bb38fb7f
Actually apply alias and uncommit fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
"""\
2
2
Test the uncommit command.
3
3
"""
 
4
 
 
5
import os
 
6
 
 
7
from bzrlib.errors import BzrError
4
8
from bzrlib.tests import TestCaseInTempDir
5
 
from bzrlib.errors import BzrError
6
9
 
7
10
class TestUncommit(TestCaseInTempDir):
8
11
    def test_uncommit(self):
9
12
        """Test uncommit functionality."""
10
13
        bzr = self.capture 
11
 
 
 
14
        os.mkdir('branch')
 
15
        os.chdir('branch')
12
16
        bzr('init')
13
17
        self.build_tree(['a', 'b', 'c'])
14
18
 
34
38
 
35
39
        self.assertEquals(bzr('revno'), '1\n')
36
40
        self.assertEquals(bzr('status'), 'modified:\n  a\n')
37
 
 
 
41
        
 
42
        bzr('checkout . ../checkout')
 
43
        os.chdir('../checkout')
 
44
        self.assertEquals("", bzr('status'))
 
45
        self.assertEquals(bzr('revno'), '1\n')
 
46
 
 
47
        open('a', 'wb').write('new contents of a\n')
 
48
        self.assertEquals(bzr('status'), 'modified:\n  a\n')
 
49
        bzr('commit -m second')
 
50
 
 
51
        self.assertEquals(bzr('status'), '')
 
52
        self.assertEquals(bzr('revno'), '2\n')
 
53
 
 
54
        txt = bzr('uncommit --dry-run --force')
 
55
        self.failIfEqual(txt.find('Dry-run'), -1)
 
56
 
 
57
        self.assertEquals(bzr('status'), '')
 
58
        self.assertEquals(bzr('revno'), '2\n')
 
59
 
 
60
        txt = bzr('uncommit --force')
 
61
 
 
62
        self.assertEquals(bzr('revno'), '1\n')
 
63
        self.assertEquals(bzr('status'), 'modified:\n  a\n')