/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

  • Committer: Jelmer Vernooij
  • Date: 2020-05-06 02:13:25 UTC
  • mfrom: (7490.7.21 work)
  • mto: This revision was merged to the branch mainline in revision 7501.
  • Revision ID: jelmer@jelmer.uk-20200506021325-awbmmqu1zyorz7sj
Merge 3.1 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
606
606
                    ret[tag_name_to_ref(tagname)] = new_sha
607
607
            return ret
608
608
        with source_store.lock_read():
609
 
            if lossy:
610
 
                generate_pack_data = source_store.generate_lossy_pack_data
611
 
            else:
612
 
                generate_pack_data = source_store.generate_pack_data
 
609
            def generate_pack_data(have, want, progress=None,
 
610
                                   ofs_delta=True):
 
611
                git_repo = getattr(source.repository, '_git', None)
 
612
                if git_repo:
 
613
                    shallow = git_repo.get_shallow()
 
614
                else:
 
615
                    shallow = None
 
616
                if lossy:
 
617
                    return source_store.generate_lossy_pack_data(
 
618
                        have, want, shallow=shallow,
 
619
                        progress=progress, ofs_delta=ofs_delta)
 
620
                elif shallow:
 
621
                    return source_store.generate_pack_data(
 
622
                        have, want, shallow=shallow,
 
623
                        progress=progress, ofs_delta=ofs_delta)
 
624
                else:
 
625
                    return source_store.generate_pack_data(
 
626
                        have, want, progress=progress, ofs_delta=ofs_delta)
613
627
            new_refs = self.send_pack(get_changed_refs, generate_pack_data)
614
628
        push_result.new_revid = repo.lookup_foreign_revision_id(
615
629
            new_refs[actual_refname])
712
726
            raise NotGitRepository()
713
727
        elif response.status != 200:
714
728
            raise GitProtocolError("unexpected http resp %d for %s" %
715
 
                                   (response.code, url))
 
729
                                   (response.status, url))
716
730
 
717
731
        # TODO: Optimization available by adding `preload_content=False` to the
718
732
        # request and just passing the `read` method on instead of going via