/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to dir.py

Rename BzrDir to ControlDir.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
17
 
18
 
"""An adapter between a Git control dir and a Bazaar BzrDir."""
 
18
"""An adapter between a Git control dir and a Bazaar ControlDir."""
19
19
 
20
20
from bzrlib import (
21
21
    bzrdir,
28
28
LockWarner = getattr(lockable_files, "_LockWarner", None)
29
29
 
30
30
from bzrlib.plugins.git import (
31
 
    LocalGitBzrDirFormat,
 
31
    LocalGitControlDirFormat,
32
32
    )
 
33
try:
 
34
    from bzrlib.controldir import (
 
35
        ControlDir,
 
36
        )
 
37
except ImportError:
 
38
    # bzr < 2.3
 
39
    from bzrlib.bzrdir import (
 
40
        BzrDir,
 
41
        )
 
42
    ControlDir = BzrDir
33
43
 
34
44
 
35
45
class GitLock(object):
69
79
            self._lock_warner = LockWarner(repr(self))
70
80
 
71
81
 
72
 
class GitDir(bzrdir.BzrDir):
 
82
class GitDir(ControlDir):
73
83
    """An adapter to the '.git' dir used by git."""
74
84
 
75
85
    def is_supported(self):
131
141
    def get_branch_transport(self, branch_format, name=None):
132
142
        if branch_format is None:
133
143
            return self.transport
134
 
        if isinstance(branch_format, LocalGitBzrDirFormat):
 
144
        if isinstance(branch_format, LocalGitControlDirFormat):
135
145
            return self.transport
136
146
        raise bzr_errors.IncompatibleFormat(branch_format, self._format)
137
147
 
138
148
    def get_repository_transport(self, format):
139
149
        if format is None:
140
150
            return self.transport
141
 
        if isinstance(format, LocalGitBzrDirFormat):
 
151
        if isinstance(format, LocalGitControlDirFormat):
142
152
            return self.transport
143
153
        raise bzr_errors.IncompatibleFormat(format, self._format)
144
154
 
145
155
    def get_workingtree_transport(self, format):
146
156
        if format is None:
147
157
            return self.transport
148
 
        if isinstance(format, LocalGitBzrDirFormat):
 
158
        if isinstance(format, LocalGitControlDirFormat):
149
159
            return self.transport
150
160
        raise bzr_errors.IncompatibleFormat(format, self._format)
151
161