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

Add FOSDEM roundtripping notes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from bzrlib import (
20
20
    branch,
21
21
    config,
22
 
    repository,
23
22
    revision,
24
23
    tag,
25
24
    )
190
189
        result.set_parent(self.bzrdir.root_transport.base)
191
190
        return result
192
191
 
193
 
 
194
 
class InterGitGenericBranch(branch.InterBranch):
195
 
 
196
 
    @classmethod
197
 
    def is_compatible(self, source, target):
198
 
        return isinstance(source, GitBranch)
199
 
 
200
 
    def update_revisions(self, stop_revision=None, overwrite=False,
201
 
        graph=None):
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):
213
 
                return []
214
 
            return [head]
215
 
        interrepo.fetch_objects(determine_wants, self.source.mapping)
216
 
        self.target.set_last_revision(last_revid)
217
 
 
218
 
 
219
 
branch.InterBranch.register_optimiser(InterGitGenericBranch)