~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_branch/test_branch.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:
1
 
# Copyright (C) 2005-2011 Canonical Ltd
 
1
# Copyright (C) 2005-2012 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
779
779
        branch.unbind()
780
780
        self.assertEqual(None, branch.get_master_branch())
781
781
 
782
 
    def test_unlocked_does_not_cache_master_branch(self):
783
 
        """Unlocked branches do not cache the result of get_master_branch."""
784
 
        master = self.make_branch('master')
785
 
        branch1 = self.make_branch('branch')
786
 
        try:
787
 
            branch1.bind(master)
788
 
        except errors.UpgradeRequired:
789
 
            raise tests.TestNotApplicable('Format does not support binding')
790
 
        # Open branch1 again
791
 
        branch2 = branch1.bzrdir.open_branch()
792
 
        self.assertNotEqual(None, branch1.get_master_branch())
793
 
        # Unbind the branch via branch2.  branch1 isn't locked so will
794
 
        # immediately return the new value for get_master_branch.
795
 
        branch2.unbind()
796
 
        self.assertEqual(None, branch1.get_master_branch())
797
 
 
798
782
    def test_bind_clears_cached_master_branch(self):
799
783
        """b.bind clears any cached value of b.get_master_branch."""
800
784
        master1 = self.make_branch('master1')