190
189
result.set_parent(self.bzrdir.root_transport.base)
194
class InterGitGenericBranch(branch.InterBranch):
197
def is_compatible(self, source, target):
198
return isinstance(source, GitBranch)
200
def update_revisions(self, stop_revision=None, overwrite=False,
202
"""See InterBranch.update_revisions()."""
203
# TODO: stop_revision, overwrite
204
interrepo = repository.InterRepository.get(self.source.repository, self.target.repository)
205
self._last_revid = None
206
def determine_wants(heads):
207
if not self.source.name in heads:
208
raise BzrError("No such remote branch '%s', found: %r" % (
209
self.source.name, heads.keys()))
210
head = heads[self.source.name]
211
self._last_revid = self.source.mapping.revision_id_foreign_to_bzr(head)
212
if self.target.repository.has_revision(self._last_revid):
215
interrepo.fetch_objects(determine_wants, self.source.mapping)
216
self.target.set_last_revision(last_revid)
219
branch.InterBranch.register_optimiser(InterGitGenericBranch)