1
from bzrlib.tests.blackbox import ExternalBase
2
from unittest import makeSuite
4
class TestBzrTools(ExternalBase):
7
file(filename, 'wb').write('')
9
def test_clean_tree(self):
13
assert os.path.lexists('name~')
14
self.touch('name.pyc')
15
self.runbzr('clean-tree')
16
assert os.path.lexists('name~')
17
assert not os.path.lexists('name')
18
self.runbzr('clean-tree --detritus')
19
assert not os.path.lexists('name~')
20
assert os.path.lexists('name.pyc')
21
self.runbzr('clean-tree --ignored')
22
assert not os.path.lexists('name.pyc')
24
def test_shelve(self):
26
self.runbzr('commit -m uc --unchanged')
27
self.runbzr('shelve -r 1 -m foo --all', retcode=3)
28
file('foo', 'wb').write('foo')
29
self.runbzr('add foo')
30
self.runbzr('commit -m foo')
31
self.runbzr('shelve -r 1 -m foo --all', retcode=0)
33
def test_fetch_ghosts(self):
35
self.runbzr('fetch-ghosts .')
39
file('myfile', 'wb').write('hello')
41
self.runbzr('commit -m hello')
42
file('myfile', 'wb').write('goodbye')
43
file('mypatch', 'wb').write(self.runbzr('diff', retcode=1, backtick=1))
45
assert file('myfile', 'rb').read() == 'hello'
46
self.runbzr('patch mypatch')
47
assert file('myfile', 'rb').read() == 'goodbye'
49
def test_branch_history(self):
51
file('myfile', 'wb').write('hello')
53
self.runbzr('commit -m hello')
54
self.runbzr('branch-history')
56
def test_branch_history(self):
58
file('myfile', 'wb').write('hello')
60
self.runbzr('commit -m hello')
61
self.runbzr('graph-ancestry . graph.dot')
62
self.runbzr('branch . my_branch')
63
self.runbzr('graph-ancestry . graph.dot --merge-branch my_branch')
65
def test_fetch_ghosts(self):
67
file('myfile', 'wb').write('hello')
69
self.runbzr('commit -m hello')
70
self.runbzr('branch . my_branch')
71
self.runbzr('fetch-ghosts my_branch')
74
return makeSuite(TestBzrTools)