43
43
from bzrlib.branch import Branch
44
from bzrlib.clone import copy_branch
45
44
from bzrlib.errors import BzrCommandError
46
45
from bzrlib.osutils import has_symlinks, pathjoin
47
46
from bzrlib.tests.HTTPTestUtil import TestCaseWithWebserver
394
394
# Merging a branch pulls its revision into the tree
395
395
a = Branch.open('.')
396
396
b = Branch.open('../b')
397
a.get_revision_xml(b.last_revision())
397
a.repository.get_revision_xml(b.last_revision())
398
398
self.log('pending merges: %s', a.working_tree().pending_merges())
399
399
self.assertEquals(a.working_tree().pending_merges(),
400
400
[b.last_revision()])
558
file("myfile", "wb").write("My contents\n")
560
self.runbzr('commit -m myfile')
561
self.run_bzr_captured('cat -r 1 myfile'.split(' '))
556
563
def test_pull_verbose(self):
557
564
"""Pull changes from one branch to another and watch the output."""
778
785
self.runbzr('commit -m done',)
779
786
self.runbzr('remerge', retcode=3)
788
def test_status(self):
792
self.runbzr('commit --unchanged --message f')
793
self.runbzr('branch . ../branch2')
794
self.runbzr('branch . ../branch3')
795
self.runbzr('commit --unchanged --message peter')
796
os.chdir('../branch2')
797
self.runbzr('merge ../branch1')
798
self.runbzr('commit --unchanged --message pumpkin')
799
os.chdir('../branch3')
800
self.runbzr('merge ../branch2')
801
message = self.capture('status')
782
804
def test_conflicts(self):
783
805
"""Handling of merge conflicts"""
820
842
from bzrlib.testament import Testament
821
843
bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
822
844
self.runbzr('re-sign -r revid:A')
823
self.assertEqual(Testament.from_revision(branch,'A').as_short_text(),
824
branch.revision_store.get('A', 'sig').read())
845
self.assertEqual(Testament.from_revision(branch.repository,
846
'A').as_short_text(),
847
branch.repository.revision_store.get('A',
826
850
bzrlib.gpg.GPGStrategy = oldstrategy
838
862
from bzrlib.testament import Testament
839
863
bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
840
864
self.runbzr('re-sign -r 1..')
841
self.assertEqual(Testament.from_revision(branch,'A').as_short_text(),
842
branch.revision_store.get('A', 'sig').read())
843
self.assertEqual(Testament.from_revision(branch,'B').as_short_text(),
844
branch.revision_store.get('B', 'sig').read())
845
self.assertEqual(Testament.from_revision(branch,'C').as_short_text(),
846
branch.revision_store.get('C', 'sig').read())
866
Testament.from_revision(branch.repository,'A').as_short_text(),
867
branch.repository.revision_store.get('A', 'sig').read())
869
Testament.from_revision(branch.repository,'B').as_short_text(),
870
branch.repository.revision_store.get('B', 'sig').read())
871
self.assertEqual(Testament.from_revision(branch.repository,
872
'C').as_short_text(),
873
branch.repository.revision_store.get('C',
848
876
bzrlib.gpg.GPGStrategy = oldstrategy