64
64
def __init__(self, gitdir, lockfiles):
65
ForeignRepository.__init__(self, GitFormat(), gitdir, lockfiles)
66
from bzrlib.plugins.git import fetch
67
repository.InterRepository.register_optimiser(fetch.InterFromGitRepository)
72
def supports_rich_root(self):
75
def _warn_if_deprecated(self):
76
# This class isn't deprecated
79
def get_mapping(self):
80
return default_mapping
84
class LocalGitRepository(GitRepository):
86
def __init__(self, gitdir, lockfiles):
65
87
# FIXME: This also caches negatives. Need to be more careful
66
88
# about this once we start writing to git
67
89
self._parents_provider = graph.CachingParentsProvider(self)
68
ForeignRepository.__init__(self, GitFormat(), gitdir, lockfiles)
90
GitRepository.__init__(self, gitdir, lockfiles)
69
91
self.base = gitdir.root_transport.base
71
92
self._git = gitdir._git
73
94
self.signatures = versionedfiles.VirtualSignatureTexts(self)
74
95
self.revisions = versionedfiles.VirtualRevisionTexts(self)
75
96
self.tags = GitTags(self._git.get_tags())
76
from bzrlib.plugins.git import fetch
77
repository.InterRepository.register_optimiser(fetch.InterFromGitRepository)
79
98
def all_revision_ids(self):
80
99
ret = set([revision.NULL_REVISION])
93
def supports_rich_root(self):
96
109
#def get_revision_delta(self, revision_id):
97
110
# parent_revid = self.get_revision(revision_id).parent_ids[0]
98
111
# diff = self._git.diff(ids.convert_revision_id_bzr_to_git(parent_revid),
133
146
ancestry.reverse()
136
def _warn_if_deprecated(self):
137
# This class isn't deprecated
140
149
def get_signature_text(self, revision_id):
141
150
raise errors.NoSuchRevision(self, revision_id)
152
161
def has_signature_for_revision_id(self, revision_id):
155
def get_mapping(self):
156
return default_mapping
158
164
def lookup_git_revid(self, bzr_revid, mapping):
160
166
return mapping.revision_id_bzr_to_foreign(bzr_revid)
255
261
def _build_inventory(self, tree_id, ie, path):
256
262
assert isinstance(path, str)
257
tree = self._repository._git.get_tree(tree_id)
263
tree = self._repository._git.tree(tree_id)
258
264
for mode, name, hexsha in tree.entries():
259
265
basename = name.decode("utf-8")