hgext/convert/transport.py
changeset 43077 687b865b95ad
parent 43076 2372284d9457
child 43089 c59eb1560c44
equal deleted inserted replaced
43076:2372284d9457 43077:687b865b95ad
    52     getprovider = getattr(
    52     getprovider = getattr(
    53         svn.core, 'svn_auth_get_platform_specific_provider', None
    53         svn.core, 'svn_auth_get_platform_specific_provider', None
    54     )
    54     )
    55     if getprovider:
    55     if getprovider:
    56         # Available in svn >= 1.6
    56         # Available in svn >= 1.6
    57         for name in ('gnome_keyring', 'keychain', 'kwallet', 'windows'):
    57         for name in (b'gnome_keyring', b'keychain', b'kwallet', b'windows'):
    58             for type in ('simple', 'ssl_client_cert_pw', 'ssl_server_trust'):
    58             for type in (b'simple', b'ssl_client_cert_pw', b'ssl_server_trust'):
    59                 p = getprovider(name, type, pool)
    59                 p = getprovider(name, type, pool)
    60                 if p:
    60                 if p:
    61                     providers.append(p)
    61                     providers.append(p)
    62     else:
    62     else:
    63         if util.safehasattr(svn.client, 'get_windows_simple_provider'):
    63         if util.safehasattr(svn.client, b'get_windows_simple_provider'):
    64             providers.append(svn.client.get_windows_simple_provider(pool))
    64             providers.append(svn.client.get_windows_simple_provider(pool))
    65 
    65 
    66     return svn.core.svn_auth_open(providers, pool)
    66     return svn.core.svn_auth_open(providers, pool)
    67 
    67 
    68 
    68 
    73 class SvnRaTransport(object):
    73 class SvnRaTransport(object):
    74     """
    74     """
    75     Open an ra connection to a Subversion repository.
    75     Open an ra connection to a Subversion repository.
    76     """
    76     """
    77 
    77 
    78     def __init__(self, url="", ra=None):
    78     def __init__(self, url=b"", ra=None):
    79         self.pool = Pool()
    79         self.pool = Pool()
    80         self.svn_url = url
    80         self.svn_url = url
    81         self.username = ''
    81         self.username = b''
    82         self.password = ''
    82         self.password = b''
    83 
    83 
    84         # Only Subversion 1.4 has reparent()
    84         # Only Subversion 1.4 has reparent()
    85         if ra is None or not util.safehasattr(svn.ra, 'reparent'):
    85         if ra is None or not util.safehasattr(svn.ra, b'reparent'):
    86             self.client = svn.client.create_context(self.pool)
    86             self.client = svn.client.create_context(self.pool)
    87             ab = _create_auth_baton(self.pool)
    87             ab = _create_auth_baton(self.pool)
    88             self.client.auth_baton = ab
    88             self.client.auth_baton = ab
    89             global svn_config
    89             global svn_config
    90             if svn_config is None:
    90             if svn_config is None: