355
def example_branch(test):
358
file('hello', 'wt').write('foo')
359
test.runbzr('add hello')
360
test.runbzr('commit -m setup hello')
362
file('goodbye', 'wt').write('baz')
363
test.runbzr('add goodbye')
364
test.runbzr('commit -m setup goodbye')
367
357
class RevertCommand(ExternalBase):
368
358
def runTest(self):
361
file('hello', 'wt').write('foo')
362
self.runbzr('add hello')
363
self.runbzr('commit -m setup hello')
370
365
file('hello', 'wt').write('bar')
371
file('goodbye', 'wt').write('qux')
372
366
self.runbzr('revert hello')
373
367
self.check_file_contents('hello', 'foo')
374
self.check_file_contents('goodbye', 'qux')
375
self.runbzr('revert')
376
self.check_file_contents('goodbye', 'baz')
379
class MergeCommand(ExternalBase):
381
from bzrlib.branch import Branch
387
self.runbzr('branch a b')
389
file('goodbye', 'wt').write('quux')
390
self.runbzr(['commit', '-m', "more u's are always good"])
393
file('hello', 'wt').write('quuux')
394
# We can't merge when there are in-tree changes
395
self.runbzr('merge ../b', retcode=1)
396
self.runbzr(['commit', '-m', "Like an epidemic of u's"])
397
self.runbzr('merge ../b')
398
self.check_file_contents('goodbye', 'quux')
399
# Merging a branch pulls its revision into the tree
400
Branch('.').get_revision_xml(Branch('../b').last_patch())