~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Marius Kruger
  • Date: 2008-10-03 21:31:00 UTC
  • mfrom: (3763 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3809.
  • Revision ID: amanic@gmail.com-20081003213100-q4rv2l9pn8qto9o0
merge with bzr.dev

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,
1137
1131
            result_branch.set_parent(parent_location)
1138
1132
 
1139
1133
        # Create/update the result working tree
1140
 
        if isinstance(target_transport, LocalTransport) and (
 
1134
        if isinstance(target_transport, local.LocalTransport) and (
1141
1135
            result_repo is None or result_repo.make_working_trees()):
1142
1136
            wt = result.create_workingtree(accelerator_tree=accelerator_tree,
1143
1137
                hardlink=hardlink)
1702
1696
                                      # FIXME: RBC 20060121 don't peek under
1703
1697
                                      # the covers
1704
1698
                                      mode=temp_control._dir_mode)
1705
 
        if sys.platform == 'win32' and isinstance(transport, LocalTransport):
 
1699
        if sys.platform == 'win32' and isinstance(transport, local.LocalTransport):
1706
1700
            win32utils.set_file_attr_hidden(transport._abspath('.bzr'))
1707
1701
        file_mode = temp_control._file_mode
1708
1702
        del temp_control
2118
2112
        self.bzrdir = to_convert
2119
2113
        self.pb = pb
2120
2114
        self.pb.note('starting upgrade from format 4 to 5')
2121
 
        if isinstance(self.bzrdir.transport, LocalTransport):
 
2115
        if isinstance(self.bzrdir.transport, local.LocalTransport):
2122
2116
            self.bzrdir.get_workingtree_transport(None).delete('stat-cache')
2123
2117
        self._convert_to_weaves()
2124
2118
        return BzrDir.open(self.bzrdir.root_transport.base)