/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: 2019-06-03 03:10:29 UTC
  • mfrom: (7312 work)
  • mto: This revision was merged to the branch mainline in revision 7318.
  • Revision ID: jelmer@jelmer.uk-20190603031029-b34je03bjulxxdwj
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
    )
90
90
from .repository import (
91
91
    GitRepository,
 
92
    GitRepositoryFormat,
92
93
    )
93
94
from .refs import (
94
95
    branch_name_to_ref,
692
693
            `redirect_location` properties, and `read` is a consumable read
693
694
            method for the response data.
694
695
        """
695
 
        from breezy.transport.http._urllib2_wrappers import Request
696
696
        headers['User-agent'] = user_agent_for_github()
697
697
        headers["Pragma"] = "no-cache"
698
698
        if allow_compression:
700
700
        else:
701
701
            headers["Accept-Encoding"] = "identity"
702
702
 
703
 
        request = Request(
 
703
        response = self.transport.request(
704
704
            ('GET' if data is None else 'POST'),
705
 
            url, data, headers,
706
 
            accepted_errors=[200, 404])
707
 
        request.follow_redirections = True
708
 
 
709
 
        response = self.transport._perform(request)
710
 
 
711
 
        if response.code == 404:
 
705
            body=data,
 
706
            headers=headers, retries=8)
 
707
 
 
708
        if response.status == 404:
712
709
            raise NotGitRepository()
713
 
        elif response.code != 200:
 
710
        elif response.status != 200:
714
711
            raise GitProtocolError("unexpected http resp %d for %s" %
715
712
                                   (response.code, url))
716
713
 
753
750
    def get_branch_format(self):
754
751
        return RemoteGitBranchFormat()
755
752
 
 
753
    @property
 
754
    def repository_format(self):
 
755
        return GitRepositoryFormat()
 
756
 
756
757
    def is_initializable(self):
757
758
        return False
758
759