~thomir-deactivatedaccount/sloecode/fix-menu-flashing

« back to all changes in this revision

Viewing changes to sloecode/bzr/factory.py

  • Committer: Thomi Richards
  • Date: 2012-03-07 02:07:10 UTC
  • mfrom: (145.1.1 fix-project-create-bug)
  • Revision ID: thomi.richards@canonical.com-20120307020710-hziz5se5i6hgbkf3
Merged changes to make sloecode compatible with bzrlib 2.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
import os
5
5
from shutil import copytree, rmtree
6
6
 
7
 
from bzrlib import bzrdir, transport
 
7
from bzrlib import bzrdir, transport, version_info
8
8
from bzrlib.repository import Repository
9
9
from sloecode.bzr.display import BazaarRepositoryAdaptor
10
10
 
74
74
        dir_name = self.get_project_repo_dir(project_name)
75
75
        repo = create_shared_repo(dir_name)
76
76
        # Now to create the trunk.
77
 
        to_transport = repo.user_transport.clone('trunk')
 
77
        try:
 
78
            to_transport = repo.user_transport.clone('trunk')
 
79
        except AttributeError:
 
80
            # Fixes lp:948483 bzrlib version 2.1 (which is current in debian
 
81
            # squeeze) uses a different name for this:
 
82
            to_transport = repo._transport.clone('trunk')
78
83
        format = bzrdir.format_registry.make_bzrdir('default')
79
84
        branch = bzrdir.BzrDir.create_branch_convenience(
80
85
            to_transport.base, format=format,