bzr branch
http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
| 
0.3.11
by John Arbash Meinel
 Updated to latest bzr.dev code, and added tests.  | 
1  | 
"""\
 | 
2  | 
Test the uncommit command.
 | 
|
3  | 
"""
 | 
|
| 
1185.31.25
by John Arbash Meinel
 Renamed all of the tests from selftest/foo.py to tests/test_foo.py  | 
4  | 
from bzrlib.tests import TestCaseInTempDir  | 
| 
0.3.11
by John Arbash Meinel
 Updated to latest bzr.dev code, and added tests.  | 
5  | 
from bzrlib.errors import BzrError  | 
6  | 
||
7  | 
class TestUncommit(TestCaseInTempDir):  | 
|
8  | 
def test_uncommit(self):  | 
|
9  | 
"""Test uncommit functionality."""  | 
|
10  | 
bzr = self.capture  | 
|
11  | 
||
12  | 
bzr('init')  | 
|
13  | 
self.build_tree(['a', 'b', 'c'])  | 
|
14  | 
||
15  | 
bzr('add')  | 
|
16  | 
bzr('commit -m initial')  | 
|
17  | 
||
18  | 
self.assertEquals(bzr('revno'), '1\n')  | 
|
19  | 
||
20  | 
open('a', 'wb').write('new contents of a\n')  | 
|
21  | 
self.assertEquals(bzr('status'), 'modified:\n a\n')  | 
|
22  | 
bzr('commit -m second')  | 
|
23  | 
||
24  | 
self.assertEquals(bzr('status'), '')  | 
|
25  | 
self.assertEquals(bzr('revno'), '2\n')  | 
|
26  | 
||
27  | 
txt = bzr('uncommit --dry-run --force')  | 
|
28  | 
self.failIfEqual(txt.find('Dry-run'), -1)  | 
|
29  | 
||
30  | 
self.assertEquals(bzr('status'), '')  | 
|
31  | 
self.assertEquals(bzr('revno'), '2\n')  | 
|
32  | 
||
33  | 
txt = bzr('uncommit --force')  | 
|
34  | 
||
35  | 
self.assertEquals(bzr('revno'), '1\n')  | 
|
36  | 
self.assertEquals(bzr('status'), 'modified:\n a\n')  | 
|
37  |