~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_upgrade.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-09-17 21:19:56 UTC
  • mfrom: (1997.1.6 bind-does-not-push-or-pull)
  • Revision ID: pqm@pqm.ubuntu.com-20060917211956-6e30d07da410fd1a
(Robert Collins) Change the Branch bind method to just bind rather than binding and pushing (fixes #43744 and #39542)

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
        self.failUnlessExists('.bzr/README')
47
47
 
48
48
    def test_upgrade_simple(self):
49
 
        """Upgrade simple v0.0.4 format to v6"""
 
49
        """Upgrade simple v0.0.4 format to latest format"""
50
50
        eq = self.assertEquals
51
51
        self.build_tree_contents(_upgrade1_template)
52
52
        upgrade(u'.')
131
131
        self.build_tree_contents(_upgrade_dir_template)
132
132
        upgrade('.', bzrdir.BzrDirMetaFormat1())
133
133
        tree = workingtree.WorkingTree.open('.')
134
 
        self.assertEqual(tree.last_revision(),
135
 
                         tree.branch.revision_history()[-1])
 
134
        self.assertEqual([tree.branch.revision_history()[-1]],
 
135
            tree.get_parent_ids())
 
136
 
 
137
    def test_upgrade_v6_to_meta_no_workingtree(self):
 
138
        # Some format6 branches do not have checkout files. Upgrading
 
139
        # such a branch to metadir must not setup a working tree.
 
140
        self.build_tree_contents(_upgrade1_template)
 
141
        upgrade('.', bzrdir.BzrDirFormat6())
 
142
        transport = get_transport('.')
 
143
        transport.delete_multi(['.bzr/pending-merges', '.bzr/inventory'])
 
144
        assert not transport.has('.bzr/stat-cache')
 
145
        # XXX: upgrade fails if a .bzr.backup is already present
 
146
        # -- David Allouche 2006-08-11
 
147
        transport.delete_tree('.bzr.backup')
 
148
        # At this point, we have a format6 branch without checkout files.
 
149
        upgrade('.', bzrdir.BzrDirMetaFormat1())
 
150
        # The upgrade should not have set up a working tree.
 
151
        control = bzrdir.BzrDir.open('.')
 
152
        self.assertFalse(control.has_workingtree())
 
153
        # We have covered the scope of this test, we may as well check that
 
154
        # upgrade has not eaten our data, even if it's a bit redundant with
 
155
        # other tests.
 
156
        self.failUnless(isinstance(control._format, bzrdir.BzrDirMetaFormat1))
 
157
        branch = control.open_branch()
 
158
        self.assertEquals(branch.revision_history(),
 
159
           ['mbp@sourcefrog.net-20051004035611-176b16534b086b3c',
 
160
            'mbp@sourcefrog.net-20051004035756-235f2b7dcdddd8dd'])
136
161
 
137
162
 
138
163
_upgrade1_template = \