mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
git_handler: reintroduce compatibility with dulwich 0.9.4 (issue124)
It's the version that ships with the latest Ubuntu LTS as of this writing.
This commit is contained in:
parent
74287cb2d6
commit
01dbae187f
@ -1519,7 +1519,16 @@ class GitHandler(object):
|
||||
opener = urllib2.build_opener(auth_handler)
|
||||
useragent = 'git/20x6 (hg-git ; uses dulwich and hg ; like git-core)'
|
||||
opener.addheaders = [('User-Agent', useragent)]
|
||||
return client.HttpGitClient(uri, opener=opener), uri
|
||||
try:
|
||||
return client.HttpGitClient(uri, opener=opener), uri
|
||||
except TypeError as e:
|
||||
if e.message.find("unexpected keyword argument 'opener'") >= 0:
|
||||
# Dulwich 0.9.4, which is the latest version that ships with
|
||||
# Ubuntu 14.04, doesn't support the 'opener' keyword. Try
|
||||
# without authentication.
|
||||
return client.HttpGitClient(uri), uri
|
||||
else:
|
||||
raise
|
||||
|
||||
# if its not git or git+ssh, try a local url..
|
||||
return client.SubprocessGitClient(), uri
|
||||
|
Loading…
Reference in New Issue
Block a user