Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 42109:2a3c0106ded9
import: suppress accept: header
irccloud and others may perform content negotation and reject (406)
if the accept header does not match the mime type of the object
author | timeless <timeless@mozdev.org> |
---|---|
date | Fri, 12 Apr 2019 12:20:38 -0400 |
parents | 7f366dd3df1f |
children | 57539e5ea2e0 |
comparison
equal
deleted
inserted
replaced
42108:1b5cec8b6a1e | 42109:2a3c0106ded9 |
---|---|
151 return _peerlookup(repo).islocal(repo) | 151 return _peerlookup(repo).islocal(repo) |
152 except AttributeError: | 152 except AttributeError: |
153 return False | 153 return False |
154 return repo.local() | 154 return repo.local() |
155 | 155 |
156 def openpath(ui, path): | 156 def openpath(ui, path, sendaccept=True): |
157 '''open path with open if local, url.open if remote''' | 157 '''open path with open if local, url.open if remote''' |
158 pathurl = util.url(path, parsequery=False, parsefragment=False) | 158 pathurl = util.url(path, parsequery=False, parsefragment=False) |
159 if pathurl.islocal(): | 159 if pathurl.islocal(): |
160 return util.posixfile(pathurl.localpath(), 'rb') | 160 return util.posixfile(pathurl.localpath(), 'rb') |
161 else: | 161 else: |
162 return url.open(ui, path) | 162 return url.open(ui, path, sendaccept=sendaccept) |
163 | 163 |
164 # a list of (ui, repo) functions called for wire peer initialization | 164 # a list of (ui, repo) functions called for wire peer initialization |
165 wirepeersetupfuncs = [] | 165 wirepeersetupfuncs = [] |
166 | 166 |
167 def _peerorrepo(ui, path, create=False, presetupfuncs=None, | 167 def _peerorrepo(ui, path, create=False, presetupfuncs=None, |