/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 git_dir.py

  • Committer: David Allouche
  • Date: 2007-12-30 01:11:44 UTC
  • mto: (0.200.47 bzr-git.pull)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: ddaa@canonical.com-20071230011144-8o9mn507kwf265z1
GitRepository.get_inventory and .revision_tree work for the null revision. Support for testing GitRepository without disk data.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
class GitDir(bzrdir.BzrDir):
59
59
    """An adapter to the '.git' dir used by git."""
60
60
 
 
61
    _gitrepository_class = git_repository.GitRepository
 
62
 
61
63
    def __init__(self, transport, lockfiles, format):
62
64
        self._format = format
63
65
        self.root_transport = transport
83
85
 
84
86
    def open_repository(self, shared=False):
85
87
        """'open' a repository for this dir."""
86
 
        return git_repository.GitRepository(self, self._lockfiles)
 
88
        return self._gitrepository_class(self, self._lockfiles)
87
89
 
88
90
    def open_workingtree(self):
89
91
        loc = urlutils.unescape_for_display(self.root_transport.base, 'ascii')
93
95
class GitBzrDirFormat(bzrdir.BzrDirFormat):
94
96
    """The .git directory control format."""
95
97
 
 
98
    _gitdir_class = GitDir
 
99
 
96
100
    @classmethod
97
101
    def _known_formats(self):
98
102
        return set([GitBzrDirFormat()])
106
110
        url = transport.base
107
111
        if url.startswith('readonly+'):
108
112
            url = url[len('readonly+'):]
109
 
        path = urlutils.local_path_from_url(url)
110
113
        if not transport.has('.git'):
111
114
            raise errors.bzr_errors.NotBranchError(path=transport.base)
112
115
        lockfiles = GitLockableFiles(GitLock())
113
 
        return GitDir(transport, lockfiles, self)
 
116
        return self._gitdir_class(transport, lockfiles, self)
114
117
 
115
118
    @classmethod
116
119
    def probe_transport(klass, transport):