/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

Fix compatibility with older versions of bzrlib.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    errors as bzr_errors,
22
22
    lockable_files,
23
23
    urlutils,
 
24
    version_info as bzrlib_version,
24
25
    )
25
26
 
26
27
LockWarner = getattr(lockable_files, "_LockWarner", None)
119
120
    get_repository_transport = get_branch_transport
120
121
    get_workingtree_transport = get_branch_transport
121
122
 
122
 
 
123
 
    def open_branch(self, name=None, ignore_fallbacks=None, unsupported=False):
 
123
    def _open_branch(self, name=None, ignore_fallbacks=None,
 
124
            unsupported=False):
124
125
        """'create' a branch for this dir."""
125
126
        repo = self.open_repository()
126
127
        from bzrlib.plugins.git.branch import LocalGitBranch
127
128
        return LocalGitBranch(self, repo, self._branch_name_to_ref(name),
128
129
            self._lockfiles)
129
130
 
 
131
    if bzrlib_version >= (2, 2):
 
132
        open_branch = _open_branch
 
133
    else:
 
134
        def open_branch(self, ignore_fallbacks=None, unsupported=False):
 
135
            return self._open_branch(name=None,
 
136
                ignore_fallbacks=ignore_fallbacks, unsupported=unsupported)
 
137
 
130
138
    def destroy_branch(self, name=None):
131
139
        del self._git.refs[self._branch_name_to_ref(name)]
132
140