You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/10/11 21:52:46 UTC
svn commit: r1182053 [3/30] - in /subversion/branches/svn_mutex: ./ build/
build/ac-macros/ build/generator/ build/generator/swig/
build/generator/templates/ contrib/client-side/
contrib/hook-scripts/enforcer/ contrib/server-side/ notes/ notes/merge-tr...
Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNClient.cpp?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNClient.cpp Tue Oct 11 19:52:34 2011
@@ -70,7 +70,7 @@
SVNClient::SVNClient(jobject jthis_in)
- : context(jthis_in)
+ : context(jthis_in, pool), m_lastPath("", pool)
{
}
@@ -94,9 +94,9 @@ void SVNClient::dispose()
jstring SVNClient::getAdminDirectoryName()
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
jstring name =
- JNIUtil::makeJString(svn_wc_get_adm_dir(requestPool.pool()));
+ JNIUtil::makeJString(svn_wc_get_adm_dir(subPool.getPool()));
if (JNIUtil::isJavaExceptionThrown())
return NULL;
@@ -105,8 +105,8 @@ jstring SVNClient::getAdminDirectoryName
jboolean SVNClient::isAdminDirectory(const char *name)
{
- SVN::Pool requestPool;
- return svn_wc_is_adm_dir(name, requestPool.pool()) ? JNI_TRUE : JNI_FALSE;
+ SVN::Pool subPool(pool);
+ return svn_wc_is_adm_dir(name, subPool.getPool()) ? JNI_TRUE : JNI_FALSE;
}
const char *SVNClient::getLastPath()
@@ -122,14 +122,14 @@ void SVNClient::list(const char *url, Re
int direntFields, bool fetchLocks,
ListCallback *callback)
{
- SVN::Pool requestPool;
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ SVN::Pool subPool(pool);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
SVN_JNI_NULL_PTR_EX(url, "path or url", );
- Path urlPath(url);
+ Path urlPath(url, subPool);
SVN_JNI_ERR(urlPath.error_occured(), );
SVN_JNI_ERR(svn_client_list2(urlPath.c_str(),
@@ -140,7 +140,7 @@ void SVNClient::list(const char *url, Re
fetchLocks,
ListCallback::callback,
callback,
- ctx, requestPool.pool()), );
+ ctx, subPool.getPool()), );
}
void
@@ -149,18 +149,18 @@ SVNClient::status(const char *path, svn_
bool ignoreExternals, StringArray &changelists,
StatusCallback *callback)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
svn_revnum_t youngest = SVN_INVALID_REVNUM;
svn_opt_revision_t rev;
SVN_JNI_NULL_PTR_EX(path, "path", );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
callback->setWcCtx(ctx->wc_ctx);
- Path checkedPath(path);
+ Path checkedPath(path, subPool);
SVN_JNI_ERR(checkedPath.error_occured(), );
rev.kind = svn_opt_revision_unspecified;
@@ -170,9 +170,9 @@ SVNClient::status(const char *path, svn_
depth,
getAll, onServer, noIgnore, FALSE,
ignoreExternals,
- changelists.array(requestPool),
+ changelists.array(subPool),
StatusCallback::callback, callback,
- requestPool.pool()), );
+ subPool.getPool()), );
}
void SVNClient::logMessages(const char *path, Revision &pegRevision,
@@ -181,32 +181,32 @@ void SVNClient::logMessages(const char *
bool includeMergedRevisions, StringArray &revProps,
long limit, LogMessageCallback *callback)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
- Targets target(path);
- const apr_array_header_t *targets = target.array(requestPool);
+ Targets target(path, subPool);
+ const apr_array_header_t *targets = target.array(subPool);
SVN_JNI_ERR(target.error_occured(), );
apr_array_header_t *ranges =
- apr_array_make(requestPool.pool(), logRanges.size(),
+ apr_array_make(subPool.getPool(), logRanges.size(),
sizeof(svn_opt_revision_range_t *));
std::vector<RevisionRange>::const_iterator it;
for (it = logRanges.begin(); it != logRanges.end(); ++it)
{
- if (it->toRange(requestPool)->start.kind
+ if (it->toRange(subPool)->start.kind
== svn_opt_revision_unspecified
- && it->toRange(requestPool)->end.kind
+ && it->toRange(subPool)->end.kind
== svn_opt_revision_unspecified)
{
svn_opt_revision_range_t *range =
- (svn_opt_revision_range_t *)apr_pcalloc(requestPool.pool(),
+ (svn_opt_revision_range_t *)apr_pcalloc(subPool.getPool(),
sizeof(*range));
range->start.kind = svn_opt_revision_number;
range->start.value.number = 1;
@@ -216,7 +216,7 @@ void SVNClient::logMessages(const char *
else
{
APR_ARRAY_PUSH(ranges, const svn_opt_revision_range_t *) =
- it->toRange(requestPool);
+ it->toRange(subPool);
}
if (JNIUtil::isExceptionThrown())
return;
@@ -225,9 +225,9 @@ void SVNClient::logMessages(const char *
SVN_JNI_ERR(svn_client_log5(targets, pegRevision.revision(), ranges,
limit, discoverPaths, stopOnCopy,
includeMergedRevisions,
- revProps.array(requestPool),
+ revProps.array(subPool),
LogMessageCallback::callback, callback, ctx,
- requestPool.pool()), );
+ subPool.getPool()), );
}
jlong SVNClient::checkout(const char *moduleName, const char *destPath,
@@ -235,18 +235,18 @@ jlong SVNClient::checkout(const char *mo
svn_depth_t depth, bool ignoreExternals,
bool allowUnverObstructions)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool;
SVN_JNI_NULL_PTR_EX(moduleName, "moduleName", -1);
SVN_JNI_NULL_PTR_EX(destPath, "destPath", -1);
- Path url(moduleName);
- Path path(destPath);
+ Path url(moduleName, subPool);
+ Path path(destPath, subPool);
SVN_JNI_ERR(url.error_occured(), -1);
SVN_JNI_ERR(path.error_occured(), -1);
svn_revnum_t rev;
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return -1;
@@ -258,7 +258,7 @@ jlong SVNClient::checkout(const char *mo
ignoreExternals,
allowUnverObstructions,
ctx,
- requestPool.pool()),
+ subPool.getPool()),
-1);
return rev;
@@ -268,56 +268,56 @@ void SVNClient::remove(Targets &targets,
bool keep_local, RevpropTable &revprops,
CommitCallback *callback)
{
- SVN::Pool requestPool;
- svn_client_ctx_t *ctx = context.getContext(message);
+ 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(requestPool);
+ const apr_array_header_t *targets2 = targets.array(subPool);
SVN_JNI_ERR(targets.error_occured(), );
SVN_JNI_ERR(svn_client_delete4(targets2, force, keep_local,
- revprops.hash(requestPool),
+ revprops.hash(subPool),
CommitCallback::callback, callback,
- ctx, requestPool.pool()), );
+ ctx, subPool.getPool()), );
}
void SVNClient::revert(const char *path, svn_depth_t depth,
StringArray &changelists)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
- Targets target(path);
- const apr_array_header_t *targets = target.array(requestPool);
+ Targets target(path, subPool);
+ const apr_array_header_t *targets = target.array(subPool);
SVN_JNI_ERR(target.error_occured(), );
SVN_JNI_ERR(svn_client_revert2(targets, depth,
- changelists.array(requestPool), ctx,
- requestPool.pool()), );
+ changelists.array(subPool), ctx,
+ subPool.getPool()), );
}
void SVNClient::add(const char *path,
svn_depth_t depth, bool force, bool no_ignore,
bool add_parents)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
- Path intPath(path);
+ Path intPath(path, subPool);
SVN_JNI_ERR(intPath.error_occured(), );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
SVN_JNI_ERR(svn_client_add4(intPath.c_str(), depth, force,
no_ignore, add_parents, ctx,
- requestPool.pool()), );
+ subPool.getPool()), );
}
jlongArray SVNClient::update(Targets &targets, Revision &revision,
@@ -325,14 +325,14 @@ jlongArray SVNClient::update(Targets &ta
bool makeParents, bool ignoreExternals,
bool allowUnverObstructions)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ 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(requestPool);
+ const apr_array_header_t *array = targets.array(subPool);
SVN_JNI_ERR(targets.error_occured(), NULL);
SVN_JNI_ERR(svn_client_update4(&revs, array,
revision.revision(),
@@ -342,7 +342,7 @@ jlongArray SVNClient::update(Targets &ta
allowUnverObstructions,
TRUE /* adds_as_modification */,
makeParents,
- ctx, requestPool.pool()),
+ ctx, subPool.getPool()),
NULL);
JNIEnv *env = JNIUtil::getEnv();
@@ -367,19 +367,19 @@ void SVNClient::commit(Targets &targets,
StringArray &changelists, RevpropTable &revprops,
CommitCallback *callback)
{
- SVN::Pool requestPool;
- const apr_array_header_t *targets2 = targets.array(requestPool);
+ SVN::Pool subPool(pool);
+ const apr_array_header_t *targets2 = targets.array(subPool);
SVN_JNI_ERR(targets.error_occured(), );
- svn_client_ctx_t *ctx = context.getContext(message);
+ svn_client_ctx_t *ctx = context.getContext(message, subPool);
if (ctx == NULL)
return;
SVN_JNI_ERR(svn_client_commit5(targets2, depth,
noUnlock, keepChangelist, TRUE,
- changelists.array(requestPool),
- revprops.hash(requestPool),
+ changelists.array(subPool),
+ revprops.hash(subPool),
CommitCallback::callback, callback,
- ctx, requestPool.pool()),
+ ctx, subPool.getPool()),
);
}
@@ -388,9 +388,9 @@ void SVNClient::copy(CopySources ©So
bool makeParents, bool ignoreExternals,
RevpropTable &revprops, CommitCallback *callback)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
- apr_array_header_t *srcs = copySources.array(requestPool);
+ apr_array_header_t *srcs = copySources.array(subPool);
if (srcs == NULL)
{
JNIUtil::throwNativeException(JAVA_PACKAGE "/ClientException",
@@ -398,18 +398,18 @@ void SVNClient::copy(CopySources ©So
return;
}
SVN_JNI_NULL_PTR_EX(destPath, "destPath", );
- Path destinationPath(destPath);
+ Path destinationPath(destPath, subPool);
SVN_JNI_ERR(destinationPath.error_occured(), );
- svn_client_ctx_t *ctx = context.getContext(message);
+ svn_client_ctx_t *ctx = context.getContext(message, subPool);
if (ctx == NULL)
return;
SVN_JNI_ERR(svn_client_copy6(srcs, destinationPath.c_str(),
copyAsChild, makeParents, ignoreExternals,
- revprops.hash(requestPool),
+ revprops.hash(subPool),
CommitCallback::callback, callback,
- ctx, requestPool.pool()), );
+ ctx, subPool.getPool()), );
}
void SVNClient::move(Targets &srcPaths, const char *destPath,
@@ -417,70 +417,70 @@ void SVNClient::move(Targets &srcPaths,
bool makeParents, RevpropTable &revprops,
CommitCallback *callback)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
- const apr_array_header_t *srcs = srcPaths.array(requestPool);
+ const apr_array_header_t *srcs = srcPaths.array(subPool);
SVN_JNI_ERR(srcPaths.error_occured(), );
SVN_JNI_NULL_PTR_EX(destPath, "destPath", );
- Path destinationPath(destPath);
+ Path destinationPath(destPath, subPool);
SVN_JNI_ERR(destinationPath.error_occured(), );
- svn_client_ctx_t *ctx = context.getContext(message);
+ svn_client_ctx_t *ctx = context.getContext(message, subPool);
if (ctx == NULL)
return;
SVN_JNI_ERR(svn_client_move6((apr_array_header_t *) srcs,
destinationPath.c_str(), moveAsChild,
- makeParents, revprops.hash(requestPool),
+ makeParents, revprops.hash(subPool),
CommitCallback::callback, callback, ctx,
- requestPool.pool()), );
+ subPool.getPool()), );
}
void SVNClient::mkdir(Targets &targets, CommitMessage *message,
bool makeParents, RevpropTable &revprops,
CommitCallback *callback)
{
- SVN::Pool requestPool;
- svn_client_ctx_t *ctx = context.getContext(message);
+ 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(requestPool);
+ const apr_array_header_t *targets2 = targets.array(subPool);
SVN_JNI_ERR(targets.error_occured(), );
SVN_JNI_ERR(svn_client_mkdir4(targets2, makeParents,
- revprops.hash(requestPool),
+ revprops.hash(subPool),
CommitCallback::callback, callback,
- ctx, requestPool.pool()), );
+ ctx, subPool.getPool()), );
}
void SVNClient::cleanup(const char *path)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
- Path intPath(path);
+ Path intPath(path, subPool);
SVN_JNI_ERR(intPath.error_occured(), );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
- SVN_JNI_ERR(svn_client_cleanup(intPath.c_str(), ctx, requestPool.pool()),);
+ SVN_JNI_ERR(svn_client_cleanup(intPath.c_str(), ctx, subPool.getPool()),);
}
void SVNClient::resolve(const char *path, svn_depth_t depth,
svn_wc_conflict_choice_t choice)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
- Path intPath(path);
+ Path intPath(path, subPool);
SVN_JNI_ERR(intPath.error_occured(), );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
SVN_JNI_ERR(svn_client_resolve(intPath.c_str(), depth, choice,
- ctx, requestPool.pool()), );
+ ctx, subPool.getPool()), );
}
jlong SVNClient::doExport(const char *srcPath, const char *destPath,
@@ -488,26 +488,26 @@ jlong SVNClient::doExport(const char *sr
bool force, bool ignoreExternals,
svn_depth_t depth, const char *nativeEOL)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(srcPath, "srcPath", -1);
SVN_JNI_NULL_PTR_EX(destPath, "destPath", -1);
- Path sourcePath(srcPath);
+ Path sourcePath(srcPath, subPool);
SVN_JNI_ERR(sourcePath.error_occured(), -1);
- Path destinationPath(destPath);
+ Path destinationPath(destPath, subPool);
SVN_JNI_ERR(destinationPath.error_occured(), -1);
svn_revnum_t rev;
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return -1;
- SVN_JNI_ERR(svn_client_export4(&rev, sourcePath.c_str(),
+ SVN_JNI_ERR(svn_client_export5(&rev, sourcePath.c_str(),
destinationPath.c_str(),
pegRevision.revision(),
revision.revision(), force,
- ignoreExternals,
+ ignoreExternals, FALSE,
depth,
nativeEOL, ctx,
- requestPool.pool()),
+ subPool.getPool()),
-1);
return rev;
@@ -521,16 +521,16 @@ jlong SVNClient::doSwitch(const char *pa
bool allowUnverObstructions,
bool ignoreAncestry)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", -1);
SVN_JNI_NULL_PTR_EX(url, "url", -1);
- Path intUrl(url);
+ Path intUrl(url, subPool);
SVN_JNI_ERR(intUrl.error_occured(), -1);
- Path intPath(path);
+ Path intPath(path, subPool);
SVN_JNI_ERR(intPath.error_occured(), -1);
svn_revnum_t rev;
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return -1;
@@ -544,7 +544,7 @@ jlong SVNClient::doSwitch(const char *pa
allowUnverObstructions,
ignoreAncestry,
ctx,
- requestPool.pool()),
+ subPool.getPool()),
-1);
return rev;
@@ -555,37 +555,37 @@ void SVNClient::doImport(const char *pat
bool noIgnore, bool ignoreUnknownNodeTypes,
RevpropTable &revprops, CommitCallback *callback)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
SVN_JNI_NULL_PTR_EX(url, "url", );
- Path intPath(path);
+ Path intPath(path, subPool);
SVN_JNI_ERR(intPath.error_occured(), );
- Path intUrl(url);
+ Path intUrl(url, subPool);
SVN_JNI_ERR(intUrl.error_occured(), );
- svn_client_ctx_t *ctx = context.getContext(message);
+ svn_client_ctx_t *ctx = context.getContext(message, subPool);
if (ctx == NULL)
return;
SVN_JNI_ERR(svn_client_import4(intPath.c_str(), intUrl.c_str(), depth,
noIgnore, ignoreUnknownNodeTypes,
- revprops.hash(requestPool),
+ revprops.hash(subPool),
CommitCallback::callback, callback,
- ctx, requestPool.pool()), );
+ ctx, subPool.getPool()), );
}
jobject
SVNClient::suggestMergeSources(const char *path, Revision &pegRevision)
{
- SVN::Pool requestPool;
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ SVN::Pool subPool(pool);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return NULL;
apr_array_header_t *sources;
SVN_JNI_ERR(svn_client_suggest_merge_sources(&sources, path,
pegRevision.revision(),
- ctx, requestPool.pool()),
+ ctx, subPool.getPool()),
NULL);
return CreateJ::StringSet(sources);
@@ -596,29 +596,29 @@ void SVNClient::merge(const char *path1,
const char *localPath, bool force, svn_depth_t depth,
bool ignoreAncestry, bool dryRun, bool recordOnly)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path1, "path1", );
SVN_JNI_NULL_PTR_EX(path2, "path2", );
SVN_JNI_NULL_PTR_EX(localPath, "localPath", );
- Path intLocalPath(localPath);
+ Path intLocalPath(localPath, subPool);
SVN_JNI_ERR(intLocalPath.error_occured(), );
- Path srcPath1(path1);
+ Path srcPath1(path1, subPool);
SVN_JNI_ERR(srcPath1.error_occured(), );
- Path srcPath2 = path2;
+ Path srcPath2(path2, subPool);
SVN_JNI_ERR(srcPath2.error_occured(), );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
- SVN_JNI_ERR(svn_client_merge3(srcPath1.c_str(), revision1.revision(),
+ SVN_JNI_ERR(svn_client_merge4(srcPath1.c_str(), revision1.revision(),
srcPath2.c_str(), revision2.revision(),
intLocalPath.c_str(),
depth,
ignoreAncestry, force, recordOnly, dryRun,
- NULL, ctx, requestPool.pool()), );
+ TRUE, NULL, ctx, subPool.getPool()), );
}
void SVNClient::merge(const char *path, Revision &pegRevision,
@@ -626,33 +626,33 @@ void SVNClient::merge(const char *path,
const char *localPath, bool force, svn_depth_t depth,
bool ignoreAncestry, bool dryRun, bool recordOnly)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
SVN_JNI_NULL_PTR_EX(localPath, "localPath", );
- Path intLocalPath(localPath);
+ Path intLocalPath(localPath, subPool);
SVN_JNI_ERR(intLocalPath.error_occured(), );
- Path srcPath(path);
+ Path srcPath(path, subPool);
SVN_JNI_ERR(srcPath.error_occured(), );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
apr_array_header_t *ranges =
- apr_array_make(requestPool.pool(), rangesToMerge.size(),
+ apr_array_make(subPool.getPool(), rangesToMerge.size(),
sizeof(const svn_opt_revision_range_t *));
std::vector<RevisionRange>::const_iterator it;
for (it = rangesToMerge.begin(); it != rangesToMerge.end(); ++it)
{
- if (it->toRange(requestPool)->start.kind
+ if (it->toRange(subPool)->start.kind
== svn_opt_revision_unspecified
- && it->toRange(requestPool)->end.kind
+ && it->toRange(subPool)->end.kind
== svn_opt_revision_unspecified)
{
svn_opt_revision_range_t *range =
- (svn_opt_revision_range_t *)apr_pcalloc(requestPool.pool(),
+ (svn_opt_revision_range_t *)apr_pcalloc(subPool.getPool(),
sizeof(*range));
range->start.kind = svn_opt_revision_number;
range->start.value.number = 1;
@@ -662,35 +662,35 @@ void SVNClient::merge(const char *path,
else
{
APR_ARRAY_PUSH(ranges, const svn_opt_revision_range_t *) =
- it->toRange(requestPool);
+ it->toRange(subPool);
}
if (JNIUtil::isExceptionThrown())
return;
}
- SVN_JNI_ERR(svn_client_merge_peg3(srcPath.c_str(),
+ SVN_JNI_ERR(svn_client_merge_peg4(srcPath.c_str(),
ranges,
pegRevision.revision(),
intLocalPath.c_str(),
depth,
ignoreAncestry, force, recordOnly,
- dryRun, NULL, ctx,
- requestPool.pool()), );
+ dryRun, TRUE, NULL, ctx,
+ subPool.getPool()), );
}
void SVNClient::mergeReintegrate(const char *path, Revision &pegRevision,
const char *localPath, bool dryRun)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
SVN_JNI_NULL_PTR_EX(localPath, "localPath", );
- Path intLocalPath(localPath);
+ Path intLocalPath(localPath, subPool);
SVN_JNI_ERR(intLocalPath.error_occured(), );
- Path srcPath(path);
+ Path srcPath(path, subPool);
SVN_JNI_ERR(srcPath.error_occured(), );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
@@ -698,26 +698,26 @@ void SVNClient::mergeReintegrate(const c
pegRevision.revision(),
intLocalPath.c_str(),
dryRun, NULL, ctx,
- requestPool.pool()), );
+ subPool.getPool()), );
}
jobject
SVNClient::getMergeinfo(const char *target, Revision &pegRevision)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
JNIEnv *env = JNIUtil::getEnv();
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return NULL;
svn_mergeinfo_t mergeinfo;
- Path intLocalTarget(target);
+ Path intLocalTarget(target, subPool);
SVN_JNI_ERR(intLocalTarget.error_occured(), NULL);
SVN_JNI_ERR(svn_client_mergeinfo_get_merged(&mergeinfo,
intLocalTarget.c_str(),
pegRevision.revision(), ctx,
- requestPool.pool()),
+ subPool.getPool()),
NULL);
if (mergeinfo == NULL)
return NULL;
@@ -750,7 +750,7 @@ SVNClient::getMergeinfo(const char *targ
return NULL;
apr_hash_index_t *hi;
- for (hi = apr_hash_first(requestPool.pool(), mergeinfo);
+ for (hi = apr_hash_first(subPool.getPool(), mergeinfo);
hi;
hi = apr_hash_next(hi))
{
@@ -782,18 +782,18 @@ void SVNClient::getMergeinfoLog(int type
StringArray &revProps,
LogMessageCallback *callback)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
SVN_JNI_NULL_PTR_EX(pathOrURL, "path or url", );
- Path urlPath(pathOrURL);
+ Path urlPath(pathOrURL, subPool);
SVN_JNI_ERR(urlPath.error_occured(), );
SVN_JNI_NULL_PTR_EX(mergeSourceURL, "merge source url", );
- Path srcURL(mergeSourceURL);
+ Path srcURL(mergeSourceURL, subPool);
SVN_JNI_ERR(srcURL.error_occured(), );
SVN_JNI_ERR(svn_client_mergeinfo_log((type == 1),
@@ -805,9 +805,9 @@ void SVNClient::getMergeinfoLog(int type
callback,
discoverChangedPaths,
depth,
- revProps.array(requestPool),
+ revProps.array(subPool),
ctx,
- requestPool.pool()), );
+ subPool.getPool()), );
return;
}
@@ -818,13 +818,13 @@ void SVNClient::getMergeinfoLog(int type
jbyteArray SVNClient::propertyGet(const char *path, const char *name,
Revision &revision, Revision &pegRevision)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", NULL);
SVN_JNI_NULL_PTR_EX(name, "name", NULL);
- Path intPath(path);
+ Path intPath(path, subPool);
SVN_JNI_ERR(intPath.error_occured(), NULL);
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return NULL;
@@ -832,12 +832,12 @@ jbyteArray SVNClient::propertyGet(const
SVN_JNI_ERR(svn_client_propget3(&props, name,
intPath.c_str(), pegRevision.revision(),
revision.revision(), NULL, svn_depth_empty,
- NULL, ctx, requestPool.pool()),
+ NULL, ctx, subPool.getPool()),
NULL);
apr_hash_index_t *hi;
// only one element since we disabled recurse
- hi = apr_hash_first(requestPool.pool(), props);
+ hi = apr_hash_first(subPool.getPool(), props);
if (hi == NULL)
return NULL; // no property with this name
@@ -855,20 +855,20 @@ void SVNClient::properties(const char *p
Revision &pegRevision, svn_depth_t depth,
StringArray &changelists, ProplistCallback *callback)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
- Path intPath(path);
+ Path intPath(path, subPool);
SVN_JNI_ERR(intPath.error_occured(), );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
SVN_JNI_ERR(svn_client_proplist3(intPath.c_str(), pegRevision.revision(),
revision.revision(), depth,
- changelists.array(requestPool),
+ changelists.array(subPool),
ProplistCallback::callback, callback,
- ctx, requestPool.pool()), );
+ ctx, subPool.getPool()), );
return;
}
@@ -877,7 +877,7 @@ void SVNClient::propertySetLocal(Targets
JNIByteArray &value, svn_depth_t depth,
StringArray &changelists, bool force)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(name, "name", );
svn_string_t *val;
@@ -885,25 +885,27 @@ void SVNClient::propertySetLocal(Targets
val = NULL;
else
val = svn_string_ncreate((const char *)value.getBytes(), value.getLength(),
- requestPool.pool());
+ subPool.getPool());
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
- const apr_array_header_t *targetsApr = targets.array(requestPool);
+ const apr_array_header_t *targetsApr = targets.array(subPool);
SVN_JNI_ERR(svn_client_propset_local(name, val, targetsApr,
depth, force,
- changelists.array(requestPool),
- ctx, requestPool.pool()), );
+ changelists.array(subPool),
+ ctx, subPool.getPool()), );
}
-void SVNClient::propertySetRemote(const char *path, const char *name,
+void SVNClient::propertySetRemote(const char *path, long base_rev,
+ const char *name,
+ CommitMessage *message,
JNIByteArray &value, bool force,
RevpropTable &revprops,
CommitCallback *callback)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(name, "name", );
svn_string_t *val;
@@ -911,34 +913,33 @@ void SVNClient::propertySetRemote(const
val = NULL;
else
val = svn_string_ncreate((const char *)value.getBytes(), value.getLength(),
- requestPool.pool());
+ subPool.getPool());
- Path intPath(path);
+ Path intPath(path, subPool);
SVN_JNI_ERR(intPath.error_occured(), );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(message, subPool);
if (ctx == NULL)
return;
SVN_JNI_ERR(svn_client_propset_remote(name, val, intPath.c_str(),
- force, SVN_INVALID_REVNUM,
- revprops.hash(requestPool),
+ force, base_rev,
+ revprops.hash(subPool),
CommitCallback::callback, callback,
- ctx, requestPool.pool()), );
+ ctx, subPool.getPool()), );
}
void SVNClient::diff(const char *target1, Revision &revision1,
const char *target2, Revision &revision2,
Revision *pegRevision, const char *relativeToDir,
- const char *outfileName, svn_depth_t depth,
+ OutputStream &outputStream, svn_depth_t depth,
StringArray &changelists,
bool ignoreAncestry, bool noDiffDelete, bool force,
bool showCopiesAsAdds)
{
- svn_error_t *err;
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
const char *c_relToDir = relativeToDir ?
- svn_dirent_canonicalize(relativeToDir, requestPool.pool()) :
+ svn_dirent_canonicalize(relativeToDir, subPool.getPool()) :
relativeToDir;
SVN_JNI_NULL_PTR_EX(target1, "target", );
@@ -946,34 +947,20 @@ void SVNClient::diff(const char *target1
if (pegRevision == NULL)
SVN_JNI_NULL_PTR_EX(target2, "target2", );
- SVN_JNI_NULL_PTR_EX(outfileName, "outfileName", );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
- Path path1(target1);
+ Path path1(target1, subPool);
SVN_JNI_ERR(path1.error_occured(), );
- apr_file_t *outfile = NULL;
- apr_status_t rv =
- apr_file_open(&outfile,
- svn_dirent_internal_style(outfileName,
- requestPool.pool()),
- APR_CREATE|APR_WRITE|APR_TRUNCATE , APR_OS_DEFAULT,
- requestPool.pool());
- if (rv != APR_SUCCESS)
- {
- SVN_JNI_ERR(svn_error_createf(rv, NULL, _("Cannot open file '%s'"),
- outfileName), );
- }
-
// We don't use any options to diff.
- apr_array_header_t *diffOptions = apr_array_make(requestPool.pool(),
+ apr_array_header_t *diffOptions = apr_array_make(subPool.getPool(),
0, sizeof(char *));
if (pegRevision)
{
- err = svn_client_diff_peg5(diffOptions,
+ SVN_JNI_ERR(svn_client_diff_peg6(diffOptions,
path1.c_str(),
pegRevision->revision(),
revision1.revision(),
@@ -986,26 +973,20 @@ void SVNClient::diff(const char *target1
force,
FALSE,
SVN_APR_LOCALE_CHARSET,
- outfile,
+ outputStream.getStream(subPool),
NULL /* error file */,
- changelists.array(requestPool),
+ changelists.array(subPool),
ctx,
- requestPool.pool());
+ subPool.getPool()),
+ );
}
else
{
// "Regular" diff (without a peg revision).
- Path path2(target2);
- err = path2.error_occured();
- if (err)
- {
- if (outfile)
- goto cleanup;
-
- SVN_JNI_ERR(err, );
- }
+ Path path2(target2, subPool);
+ SVN_JNI_ERR(path2.error_occured(), );
- err = svn_client_diff5(diffOptions,
+ SVN_JNI_ERR(svn_client_diff6(diffOptions,
path1.c_str(),
revision1.revision(),
path2.c_str(),
@@ -1018,47 +999,36 @@ void SVNClient::diff(const char *target1
force,
FALSE,
SVN_APR_LOCALE_CHARSET,
- outfile,
- NULL /* error file */,
- changelists.array(requestPool),
+ outputStream.getStream(subPool),
+ NULL /* error stream */,
+ changelists.array(subPool),
ctx,
- requestPool.pool());
- }
-
-cleanup:
- rv = apr_file_close(outfile);
- if (rv != APR_SUCCESS)
- {
- svn_error_clear(err);
-
- SVN_JNI_ERR(svn_error_createf(rv, NULL, _("Cannot close file '%s'"),
- outfileName), );
+ subPool.getPool()),
+ );
}
-
- SVN_JNI_ERR(err, );
}
void SVNClient::diff(const char *target1, Revision &revision1,
const char *target2, Revision &revision2,
- const char *relativeToDir, const char *outfileName,
+ const char *relativeToDir, OutputStream &outputStream,
svn_depth_t depth, StringArray &changelists,
bool ignoreAncestry, bool noDiffDelete, bool force,
bool showCopiesAsAdds)
{
diff(target1, revision1, target2, revision2, NULL, relativeToDir,
- outfileName, depth, changelists, ignoreAncestry, noDiffDelete, force,
+ outputStream, depth, changelists, ignoreAncestry, noDiffDelete, force,
showCopiesAsAdds);
}
void SVNClient::diff(const char *target, Revision &pegRevision,
Revision &startRevision, Revision &endRevision,
- const char *relativeToDir, const char *outfileName,
+ const char *relativeToDir, OutputStream &outputStream,
svn_depth_t depth, StringArray &changelists,
bool ignoreAncestry, bool noDiffDelete, bool force,
bool showCopiesAsAdds)
{
diff(target, startRevision, NULL, endRevision, &pegRevision,
- relativeToDir, outfileName, depth, changelists,
+ relativeToDir, outputStream, depth, changelists,
ignoreAncestry, noDiffDelete, force, showCopiesAsAdds);
}
@@ -1069,28 +1039,28 @@ SVNClient::diffSummarize(const char *tar
bool ignoreAncestry,
DiffSummaryReceiver &receiver)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(target1, "target1", );
SVN_JNI_NULL_PTR_EX(target2, "target2", );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
- Path path1(target1);
+ Path path1(target1, subPool);
SVN_JNI_ERR(path1.error_occured(), );
- Path path2(target2);
+ Path path2(target2, subPool);
SVN_JNI_ERR(path2.error_occured(), );
SVN_JNI_ERR(svn_client_diff_summarize2(path1.c_str(), revision1.revision(),
path2.c_str(), revision2.revision(),
depth,
ignoreAncestry,
- changelists.array(requestPool),
+ changelists.array(subPool),
DiffSummaryReceiver::summarize,
&receiver,
- ctx, requestPool.pool()), );
+ ctx, subPool.getPool()), );
}
void
@@ -1099,15 +1069,15 @@ SVNClient::diffSummarize(const char *tar
svn_depth_t depth, StringArray &changelists,
bool ignoreAncestry, DiffSummaryReceiver &receiver)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(target, "target", );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
- Path path(target);
+ Path path(target, subPool);
SVN_JNI_ERR(path.error_occured(), );
SVN_JNI_ERR(svn_client_diff_summarize_peg2(path.c_str(),
@@ -1116,41 +1086,41 @@ SVNClient::diffSummarize(const char *tar
endRevision.revision(),
depth,
ignoreAncestry,
- changelists.array(requestPool),
+ changelists.array(subPool),
DiffSummaryReceiver::summarize,
&receiver, ctx,
- requestPool.pool()), );
+ subPool.getPool()), );
}
void SVNClient::streamFileContent(const char *path, Revision &revision,
Revision &pegRevision,
OutputStream &outputStream)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
- Path intPath(path);
+ Path intPath(path, subPool);
SVN_JNI_ERR(intPath.error_occured(), );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
- SVN_JNI_ERR(svn_client_cat2(outputStream.getStream(requestPool),
+ SVN_JNI_ERR(svn_client_cat2(outputStream.getStream(subPool),
path, pegRevision.revision(),
- revision.revision(), ctx, requestPool.pool()),
+ revision.revision(), ctx, subPool.getPool()),
);
}
jbyteArray SVNClient::revProperty(const char *path,
const char *name, Revision &rev)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", NULL);
SVN_JNI_NULL_PTR_EX(name, "name", NULL);
- Path intPath(path);
+ Path intPath(path, subPool);
SVN_JNI_ERR(intPath.error_occured(), NULL);
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return NULL;
@@ -1158,8 +1128,8 @@ jbyteArray SVNClient::revProperty(const
svn_string_t *propval;
svn_revnum_t set_rev;
SVN_JNI_ERR(svn_client_url_from_path2(&URL, intPath.c_str(), ctx,
- requestPool.pool(),
- requestPool.pool()),
+ subPool.getPool(),
+ subPool.getPool()),
NULL);
if (URL == NULL)
@@ -1171,7 +1141,7 @@ jbyteArray SVNClient::revProperty(const
SVN_JNI_ERR(svn_client_revprop_get(name, &propval, URL,
rev.revision(), &set_rev, ctx,
- requestPool.pool()),
+ subPool.getPool()),
NULL);
if (propval == NULL)
return NULL;
@@ -1182,26 +1152,26 @@ jbyteArray SVNClient::revProperty(const
void SVNClient::relocate(const char *from, const char *to, const char *path,
bool ignoreExternals)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
SVN_JNI_NULL_PTR_EX(from, "from", );
SVN_JNI_NULL_PTR_EX(to, "to", );
- Path intPath(path);
+ Path intPath(path, subPool);
SVN_JNI_ERR(intPath.error_occured(), );
- Path intFrom(from);
+ Path intFrom(from, subPool);
SVN_JNI_ERR(intFrom.error_occured(), );
- Path intTo(to);
+ Path intTo(to, subPool);
SVN_JNI_ERR(intTo.error_occured(), );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
SVN_JNI_ERR(svn_client_relocate2(intPath.c_str(), intFrom.c_str(),
intTo.c_str(), ignoreExternals, ctx,
- requestPool.pool()), );
+ subPool.getPool()), );
}
void SVNClient::blame(const char *path, Revision &pegRevision,
@@ -1209,13 +1179,13 @@ void SVNClient::blame(const char *path,
bool ignoreMimeType, bool includeMergedRevisions,
BlameCallback *callback)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
- apr_pool_t *pool = requestPool.pool();
- Path intPath(path);
+ apr_pool_t *pool = subPool.getPool();
+ Path intPath(path, subPool);
SVN_JNI_ERR(intPath.error_occured(), );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
@@ -1232,29 +1202,29 @@ void SVNClient::blame(const char *path,
void SVNClient::addToChangelist(Targets &srcPaths, const char *changelist,
svn_depth_t depth, StringArray &changelists)
{
- SVN::Pool requestPool;
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ SVN::Pool subPool(pool);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
- const apr_array_header_t *srcs = srcPaths.array(requestPool);
+ const apr_array_header_t *srcs = srcPaths.array(subPool);
SVN_JNI_ERR(srcPaths.error_occured(), );
SVN_JNI_ERR(svn_client_add_to_changelist(srcs, changelist, depth,
- changelists.array(requestPool),
- ctx, requestPool.pool()), );
+ changelists.array(subPool),
+ ctx, subPool.getPool()), );
}
void SVNClient::removeFromChangelists(Targets &srcPaths, svn_depth_t depth,
StringArray &changelists)
{
- SVN::Pool requestPool;
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ SVN::Pool subPool(pool);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
- const apr_array_header_t *srcs = srcPaths.array(requestPool);
+ const apr_array_header_t *srcs = srcPaths.array(subPool);
SVN_JNI_ERR(srcPaths.error_occured(), );
SVN_JNI_ERR(svn_client_remove_from_changelists(srcs, depth,
- changelists.array(requestPool),
- ctx, requestPool.pool()), );
+ changelists.array(subPool),
+ ctx, subPool.getPool()), );
}
void SVNClient::getChangelists(const char *rootPath,
@@ -1262,56 +1232,56 @@ void SVNClient::getChangelists(const cha
svn_depth_t depth,
ChangelistCallback *callback)
{
- SVN::Pool requestPool;
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ SVN::Pool subPool(pool);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
SVN_JNI_ERR(svn_client_get_changelists(rootPath,
- changelists.array(requestPool),
+ changelists.array(subPool),
depth, ChangelistCallback::callback,
- callback, ctx, requestPool.pool()),
+ callback, ctx, subPool.getPool()),
);
}
void SVNClient::lock(Targets &targets, const char *comment, bool force)
{
- SVN::Pool requestPool;
- const apr_array_header_t *targetsApr = targets.array(requestPool);
+ SVN::Pool subPool(pool);
+ const apr_array_header_t *targetsApr = targets.array(subPool);
SVN_JNI_ERR(targets.error_occured(), );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
SVN_JNI_ERR(svn_client_lock(targetsApr, comment, force, ctx,
- requestPool.pool()), );
+ subPool.getPool()), );
}
void SVNClient::unlock(Targets &targets, bool force)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
- const apr_array_header_t *targetsApr = targets.array(requestPool);
+ const apr_array_header_t *targetsApr = targets.array(subPool);
SVN_JNI_ERR(targets.error_occured(), );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
SVN_JNI_ERR(svn_client_unlock((apr_array_header_t*)targetsApr, force,
- ctx, requestPool.pool()), );
+ ctx, subPool.getPool()), );
}
void SVNClient::setRevProperty(const char *path,
const char *name, Revision &rev,
const char *value, const char *original_value,
bool force)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
SVN_JNI_NULL_PTR_EX(name, "name", );
- Path intPath(path);
+ Path intPath(path, subPool);
SVN_JNI_ERR(intPath.error_occured(), );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
const char *URL;
SVN_JNI_ERR(svn_client_url_from_path2(&URL, intPath.c_str(), ctx,
- requestPool.pool(),
- requestPool.pool()), );
+ subPool.getPool(),
+ subPool.getPool()), );
if (URL == NULL)
{
@@ -1320,41 +1290,41 @@ void SVNClient::setRevProperty(const cha
);
}
- svn_string_t *val = svn_string_create(value, requestPool.pool());
+ svn_string_t *val = svn_string_create(value, subPool.getPool());
svn_string_t *orig_val;
if (original_value != NULL)
- orig_val = svn_string_create(original_value, requestPool.pool());
+ orig_val = svn_string_create(original_value, subPool.getPool());
else
orig_val = NULL;
svn_revnum_t set_revision;
SVN_JNI_ERR(svn_client_revprop_set2(name, val, orig_val, URL, rev.revision(),
&set_revision, force, ctx,
- requestPool.pool()), );
+ subPool.getPool()), );
}
jstring SVNClient::getVersionInfo(const char *path, const char *trailUrl,
bool lastChanged)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", NULL);
- Path intPath(path);
+ Path intPath(path, subPool);
SVN_JNI_ERR(intPath.error_occured(), NULL);
int wc_format;
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return NULL;
SVN_JNI_ERR(svn_wc_check_wc2(&wc_format, ctx->wc_ctx, intPath.c_str(),
- requestPool.pool()),
+ subPool.getPool()),
NULL);
if (! wc_format)
{
svn_node_kind_t kind;
SVN_JNI_ERR(svn_io_check_path(intPath.c_str(), &kind,
- requestPool.pool()),
+ subPool.getPool()),
NULL);
if (kind == svn_node_dir)
{
@@ -1373,12 +1343,12 @@ jstring SVNClient::getVersionInfo(const
const char *local_abspath;
SVN_JNI_ERR(svn_dirent_get_absolute(&local_abspath, intPath.c_str(),
- requestPool.pool()), NULL);
+ subPool.getPool()), NULL);
SVN_JNI_ERR(svn_wc_revision_status2(&result, ctx->wc_ctx, local_abspath,
trailUrl, lastChanged,
ctx->cancel_func, ctx->cancel_baton,
- requestPool.pool(),
- requestPool.pool()), NULL);
+ subPool.getPool(),
+ subPool.getPool()), NULL);
std::ostringstream value;
value << result->min_rev;
@@ -1399,40 +1369,40 @@ jstring SVNClient::getVersionInfo(const
void SVNClient::upgrade(const char *path)
{
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
- Path checkedPath(path);
+ Path checkedPath(path, subPool);
SVN_JNI_ERR(checkedPath.error_occured(), );
- SVN_JNI_ERR(svn_client_upgrade(path, ctx, requestPool.pool()), );
+ SVN_JNI_ERR(svn_client_upgrade(path, ctx, subPool.getPool()), );
}
jobject SVNClient::revProperties(const char *path, Revision &revision)
{
apr_hash_t *props;
- SVN::Pool requestPool;
+ SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", NULL);
- Path intPath(path);
+ Path intPath(path, subPool);
SVN_JNI_ERR(intPath.error_occured(), NULL);
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
const char *URL;
svn_revnum_t set_rev;
SVN_JNI_ERR(svn_client_url_from_path2(&URL, intPath.c_str(), ctx,
- requestPool.pool(),
- requestPool.pool()),
+ subPool.getPool(),
+ subPool.getPool()),
NULL);
if (ctx == NULL)
return NULL;
SVN_JNI_ERR(svn_client_revprop_list(&props, URL, revision.revision(),
- &set_rev, ctx, requestPool.pool()),
+ &set_rev, ctx, subPool.getPool()),
NULL);
return CreateJ::PropertyMap(props);
@@ -1451,21 +1421,21 @@ SVNClient::info2(const char *path, Revis
{
SVN_JNI_NULL_PTR_EX(path, "path", );
- SVN::Pool requestPool;
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ SVN::Pool subPool(pool);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
- Path checkedPath(path);
+ Path checkedPath(path, subPool);
SVN_JNI_ERR(checkedPath.error_occured(), );
SVN_JNI_ERR(svn_client_info3(checkedPath.c_str(),
pegRevision.revision(),
revision.revision(),
- InfoCallback::callback,
- callback, depth,
- changelists.array(requestPool), ctx,
- requestPool.pool()), );
+ depth, FALSE, TRUE,
+ changelists.array(subPool),
+ InfoCallback::callback, callback,
+ ctx, subPool.getPool()), );
}
void
@@ -1476,14 +1446,14 @@ SVNClient::patch(const char *patchPath,
SVN_JNI_NULL_PTR_EX(patchPath, "patchPath", );
SVN_JNI_NULL_PTR_EX(targetPath, "targetPath", );
- SVN::Pool requestPool;
- svn_client_ctx_t *ctx = context.getContext(NULL);
+ SVN::Pool subPool(pool);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
- Path checkedPatchPath(patchPath);
+ Path checkedPatchPath(patchPath, subPool);
SVN_JNI_ERR(checkedPatchPath.error_occured(), );
- Path checkedTargetPath(targetPath);
+ Path checkedTargetPath(targetPath, subPool);
SVN_JNI_ERR(checkedTargetPath.error_occured(), );
// Should parameterize the following, instead of defaulting to FALSE
@@ -1492,7 +1462,7 @@ SVNClient::patch(const char *patchPath,
dryRun, stripCount, reverse,
ignoreWhitespace, removeTempfiles,
PatchCallback::callback, callback,
- ctx, requestPool.pool()), );
+ ctx, subPool.getPool()), );
}
ClientContext &
Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNClient.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNClient.h?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNClient.h (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNClient.h Tue Oct 11 19:52:34 2011
@@ -81,7 +81,8 @@ class SVNClient :public SVNBase
void propertySetLocal(Targets &targets, const char *name, JNIByteArray &value,
svn_depth_t depth, StringArray &changelists,
bool force);
- void propertySetRemote(const char *path, const char *name,
+ void propertySetRemote(const char *path, long base_rev, const char *name,
+ CommitMessage *message,
JNIByteArray &value, bool force,
RevpropTable &revprops, CommitCallback *callback);
void properties(const char *path, Revision &revision,
@@ -173,13 +174,13 @@ class SVNClient :public SVNBase
Revision &revision, Revision &pegRevision);
void diff(const char *target1, Revision &revision1,
const char *target2, Revision &revision2,
- const char *relativeToDir, const char *outfileName,
+ const char *relativeToDir, OutputStream &outputStream,
svn_depth_t depth, StringArray &changelists,
bool ignoreAncestry, bool noDiffDelete, bool force,
bool showCopiesAsAdds);
void diff(const char *target, Revision &pegevision,
Revision &startRevision, Revision &endRevision,
- const char *relativeToDir, const char *outfileName,
+ const char *relativeToDir, OutputStream &outputStream,
svn_depth_t depth, StringArray &changelists,
bool ignoreAncestry, bool noDiffDelete, bool force,
bool showCopiesAsAdds);
@@ -208,7 +209,8 @@ class SVNClient :public SVNBase
void diff(const char *target1, Revision &revision1,
const char *target2, Revision &revision2,
Revision *pegRevision, const char *relativeToDir,
- const char *outfileName, svn_depth_t depth, StringArray &changelists,
+ OutputStream &outputStream, svn_depth_t depth,
+ StringArray &changelists,
bool ignoreAncestry, bool noDiffDelete, bool force,
bool showCopiesAsAdds);
Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNRepos.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNRepos.cpp?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNRepos.cpp (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/SVNRepos.cpp Tue Oct 11 19:52:34 2011
@@ -83,7 +83,7 @@ void SVNRepos::create(File &path, bool d
SVN::Pool requestPool;
svn_repos_t *repos;
apr_hash_t *config;
- apr_hash_t *fs_config = apr_hash_make(requestPool.pool());
+ apr_hash_t *fs_config = apr_hash_make(requestPool.getPool());
if (path.isNull())
{
@@ -103,10 +103,10 @@ void SVNRepos::create(File &path, bool d
SVN_JNI_ERR(svn_config_get_config(&config,
configPath.getInternalStyle(requestPool),
- requestPool.pool()),);
+ requestPool.getPool()),);
SVN_JNI_ERR(svn_repos_create(&repos, path.getInternalStyle(requestPool),
NULL, NULL, config, fs_config,
- requestPool.pool()), );
+ requestPool.getPool()), );
}
void SVNRepos::deltify(File &path, Revision &revStart, Revision &revEnd)
@@ -125,9 +125,9 @@ void SVNRepos::deltify(File &path, Revis
}
SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
- NULL, requestPool.pool()), );
+ NULL, requestPool.getPool()), );
fs = svn_repos_fs(repos);
- SVN_JNI_ERR(svn_fs_youngest_rev(&youngest, fs, requestPool.pool()), );
+ SVN_JNI_ERR(svn_fs_youngest_rev(&youngest, fs, requestPool.getPool()), );
if (revStart.revision()->kind == svn_opt_revision_number)
/* ### We only handle revision numbers right now, not dates. */
@@ -169,7 +169,7 @@ void SVNRepos::deltify(File &path, Revis
for (revision = start; revision <= end; ++revision)
{
revisionPool.clear();
- SVN_JNI_ERR(svn_fs_deltify_revision (fs, revision, revisionPool.pool()),
+ SVN_JNI_ERR(svn_fs_deltify_revision (fs, revision, revisionPool.getPool()),
);
}
@@ -194,9 +194,9 @@ void SVNRepos::dump(File &path, OutputSt
}
SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
- NULL, requestPool.pool()), );
+ NULL, requestPool.getPool()), );
fs = svn_repos_fs(repos);
- SVN_JNI_ERR(svn_fs_youngest_rev(&youngest, fs, requestPool.pool()), );
+ SVN_JNI_ERR(svn_fs_youngest_rev(&youngest, fs, requestPool.getPool()), );
/* ### We only handle revision numbers right now, not dates. */
if (revsionStart.revision()->kind == svn_opt_revision_number)
@@ -244,7 +244,7 @@ void SVNRepos::dump(File &path, OutputSt
? ReposNotifyCallback::notify
: NULL,
notifyCallback,
- checkCancel, this, requestPool.pool()), );
+ checkCancel, this, requestPool.getPool()), );
}
void SVNRepos::hotcopy(File &path, File &targetPath,
@@ -266,7 +266,7 @@ void SVNRepos::hotcopy(File &path, File
SVN_JNI_ERR(svn_repos_hotcopy(path.getInternalStyle(requestPool),
targetPath.getInternalStyle(requestPool),
- cleanLogs, requestPool.pool()), );
+ cleanLogs, requestPool.getPool()), );
}
static void
@@ -283,7 +283,7 @@ list_dblogs (File &path, MessageReceiver
SVN_JNI_ERR(svn_repos_db_logfiles(&logfiles,
path.getInternalStyle(requestPool),
- only_unused, requestPool.pool()), );
+ only_unused, requestPool.getPool()), );
/* Loop, printing log files. We append the log paths to the
* repository path, making sure to return everything to the native
@@ -293,8 +293,8 @@ list_dblogs (File &path, MessageReceiver
const char *log_utf8;
log_utf8 = svn_dirent_join(path.getInternalStyle(requestPool),
APR_ARRAY_IDX(logfiles, i, const char *),
- requestPool.pool());
- log_utf8 = svn_dirent_local_style (log_utf8, requestPool.pool());
+ requestPool.getPool());
+ log_utf8 = svn_dirent_local_style (log_utf8, requestPool.getPool());
receiver.receiveMessage(log_utf8);
}
}
@@ -334,7 +334,7 @@ void SVNRepos::load(File &path,
}
SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
- NULL, requestPool.pool()), );
+ NULL, requestPool.getPool()), );
SVN_JNI_ERR(svn_repos_load_fs3(repos, dataIn.getStream(requestPool),
uuid_action, relativePath,
@@ -344,7 +344,7 @@ void SVNRepos::load(File &path,
? ReposNotifyCallback::notify
: NULL,
notifyCallback,
- checkCancel, this, requestPool.pool()), );
+ checkCancel, this, requestPool.getPool()), );
}
void SVNRepos::lstxns(File &path, MessageReceiver &messageReceiver)
@@ -361,9 +361,9 @@ void SVNRepos::lstxns(File &path, Messag
}
SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
- NULL, requestPool.pool()), );
+ NULL, requestPool.getPool()), );
fs = svn_repos_fs (repos);
- SVN_JNI_ERR(svn_fs_list_transactions(&txns, fs, requestPool.pool()), );
+ SVN_JNI_ERR(svn_fs_list_transactions(&txns, fs, requestPool.getPool()), );
/* Loop, printing revisions. */
for (int i = 0; i < txns->nelts; ++i)
@@ -391,16 +391,16 @@ jlong SVNRepos::recover(File &path, Repo
? ReposNotifyCallback::notify
: NULL,
notifyCallback,
- checkCancel, this, requestPool.pool()),
+ checkCancel, this, requestPool.getPool()),
-1);
/* Since db transactions may have been replayed, it's nice to tell
* people what the latest revision is. It also proves that the
* recovery actually worked. */
SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
- NULL, requestPool.pool()), -1);
+ NULL, requestPool.getPool()), -1);
SVN_JNI_ERR(svn_fs_youngest_rev(&youngest_rev, svn_repos_fs (repos),
- requestPool.pool()),
+ requestPool.getPool()),
-1);
return youngest_rev;
}
@@ -422,7 +422,7 @@ void SVNRepos::rmtxns(File &path, String
}
SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
- NULL, requestPool.pool()), );
+ NULL, requestPool.getPool()), );
fs = svn_repos_fs (repos);
args = transactions.array(requestPool);
@@ -433,9 +433,9 @@ void SVNRepos::rmtxns(File &path, String
svn_error_t *err;
/* Try to open the txn. If that succeeds, try to abort it. */
- err = svn_fs_open_txn(&txn, fs, txn_name, transactionPool.pool());
+ err = svn_fs_open_txn(&txn, fs, txn_name, transactionPool.getPool());
if (! err)
- err = svn_fs_abort_txn(txn, transactionPool.pool());
+ err = svn_fs_abort_txn(txn, transactionPool.getPool());
/* If either the open or the abort of the txn fails because that
* transaction is dead, just try to purge the thing. Else,
@@ -444,7 +444,7 @@ void SVNRepos::rmtxns(File &path, String
if (err && (err->apr_err == SVN_ERR_FS_TRANSACTION_DEAD))
{
svn_error_clear (err);
- err = svn_fs_purge_txn(fs, txn_name, transactionPool.pool());
+ err = svn_fs_purge_txn(fs, txn_name, transactionPool.getPool());
}
/* If we had a real from the txn open, abort, or purge, we clear
@@ -479,13 +479,13 @@ void SVNRepos::setRevProp(File &path, Re
/* Open the filesystem. */
svn_repos_t *repos;
SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
- NULL, requestPool.pool()), );
+ NULL, requestPool.getPool()), );
/* If we are bypassing the hooks system, we just hit the filesystem
* directly. */
svn_error_t *err;
svn_string_t *propValStr = svn_string_create(propValue,
- requestPool.pool());
+ requestPool.getPool());
if (usePreRevPropChangeHook || usePostRevPropChangeHook)
{
err = svn_repos_fs_change_rev_prop4(repos,
@@ -493,14 +493,14 @@ void SVNRepos::setRevProp(File &path, Re
NULL, propName, NULL, propValStr,
usePreRevPropChangeHook,
usePostRevPropChangeHook, NULL,
- NULL, requestPool.pool());
+ NULL, requestPool.getPool());
}
else
{
svn_fs_t *fs = svn_repos_fs (repos);
err = svn_fs_change_rev_prop2(fs, revision.revision()->value.number,
propName, NULL, propValStr,
- requestPool.pool());
+ requestPool.getPool());
}
SVN_JNI_ERR(err, );
}
@@ -553,15 +553,15 @@ SVNRepos::verify(File &path, Revision &r
/* This whole process is basically just a dump of the repository
* with no interest in the output. */
SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
- NULL, requestPool.pool()), );
+ NULL, requestPool.getPool()), );
SVN_JNI_ERR(svn_fs_youngest_rev(&youngest, svn_repos_fs (repos),
- requestPool.pool()), );
+ requestPool.getPool()), );
/* Find the revision numbers at which to start and end. */
SVN_JNI_ERR(getRevnum(&lower, revisionStart.revision(),
- youngest, repos, requestPool.pool()), );
+ youngest, repos, requestPool.getPool()), );
SVN_JNI_ERR(getRevnum(&upper, revisionEnd.revision(),
- youngest, repos, requestPool.pool()), );
+ youngest, repos, requestPool.getPool()), );
// Fill in implied revisions if necessary.
if (lower == SVN_INVALID_REVNUM)
@@ -585,7 +585,7 @@ SVNRepos::verify(File &path, Revision &r
: NULL,
notifyCallback,
checkCancel, this /* cancel callback/baton */,
- requestPool.pool()), );
+ requestPool.getPool()), );
}
void SVNRepos::pack(File &path, ReposNotifyCallback *notifyCallback)
@@ -600,7 +600,7 @@ void SVNRepos::pack(File &path, ReposNot
}
SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
- NULL, requestPool.pool()), );
+ NULL, requestPool.getPool()), );
SVN_JNI_ERR(svn_repos_fs_pack2(repos,
notifyCallback != NULL
@@ -608,7 +608,7 @@ void SVNRepos::pack(File &path, ReposNot
: NULL,
notifyCallback,
checkCancel, this,
- requestPool.pool()),
+ requestPool.getPool()),
);
}
@@ -627,7 +627,7 @@ void SVNRepos::upgrade(File &path, Repos
? ReposNotifyCallback::notify
: NULL,
notifyCallback,
- requestPool.pool()),
+ requestPool.getPool()),
);
}
@@ -645,10 +645,10 @@ jobject SVNRepos::lslocks(File &path, sv
}
SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
- NULL, requestPool.pool()), NULL);
+ NULL, requestPool.getPool()), NULL);
/* Fetch all locks on or below the root directory. */
SVN_JNI_ERR(svn_repos_fs_get_locks2(&locks, repos, "/", depth, NULL, NULL,
- requestPool.pool()),
+ requestPool.getPool()),
NULL);
JNIEnv *env = JNIUtil::getEnv();
@@ -658,7 +658,7 @@ jobject SVNRepos::lslocks(File &path, sv
std::vector<jobject> jlocks;
- for (hi = apr_hash_first (requestPool.pool(), locks);
+ for (hi = apr_hash_first (requestPool.getPool(), locks);
hi;
hi = apr_hash_next (hi))
{
@@ -678,7 +678,7 @@ jobject SVNRepos::lslocks(File &path, sv
void SVNRepos::rmlocks(File &path, StringArray &locks)
{
SVN::Pool requestPool;
- apr_pool_t *pool = requestPool.pool();
+ apr_pool_t *pool = requestPool.getPool();
svn_repos_t *repos;
svn_fs_t *fs;
svn_fs_access_t *access;
@@ -690,7 +690,7 @@ void SVNRepos::rmlocks(File &path, Strin
}
SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
- NULL, requestPool.pool()), );
+ NULL, requestPool.getPool()), );
fs = svn_repos_fs (repos);
const char *username;
@@ -724,7 +724,7 @@ void SVNRepos::rmlocks(File &path, Strin
svn_lock_t *lock;
/* Fetch the path's svn_lock_t. */
- svn_error_t *err = svn_fs_get_lock(&lock, fs, lock_path, subpool.pool());
+ svn_error_t *err = svn_fs_get_lock(&lock, fs, lock_path, subpool.getPool());
if (err)
goto move_on;
if (! lock)
@@ -732,7 +732,7 @@ void SVNRepos::rmlocks(File &path, Strin
/* Now forcibly destroy the lock. */
err = svn_fs_unlock (fs, lock_path,
- lock->token, 1 /* force */, subpool.pool());
+ lock->token, 1 /* force */, subpool.getPool());
if (err)
goto move_on;
Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/StringArray.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/StringArray.cpp?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/StringArray.cpp (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/StringArray.cpp Tue Oct 11 19:52:34 2011
@@ -39,7 +39,7 @@ StringArray::~StringArray()
const apr_array_header_t *StringArray::array(const SVN::Pool &pool)
{
apr_array_header_t *strings
- = apr_array_make(pool.pool(), m_strings.size(), sizeof(char *));
+ = apr_array_make(pool.getPool(), m_strings.size(), sizeof(char *));
std::vector<std::string>::const_iterator it;
for (it = m_strings.begin(); it < m_strings.end(); ++it)
Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/Targets.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/Targets.cpp?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/Targets.cpp (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/Targets.cpp Tue Oct 11 19:52:34 2011
@@ -36,10 +36,11 @@ Targets::~Targets()
{
}
-Targets::Targets(const char *path)
+Targets::Targets(const char *path, SVN::Pool &in_pool)
+ : m_subpool(in_pool)
{
m_strArray = NULL;
- m_targets.push_back (path);
+ m_targets.push_back (apr_pstrdup(m_subpool.getPool(), path));
m_error_occured = NULL;
}
@@ -58,7 +59,7 @@ const apr_array_header_t *Targets::array
for (it = vec.begin(); it < vec.end(); ++it)
{
const char *tt = it->c_str();
- svn_error_t *err = JNIUtil::preprocessPath(tt, pool.pool());
+ svn_error_t *err = JNIUtil::preprocessPath(tt, pool.getPool());
if (err != NULL)
{
m_error_occured = err;
@@ -68,25 +69,31 @@ const apr_array_header_t *Targets::array
}
}
- std::vector<Path>::const_iterator it;
+ std::vector<const char*>::const_iterator it;
- apr_pool_t *apr_pool = pool.pool ();
+ apr_pool_t *apr_pool = pool.getPool();
apr_array_header_t *apr_targets = apr_array_make (apr_pool,
m_targets.size(),
sizeof(const char *));
for (it = m_targets.begin(); it != m_targets.end(); ++it)
{
- const Path &path = *it;
- const char *target =
- apr_pstrdup (apr_pool, path.c_str());
- (*((const char **) apr_array_push (apr_targets))) = target;
+ const char *target = *it;
+
+ svn_error_t *err = JNIUtil::preprocessPath(target, pool.getPool());
+ if (err != NULL)
+ {
+ m_error_occured = err;
+ break;
+ }
+ APR_ARRAY_PUSH(apr_targets, const char *) = *it;
}
return apr_targets;
}
-Targets::Targets(StringArray &strArray)
+Targets::Targets(StringArray &strArray, SVN::Pool &in_pool)
+ : m_subpool(in_pool)
{
m_strArray = &strArray;
m_error_occured = NULL;
Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/Targets.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/Targets.h?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/Targets.h (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/Targets.h Tue Oct 11 19:52:34 2011
@@ -34,17 +34,19 @@
struct apr_array_header_t;
#include "Path.h"
+#include "Pool.h"
#include <vector>
class Targets
{
private:
- std::vector<Path> m_targets;
+ SVN::Pool m_subpool;
+ std::vector<const char*> m_targets;
StringArray *m_strArray;
svn_error_t *m_error_occured;
public:
- Targets(StringArray &strArray);
- Targets(const char *path);
+ Targets(StringArray &strArray, SVN::Pool &in_pool);
+ Targets(const char *path, SVN::Pool &in_pool);
void add(const char *path);
~Targets();
const apr_array_header_t *array(const SVN::Pool &pool);
Modified: subversion/branches/svn_mutex/subversion/bindings/javahl/native/libsvnjavahl.la.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/bindings/javahl/native/libsvnjavahl.la.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/bindings/javahl/native/libsvnjavahl.la.c (original)
+++ subversion/branches/svn_mutex/subversion/bindings/javahl/native/libsvnjavahl.la.c Tue Oct 11 19:52:34 2011
@@ -30,3 +30,8 @@ JNI_OnLoad(JavaVM *vm, void *reserved)
{
return JNI_VERSION_1_2;
}
+
+JNIEXPORT void JNICALL
+JNI_OnUnload(JavaVM *vm, void *reserved)
+{
+}