Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/bindings/javahl/native/SVNClient.cpp view on Meta::CPAN
svn_revnum_t rev;
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return -1;
SVN_JNI_ERR(svn_client_checkout3(&rev, url.c_str(),
path.c_str(),
pegRevision.revision(),
revision.revision(),
depth,
ignoreExternals,
allowUnverObstructions,
ctx,
subPool.getPool()),
-1);
return rev;
}
void SVNClient::remove(Targets &targets, CommitMessage *message, bool force,
bool keep_local, RevpropTable &revprops,
CommitCallback *callback)
{
SVN::Pool subPool(pool);
svn_client_ctx_t *ctx = context.getContext(message, subPool);
if (ctx == NULL)
return;
const apr_array_header_t *targets2 = targets.array(subPool);
SVN_JNI_ERR(targets.error_occurred(), );
SVN_JNI_ERR(svn_client_delete4(targets2, force, keep_local,
revprops.hash(subPool),
CommitCallback::callback, callback,
ctx, subPool.getPool()), );
}
void SVNClient::revert(const char *path, svn_depth_t depth,
StringArray &changelists)
{
SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
Targets target(path, subPool);
const apr_array_header_t *targets = target.array(subPool);
SVN_JNI_ERR(target.error_occurred(), );
SVN_JNI_ERR(svn_client_revert2(targets, depth,
changelists.array(subPool), ctx,
subPool.getPool()), );
}
void SVNClient::add(const char *path,
svn_depth_t depth, bool force,
bool no_ignore, bool no_autoprops,
bool add_parents)
{
SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
Path intPath(path, subPool);
SVN_JNI_ERR(intPath.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
SVN_JNI_ERR(svn_client_add5(intPath.c_str(), depth, force,
no_ignore, no_autoprops, add_parents, ctx,
subPool.getPool()), );
}
jlongArray SVNClient::update(Targets &targets, Revision &revision,
svn_depth_t depth, bool depthIsSticky,
bool makeParents, bool ignoreExternals,
bool allowUnverObstructions)
{
SVN::Pool subPool(pool);
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
apr_array_header_t *revs;
if (ctx == NULL)
return NULL;
const apr_array_header_t *array = targets.array(subPool);
SVN_JNI_ERR(targets.error_occurred(), NULL);
SVN_JNI_ERR(svn_client_update4(&revs, array,
revision.revision(),
depth,
depthIsSticky,
ignoreExternals,
allowUnverObstructions,
TRUE /* adds_as_modification */,
makeParents,
ctx, subPool.getPool()),
NULL);
JNIEnv *env = JNIUtil::getEnv();
jlongArray jrevs = env->NewLongArray(revs->nelts);
if (JNIUtil::isJavaExceptionThrown())
return NULL;
jlong *jrevArray = env->GetLongArrayElements(jrevs, NULL);
if (JNIUtil::isJavaExceptionThrown())
return NULL;
for (int i = 0; i < revs->nelts; ++i)
{
jlong rev = APR_ARRAY_IDX(revs, i, svn_revnum_t);
jrevArray[i] = rev;
}
env->ReleaseLongArrayElements(jrevs, jrevArray, 0);
return jrevs;
}
void SVNClient::commit(Targets &targets, CommitMessage *message,
svn_depth_t depth, bool noUnlock, bool keepChangelist,
StringArray &changelists, RevpropTable &revprops,
CommitCallback *callback)
{
SVN::Pool subPool(pool);
const apr_array_header_t *targets2 = targets.array(subPool);
SVN_JNI_ERR(targets.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(message, subPool);
if (ctx == NULL)
return;
SVN_JNI_ERR(svn_client_commit6(targets2, depth,
noUnlock, keepChangelist,
TRUE,
( run in 0.504 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )