/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/branch_implementations/test_branch.py

MergeĀ upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Tests for branch implementations - tests a branch format."""
18
18
 
752
752
        tree3.merge_from_branch(tree2.branch)
753
753
        tree3.commit('empty commit 6')
754
754
        tree2.pull(tree3.branch)
 
755
 
 
756
 
 
757
class TestIgnoreFallbacksParameter(TestCaseWithBranch):
 
758
 
 
759
    def make_branch_with_fallback(self):
 
760
        fallback = self.make_branch('fallback')
 
761
        if not fallback._format.supports_stacking():
 
762
            raise tests.TestNotApplicable("format does not support stacking")
 
763
        stacked = self.make_branch('stacked')
 
764
        stacked.set_stacked_on_url(fallback.base)
 
765
        return stacked
 
766
 
 
767
    def test_fallbacks_not_opened(self):
 
768
        stacked = self.make_branch_with_fallback()
 
769
        self.get_transport('').rename('fallback', 'moved')
 
770
        reopened = stacked.bzrdir.open_branch(ignore_fallbacks=True)
 
771
        self.assertEqual([], reopened.repository._fallback_repositories)
 
772
        
 
773
    def test_fallbacks_are_opened(self):
 
774
        stacked = self.make_branch_with_fallback()
 
775
        reopened = stacked.bzrdir.open_branch(ignore_fallbacks=False)
 
776
        self.assertLength(1, reopened.repository._fallback_repositories)