~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-14 18:29:43 UTC
  • mfrom: (6404.6.11 cached-branch-store)
  • Revision ID: pqm@pqm.ubuntu.com-20120214182943-vso6j0mqdnxfkp7s
(vila) Cache the branch config store to avoid useless IOs. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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()
281
283
        self.assertEquals(osutils.abspath(branch_b.get_submit_branch()),
282
284
                          osutils.abspath(parent))
283
285
        # test implicit --remember when committing new file
295
297
                                working_dir='branch_b')
296
298
        self.assertEquals(out, '')
297
299
        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()
298
302
        self.assertEquals(osutils.abspath(branch_b.get_submit_branch()),
299
303
                          osutils.abspath(branch_c.bzrdir.root_transport.base))
300
304
        # re-open tree as external run_bzr modified it
553
557
        tree_b = tree_a.bzrdir.sprout('b').open_workingtree()
554
558
        tree_c = tree_a.bzrdir.sprout('c').open_workingtree()
555
559
        out, err = self.run_bzr(['merge', '-d', 'c'])
556
 
        self.assertContainsRe(err, 'Merging from remembered parent location .*a\/')
557
 
        tree_c.branch.set_submit_branch(tree_b.bzrdir.root_transport.base)
 
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()
558
567
        out, err = self.run_bzr(['merge', '-d', 'c'])
559
 
        self.assertContainsRe(err, 'Merging from remembered submit location .*b\/')
 
568
        self.assertContainsRe(err,
 
569
                              'Merging from remembered submit location .*b\/')
560
570
 
561
571
    def test_remember_sets_submit(self):
562
572
        tree_a = self.make_branch_and_tree('a')
566
576
 
567
577
        # Remember should not happen if using default from parent
568
578
        out, err = self.run_bzr(['merge', '-d', 'b'])
569
 
        self.assertIs(tree_b.branch.get_submit_branch(), None)
 
579
        refreshed = workingtree.WorkingTree.open('b')
 
580
        self.assertIs(refreshed.branch.get_submit_branch(), None)
570
581
 
571
582
        # Remember should happen if user supplies location
572
583
        out, err = self.run_bzr(['merge', '-d', 'b', 'a'])
573
 
        self.assertEqual(tree_b.branch.get_submit_branch(),
 
584
        refreshed = workingtree.WorkingTree.open('b')
 
585
        self.assertEqual(refreshed.branch.get_submit_branch(),
574
586
                         tree_a.bzrdir.root_transport.base)
575
587
 
576
588
    def test_no_remember_dont_set_submit(self):