2
Test the uncommit command.
4
from bzrlib.tests import TestCaseInTempDir
5
from bzrlib.errors import BzrError
7
class TestUncommit(TestCaseInTempDir):
8
def test_uncommit(self):
9
"""Test uncommit functionality."""
13
self.build_tree(['a', 'b', 'c'])
16
bzr('commit -m initial')
18
self.assertEquals(bzr('revno'), '1\n')
20
open('a', 'wb').write('new contents of a\n')
21
self.assertEquals(bzr('status'), 'modified:\n a\n')
22
bzr('commit -m second')
24
self.assertEquals(bzr('status'), '')
25
self.assertEquals(bzr('revno'), '2\n')
27
txt = bzr('uncommit --dry-run --force')
28
self.failIfEqual(txt.find('Dry-run'), -1)
30
self.assertEquals(bzr('status'), '')
31
self.assertEquals(bzr('revno'), '2\n')
33
txt = bzr('uncommit --force')
35
self.assertEquals(bzr('revno'), '1\n')
36
self.assertEquals(bzr('status'), 'modified:\n a\n')