internal SvnClientContext(AprPool pool, SvnClientContext client)
        {
            if (client is null)
            {
                throw new ArgumentNullException(nameof(client));
            }

            _ctxBaton = new AprBaton <SvnClientContext>(this);

            _pool   = pool;
            _parent = client;

            _ctx            = client.CtxHandle;
            _authentication = client.Authentication;
        }
        internal unsafe SvnClientContext(AprPool pool)
        {
            if (pool is null)
            {
                throw new ArgumentNullException(nameof(pool));
            }

            _ctxBaton  = new AprBaton <SvnClientContext>(this);
            _callbacks = new SvnClientCallbacks();

            _pool = pool;
            svn_client_ctx_t.__Internal *ctxInternal = null;

            // We manage the config hash ourselves
            var error = svn_client.svn_client_create_context2((void **)&ctxInternal, null, pool.Handle);

            if (error != null)
            {
                throw SvnException.Create(error);
            }

            var ctx = svn_client_ctx_t.__CreateInstance(new IntPtr(ctxInternal));

            ctx.cancel_func    = _callbacks.libsvnsharp_cancel_func.Get();
            ctx.cancel_baton   = _ctxBaton.Handle;
            ctx.progress_func  = _callbacks.libsvnsharp_progress_func.Get();
            ctx.progress_baton = _ctxBaton.Handle;
            ctx.log_msg_func3  = _callbacks.libsvnsharp_commit_log_func.Get();
            ctx.log_msg_baton3 = _ctxBaton.Handle;

            //TODO:
            //ctx.check_tunnel_func = libsvnsharp_check_tunnel_func;
            //ctx.open_tunnel_func = libsvnsharp_open_tunnel_func;
            //ctx.tunnel_baton = _ctxBaton.Handle;

            ctx.client_name = pool.AllocString(SvnBase._clientName);

            _ctx            = ctx;
            _authentication = new SvnAuthentication(this, pool);
        }