~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/codehosting/codeimport/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:
100
100
            if needs_tree:
101
101
                local_branch.bzrdir.create_workingtree()
102
102
            return local_branch
103
 
        # XXX Tim Penhey 2009-09-18 bug 432217 Automatic upgrade of import
104
 
        # branches disabled.  Need an orderly upgrade process.
105
 
        if False and remote_bzr_dir.needs_format_conversion(
106
 
            format=required_format):
107
 
            try:
108
 
                remote_bzr_dir.root_transport.delete_tree('backup.bzr')
109
 
            except NoSuchFile:
110
 
                pass
111
 
            upgrade(remote_url, required_format)
112
103
        # The proper thing to do here would be to call
113
104
        # "remote_bzr_dir.sprout()".  But 2a fetch slowly checks which
114
105
        # revisions are in the ancestry of the tip of the remote branch, which
121
112
        target_control.create_prefix()
122
113
        remote_bzr_dir.transport.copy_tree_to_transport(target_control)
123
114
        local_bzr_dir = BzrDir.open_from_transport(target)
 
115
        if local_bzr_dir.needs_format_conversion(format=required_format):
 
116
            try:
 
117
                local_bzr_dir.root_transport.delete_tree('backup.bzr')
 
118
            except NoSuchFile:
 
119
                pass
 
120
            upgrade(target_path, required_format, clean_up=True)
124
121
        if needs_tree:
125
122
            local_bzr_dir.create_workingtree()
126
123
        return local_bzr_dir.open_branch()