mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
fallback to unauthenticated http(s) access when using older dulwich
This commit is contained in:
parent
7e0c3b141b
commit
97838c2daf
@ -1378,7 +1378,15 @@ class GitHandler(object):
|
||||
else:
|
||||
auth_handler = urllib2.HTTPBasicAuthHandler(AuthManager(self.ui))
|
||||
opener = urllib2.build_opener(auth_handler)
|
||||
try:
|
||||
return client.HttpGitClient(uri, opener=opener, thin_packs=False), uri
|
||||
except TypeError as e:
|
||||
if e.message.find("unexpected keyword argument 'opener'") >= 0:
|
||||
# using a version of dulwich that doesn't support
|
||||
# http(s) authentication -- try without authentication
|
||||
return client.HttpGitClient(uri, thin_packs=False), uri
|
||||
else:
|
||||
raise
|
||||
|
||||
# if its not git or git+ssh, try a local url..
|
||||
return client.SubprocessGitClient(thin_packs=False), uri
|
||||
|
Loading…
Reference in New Issue
Block a user