📄 svnclient.cpp
字号:
{ return NULL; } } return ret; } else { JNIUtil::handleSVNError(Err); return NULL; }}jlong SVNClient::checkout(const char *moduleName, const char *destPath, Revision &revision, Revision &pegRevision, bool recurse, bool ignoreExternals){ Pool requestPool; apr_pool_t * apr_pool = requestPool.pool (); if(moduleName == NULL) { JNIUtil::throwNullPointerException("moduleName"); return -1; } if(destPath == NULL) { JNIUtil::throwNullPointerException("destPath"); return -1; } Path url(moduleName); Path path(destPath); svn_error_t *Err = url.error_occured(); if(Err != NULL) { JNIUtil::handleSVNError(Err); return -1; } Err = path.error_occured(); if(Err != NULL) { JNIUtil::handleSVNError(Err); return -1; } svn_revnum_t retval; svn_client_ctx_t *ctx = getContext(NULL); if(ctx == NULL) { return -1; } Err = svn_client_checkout2 (&retval, url.c_str(), path.c_str (), pegRevision.revision (), revision.revision (), recurse, ignoreExternals, ctx, apr_pool); if(Err != NULL) { JNIUtil::handleSVNError(Err); return -1; } return retval;}void SVNClient::notification(Notify *notify){ delete m_notify; m_notify = notify;}void SVNClient::notification2(Notify2 *notify2){ delete m_notify2; m_notify2 = notify2;}void SVNClient::remove(Targets &targets, const char *message, bool force){ svn_client_commit_info_t *commit_info = NULL; Pool requestPool; apr_pool_t * apr_pool = requestPool.pool (); svn_client_ctx_t *ctx = getContext(message); if(ctx == NULL) { return; } const apr_array_header_t *targets2 = targets.array(requestPool); svn_error_t *Err = targets.error_occured(); if(Err != NULL) { JNIUtil::handleSVNError(Err); return; } Err = svn_client_delete (&commit_info, targets2, force, ctx, apr_pool); if(Err != NULL) JNIUtil::handleSVNError(Err);}void SVNClient::revert(const char *path, bool recurse){ Pool requestPool; apr_pool_t * apr_pool = requestPool.pool (); if(path == NULL) { JNIUtil::throwNullPointerException("path"); return; } svn_client_ctx_t *ctx = getContext(NULL); Targets target (path); const apr_array_header_t *targets = target.array(requestPool); svn_error_t *Err = target.error_occured(); if(Err != NULL) { JNIUtil::handleSVNError(Err); return; } if(ctx == NULL) { return; } Err = svn_client_revert (targets, recurse, ctx, apr_pool); if(Err != NULL) JNIUtil::handleSVNError(Err);}void SVNClient::add(const char *path, bool recurse, bool force){ Pool requestPool; apr_pool_t * apr_pool = requestPool.pool (); if(path == NULL) { JNIUtil::throwNullPointerException("path"); return; } Path intPath(path); svn_error_t *Err = intPath.error_occured(); if(Err != NULL) { JNIUtil::handleSVNError(Err); return; } svn_client_ctx_t *ctx = getContext(NULL); if(ctx == NULL) { return; } Err = svn_client_add3 (intPath.c_str (), recurse, force, FALSE, ctx, apr_pool); if(Err != NULL) JNIUtil::handleSVNError(Err);}jlongArray SVNClient::update(Targets &targets, Revision &revision, bool recurse, bool ignoreExternals){ Pool requestPool; apr_pool_t * apr_pool = requestPool.pool (); svn_client_ctx_t *ctx = getContext(NULL); apr_array_header_t *retval; if(ctx == NULL) { return NULL; } const apr_array_header_t *array = targets.array(requestPool); svn_error_t *Err = targets.error_occured(); if(Err != NULL) { JNIUtil::handleSVNError(Err); return NULL; } Err = svn_client_update2 (&retval, array, revision.revision (), recurse, ignoreExternals, ctx, apr_pool); if(Err != NULL) { JNIUtil::handleSVNError(Err); return NULL; } JNIEnv *env = JNIUtil::getEnv(); jlongArray ret = env->NewLongArray(retval->nelts); if(JNIUtil::isJavaExceptionThrown()) return NULL; jlong *retArray = env->GetLongArrayElements(ret, NULL); if(JNIUtil::isJavaExceptionThrown()) return NULL; for(int i = 0; i < retval->nelts; i++) { jlong rev = APR_ARRAY_IDX (retval, i, svn_revnum_t); retArray[i] = rev; } env->ReleaseLongArrayElements(ret, retArray, 0); return ret;}jlong SVNClient::commit(Targets &targets, const char *message, bool recurse, bool noUnlock){ Pool requestPool; apr_pool_t * apr_pool = requestPool.pool (); svn_client_commit_info_t *commit_info = NULL; const apr_array_header_t *targets2 = targets.array(requestPool); svn_error_t *Err = targets.error_occured(); if(Err != NULL) { JNIUtil::handleSVNError(Err); return -1; } svn_client_ctx_t *ctx = getContext(message); if(ctx == NULL) { return -1; } Err = svn_client_commit2 (&commit_info, targets2, recurse, noUnlock, ctx, apr_pool); if(Err != NULL) JNIUtil::handleSVNError(Err); if(commit_info && SVN_IS_VALID_REVNUM (commit_info->revision)) return commit_info->revision; return -1;}void SVNClient::copy(const char *srcPath, const char *destPath, const char *message, Revision &revision){ Pool requestPool; apr_pool_t * apr_pool = requestPool.pool (); if(srcPath == NULL) { JNIUtil::throwNullPointerException("srcPath"); return; } if(destPath == NULL) { JNIUtil::throwNullPointerException("destPath"); return; } Path sourcePath(srcPath); svn_error_t *Err = sourcePath.error_occured(); if(Err != NULL) { JNIUtil::handleSVNError(Err); return; } Path destinationPath(destPath); Err = destinationPath.error_occured(); if(Err != NULL) { JNIUtil::handleSVNError(Err); return; } svn_client_commit_info_t *commit_info = NULL; svn_client_ctx_t *ctx = getContext(message); if(ctx == NULL) { return; } Err = svn_client_copy (&commit_info, sourcePath.c_str (), revision.revision(), destinationPath.c_str (), ctx, apr_pool); if(Err != NULL) JNIUtil::handleSVNError(Err);}void SVNClient::move(const char *srcPath, const char *destPath, const char *message, bool force){ Pool requestPool; apr_pool_t * apr_pool = requestPool.pool (); if(srcPath == NULL) { JNIUtil::throwNullPointerException("srcPath"); return; } if(destPath == NULL) { JNIUtil::throwNullPointerException("destPath"); return; } svn_client_commit_info_t *commit_info = NULL; Path sourcePath(srcPath); svn_error_t *Err = sourcePath.error_occured(); if(Err != NULL) { JNIUtil::handleSVNError(Err); return; } Path destinationPath(destPath); Err = destinationPath.error_occured(); if(Err != NULL) { JNIUtil::handleSVNError(Err); return; } svn_client_ctx_t *ctx = getContext(message); if(ctx == NULL) { return; } Err = svn_client_move2 (&commit_info, sourcePath.c_str (), destinationPath.c_str (), force, ctx, apr_pool); if(Err != NULL) JNIUtil::handleSVNError(Err);}void SVNClient::mkdir(Targets &targets, const char *message){ Pool requestPool; apr_pool_t * apr_pool = requestPool.pool (); svn_client_commit_info_t *commit_info = NULL; svn_client_ctx_t *ctx = getContext(message); if(ctx == NULL) { return; } const apr_array_header_t *targets2 = targets.array(requestPool); svn_error_t *Err = targets.error_occured(); if(Err != NULL) { JNIUtil::handleSVNError(Err); return; } Err = svn_client_mkdir (&commit_info, targets2, ctx, apr_pool); if(Err != NULL) JNIUtil::handleSVNError(Err);}void SVNClient::cleanup(const char *path){ Pool requestPool; apr_pool_t * apr_pool = requestPool.pool (); if(path == NULL) { JNIUtil::throwNullPointerException("path"); return; } Path intPath(path); svn_error_t *Err = intPath.error_occured(); if(Err != NULL) { JNIUtil::handleSVNError(Err); return; } svn_client_ctx_t *ctx = getContext(NULL); if(ctx == NULL) { return; } Err = svn_client_cleanup (intPath.c_str (), ctx, apr_pool); if(Err != NULL) JNIUtil::handleSVNError(Err);}void SVNClient::resolved(const char *path, bool recurse){ Pool requestPool; apr_pool_t * apr_pool = requestPool.pool (); if(path == NULL) { JNIUtil::throwNullPointerException("path"); return; } Path intPath(path); svn_error_t *Err = intPath.error_occured(); if(Err != NULL) { JNIUtil::handleSVNError(Err); return; } svn_client_ctx_t *ctx = getContext(NULL); if(ctx == NULL) { return; } Err = svn_client_resolved (intPath.c_str (), recurse, ctx, apr_pool); if(Err != NULL) JNIUtil::handleSVNError(Err);}jlong SVNClient::doExport(const char *srcPath, const char *destPath, Revision &revision, Revision &pegRevision, bool force, bool ignoreExternals, bool recurse, const char *nativeEOL){ Pool requestPool; apr_pool_t * apr_pool = requestPool.pool (); if(srcPath == NULL) { JNIUtil::throwNullPointerException("srcPath"); return -1; } if(destPath == NULL) { JNIUtil::throwNullPointerException("destPath"); return -1; } Path sourcePath(srcPath); svn_error_t *Err = sourcePath.error_occured(); if(Err != NULL) { JNIUtil::handleSVNError(Err); return -1; } Path destinationPath(destPath); Err = destinationPath.error_occured(); if(Err != NULL)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -