Logo Search packages:      
Sourcecode: hgsubversion version File versions  Download package

def hgsubversion::svnwrap::svn_swig_wrapper::SubversionRepo::init_ra_and_client (   self )
Initializes the RA and client layers, because sometimes getting
unified diffs runs the remote server out of open files.

Definition at line 186 of file svn_swig_wrapper.py.

                                :
        """Initializes the RA and client layers, because sometimes getting
        unified diffs runs the remote server out of open files.
        """
        # while we're in here we'll recreate our pool
        self.pool = core.Pool()
        if self.username:
            core.svn_auth_set_parameter(self.auth_baton,
                                        core.SVN_AUTH_PARAM_DEFAULT_USERNAME,
                                        self.username)
        if self.password:
            core.svn_auth_set_parameter(self.auth_baton,
                                        core.SVN_AUTH_PARAM_DEFAULT_PASSWORD,
                                        self.password)
        self.client_context = client.create_context()

        self.client_context.auth_baton = self.auth_baton
        self.client_context.config = svn_config
        callbacks = RaCallbacks()
        callbacks.auth_baton = self.auth_baton
        self.callbacks = callbacks
        try:
            self.ra = ra.open2(self.svn_url, callbacks,
                               svn_config, self.pool)
        except SubversionException, e:
            if e.apr_err == core.SVN_ERR_RA_SERF_SSL_CERT_UNTRUSTED:
                msg = ('Subversion does not trust the SSL certificate for this '
                       'site; please try running \'svn ls %s\' first.'
                       % self.svn_url)
            elif e.apr_err == core.SVN_ERR_RA_DAV_REQUEST_FAILED:
                msg = ('Failed to open Subversion repository; please try '
                       'running \'svn ls %s\' for details.' % self.svn_url)
            else:
                msg = e.args[0]
                for k, v in vars(core).iteritems():
                    if k.startswith('SVN_ERR_') and v == e.apr_err:
                        msg = '%s (%s)' % (msg, k)
                        break
            raise common.SubversionConnectionException(msg)


Generated by  Doxygen 1.6.0   Back to index