178
178
self.log(tmp_output)
179
179
self.assertEquals(output, tmp_output)
181
def example_branch(test):
183
file('hello', 'wt').write('foo')
184
test.runbzr('add hello')
185
test.runbzr('commit -m setup hello')
186
file('goodbye', 'wt').write('baz')
187
test.runbzr('add goodbye')
188
test.runbzr('commit -m setup goodbye')
190
def test_revert(self):
191
self.example_branch()
192
file('hello', 'wt').write('bar')
193
file('goodbye', 'wt').write('qux')
194
self.runbzr('revert hello')
195
self.check_file_contents('hello', 'foo')
196
self.check_file_contents('goodbye', 'qux')
197
self.runbzr('revert')
198
self.check_file_contents('goodbye', 'baz')
200
def test_merge(self):
201
from bzrlib.branch import Branch
205
self.example_branch()
207
self.runbzr('branch a b')
209
file('goodbye', 'wt').write('quux')
210
self.runbzr(['commit', '-m', "more u's are always good"])
213
file('hello', 'wt').write('quuux')
214
# We can't merge when there are in-tree changes
215
self.runbzr('merge ../b', retcode=1)
216
self.runbzr(['commit', '-m', "Like an epidemic of u's"])
217
self.runbzr('merge ../b')
218
self.check_file_contents('goodbye', 'quux')
219
# Merging a branch pulls its revision into the tree
222
a.get_revision_xml(b.last_patch())
223
print "Pending: %s" % a.pending_merges()
224
# assert a.pending_merges() == [b.last_patch()], "Assertion %s %s" \
225
# % (a.pending_merges(), b.last_patch())
227
181
class OldTests(ExternalBase):
228
"""old tests moved from ./testbzr."""
182
# old tests moved from ./testbzr
230
183
def test_bzr(self):
231
184
from os import chdir, mkdir
232
185
from os.path import exists