/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

More work on roundtrip push support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
 
115
115
    def set_tag(self, name, revid):
116
116
        self.repository._git.refs[tag_name_to_ref(name)], _ = \
117
 
            self.branch.mapping.revision_id_bzr_to_foreign(revid)
 
117
            self.branch.lookup_bzr_revision_id(revid)
118
118
 
119
119
 
120
120
class DictTagDict(LocalGitTagDict):
257
257
        return self.repository.lookup_foreign_revision_id(foreign_revid,
258
258
            self.mapping)
259
259
 
 
260
    def lookup_bzr_revision_id(self, revid):
 
261
        return self.repository.lookup_bzr_revision_id(
 
262
            revid, mapping=self.mapping)
 
263
 
260
264
 
261
265
class LocalGitBranch(GitBranch):
262
266
    """A local Git branch."""
419
423
class InterFromGitBranch(branch.GenericInterBranch):
420
424
    """InterBranch implementation that pulls from Git into bzr."""
421
425
 
 
426
    @staticmethod
 
427
    def _get_branch_formats_to_test():
 
428
        return []
 
429
 
422
430
    @classmethod
423
431
    def _get_interrepo(self, source, target):
424
432
        return repository.InterRepository.get(source.repository,
455
463
            if self.target.repository.has_revision(self._last_revid):
456
464
                return []
457
465
            return [head]
458
 
        pack_hint, head = interrepo.fetch_objects(
 
466
        pack_hint, head, refs = interrepo.fetch_objects(
459
467
            determine_wants, self.source.mapping, limit=limit)
460
468
        if (pack_hint is not None and
461
469
            self.target.repository._format.pack_compresses):
546
554
class InterGitLocalRemoteBranch(InterGitBranch):
547
555
    """InterBranch that copies from a local to a remote git branch."""
548
556
 
 
557
    @staticmethod
 
558
    def _get_branch_formats_to_test():
 
559
        return []
 
560
 
549
561
    @classmethod
550
562
    def is_compatible(self, source, target):
551
563
        from bzrlib.plugins.git.remote import RemoteGitBranch
575
587
class InterGitRemoteLocalBranch(InterGitBranch):
576
588
    """InterBranch that copies from a remote to a local git branch."""
577
589
 
 
590
    @staticmethod
 
591
    def _get_branch_formats_to_test():
 
592
        return []
 
593
 
578
594
    @classmethod
579
595
    def is_compatible(self, source, target):
580
596
        from bzrlib.plugins.git.remote import RemoteGitBranch
685
701
            refs.update(new_refs)
686
702
            return refs
687
703
        old_refs, new_refs = self.interrepo.fetch_refs(update_refs)
688
 
        result.old_revid = self.target.lookup_foreign_revision_id(
689
 
            old_refs.get(main_ref, ZERO_SHA))
 
704
        (result.old_revid, old_sha1) = old_refs.get(main_ref, (ZERO_SHA, NULL_REVISION))
 
705
        if result.old_revid is None:
 
706
            result.old_revid = self.target.lookup_foreign_revision_id(old_sha1)
690
707
        result.new_revid = new_refs[main_ref]
691
708
        return result
692
709