~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/codehosting/codeimport/tests/test_worker.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-07-28 19:18:13 UTC
  • mfrom: (13457.6.8 upgrade-stderr)
  • Revision ID: launchpad@pqm.canonical.com-20110728191813-kw179ng15cpum2ln
[r=jcsackett,
        mbp][bug=808035] Fix processing of code imports that are currently
        stored in an old bzr format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    )
25
25
from bzrlib.errors import (
26
26
    NoSuchFile,
27
 
    NotBranchError,
28
27
    )
29
28
from bzrlib.tests import TestCaseWithTransport
30
29
from bzrlib import trace
31
30
from bzrlib.transport import get_transport
32
 
from bzrlib.upgrade import upgrade
33
31
from bzrlib.urlutils import (
34
32
    join as urljoin,
35
33
    local_path_from_url,
210
208
        store = self.makeBranchStore()
211
209
        target_url = store._getMirrorURL(self.arbitrary_branch_id)
212
210
        knit_format = format_registry.get('knit')()
213
 
        create_branch_with_one_revision(target_url, format=knit_format)
214
 
        default_format = BzrDirFormat.get_default_format()
 
211
        tree = create_branch_with_one_revision(target_url, format=knit_format)
 
212
        self.assertNotEquals(tree.bzrdir._format.repository_format.network_name(),
 
213
            default_format.repository_format.network_name())
215
214
 
216
215
        # The fetched branch is in the default format.
217
216
        new_branch = store.pull(
218
217
            self.arbitrary_branch_id, self.temp_dir, default_format)
219
218
        # Make sure backup.bzr is removed, as it interferes with CSCVS.
220
219
        self.assertEquals(os.listdir(self.temp_dir), [".bzr"])
221
 
        self.assertEqual(
222
 
            default_format, new_branch.bzrdir._format)
 
220
        self.assertEquals(new_branch.repository._format.network_name(),
 
221
            default_format.repository_format.network_name())
223
222
 
224
223
    def test_pushUpgradesFormat(self):
225
224
        # A branch should always be in the most up-to-date format before a
228
227
        target_url = store._getMirrorURL(self.arbitrary_branch_id)
229
228
        knit_format = format_registry.get('knit')()
230
229
        create_branch_with_one_revision(target_url, format=knit_format)
231
 
        default_format = BzrDirFormat.get_default_format()
232
230
 
233
231
        # The fetched branch is in the default format.
234
232
        new_branch = store.pull(