/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/plugins/hg/__init__.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-07-20 02:17:05 UTC
  • mfrom: (7518.1.2 merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200720021705-5f11tmo1hdqjxm6x
Merge lp:brz/3.1.

Merged from https://code.launchpad.net/~jelmer/brz/merge-3.1/+merge/387628

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
    def probe_transport(klass, transport):
81
81
        """Our format is present if the transport has a '.hg/' subdir."""
82
82
        if klass._has_hg_dumb_repository(transport):
83
 
            return HgDirFormat()
 
83
            return LocalHgDirFormat()
84
84
        raise errors.NotBranchError(path=transport.base)
85
85
 
86
86
    @classmethod
123
123
 
124
124
    @classmethod
125
125
    def priority(klass, transport):
126
 
        return 90
 
126
        if 'hg' in transport.base:
 
127
            return 90
 
128
        # hgweb repositories are prone to return *a* page for every possible URL,
 
129
        # making probing hard for other formats so use 99 here rather than 100.
 
130
        return 99
127
131
 
128
132
    @staticmethod
129
133
    def _has_hg_http_smart_server(transport, external_url):
135
139
        """
136
140
        from breezy.urlutils import urlparse
137
141
        parsed_url = urlparse.urlparse(external_url)
138
 
        parsed_url = parsed_url._replace(
139
 
            query='cmd=capabilities', path=parsed_url.path.rstrip('/') + '/hg')
 
142
        parsed_url = parsed_url._replace(query='cmd=capabilities')
140
143
        url = urlparse.urlunparse(parsed_url)
141
144
        resp = transport.request(
142
145
            'GET', url, headers={'Accept': 'application/mercurial-0.1'})