/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

Support 'add' in empty directory.

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