# HG changeset patch # User Siddharth Agarwal # Date 1425668313 28800 # Node ID 6547d63aee4e9ab974d20775edde9b84a1da9e2a # Parent 875112f4bf0db6de6b804109eceb40396cf22b2e 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. diff --git a/hggit/git_handler.py b/hggit/git_handler.py --- a/hggit/git_handler.py +++ b/hggit/git_handler.py @@ -1519,7 +1519,16 @@ 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