24
24
def test_shelve(self):
25
25
self.runbzr('init')
26
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)
27
self.runbzr('shelve -r 1 -m foo', retcode=1)
33
29
def test_fetch_ghosts(self):
34
30
self.runbzr('init')
35
self.runbzr('fetch-ghosts .')
32
self.runbzr('fetch-ghosts .', retcode=1)
33
except AssertionError:
34
self.runbzr('fetch-ghosts .', retcode=3)
37
36
def test_patch(self):
38
37
self.runbzr('init')
46
45
self.runbzr('patch mypatch')
47
46
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
self.runbzr('init source')
75
self.runbzr('checkout --lightweight source checkout')
76
self.runbzr('zap checkout')
78
def test_branches(self):
79
self.runbzr('init source')
80
self.runbzr('init source/subsource')
81
self.runbzr('checkout --lightweight source checkout')
82
self.runbzr('init checkout/subcheckout')
83
self.runbzr('init checkout/.bzr/subcheckout')
84
out = self.capture('branches')
85
lines = out.split('\n')
86
self.assertIs(True, 'source' in lines)
87
self.assertIs(True, 'source/subsource' in lines)
88
self.assertIs(True, 'checkout/subcheckout' in lines)
89
self.assertIs(True, 'checkout' not in lines)
90
self.assertIs(True, 'checkout/.bzr/subcheckout' not in lines)
93
50
return makeSuite(TestBzrTools)