~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Andrew Bennetts
  • Date: 2008-09-08 13:48:22 UTC
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080908134822-4go1k558uvynbbjj
More minor import tidying suggested by pyflakes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
# TODO: Move old formats into a plugin to make this file smaller.
29
29
 
30
 
from cStringIO import StringIO
31
30
import os
32
31
import sys
33
32
 
35
34
lazy_import(globals(), """
36
35
from stat import S_ISDIR
37
36
import textwrap
38
 
from warnings import warn
39
37
 
40
38
import bzrlib
41
39
from bzrlib import (
45
43
    lockable_files,
46
44
    lockdir,
47
45
    osutils,
48
 
    registry,
49
46
    remote,
50
47
    revision as _mod_revision,
51
 
    symbol_versioning,
52
48
    ui,
53
49
    urlutils,
54
50
    versionedfile,
59
55
    xml5,
60
56
    )
61
57
from bzrlib.osutils import (
62
 
    sha_strings,
63
58
    sha_string,
64
59
    )
65
 
from bzrlib.repository import Repository
66
60
from bzrlib.smart.client import _SmartClient
67
 
from bzrlib.smart import protocol
68
61
from bzrlib.store.versioned import WeaveStore
69
62
from bzrlib.transactions import WriteTransaction
70
63
from bzrlib.transport import (
71
64
    do_catching_redirections,
72
65
    get_transport,
 
66
    local,
73
67
    )
74
68
from bzrlib.weave import Weave
75
69
""")
78
72
    mutter,
79
73
    note,
80
74
    )
81
 
from bzrlib.transport.local import LocalTransport
82
 
from bzrlib.symbol_versioning import (
83
 
    deprecated_function,
84
 
    deprecated_method,
 
75
 
 
76
from bzrlib import (
 
77
    registry,
 
78
    symbol_versioning,
85
79
    )
86
80
 
87
81
 
474
468
        if force_new_tree:
475
469
            # check for non local urls
476
470
            t = get_transport(base, possible_transports)
477
 
            if not isinstance(t, LocalTransport):
 
471
            if not isinstance(t, local.LocalTransport):
478
472
                raise errors.NotLocalUrl(base)
479
473
        bzrdir = BzrDir.create(base, format, possible_transports)
480
474
        repo = bzrdir._find_or_create_repository(force_new_repo)
502
496
        :return: The WorkingTree object.
503
497
        """
504
498
        t = get_transport(base)
505
 
        if not isinstance(t, LocalTransport):
 
499
        if not isinstance(t, local.LocalTransport):
506
500
            raise errors.NotLocalUrl(base)
507
501
        bzrdir = BzrDir.create_branch_and_repo(base,
508
502
                                               force_new_repo=True,
1135
1129
            result_branch.set_parent(parent_location)
1136
1130
 
1137
1131
        # Create/update the result working tree
1138
 
        if isinstance(target_transport, LocalTransport) and (
 
1132
        if isinstance(target_transport, local.LocalTransport) and (
1139
1133
            result_repo is None or result_repo.make_working_trees()):
1140
1134
            wt = result.create_workingtree(accelerator_tree=accelerator_tree,
1141
1135
                hardlink=hardlink)
1696
1690
                                      # FIXME: RBC 20060121 don't peek under
1697
1691
                                      # the covers
1698
1692
                                      mode=temp_control._dir_mode)
1699
 
        if sys.platform == 'win32' and isinstance(transport, LocalTransport):
 
1693
        if sys.platform == 'win32' and isinstance(transport, local.LocalTransport):
1700
1694
            win32utils.set_file_attr_hidden(transport._abspath('.bzr'))
1701
1695
        file_mode = temp_control._file_mode
1702
1696
        del temp_control
2112
2106
        self.bzrdir = to_convert
2113
2107
        self.pb = pb
2114
2108
        self.pb.note('starting upgrade from format 4 to 5')
2115
 
        if isinstance(self.bzrdir.transport, LocalTransport):
 
2109
        if isinstance(self.bzrdir.transport, local.LocalTransport):
2116
2110
            self.bzrdir.get_workingtree_transport(None).delete('stat-cache')
2117
2111
        self._convert_to_weaves()
2118
2112
        return BzrDir.open(self.bzrdir.root_transport.base)