~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugins/weave_fmt/test_bzrdir.py

  • Committer: Ross Lagerwall
  • Date: 2012-08-07 06:32:51 UTC
  • mto: (6437.63.5 2.5)
  • mto: This revision was merged to the branch mainline in revision 6558.
  • Revision ID: rosslagerwall@gmail.com-20120807063251-x9p03ghg2ws8oqjc
Add bzrlib/locale to .bzrignore

bzrlib/locale is generated with ./setup.py build_mo which is in turn called
by ./setup.py build

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2011, 2012, 2016 Canonical Ltd
 
1
# Copyright (C) 2006-2011 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
27
27
from bzrlib import (
28
28
    branch,
29
29
    bzrdir,
30
 
    controldir,
31
30
    errors,
32
31
    repository,
33
32
    upgrade,
67
66
            self.assertTrue(ctrl_2 is ctrl_3)
68
67
        check_dir_components_use_same_lock(dir)
69
68
        # and if we open it normally.
70
 
        dir = controldir.ControlDir.open(self.get_url())
 
69
        dir = bzrdir.BzrDir.open(self.get_url())
71
70
        check_dir_components_use_same_lock(dir)
72
71
 
73
72
    def test_can_convert(self):
101
100
            self.assertTrue(ctrl_2 is ctrl_3)
102
101
        check_dir_components_use_same_lock(dir)
103
102
        # and if we open it normally.
104
 
        dir = controldir.ControlDir.open(self.get_url())
 
103
        dir = bzrdir.BzrDir.open(self.get_url())
105
104
        check_dir_components_use_same_lock(dir)
106
105
 
107
106
    def test_can_convert(self):
303
302
        # At this point, we have a format6 branch without checkout files.
304
303
        upgrade.upgrade('.', bzrdir.BzrDirMetaFormat1())
305
304
        # The upgrade should not have set up a working tree.
306
 
        control = controldir.ControlDir.open('.')
 
305
        control = bzrdir.BzrDir.open('.')
307
306
        self.assertFalse(control.has_workingtree())
308
307
        # We have covered the scope of this test, we may as well check that
309
308
        # upgrade has not eaten our data, even if it's a bit redundant with
311
310
        self.assertIsInstance(control._format, bzrdir.BzrDirMetaFormat1)
312
311
        b = control.open_branch()
313
312
        self.addCleanup(b.lock_read().unlock)
314
 
        self.assertEqual(b._revision_history(),
 
313
        self.assertEquals(b._revision_history(),
315
314
           ['mbp@sourcefrog.net-20051004035611-176b16534b086b3c',
316
315
            'mbp@sourcefrog.net-20051004035756-235f2b7dcdddd8dd'])
317
316
 
318
317
    def test_upgrade_simple(self):
319
318
        """Upgrade simple v0.0.4 format to latest format"""
320
 
        eq = self.assertEqual
 
319
        eq = self.assertEquals
321
320
        self.build_tree_contents(_upgrade1_template)
322
321
        upgrade.upgrade(u'.')
323
 
        control = controldir.ControlDir.open('.')
 
322
        control = bzrdir.BzrDir.open('.')
324
323
        b = control.open_branch()
325
324
        # tsk, peeking under the covers.
326
325
        self.assertIsInstance(
378
377
        bzr, but can happen in branches imported from baz and arch, or from
379
378
        other systems, where the importer knows about a revision but not
380
379
        its contents."""
381
 
        eq = self.assertEqual
 
380
        eq = self.assertEquals
382
381
        self.build_tree_contents(_ghost_template)
383
382
        upgrade.upgrade(u'.')
384
383
        b = branch.Branch.open(u'.')
390
389
 
391
390
    def test_upgrade_makes_dir_weaves(self):
392
391
        self.build_tree_contents(_upgrade_dir_template)
393
 
        old_repodir = controldir.ControlDir.open_unsupported('.')
 
392
        old_repodir = bzrdir.BzrDir.open_unsupported('.')
394
393
        old_repo_format = old_repodir.open_repository()._format
395
394
        upgrade.upgrade('.')
396
395
        # this is the path to the literal file. As format changes
545
544
        self.build_tree(['master/', 'child/'])
546
545
        self.make_branch_and_tree('master')
547
546
        self.make_branch_and_tree('child',
548
 
                        format=controldir.format_registry.make_bzrdir('weave'))
 
547
                        format=bzrdir.format_registry.make_bzrdir('weave'))
549
548
        os.chdir('child')
550
549
 
551
550
    def test_bind_format_6_bzrdir(self):