svn_client_checkout3 因 EXC_BAD_ACCESS 崩溃
我想签出工作副本:
apr_pool_t *pool = NULL;
apr_pool_create(&pool, NULL);
svn_client_ctx_t *context = NULL;
svn_client_create_context(&context, pool);
svn_opt_revision_t revision;
revision.kind = svn_opt_revision_head;
svn_client_checkout3(NULL,
repo.URL.absoluteString.UTF8String, // repo URL
localURL.path.UTF8String, // local path
&revision,
&revision,
svn_depth_infinity,
TRUE,
FALSE,
context,
pool);
apr_pool_destroy(pool);
它在 svn_client_checkout3
处崩溃,并出现 EXC_BAD_ACCESS
(可能是分段错误)。我阅读了文档,但我无法找出我做错了什么。
导致此错误的原因可能是什么?
I want to checkout a working copy:
apr_pool_t *pool = NULL;
apr_pool_create(&pool, NULL);
svn_client_ctx_t *context = NULL;
svn_client_create_context(&context, pool);
svn_opt_revision_t revision;
revision.kind = svn_opt_revision_head;
svn_client_checkout3(NULL,
repo.URL.absoluteString.UTF8String, // repo URL
localURL.path.UTF8String, // local path
&revision,
&revision,
svn_depth_infinity,
TRUE,
FALSE,
context,
pool);
apr_pool_destroy(pool);
It crashes at svn_client_checkout3
with EXC_BAD_ACCESS
(probably a segmentation fault). I read the documentation but I can't find out what I'm doing wrong.
What could be the cause of this error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您在此代码片段之前初始化了 APR、svn_utf、svn_fs、svn_ra 等?
Subversion 存储库中有一些代码示例,展示了您应该如何执行初始化以及如何处理授权等回调提示。
如果您想避免这一切,我建议您查看 Python(Subversion 的一部分)、Java(JavaHL 和 SvnKit)和 .Net(SharpSvn)。或者,如果您只想执行一个命令,您只需使用
svn
即可。I assume you initialized APR, svn_utf, svn_fs, svn_ra, etc. before this code snippet?
There are some code examples in the Subversion repository that show how you should perform initialization and to take care of callback prompts for things like authorization.
If you would like to avoid all this I would recommend looking at some of the higher level bindings that exist for Python (part of Subversion), Java (JavaHL and SvnKit) and .Net (SharpSvn). Or if you just want to perform one command you could just shell out to
svn
.