Mercurial > hg
comparison hgext/convert/transport.py @ 14945:11aad09a6370
hgext: replace uses of hasattr with util.safehasattr
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Mon, 25 Jul 2011 20:37:12 -0500 |
parents | 8fa85378c527 |
children | 6e3c560f2fd1 |
comparison
equal
deleted
inserted
replaced
14944:e2c413bde8a5 | 14945:11aad09a6370 |
---|---|
52 for type in ('simple', 'ssl_client_cert_pw', 'ssl_server_trust'): | 52 for type in ('simple', 'ssl_client_cert_pw', 'ssl_server_trust'): |
53 p = getprovider(name, type, pool) | 53 p = getprovider(name, type, pool) |
54 if p: | 54 if p: |
55 providers.append(p) | 55 providers.append(p) |
56 else: | 56 else: |
57 if hasattr(svn.client, 'get_windows_simple_provider'): | 57 if util.safehasattr(svn.client, 'get_windows_simple_provider'): |
58 providers.append(svn.client.get_windows_simple_provider(pool)) | 58 providers.append(svn.client.get_windows_simple_provider(pool)) |
59 | 59 |
60 return svn.core.svn_auth_open(providers, pool) | 60 return svn.core.svn_auth_open(providers, pool) |
61 | 61 |
62 class NotBranchError(SubversionException): | 62 class NotBranchError(SubversionException): |
71 self.svn_url = url | 71 self.svn_url = url |
72 self.username = '' | 72 self.username = '' |
73 self.password = '' | 73 self.password = '' |
74 | 74 |
75 # Only Subversion 1.4 has reparent() | 75 # Only Subversion 1.4 has reparent() |
76 if ra is None or not hasattr(svn.ra, 'reparent'): | 76 if ra is None or not util.safehasattr(svn.ra, 'reparent'): |
77 self.client = svn.client.create_context(self.pool) | 77 self.client = svn.client.create_context(self.pool) |
78 ab = _create_auth_baton(self.pool) | 78 ab = _create_auth_baton(self.pool) |
79 if False: | 79 if False: |
80 svn.core.svn_auth_set_parameter( | 80 svn.core.svn_auth_set_parameter( |
81 ab, svn.core.SVN_AUTH_PARAM_DEFAULT_USERNAME, self.username) | 81 ab, svn.core.SVN_AUTH_PARAM_DEFAULT_USERNAME, self.username) |