/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 breezy/git/remote.py

Fix compatibility with newer Dulwich.

Merged from https://code.launchpad.net/~jelmer/brz/new-git/+merge/383480

Show diffs side-by-side

added added

removed removed

Lines of Context:
616
616
                    ret[tag_name_to_ref(tagname)] = new_sha
617
617
            return ret
618
618
        with source_store.lock_read():
619
 
            if lossy:
620
 
                generate_pack_data = source_store.generate_lossy_pack_data
621
 
            else:
622
 
                generate_pack_data = source_store.generate_pack_data
 
619
            def generate_pack_data(have, want, progress=None,
 
620
                                   ofs_delta=True):
 
621
                git_repo = getattr(source.repository, '_git', None)
 
622
                if git_repo:
 
623
                    shallow = git_repo.get_shallow()
 
624
                else:
 
625
                    shallow = None
 
626
                if lossy:
 
627
                    return source_store.generate_lossy_pack_data(
 
628
                        have, want, shallow=shallow,
 
629
                        progress=progress, ofs_delta=ofs_delta)
 
630
                elif shallow:
 
631
                    return source_store.generate_pack_data(
 
632
                        have, want, shallow=shallow,
 
633
                        progress=progress, ofs_delta=ofs_delta)
 
634
                else:
 
635
                    return source_store.generate_pack_data(
 
636
                        have, want, progress=progress, ofs_delta=ofs_delta)
623
637
            new_refs = self.send_pack(get_changed_refs, generate_pack_data)
624
638
        push_result.new_revid = repo.lookup_foreign_revision_id(
625
639
            new_refs[actual_refname])