# HG changeset patch # User Patrick Mezard # Date 1240435498 -7200 # Node ID 25d843281127dbd6335527b35788770c4886d112 # Parent 5278817fe8a18d2cc958a1ba4e0a8ed13e609964 Use svn 1.6 platform specific auth providers if available diff --git a/svnwrap/svn_swig_wrapper.py b/svnwrap/svn_swig_wrapper.py --- a/svnwrap/svn_swig_wrapper.py +++ b/svnwrap/svn_swig_wrapper.py @@ -62,7 +62,7 @@ def _create_auth_baton(pool): # Give the client context baton a suite of authentication # providers.h platform_specific = ['svn_auth_get_gnome_keyring_simple_provider', - 'svn_auth_get_gnome_keyring_ssl_client_cert_pw_provider', + 'svn_auth_get_gnome_keyring_ssl_client_cert_pw_provider', 'svn_auth_get_keychain_simple_provider', 'svn_auth_get_keychain_ssl_client_cert_pw_provider', 'svn_auth_get_kwallet_simple_provider', @@ -73,13 +73,23 @@ def _create_auth_baton(pool): ] providers = [] - - for p in platform_specific: - if hasattr(core, p): - try: - providers.append(getattr(core, p)()) - except RuntimeError: - pass + # Platform-dependant authentication methods + getprovider = getattr(core, 'svn_auth_get_platform_specific_provider', + None) + if getprovider: + # Available in svn >= 1.6 + for name in ('gnome_keyring', 'keychain', 'kwallet', 'windows'): + for type in ('simple', 'ssl_client_cert_pw', 'ssl_server_trust'): + p = getprovider(name, type, pool) + if p: + providers.append(p) + else: + for p in platform_specific: + if hasattr(core, p): + try: + providers.append(getattr(core, p)()) + except RuntimeError: + pass providers += [ client.get_simple_provider(),