~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_merge.py

  • Committer: Patch Queue Manager
  • Date: 2012-02-01 08:55:45 UTC
  • mfrom: (6457.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20120201085545-9vsszbsn7pbdvqb5
(vila) Merge 2.5 branch (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
from bzrlib import (
28
28
    branch,
 
29
    bzrdir,
29
30
    conflicts,
30
 
    controldir,
31
31
    merge_directive,
32
32
    osutils,
33
33
    tests,
75
75
        return tree, other
76
76
 
77
77
    def test_merge_reprocess(self):
78
 
        d = controldir.ControlDir.create_standalone_workingtree('.')
 
78
        d = bzrdir.BzrDir.create_standalone_workingtree('.')
79
79
        d.commit('h')
80
80
        self.run_bzr('merge . --reprocess --merge-type weave')
81
81
 
278
278
 
279
279
        base = urlutils.local_path_from_url(branch_a.base)
280
280
        self.assertEndsWith(err, '+N  b\nAll changes applied successfully.\n')
281
 
        # re-open branch as external run_bzr modified it
282
 
        branch_b = branch_b.bzrdir.open_branch()
283
281
        self.assertEquals(osutils.abspath(branch_b.get_submit_branch()),
284
282
                          osutils.abspath(parent))
285
283
        # test implicit --remember when committing new file
297
295
                                working_dir='branch_b')
298
296
        self.assertEquals(out, '')
299
297
        self.assertEquals(err, '+N  c\nAll changes applied successfully.\n')
300
 
        # re-open branch as external run_bzr modified it
301
 
        branch_b = branch_b.bzrdir.open_branch()
302
298
        self.assertEquals(osutils.abspath(branch_b.get_submit_branch()),
303
299
                          osutils.abspath(branch_c.bzrdir.root_transport.base))
304
300
        # re-open tree as external run_bzr modified it
557
553
        tree_b = tree_a.bzrdir.sprout('b').open_workingtree()
558
554
        tree_c = tree_a.bzrdir.sprout('c').open_workingtree()
559
555
        out, err = self.run_bzr(['merge', '-d', 'c'])
560
 
        self.assertContainsRe(err,
561
 
                              'Merging from remembered parent location .*a\/')
562
 
        tree_c.branch.lock_write()
563
 
        try:
564
 
            tree_c.branch.set_submit_branch(tree_b.bzrdir.root_transport.base)
565
 
        finally:
566
 
            tree_c.branch.unlock()
 
556
        self.assertContainsRe(err, 'Merging from remembered parent location .*a\/')
 
557
        tree_c.branch.set_submit_branch(tree_b.bzrdir.root_transport.base)
567
558
        out, err = self.run_bzr(['merge', '-d', 'c'])
568
 
        self.assertContainsRe(err,
569
 
                              'Merging from remembered submit location .*b\/')
 
559
        self.assertContainsRe(err, 'Merging from remembered submit location .*b\/')
570
560
 
571
561
    def test_remember_sets_submit(self):
572
562
        tree_a = self.make_branch_and_tree('a')
576
566
 
577
567
        # Remember should not happen if using default from parent
578
568
        out, err = self.run_bzr(['merge', '-d', 'b'])
579
 
        refreshed = workingtree.WorkingTree.open('b')
580
 
        self.assertIs(refreshed.branch.get_submit_branch(), None)
 
569
        self.assertIs(tree_b.branch.get_submit_branch(), None)
581
570
 
582
571
        # Remember should happen if user supplies location
583
572
        out, err = self.run_bzr(['merge', '-d', 'b', 'a'])
584
 
        refreshed = workingtree.WorkingTree.open('b')
585
 
        self.assertEqual(refreshed.branch.get_submit_branch(),
 
573
        self.assertEqual(tree_b.branch.get_submit_branch(),
586
574
                         tree_a.bzrdir.root_transport.base)
587
575
 
588
576
    def test_no_remember_dont_set_submit(self):