347
347
runbzr('log --forward')
353
def example_branch(test):
356
file('hello', 'wt').write('foo')
357
test.runbzr('add hello')
358
test.runbzr('commit -m setup hello')
360
file('goodbye', 'wt').write('baz')
361
test.runbzr('add goodbye')
362
test.runbzr('commit -m setup goodbye')
365
class RevertCommand(ExternalBase):
368
file('hello', 'wt').write('bar')
369
file('goodbye', 'wt').write('qux')
370
self.runbzr('revert hello')
371
self.check_file_contents('hello', 'foo')
372
self.check_file_contents('goodbye', 'qux')
373
self.runbzr('revert')
374
self.check_file_contents('goodbye', 'baz')
377
class MergeCommand(ExternalBase):
379
from bzrlib.branch import Branch
385
self.runbzr('branch a b')
387
file('goodbye', 'wt').write('quux')
388
self.runbzr(['commit', '-m', "more u's are always good"])
391
file('hello', 'wt').write('quuux')
392
# We can't merge when there are in-tree changes
393
self.runbzr('merge ../b', retcode=1)
394
self.runbzr(['commit', '-m', "Like an epidemic of u's"])
395
self.runbzr('merge ../b')
396
self.check_file_contents('goodbye', 'quux')
397
# Merging a branch pulls its revision into the tree
400
a.get_revision_xml(b.last_patch())
401
print "Pending: %s" % a.pending_merges()
402
# assert a.pending_merges() == [b.last_patch()], "Assertion %s %s" \
403
# % (a.pending_merges(), b.last_patch())