You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2012/12/04 16:35:57 UTC
svn commit: r1416996 [2/13] - in /subversion/branches/wc-collate-path: ./
build/ build/ac-macros/ build/generator/ contrib/client-side/svnmerge/
contrib/server-side/svncutter/ notes/ subversion/bindings/cxxhl/
subversion/bindings/javahl/native/ subvers...
Modified: subversion/branches/wc-collate-path/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/bindings/javahl/native/SVNClient.cpp?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/branches/wc-collate-path/subversion/bindings/javahl/native/SVNClient.cpp Tue Dec 4 15:35:13 2012
@@ -131,7 +131,7 @@ void SVNClient::list(const char *url, Re
SVN_JNI_NULL_PTR_EX(url, "path or url", );
Path urlPath(url, subPool);
- SVN_JNI_ERR(urlPath.error_occured(), );
+ SVN_JNI_ERR(urlPath.error_occurred(), );
SVN_JNI_ERR(svn_client_list2(urlPath.c_str(),
pegRevision.revision(),
@@ -162,7 +162,7 @@ SVNClient::status(const char *path, svn_
callback->setWcCtx(ctx->wc_ctx);
Path checkedPath(path, subPool);
- SVN_JNI_ERR(checkedPath.error_occured(), );
+ SVN_JNI_ERR(checkedPath.error_occurred(), );
rev.kind = svn_opt_revision_unspecified;
@@ -176,30 +176,18 @@ SVNClient::status(const char *path, svn_
subPool.getPool()), );
}
-void SVNClient::logMessages(const char *path, Revision &pegRevision,
- std::vector<RevisionRange> &logRanges,
- bool stopOnCopy, bool discoverPaths,
- bool includeMergedRevisions, StringArray &revProps,
- long limit, LogMessageCallback *callback)
+/* Convert a vector of revision ranges to an APR array of same. */
+static apr_array_header_t *
+rev_range_vector_to_apr_array(std::vector<RevisionRange> &revRanges,
+ SVN::Pool &subPool)
{
- 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_occured(), );
-
apr_array_header_t *ranges =
- apr_array_make(subPool.getPool(), static_cast<int>(logRanges.size()),
- sizeof(svn_opt_revision_range_t *));
+ apr_array_make(subPool.getPool(),
+ static_cast<int>(revRanges.size()),
+ sizeof(svn_opt_revision_range_t *));
std::vector<RevisionRange>::const_iterator it;
- for (it = logRanges.begin(); it != logRanges.end(); ++it)
+ for (it = revRanges.begin(); it != revRanges.end(); ++it)
{
if (it->toRange(subPool)->start.kind
== svn_opt_revision_unspecified
@@ -220,8 +208,33 @@ void SVNClient::logMessages(const char *
it->toRange(subPool);
}
if (JNIUtil::isExceptionThrown())
- return;
+ return NULL;
}
+ return ranges;
+}
+
+void SVNClient::logMessages(const char *path, Revision &pegRevision,
+ std::vector<RevisionRange> &logRanges,
+ bool stopOnCopy, bool discoverPaths,
+ bool includeMergedRevisions, StringArray &revProps,
+ long limit, LogMessageCallback *callback)
+{
+ 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(), );
+
+ apr_array_header_t *ranges =
+ rev_range_vector_to_apr_array(logRanges, subPool);
+ if (JNIUtil::isExceptionThrown())
+ return;
SVN_JNI_ERR(svn_client_log5(targets, pegRevision.revision(), ranges,
limit, discoverPaths, stopOnCopy,
@@ -243,8 +256,8 @@ jlong SVNClient::checkout(const char *mo
Path url(moduleName, subPool);
Path path(destPath, subPool);
- SVN_JNI_ERR(url.error_occured(), -1);
- SVN_JNI_ERR(path.error_occured(), -1);
+ SVN_JNI_ERR(url.error_occurred(), -1);
+ SVN_JNI_ERR(path.error_occurred(), -1);
svn_revnum_t rev;
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
@@ -275,7 +288,7 @@ void SVNClient::remove(Targets &targets,
return;
const apr_array_header_t *targets2 = targets.array(subPool);
- SVN_JNI_ERR(targets.error_occured(), );
+ SVN_JNI_ERR(targets.error_occurred(), );
SVN_JNI_ERR(svn_client_delete4(targets2, force, keep_local,
revprops.hash(subPool),
@@ -296,7 +309,7 @@ void SVNClient::revert(const char *path,
Targets target(path, subPool);
const apr_array_header_t *targets = target.array(subPool);
- SVN_JNI_ERR(target.error_occured(), );
+ SVN_JNI_ERR(target.error_occurred(), );
SVN_JNI_ERR(svn_client_revert2(targets, depth,
changelists.array(subPool), ctx,
subPool.getPool()), );
@@ -311,7 +324,7 @@ void SVNClient::add(const char *path,
SVN_JNI_NULL_PTR_EX(path, "path", );
Path intPath(path, subPool);
- SVN_JNI_ERR(intPath.error_occured(), );
+ SVN_JNI_ERR(intPath.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
@@ -334,7 +347,7 @@ jlongArray SVNClient::update(Targets &ta
return NULL;
const apr_array_header_t *array = targets.array(subPool);
- SVN_JNI_ERR(targets.error_occured(), NULL);
+ SVN_JNI_ERR(targets.error_occurred(), NULL);
SVN_JNI_ERR(svn_client_update4(&revs, array,
revision.revision(),
depth,
@@ -370,7 +383,7 @@ void SVNClient::commit(Targets &targets,
{
SVN::Pool subPool(pool);
const apr_array_header_t *targets2 = targets.array(subPool);
- SVN_JNI_ERR(targets.error_occured(), );
+ SVN_JNI_ERR(targets.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(message, subPool);
if (ctx == NULL)
return;
@@ -400,7 +413,7 @@ void SVNClient::copy(CopySources ©So
}
SVN_JNI_NULL_PTR_EX(destPath, "destPath", );
Path destinationPath(destPath, subPool);
- SVN_JNI_ERR(destinationPath.error_occured(), );
+ SVN_JNI_ERR(destinationPath.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(message, subPool);
if (ctx == NULL)
@@ -421,10 +434,10 @@ void SVNClient::move(Targets &srcPaths,
SVN::Pool subPool(pool);
const apr_array_header_t *srcs = srcPaths.array(subPool);
- SVN_JNI_ERR(srcPaths.error_occured(), );
+ SVN_JNI_ERR(srcPaths.error_occurred(), );
SVN_JNI_NULL_PTR_EX(destPath, "destPath", );
Path destinationPath(destPath, subPool);
- SVN_JNI_ERR(destinationPath.error_occured(), );
+ SVN_JNI_ERR(destinationPath.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(message, subPool);
if (ctx == NULL)
@@ -447,7 +460,7 @@ void SVNClient::mkdir(Targets &targets,
return;
const apr_array_header_t *targets2 = targets.array(subPool);
- SVN_JNI_ERR(targets.error_occured(), );
+ SVN_JNI_ERR(targets.error_occurred(), );
SVN_JNI_ERR(svn_client_mkdir4(targets2, makeParents,
revprops.hash(subPool),
@@ -460,7 +473,7 @@ void SVNClient::cleanup(const char *path
SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
Path intPath(path, subPool);
- SVN_JNI_ERR(intPath.error_occured(), );
+ SVN_JNI_ERR(intPath.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
@@ -475,7 +488,7 @@ void SVNClient::resolve(const char *path
SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
Path intPath(path, subPool);
- SVN_JNI_ERR(intPath.error_occured(), );
+ SVN_JNI_ERR(intPath.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
@@ -493,9 +506,9 @@ jlong SVNClient::doExport(const char *sr
SVN_JNI_NULL_PTR_EX(srcPath, "srcPath", -1);
SVN_JNI_NULL_PTR_EX(destPath, "destPath", -1);
Path sourcePath(srcPath, subPool);
- SVN_JNI_ERR(sourcePath.error_occured(), -1);
+ SVN_JNI_ERR(sourcePath.error_occurred(), -1);
Path destinationPath(destPath, subPool);
- SVN_JNI_ERR(destinationPath.error_occured(), -1);
+ SVN_JNI_ERR(destinationPath.error_occurred(), -1);
svn_revnum_t rev;
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
@@ -526,9 +539,9 @@ jlong SVNClient::doSwitch(const char *pa
SVN_JNI_NULL_PTR_EX(path, "path", -1);
SVN_JNI_NULL_PTR_EX(url, "url", -1);
Path intUrl(url, subPool);
- SVN_JNI_ERR(intUrl.error_occured(), -1);
+ SVN_JNI_ERR(intUrl.error_occurred(), -1);
Path intPath(path, subPool);
- SVN_JNI_ERR(intPath.error_occured(), -1);
+ SVN_JNI_ERR(intPath.error_occurred(), -1);
svn_revnum_t rev;
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
@@ -562,16 +575,16 @@ void SVNClient::doImport(const char *pat
SVN_JNI_NULL_PTR_EX(path, "path", );
SVN_JNI_NULL_PTR_EX(url, "url", );
Path intPath(path, subPool);
- SVN_JNI_ERR(intPath.error_occured(), );
+ SVN_JNI_ERR(intPath.error_occurred(), );
Path intUrl(url, subPool);
- SVN_JNI_ERR(intUrl.error_occured(), );
+ SVN_JNI_ERR(intUrl.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(message, subPool);
if (ctx == NULL)
return;
SVN_JNI_ERR(svn_client_import5(intPath.c_str(), intUrl.c_str(), depth,
- noIgnore, ignoreUnknownNodeTypes,
+ noIgnore, FALSE, ignoreUnknownNodeTypes,
revprops.hash(subPool),
ImportFilterCallback::callback, ifCallback,
CommitCallback::callback, commitCallback,
@@ -605,13 +618,13 @@ void SVNClient::merge(const char *path1,
SVN_JNI_NULL_PTR_EX(path2, "path2", );
SVN_JNI_NULL_PTR_EX(localPath, "localPath", );
Path intLocalPath(localPath, subPool);
- SVN_JNI_ERR(intLocalPath.error_occured(), );
+ SVN_JNI_ERR(intLocalPath.error_occurred(), );
Path srcPath1(path1, subPool);
- SVN_JNI_ERR(srcPath1.error_occured(), );
+ SVN_JNI_ERR(srcPath1.error_occurred(), );
Path srcPath2(path2, subPool);
- SVN_JNI_ERR(srcPath2.error_occured(), );
+ SVN_JNI_ERR(srcPath2.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
@@ -634,44 +647,19 @@ void SVNClient::merge(const char *path,
SVN_JNI_NULL_PTR_EX(path, "path", );
SVN_JNI_NULL_PTR_EX(localPath, "localPath", );
Path intLocalPath(localPath, subPool);
- SVN_JNI_ERR(intLocalPath.error_occured(), );
+ SVN_JNI_ERR(intLocalPath.error_occurred(), );
Path srcPath(path, subPool);
- SVN_JNI_ERR(srcPath.error_occured(), );
+ SVN_JNI_ERR(srcPath.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
return;
apr_array_header_t *ranges =
- apr_array_make(subPool.getPool(),
- static_cast<int>(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(subPool)->start.kind
- == svn_opt_revision_unspecified
- && it->toRange(subPool)->end.kind
- == svn_opt_revision_unspecified)
- {
- svn_opt_revision_range_t *range =
- reinterpret_cast<svn_opt_revision_range_t *>
- (apr_pcalloc(subPool.getPool(), sizeof(*range)));
- range->start.kind = svn_opt_revision_number;
- range->start.value.number = 1;
- range->end.kind = svn_opt_revision_head;
- APR_ARRAY_PUSH(ranges, const svn_opt_revision_range_t *) = range;
- }
- else
- {
- APR_ARRAY_PUSH(ranges, const svn_opt_revision_range_t *) =
- it->toRange(subPool);
- }
- if (JNIUtil::isExceptionThrown())
- return;
- }
+ rev_range_vector_to_apr_array(rangesToMerge, subPool);
+ if (JNIUtil::isExceptionThrown())
+ return;
SVN_JNI_ERR(svn_client_merge_peg4(srcPath.c_str(),
ranges,
@@ -690,10 +678,10 @@ void SVNClient::mergeReintegrate(const c
SVN_JNI_NULL_PTR_EX(path, "path", );
SVN_JNI_NULL_PTR_EX(localPath, "localPath", );
Path intLocalPath(localPath, subPool);
- SVN_JNI_ERR(intLocalPath.error_occured(), );
+ SVN_JNI_ERR(intLocalPath.error_occurred(), );
Path srcPath(path, subPool);
- SVN_JNI_ERR(srcPath.error_occured(), );
+ SVN_JNI_ERR(srcPath.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
@@ -718,7 +706,7 @@ SVNClient::getMergeinfo(const char *targ
svn_mergeinfo_t mergeinfo;
Path intLocalTarget(target, subPool);
- SVN_JNI_ERR(intLocalTarget.error_occured(), NULL);
+ SVN_JNI_ERR(intLocalTarget.error_occurred(), NULL);
SVN_JNI_ERR(svn_client_mergeinfo_get_merged(&mergeinfo,
intLocalTarget.c_str(),
pegRevision.revision(), ctx,
@@ -796,11 +784,11 @@ void SVNClient::getMergeinfoLog(int type
SVN_JNI_NULL_PTR_EX(pathOrURL, "path or url", );
Path urlPath(pathOrURL, subPool);
- SVN_JNI_ERR(urlPath.error_occured(), );
+ SVN_JNI_ERR(urlPath.error_occurred(), );
SVN_JNI_NULL_PTR_EX(mergeSourceURL, "merge source url", );
Path srcURL(mergeSourceURL, subPool);
- SVN_JNI_ERR(srcURL.error_occured(), );
+ SVN_JNI_ERR(srcURL.error_occurred(), );
SVN_JNI_ERR(svn_client_mergeinfo_log((type == 1),
urlPath.c_str(),
@@ -829,7 +817,7 @@ jbyteArray SVNClient::propertyGet(const
SVN_JNI_NULL_PTR_EX(path, "path", NULL);
SVN_JNI_NULL_PTR_EX(name, "name", NULL);
Path intPath(path, subPool);
- SVN_JNI_ERR(intPath.error_occured(), NULL);
+ SVN_JNI_ERR(intPath.error_occurred(), NULL);
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
@@ -855,9 +843,7 @@ jbyteArray SVNClient::propertyGet(const
if (propval == NULL)
return NULL;
- return JNIUtil::makeJByteArray
- (reinterpret_cast<const signed char *>(propval->data),
- static_cast<int>(propval->len));
+ return JNIUtil::makeJByteArray(propval);
}
void SVNClient::properties(const char *path, Revision &revision,
@@ -867,7 +853,7 @@ void SVNClient::properties(const char *p
SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
Path intPath(path, subPool);
- SVN_JNI_ERR(intPath.error_occured(), );
+ SVN_JNI_ERR(intPath.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
@@ -929,7 +915,7 @@ void SVNClient::propertySetRemote(const
subPool.getPool());
Path intPath(path, subPool);
- SVN_JNI_ERR(intPath.error_occured(), );
+ SVN_JNI_ERR(intPath.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(message, subPool);
if (ctx == NULL)
@@ -965,7 +951,7 @@ void SVNClient::diff(const char *target1
return;
Path path1(target1, subPool);
- SVN_JNI_ERR(path1.error_occured(), );
+ SVN_JNI_ERR(path1.error_occurred(), );
// We don't use any options to diff.
apr_array_header_t *diffOptions = apr_array_make(subPool.getPool(),
@@ -999,7 +985,7 @@ void SVNClient::diff(const char *target1
{
// "Regular" diff (without a peg revision).
Path path2(target2, subPool);
- SVN_JNI_ERR(path2.error_occured(), );
+ SVN_JNI_ERR(path2.error_occurred(), );
SVN_JNI_ERR(svn_client_diff6(diffOptions,
path1.c_str(),
@@ -1067,9 +1053,9 @@ SVNClient::diffSummarize(const char *tar
return;
Path path1(target1, subPool);
- SVN_JNI_ERR(path1.error_occured(), );
+ SVN_JNI_ERR(path1.error_occurred(), );
Path path2(target2, subPool);
- SVN_JNI_ERR(path2.error_occured(), );
+ SVN_JNI_ERR(path2.error_occurred(), );
SVN_JNI_ERR(svn_client_diff_summarize2(path1.c_str(), revision1.revision(),
path2.c_str(), revision2.revision(),
@@ -1096,7 +1082,7 @@ SVNClient::diffSummarize(const char *tar
return;
Path path(target, subPool);
- SVN_JNI_ERR(path.error_occured(), );
+ SVN_JNI_ERR(path.error_occurred(), );
SVN_JNI_ERR(svn_client_diff_summarize_peg2(path.c_str(),
pegRevision.revision(),
@@ -1117,7 +1103,7 @@ void SVNClient::streamFileContent(const
SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
Path intPath(path, subPool);
- SVN_JNI_ERR(intPath.error_occured(), );
+ SVN_JNI_ERR(intPath.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
@@ -1136,7 +1122,7 @@ jbyteArray SVNClient::revProperty(const
SVN_JNI_NULL_PTR_EX(path, "path", NULL);
SVN_JNI_NULL_PTR_EX(name, "name", NULL);
Path intPath(path, subPool);
- SVN_JNI_ERR(intPath.error_occured(), NULL);
+ SVN_JNI_ERR(intPath.error_occurred(), NULL);
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
@@ -1164,9 +1150,7 @@ jbyteArray SVNClient::revProperty(const
if (propval == NULL)
return NULL;
- return JNIUtil::makeJByteArray
- (reinterpret_cast<const signed char *>(propval->data),
- static_cast<int>(propval->len));
+ return JNIUtil::makeJByteArray(propval);
}
void SVNClient::relocate(const char *from, const char *to, const char *path,
bool ignoreExternals)
@@ -1176,13 +1160,13 @@ void SVNClient::relocate(const char *fro
SVN_JNI_NULL_PTR_EX(from, "from", );
SVN_JNI_NULL_PTR_EX(to, "to", );
Path intPath(path, subPool);
- SVN_JNI_ERR(intPath.error_occured(), );
+ SVN_JNI_ERR(intPath.error_occurred(), );
Path intFrom(from, subPool);
- SVN_JNI_ERR(intFrom.error_occured(), );
+ SVN_JNI_ERR(intFrom.error_occurred(), );
Path intTo(to, subPool);
- SVN_JNI_ERR(intTo.error_occured(), );
+ SVN_JNI_ERR(intTo.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
@@ -1201,7 +1185,7 @@ void SVNClient::blame(const char *path,
SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
Path intPath(path, subPool);
- SVN_JNI_ERR(intPath.error_occured(), );
+ SVN_JNI_ERR(intPath.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
@@ -1223,7 +1207,7 @@ void SVNClient::addToChangelist(Targets
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
const apr_array_header_t *srcs = srcPaths.array(subPool);
- SVN_JNI_ERR(srcPaths.error_occured(), );
+ SVN_JNI_ERR(srcPaths.error_occurred(), );
SVN_JNI_ERR(svn_client_add_to_changelist(srcs, changelist, depth,
changelists.array(subPool),
@@ -1237,7 +1221,7 @@ void SVNClient::removeFromChangelists(Ta
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
const apr_array_header_t *srcs = srcPaths.array(subPool);
- SVN_JNI_ERR(srcPaths.error_occured(), );
+ SVN_JNI_ERR(srcPaths.error_occurred(), );
SVN_JNI_ERR(svn_client_remove_from_changelists(srcs, depth,
changelists.array(subPool),
@@ -1263,7 +1247,7 @@ void SVNClient::lock(Targets &targets, c
{
SVN::Pool subPool(pool);
const apr_array_header_t *targetsApr = targets.array(subPool);
- SVN_JNI_ERR(targets.error_occured(), );
+ SVN_JNI_ERR(targets.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
SVN_JNI_ERR(svn_client_lock(targetsApr, comment, force, ctx,
@@ -1275,11 +1259,10 @@ void SVNClient::unlock(Targets &targets,
SVN::Pool subPool(pool);
const apr_array_header_t *targetsApr = targets.array(subPool);
- SVN_JNI_ERR(targets.error_occured(), );
+ SVN_JNI_ERR(targets.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
SVN_JNI_ERR(svn_client_unlock(
- const_cast<apr_array_header_t*>(targetsApr), force,
- ctx, subPool.getPool()), );
+ targetsApr, force, ctx, subPool.getPool()), );
}
void SVNClient::setRevProperty(const char *path,
const char *name, Revision &rev,
@@ -1290,7 +1273,7 @@ void SVNClient::setRevProperty(const cha
SVN_JNI_NULL_PTR_EX(path, "path", );
SVN_JNI_NULL_PTR_EX(name, "name", );
Path intPath(path, subPool);
- SVN_JNI_ERR(intPath.error_occured(), );
+ SVN_JNI_ERR(intPath.error_occurred(), );
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
@@ -1328,7 +1311,7 @@ jstring SVNClient::getVersionInfo(const
SVN_JNI_NULL_PTR_EX(path, "path", NULL);
Path intPath(path, subPool);
- SVN_JNI_ERR(intPath.error_occured(), NULL);
+ SVN_JNI_ERR(intPath.error_occurred(), NULL);
int wc_format;
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
@@ -1395,7 +1378,7 @@ void SVNClient::upgrade(const char *path
return;
Path checkedPath(path, subPool);
- SVN_JNI_ERR(checkedPath.error_occured(), );
+ SVN_JNI_ERR(checkedPath.error_occurred(), );
SVN_JNI_ERR(svn_client_upgrade(path, ctx, subPool.getPool()), );
}
@@ -1406,7 +1389,7 @@ jobject SVNClient::revProperties(const c
SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", NULL);
Path intPath(path, subPool);
- SVN_JNI_ERR(intPath.error_occured(), NULL);
+ SVN_JNI_ERR(intPath.error_occurred(), NULL);
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
const char *URL;
@@ -1445,7 +1428,7 @@ SVNClient::info2(const char *path, Revis
return;
Path checkedPath(path, subPool);
- SVN_JNI_ERR(checkedPath.error_occured(), );
+ SVN_JNI_ERR(checkedPath.error_occurred(), );
SVN_JNI_ERR(svn_client_info3(checkedPath.c_str(),
pegRevision.revision(),
@@ -1470,9 +1453,9 @@ SVNClient::patch(const char *patchPath,
return;
Path checkedPatchPath(patchPath, subPool);
- SVN_JNI_ERR(checkedPatchPath.error_occured(), );
+ SVN_JNI_ERR(checkedPatchPath.error_occurred(), );
Path checkedTargetPath(targetPath, subPool);
- SVN_JNI_ERR(checkedTargetPath.error_occured(), );
+ SVN_JNI_ERR(checkedTargetPath.error_occurred(), );
// Should parameterize the following, instead of defaulting to FALSE
SVN_JNI_ERR(svn_client_patch(checkedPatchPath.c_str(),
Modified: subversion/branches/wc-collate-path/subversion/bindings/javahl/native/Targets.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/bindings/javahl/native/Targets.cpp?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/bindings/javahl/native/Targets.cpp (original)
+++ subversion/branches/wc-collate-path/subversion/bindings/javahl/native/Targets.cpp Tue Dec 4 15:35:13 2012
@@ -41,7 +41,7 @@ Targets::Targets(const char *path, SVN::
{
m_strArray = NULL;
m_targets.push_back(apr_pstrdup(m_subpool.getPool(), path));
- m_error_occured = NULL;
+ m_error_occurred = NULL;
}
void Targets::add(const char *path)
@@ -62,7 +62,7 @@ const apr_array_header_t *Targets::array
svn_error_t *err = JNIUtil::preprocessPath(tt, pool.getPool());
if (err != NULL)
{
- m_error_occured = err;
+ m_error_occurred = err;
break;
}
m_targets.push_back(tt);
@@ -83,7 +83,7 @@ const apr_array_header_t *Targets::array
svn_error_t *err = JNIUtil::preprocessPath(target, pool.getPool());
if (err != NULL)
{
- m_error_occured = err;
+ m_error_occurred = err;
break;
}
APR_ARRAY_PUSH(apr_targets, const char *) = target;
@@ -96,10 +96,10 @@ Targets::Targets(StringArray &strArray,
: m_subpool(in_pool)
{
m_strArray = &strArray;
- m_error_occured = NULL;
+ m_error_occurred = NULL;
}
-svn_error_t *Targets::error_occured()
+svn_error_t *Targets::error_occurred()
{
- return m_error_occured;
+ return m_error_occurred;
}
Modified: subversion/branches/wc-collate-path/subversion/bindings/javahl/native/Targets.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/bindings/javahl/native/Targets.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/bindings/javahl/native/Targets.h (original)
+++ subversion/branches/wc-collate-path/subversion/bindings/javahl/native/Targets.h Tue Dec 4 15:35:13 2012
@@ -43,14 +43,14 @@ class Targets
SVN::Pool m_subpool;
std::vector<const char*> m_targets;
StringArray *m_strArray;
- svn_error_t *m_error_occured;
+ svn_error_t *m_error_occurred;
public:
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);
- svn_error_t *error_occured();
+ svn_error_t *error_occurred();
};
#endif // TARGETS_H
Modified: subversion/branches/wc-collate-path/subversion/bindings/swig/perl/native/Base.pm
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/bindings/swig/perl/native/Base.pm?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/bindings/swig/perl/native/Base.pm (original)
+++ subversion/branches/wc-collate-path/subversion/bindings/swig/perl/native/Base.pm Tue Dec 4 15:35:13 2012
@@ -40,7 +40,7 @@ with prefix trimmed in the namespace of
The 3rd through the last parameter is a list of symbol endings that
you wish for SVN::Base not to import into your namespace. This is useful
-for cases where you may want to import certaion symbols differently than
+for cases where you may want to import certain symbols differently than
normally.
=head1 CAVEATS
Modified: subversion/branches/wc-collate-path/subversion/bindings/swig/perl/native/Makefile.PL.in
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/bindings/swig/perl/native/Makefile.PL.in?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/bindings/swig/perl/native/Makefile.PL.in (original)
+++ subversion/branches/wc-collate-path/subversion/bindings/swig/perl/native/Makefile.PL.in Tue Dec 4 15:35:13 2012
@@ -53,6 +53,7 @@ my $includes = '@SVN_APR_INCLUDES@ @SVN_
# https://sourceforge.net/tracker/?func=detail&aid=3571361&group_id=1645&atid=101645
# SWIG is using C++ style comments in an extern "C" code.
$cflags =~ s/-ansi\s+//g;
+$cflags =~ s/-std=c89\s+//g;
# According to the log of r7937, the flags guarded by the conditional break
# the build on FreeBSD if not conditionalized.
Modified: subversion/branches/wc-collate-path/subversion/bindings/swig/perl/native/Repos.pm
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/bindings/swig/perl/native/Repos.pm?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/bindings/swig/perl/native/Repos.pm (original)
+++ subversion/branches/wc-collate-path/subversion/bindings/swig/perl/native/Repos.pm Tue Dec 4 15:35:13 2012
@@ -183,11 +183,11 @@ of paths that have changed in this revis
=item $rev
-The revision this change occured in.
+The revision this change occurred in.
=item $date
-The date and time the revision occured.
+The date and time the revision occurred.
=item $msg
Modified: subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/svn/info.rb
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/svn/info.rb?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/svn/info.rb (original)
+++ subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/svn/info.rb Tue Dec 4 15:35:13 2012
@@ -229,7 +229,9 @@ module Svn
def parse_diff_unified(entry)
in_content = false
- entry.body.each do |line|
+ # ruby 1.8 and ruby 1.9 compat
+ each_meth = entry.body.respond_to?(:each_line) ? :each_line : :each
+ entry.body.send(each_meth) do |line|
case line
when /^@@/
in_content = true
Modified: subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/svn/util.rb
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/svn/util.rb?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/svn/util.rb (original)
+++ subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/svn/util.rb Tue Dec 4 15:35:13 2012
@@ -36,7 +36,7 @@ module Svn
module Util #:nodoc:
module_function
def to_ruby_class_name(name)
- name.split("_").collect do |x|
+ name.to_s.split("_").collect do |x|
"#{x[0,1].upcase}#{x[1..-1].downcase}"
end.join("")
end
Modified: subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/my-assertions.rb
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/my-assertions.rb?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/my-assertions.rb (original)
+++ subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/my-assertions.rb Tue Dec 4 15:35:13 2012
@@ -24,20 +24,33 @@ module Test
module Unit
module Assertions
+ # make an intermediary assertion block handler
+ def _my_assert_block(&block)
+ if RUBY_VERSION > '1.9'
+ assert_block do
+ yield
+ end
+ else
+ _wrap_assertion do
+ yield
+ end
+ end
+ end
+
def assert_true(boolean, message=nil)
- _wrap_assertion do
+ _my_assert_block do
assert_equal(true, boolean, message)
end
end
def assert_false(boolean, message=nil)
- _wrap_assertion do
+ _my_assert_block do
assert_equal(false, boolean, message)
end
end
def assert_nested_sorted_array(expected, actual, message=nil)
- _wrap_assertion do
+ _my_assert_block do
assert_equal(expected.collect {|elem| elem.sort},
actual.collect {|elem| elem.sort},
message)
@@ -45,7 +58,7 @@ module Test
end
def assert_equal_log_entries(expected, actual, message=nil)
- _wrap_assertion do
+ _my_assert_block do
actual = actual.collect do |entry|
changed_paths = entry.changed_paths
changed_paths.each_key do |path|
Modified: subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test-unit-ext.rb
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test-unit-ext.rb?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test-unit-ext.rb (original)
+++ subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test-unit-ext.rb Tue Dec 4 15:35:13 2012
@@ -17,7 +17,7 @@
# under the License.
# ====================================================================
-require "test-unit-ext/always-show-result"
+require "test-unit-ext/always-show-result" if RUBY_VERSION < '1.9.3'
require "test-unit-ext/priority"
-require "test-unit-ext/backtrace-filter"
-require "test-unit-ext/long-display-for-emacs"
+require "test-unit-ext/backtrace-filter" if RUBY_VERSION < '1.9.3'
+require "test-unit-ext/long-display-for-emacs" if RUBY_VERSION < '1.9.3'
Modified: subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test-unit-ext/priority.rb
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test-unit-ext/priority.rb?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test-unit-ext/priority.rb (original)
+++ subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test-unit-ext/priority.rb Tue Dec 4 15:35:13 2012
@@ -179,7 +179,7 @@ module Test
apply_priority
!@tests.empty?
end
- end
+ end if RUBY_VERSION < '1.9.3'
class AutoRunner
alias_method :original_options, :options
Modified: subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_client.rb
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_client.rb?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_client.rb (original)
+++ subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_client.rb Tue Dec 4 15:35:13 2012
@@ -2203,7 +2203,10 @@ class SvnClientTest < Test::Unit::TestCa
make_context(log) do |ctx|
items = nil
- ctx.set_log_msg_func do |items|
+ ctx.set_log_msg_func do |l_items|
+ # ruby 1.8 will carry the assignment of items out of the
+ # scope of this block, 1.9 will not, so we must assign.
+ items = l_items
[true, log]
end
Modified: subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_core.rb
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_core.rb?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_core.rb (original)
+++ subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_core.rb Tue Dec 4 15:35:13 2012
@@ -1,3 +1,4 @@
+# encoding = utf-8
# ====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
@@ -52,7 +53,13 @@ class SvnCoreTest < Test::Unit::TestCase
now = Time.now.gmtime
str = now.strftime("%Y-%m-%dT%H:%M:%S.") + "#{now.usec}Z"
- assert_equal(now, Time.from_svn_format(str))
+ if RUBY_VERSION > '1.9'
+ # ruby 1.9 Time comparison gets into the nano-seconds, strftime
+ # shaves these off. So we can compare epoch time instead
+ assert_equal(now.to_i, Time.from_svn_format(str).gmtime.to_i)
+ else
+ assert_equal(now, Time.from_svn_format(str).gmtime)
+ end
apr_time = now.to_i * 1000000 + now.usec
assert_equal(apr_time, now.to_apr_time)
@@ -244,7 +251,11 @@ class SvnCoreTest < Test::Unit::TestCase
config_infos << [section, name, value]
end
assert_equal(infos.sort, config_infos.sort)
- assert_equal(infos.sort, config.collect {|args| args}.sort)
+ if RUBY_VERSION > '1.9'
+ assert_equal(infos.sort, config.collect {|sect,name,val| [sect,name,val]}.sort)
+ else
+ assert_equal(infos.sort, config.collect {|args| args}.sort)
+ end
end
def test_config_find_group
@@ -532,7 +543,13 @@ EOD
date_str = now.strftime("%Y-%m-%dT%H:%M:%S")
date_str << ".#{now.usec}Z"
info.date = date_str
- assert_equal(now, info.date)
+ if RUBY_VERSION > '1.9'
+ # ruby 1.9 Time comparison gets into the nano-seconds, strftime
+ # shaves these off. So we can compare epoch time instead
+ assert_equal(now.to_i, info.date.gmtime.to_i)
+ else
+ assert_equal(now, info.date.gmtime)
+ end
end
def test_svn_prop
Modified: subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_delta.rb
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_delta.rb?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_delta.rb (original)
+++ subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_delta.rb Tue Dec 4 15:35:13 2012
@@ -1,3 +1,4 @@
+# encoding: UTF-8
# ====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
@@ -17,9 +18,10 @@
# under the License.
# ====================================================================
+require "my-assertions"
require "util"
require "stringio"
-require 'md5'
+require 'digest/md5'
require 'tempfile'
require "svn/info"
@@ -46,8 +48,8 @@ class SvnDeltaTest < Test::Unit::TestCas
target = StringIO.new(t)
stream = Svn::Delta::TextDeltaStream.new(source, target)
assert_nil(stream.md5_digest)
- _wrap_assertion do
- stream.each do |window|
+ _my_assert_block do
+ ret = stream.each do |window|
window.ops.each do |op|
op_size = op.offset + op.length
case op.action_code
@@ -62,8 +64,9 @@ class SvnDeltaTest < Test::Unit::TestCas
end
end
end
+ true if RUBY_VERSION > '1.9' # this block returns nil in > ruby '1.9'
end
- assert_equal(MD5.new(t).hexdigest, stream.md5_digest)
+ assert_equal(Digest::MD5.hexdigest(t), stream.md5_digest)
end
def test_txdelta_window_compose
@@ -81,7 +84,7 @@ class SvnDeltaTest < Test::Unit::TestCas
end
end
- _wrap_assertion do
+ _my_assert_block do
composed_window.ops.each do |op|
op_size = op.offset + op.length
case op.action_code
@@ -161,21 +164,33 @@ class SvnDeltaTest < Test::Unit::TestCas
assert_equal(target_text * 3, apply_result.read)
end
+ def get_regex(pattern, encoding='ASCII', options=0)
+ Regexp.new(pattern.encode(encoding),options)
+ end
+
def test_svndiff
source_text = "abcde"
target_text = "abXde"
source = StringIO.new(source_text)
target = StringIO.new(target_text)
stream = Svn::Delta::TextDeltaStream.new(source, target)
-
- output = StringIO.new("")
+
+ if RUBY_VERSION > '1.9'
+ output = StringIO.new("".encode('ASCII-8BIT'))
+ else
+ output = StringIO.new("")
+ end
handler = Svn::Delta.svndiff_handler(output)
Svn::Delta.send(target_text, handler)
output.rewind
result = output.read
- assert_match(/\ASVN.*#{target_text}\z/, result)
-
+ if RUBY_VERSION > '1.9'
+ regex = get_regex("\\ASVN.*#{target_text}\\Z".encode('utf-8'),result.encoding,16)
+ assert_match(regex, result)
+ else
+ assert_match(/\ASVN.*#{target_text}\Z/, result)
+ end
# skip svndiff window
input = StringIO.new(result[4..-1])
window = Svn::Delta.read_svndiff_window(input, 0)
Modified: subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_fs.rb
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_fs.rb?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_fs.rb (original)
+++ subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_fs.rb Tue Dec 4 15:35:13 2012
@@ -20,7 +20,7 @@
require "my-assertions"
require "util"
require "time"
-require "md5"
+require "digest/md5"
require "svn/core"
require "svn/fs"
@@ -49,14 +49,15 @@ class SvnFsTest < Test::Unit::TestCase
assert(!File.exist?(path))
fs = nil
- callback = Proc.new do |fs|
+ callback = Proc.new do |t_fs|
assert(File.exist?(path))
assert_equal(fs_type, Svn::Fs.type(path))
- fs.set_warning_func do |err|
+ t_fs.set_warning_func do |err|
p err
abort
end
- assert_equal(path, fs.path)
+ assert_equal(path, t_fs.path)
+ fs = t_fs
end
yield(:create, [path, config], callback)
@@ -162,7 +163,7 @@ class SvnFsTest < Test::Unit::TestCase
assert_equal(src, @fs.root.file_contents(path_in_repos){|f| f.read})
assert_equal(src.length, @fs.root.file_length(path_in_repos))
- assert_equal(MD5.new(src).hexdigest,
+ assert_equal(Digest::MD5.hexdigest(src),
@fs.root.file_md5_checksum(path_in_repos))
assert_equal([path_in_repos], @fs.root.paths_changed.keys)
@@ -364,7 +365,7 @@ class SvnFsTest < Test::Unit::TestCase
File.open(path, "w") {|f| f.print(modified)}
@fs.transaction do |txn|
- checksum = MD5.new(normalize_line_break(result)).hexdigest
+ checksum = Digest::MD5.hexdigest(normalize_line_break(result))
stream = txn.root.apply_text(path_in_repos, checksum)
stream.write(normalize_line_break(result))
stream.close
@@ -392,8 +393,8 @@ class SvnFsTest < Test::Unit::TestCase
File.open(path, "w") {|f| f.print(modified)}
@fs.transaction do |txn|
- base_checksum = MD5.new(normalize_line_break(src)).hexdigest
- checksum = MD5.new(normalize_line_break(result)).hexdigest
+ base_checksum = Digest::MD5.hexdigest(normalize_line_break(src))
+ checksum = Digest::MD5.hexdigest(normalize_line_break(result))
handler = txn.root.apply_textdelta(path_in_repos,
base_checksum, checksum)
assert_raises(Svn::Error::ChecksumMismatch) do
Modified: subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_repos.rb
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_repos.rb?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_repos.rb (original)
+++ subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_repos.rb Tue Dec 4 15:35:13 2012
@@ -98,11 +98,12 @@ class SvnReposTest < Test::Unit::TestCas
fs_type = Svn::Fs::TYPE_FSFS
fs_config = {Svn::Fs::CONFIG_FS_TYPE => fs_type}
repos = nil
- Svn::Repos.create(tmp_repos_path, {}, fs_config) do |repos|
+ Svn::Repos.create(tmp_repos_path, {}, fs_config) do |t_repos|
assert(File.exist?(tmp_repos_path))
- fs_type_path = File.join(repos.fs.path, Svn::Fs::CONFIG_FS_TYPE)
+ fs_type_path = File.join(t_repos.fs.path, Svn::Fs::CONFIG_FS_TYPE)
assert_equal(fs_type, File.open(fs_type_path) {|f| f.read.chop})
- repos.fs.set_warning_func(&warning_func)
+ t_repos.fs.set_warning_func(&warning_func)
+ repos = t_repos
end
assert(repos.closed?)
Modified: subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_wc.rb
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_wc.rb?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_wc.rb (original)
+++ subversion/branches/wc-collate-path/subversion/bindings/swig/ruby/test/test_wc.rb Tue Dec 4 15:35:13 2012
@@ -534,7 +534,7 @@ EOE
ctx.ci(lf_path)
Svn::Wc::AdmAccess.open(nil, @wc_path, true, 5) do |access|
- _wrap_assertion do
+ _my_assert_block do
File.open(src_path, "wb") {|f| f.print(source)}
args = [method_name, src_path, crlf_path, Svn::Wc::TRANSLATE_FROM_NF]
result = yield(access.send(*args), source)
@@ -1089,7 +1089,11 @@ EOE
assert_not_nil context
assert_kind_of Svn::Wc::Context, context
end
- assert_nil result;
+ if RUBY_VERSION > '1.9'
+ assert_equal(result,true)
+ else
+ assert_nil result
+ end
end
end
Modified: subversion/branches/wc-collate-path/subversion/include/private/svn_client_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/include/private/svn_client_private.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/include/private/svn_client_private.h (original)
+++ subversion/branches/wc-collate-path/subversion/include/private/svn_client_private.h Tue Dec 4 15:35:13 2012
@@ -226,21 +226,6 @@ svn_client__wc_node_get_origin(svn_clien
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/* Set *YCA, *BASE, *RIGHT, *TARGET to the repository locations of the
- * youngest common ancestor of the branches, the base chosen for 3-way
- * merge, the right-hand side of the source diff, and the target WC.
- *
- * Any of the output pointers may be NULL if not wanted.
- */
-svn_error_t *
-svn_client__automatic_merge_get_locations(
- svn_client__pathrev_t **yca,
- svn_client__pathrev_t **base,
- svn_client__pathrev_t **right,
- svn_client__pathrev_t **target,
- const svn_client_automatic_merge_t *merge,
- apr_pool_t *result_pool);
-
#ifdef __cplusplus
}
Modified: subversion/branches/wc-collate-path/subversion/include/private/svn_cmdline_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/include/private/svn_cmdline_private.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/include/private/svn_cmdline_private.h (original)
+++ subversion/branches/wc-collate-path/subversion/include/private/svn_cmdline_private.h Tue Dec 4 15:35:13 2012
@@ -31,6 +31,7 @@
#include "svn_string.h"
#include "svn_error.h"
+#include "svn_io.h"
#ifdef __cplusplus
extern "C" {
@@ -108,6 +109,40 @@ svn_cmdline__apply_config_options(apr_ha
const char *prefix,
const char *argument_name);
+/* Return a string allocated in POOL that is a copy of STR but with each
+ * line prefixed with INDENT. A line is all characters up to the first
+ * CR-LF, LF-CR, CR or LF, or the end of STR if sooner. */
+const char *
+svn_cmdline__indent_string(const char *str,
+ const char *indent,
+ apr_pool_t *pool);
+
+/* Print to stdout a hash PROP_HASH that maps property names (char *) to
+ property values (svn_string_t *). The names are assumed to be in UTF-8
+ format; the values are either in UTF-8 (the special Subversion props) or
+ plain binary values.
+
+ If OUT is not NULL, then write to it rather than stdout.
+
+ If NAMES_ONLY is true, print just names, else print names and
+ values. */
+svn_error_t *
+svn_cmdline__print_prop_hash(svn_stream_t *out,
+ apr_hash_t *prop_hash,
+ svn_boolean_t names_only,
+ apr_pool_t *pool);
+
+/* Similar to svn_cmdline__print_prop_hash(), only output xml to *OUTSTR.
+ If INHERITED_PROPS is true, then PROP_HASH contains inherited properties,
+ otherwise PROP_HASH contains explicit properties. If *OUTSTR is NULL,
+ allocate it first from POOL, otherwise append to it. */
+svn_error_t *
+svn_cmdline__print_xml_prop_hash(svn_stringbuf_t **outstr,
+ apr_hash_t *prop_hash,
+ svn_boolean_t names_only,
+ svn_boolean_t inherited_props,
+ apr_pool_t *pool);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/wc-collate-path/subversion/include/private/svn_named_atomic.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/include/private/svn_named_atomic.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/include/private/svn_named_atomic.h (original)
+++ subversion/branches/wc-collate-path/subversion/include/private/svn_named_atomic.h Tue Dec 4 15:35:13 2012
@@ -54,7 +54,7 @@ typedef struct svn_named_atomic__t svn_n
/** Returns #FALSE when named atomics are not available to our process
* and svn_atomic_namespace__create is likely to fail.
*
- * Please note that the actual check will be performed only once and later
+ * @note The actual check will be performed only once and later
* changes in process privileges will not reflect in the outcome of future
* calls to this function.
*/
@@ -76,7 +76,7 @@ svn_named_atomic__is_efficient(void);
* the same shared memory region but have independent lifetimes.
*
* The access object will be allocated in @a result_pool and atomics gotten
- * from this object will become invalid when the pool is being cleaned.
+ * from this object will become invalid when the pool is being cleared.
*/
svn_error_t *
svn_atomic_namespace__create(svn_atomic_namespace__t **ns,
@@ -104,8 +104,10 @@ svn_atomic_namespace__cleanup(const char
* characters and an error will be returned if the specified name is longer
* than supported.
*
- * Please note that the lifetime of the atomic is bound to the lifetime
+ * @note The lifetime of the atomic object is bound to the lifetime
* of the @a ns object, i.e. the pool the latter was created in.
+ * The data in the namespace persists as long as at least one process
+ * holds an #svn_atomic_namespace__t object corresponding to it.
*/
svn_error_t *
svn_named_atomic__get(svn_named_atomic__t **atomic,
@@ -120,8 +122,8 @@ svn_error_t *
svn_named_atomic__read(apr_int64_t *value,
svn_named_atomic__t *atomic);
-/** Set the data in @a atomic to @a NEW_VALUE and return its old content
- * in @a OLD_VALUE. @a OLD_VALUE may be NULL.
+/** Set the data in @a atomic to @a new_value and return its old content
+ * in @a *old_value. @a old_value may be NULL.
*
* An error will be returned if @a atomic is @c NULL.
*/
@@ -131,7 +133,7 @@ svn_named_atomic__write(apr_int64_t *old
svn_named_atomic__t *atomic);
/** Add @a delta to the data in @a atomic and return its new value in
- * @a NEW_VALUE. @a NEW_VALUE may be NULL.
+ * @a *new_value. @a new_value may be null.
*
* An error will be returned if @a atomic is @c NULL.
*/
@@ -141,8 +143,8 @@ svn_named_atomic__add(apr_int64_t *new_v
svn_named_atomic__t *atomic);
/** If the current data in @a atomic equals @a comperand, set it to
- * @a NEW_VALUE. Return the initial value in @a OLD_VALUE.
- * @a OLD_VALUE may be NULL.
+ * @a new_value. Return the initial value in @a *old_value.
+ * @a old_value may be NULL.
*
* An error will be returned if @a atomic is @c NULL.
*/
Modified: subversion/branches/wc-collate-path/subversion/include/private/svn_string_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/include/private/svn_string_private.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/include/private/svn_string_private.h (original)
+++ subversion/branches/wc-collate-path/subversion/include/private/svn_string_private.h Tue Dec 4 15:35:13 2012
@@ -46,6 +46,83 @@ extern "C" {
* @{
*/
+
+/** A self-contained memory buffer of known size.
+ *
+ * Intended to be used where a single variable-sized buffer is needed
+ * within an iteration, a scratch pool is available and we want to
+ * avoid the cost of creating another pool just for the iteration.
+ */
+typedef struct svn_membuf_t
+{
+ /** The a pool from which this buffer was originally allocated, and is not
+ * necessarily specific to this buffer. This is used only for allocating
+ * more memory from when the buffer needs to grow.
+ */
+ apr_pool_t *pool;
+
+ /** pointer to the memory */
+ void *data;
+
+ /** total size of buffer allocated */
+ apr_size_t size;
+} svn_membuf_t;
+
+
+/* Initialize a memory buffer of the given size */
+void
+svn_membuf__create(svn_membuf_t *membuf, apr_size_t size, apr_pool_t *pool);
+
+/* Ensure that the given memory buffer has at least the given size */
+void
+svn_membuf__ensure(svn_membuf_t *membuf, apr_size_t size);
+
+/* Resize the given memory buffer, preserving its contents. */
+void
+svn_membuf__resize(svn_membuf_t *membuf, apr_size_t size);
+
+/* Zero-fill the given memory */
+void
+svn_membuf__zero(svn_membuf_t *membuf);
+
+/* Zero-fill the given memory buffer up to the smaller of SIZE and the
+ current buffer size. */
+void
+svn_membuf__nzero(svn_membuf_t *membuf, apr_size_t size);
+
+/* Inline implementation of svn_membuf__zero.
+ * Note that PMEMBUF is evaluated only once.
+ */
+#define SVN_MEMBUF__ZERO(pmembuf) \
+ do \
+ { \
+ svn_membuf_t *const _m_b_f_ = (pmembuf); \
+ memset(_m_b_f_->data, 0, _m_b_f_->size); \
+ } \
+ while(0)
+
+/* Inline implementation of svn_membuf__nzero
+ * Note that PMEMBUF and PSIZE are evaluated only once.
+ */
+#define SVN_MEMBUF__NZERO(pmembuf, psize) \
+ do \
+ { \
+ svn_membuf_t *const _m_b_f_ = (pmembuf); \
+ const apr_size_t _s_z_ = (psize); \
+ if (_s_z_ > _m_b_f_->size) \
+ memset(_m_b_f_->data, 0, _m_b_f_->size); \
+ else \
+ memset(_m_b_f_->data, 0, _s_z_); \
+ } \
+ while(0)
+
+#ifndef SVN_DEBUG
+/* In non-debug mode, just use these inlie replacements */
+#define svn_membuf__zero(B) SVN_MEMBUF__ZERO((B))
+#define svn_membuf__nzero(B, S) SVN_MEMBUF__NZERO((B), (S))
+#endif
+
+
/** Returns the #svn_string_t information contained in the data and
* len members of @a strbuf. This is effectively a typecast, converting
* @a strbuf into an #svn_string_t. This first will become invalid and must
@@ -54,13 +131,6 @@ extern "C" {
svn_string_t *
svn_stringbuf__morph_into_string(svn_stringbuf_t *strbuf);
-/** Like svn_stringbuf_ensure, but does not reserve space for the '\0'
- * and does not copy the data.
- */
-void
-svn_stringbuf__reserve(svn_stringbuf_t *str, apr_size_t minimum_size);
-
-
/** Like apr_strtoff but provided here for backward compatibility
* with APR 0.9 */
apr_status_t
@@ -97,6 +167,49 @@ svn__ui64toa_sep(apr_uint64_t number, ch
char *
svn__i64toa_sep(apr_int64_t number, char seperator, apr_pool_t *pool);
+/**
+ * Computes the similarity score of STRA and STRB. Returns the ratio
+ * of the length of their longest common subsequence and the average
+ * length of the strings, normalized to the range [0..1000].
+ * The result is equivalent to Python's
+ *
+ * difflib.SequenceMatcher.ratio
+ *
+ * Optionally sets *RLCS to the length of the longest common
+ * subsequence of STRA and STRB. Using BUFFER for temporary storage,
+ * requires memory proportional to the length of the shorter string.
+ *
+ * The LCS algorithm used is described in, e.g.,
+ *
+ * http://en.wikipedia.org/wiki/Longest_common_subsequence_problem
+ *
+ * Q: Why another LCS when we already have one in libsvn_diff?
+ * A: svn_diff__lcs is too heavyweight and too generic for the
+ * purposes of similarity testing. Whilst it would be possible
+ * to use a character-based tokenizer with it, we really only need
+ * the *length* of the LCS for the similarity score, not all the
+ * other information that svn_diff__lcs produces in order to
+ * make printing diffs possible.
+ *
+ * Q: Is there a limit on the length of the string parameters?
+ * A: Only available memory. But note that the LCS algorithm used
+ * has O(strlen(STRA) * strlen(STRB)) worst-case performance,
+ * so do keep a rein on your enthusiasm.
+ */
+unsigned int
+svn_cstring__similarity(const char *stra, const char *strb,
+ svn_membuf_t *buffer, apr_size_t *rlcs);
+
+/**
+ * Like svn_cstring__similarity, but accepts svn_string_t's instead
+ * of NUL-terminated character strings.
+ */
+unsigned int
+svn_string__similarity(const svn_string_t *stringa,
+ const svn_string_t *stringb,
+ svn_membuf_t *buffer, apr_size_t *rlcs);
+
+
/** @} */
/** @} */
Modified: subversion/branches/wc-collate-path/subversion/include/private/svn_utf_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/include/private/svn_utf_private.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/include/private/svn_utf_private.h (original)
+++ subversion/branches/wc-collate-path/subversion/include/private/svn_utf_private.h Tue Dec 4 15:35:13 2012
@@ -32,6 +32,7 @@
#include "svn_types.h"
#include "svn_string.h"
+#include "svn_string_private.h"
#ifdef __cplusplus
extern "C" {
@@ -96,7 +97,7 @@ svn_utf__cstring_from_utf8_fuzzy(const c
svn_error_t *
svn_utf__normcmp(const char *str1, apr_size_t len1,
const char *str2, apr_size_t len2,
- svn_stringbuf_t *buf1, svn_stringbuf_t *buf2,
+ svn_membuf_t *buf1, svn_membuf_t *buf2,
int *result);
@@ -123,9 +124,9 @@ svn_utf__glob(const char *pattern, apr_s
const char *string, apr_size_t string_len,
const char *escape, apr_size_t escape_len,
svn_boolean_t sql_like,
- svn_stringbuf_t *pattern_buf,
- svn_stringbuf_t *string_buf,
- svn_stringbuf_t *temp_buf,
+ svn_membuf_t *pattern_buf,
+ svn_membuf_t *string_buf,
+ svn_membuf_t *temp_buf,
svn_boolean_t *match);
/* Return the version of the wrapped utf8proc library. */
Modified: subversion/branches/wc-collate-path/subversion/include/private/svn_wc_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/include/private/svn_wc_private.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/include/private/svn_wc_private.h (original)
+++ subversion/branches/wc-collate-path/subversion/include/private/svn_wc_private.h Tue Dec 4 15:35:13 2012
@@ -546,6 +546,10 @@ svn_wc__node_is_status_deleted(svn_boole
* and has no deleted ancestor, @a *deleted_ancestor_abspath will equal
* @a local_abspath. If @a local_abspath was not deleted,
* set @a *deleted_ancestor_abspath to @c NULL.
+ *
+ * A node is considered 'deleted' if it is deleted or moved-away, and is
+ * not replaced.
+ *
* @a *deleted_ancestor_abspath is allocated in @a result_pool.
* Use @a scratch_pool for all temporary allocations.
*/
@@ -669,35 +673,6 @@ svn_wc__node_get_pre_ng_status_data(svn_
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-
-/**
- * Return the location of the base for this node's next commit,
- * reflecting any local tree modifications affecting this node.
- *
- * Get the base location of @a local_abspath using @a wc_ctx. If @a
- * local_abspath is not in the working copy, return @c
- * SVN_ERR_WC_PATH_NOT_FOUND.
- *
- * If this node has no uncommitted changes, return the same location as
- * svn_wc__node_get_base().
- *
- * If this node is moved-here or copied-here (possibly as part of a replace),
- * return the location of the copy/move source. Do the same even when the node
- * has been removed from a recursive copy (subpath excluded from the copy).
- *
- * Else, if this node is locally added, return SVN_INVALID_REVNUM/NULL, or
- * if locally deleted or replaced, return the revert-base location.
- */
-svn_error_t *
-svn_wc__node_get_commit_base(svn_revnum_t *revision,
- const char **repos_relpath,
- const char **repos_root_url,
- const char **repos_uuid,
- svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
/**
* Fetch lock information (if any) for @a local_abspath using @a wc_ctx:
*
@@ -912,9 +887,11 @@ svn_wc__prop_retrieve_recursive(apr_hash
/**
* Set @a *iprops_paths to a hash mapping const char * absolute working
- * copy paths to the same for each path in the working copy at or below
- * @a local_abspath, limited by @a depth, that has cached inherited
- * properties for the base node of the path. Allocate @a *iprop_paths
+ * copy paths to the nodes repository root relative path for each path
+ * in the working copy at or below @a local_abspath, limited by @a depth,
+ * that has cached inherited properties for the base node of the path.
+ *
+ * Allocate @a *iprop_paths
* in @a result_pool. Use @a scratch_pool for temporary allocations.
*/
svn_error_t *
@@ -1227,7 +1204,12 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
/* Internal version of svn_wc_delete4(). It has one additional parameter,
* MOVED_TO_ABSPATH. If not NULL, this parameter indicates that the
- * delete operation is the delete-half of a move. */
+ * delete operation is the delete-half of a move.
+ *
+ * ### Inconsistency: if DELETE_UNVERSIONED_TARGET is FALSE and a target is
+ * unversioned, svn_wc__delete_many() will continue whereas
+ * svn_wc__delete_internal() will throw an error.
+ */
svn_error_t *
svn_wc__delete_internal(svn_wc_context_t *wc_ctx,
const char *local_abspath,
@@ -1243,7 +1225,12 @@ svn_wc__delete_internal(svn_wc_context_t
/* Alternative version of svn_wc_delete4().
* It can delete multiple TARGETS more efficiently (within a single sqlite
- * transaction per working copy), but lacks support for moves. */
+ * transaction per working copy), but lacks support for moves.
+ *
+ * ### Inconsistency: if DELETE_UNVERSIONED_TARGET is FALSE and a target is
+ * unversioned, svn_wc__delete_many() will continue whereas
+ * svn_wc__delete_internal() will throw an error.
+ */
svn_error_t *
svn_wc__delete_many(svn_wc_context_t *wc_ctx,
const apr_array_header_t *targets,
Modified: subversion/branches/wc-collate-path/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/include/svn_client.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/include/svn_client.h (original)
+++ subversion/branches/wc-collate-path/subversion/include/svn_client.h Tue Dec 4 15:35:13 2012
@@ -1011,7 +1011,7 @@ svn_client_create_context2(svn_client_ct
apr_pool_t *pool);
-/** Similar to svn_client_create_context but passes a NULL @a cfg_hash.
+/** Similar to svn_client_create_context2 but passes a NULL @a cfg_hash.
*
* @deprecated Provided for backward compatibility with the 1.7 API.
*/
@@ -1524,17 +1524,42 @@ svn_client_switch(svn_revnum_t *result_r
* behaviour only when recursing into an already versioned directory with @a
* force.)
*
+ * If @a no_autoprops is TRUE, don't set any autoprops on added files. If
+ * @a no_autoprops is FALSE then all added files have autprops set as per
+ * the auto-props list in @a ctx->config and the value of any
+ * @c SVN_PROP_INHERITABLE_AUTO_PROPS properties inherited by the nearest
+ * parents of @a path which are already under version control.
+ *
* If @a add_parents is TRUE, recurse up @a path's directory and look for
* a versioned directory. If found, add all intermediate paths between it
* and @a path. If not found, return #SVN_ERR_CLIENT_NO_VERSIONED_PARENT.
*
+ * @a scratch_pool is used for temporary allocations only.
+ *
* @par Important:
* This is a *scheduling* operation. No changes will
* happen to the repository until a commit occurs. This scheduling
* can be removed with svn_client_revert2().
*
- * @since New in 1.5.
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_client_add5(const char *path,
+ svn_depth_t depth,
+ svn_boolean_t force,
+ svn_boolean_t no_ignore,
+ svn_boolean_t no_autoprops,
+ svn_boolean_t add_parents,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool);
+
+/**
+ * Similar to svn_client_add3(), but with @a no_autoprops always set to
+ * FALSE.
+ *
+ * @deprecated Provided for backward compatibility with the 1.7 API.
*/
+SVN_DEPRECATED
svn_error_t *
svn_client_add4(const char *path,
svn_depth_t depth,
@@ -1852,7 +1877,7 @@ typedef svn_error_t *(*svn_client_import
* actions: #svn_wc_notify_commit_added,
* #svn_wc_notify_commit_postfix_txdelta.
*
- * Use @a pool for any temporary allocation.
+ * Use @a scratch_pool for any temporary allocation.
*
* If non-NULL, @a revprop_table is a hash table holding additional,
* custom revision properties (<tt>const char *</tt> names mapped to
@@ -1879,6 +1904,13 @@ typedef svn_error_t *(*svn_client_import
* if the target is part of a WC the import ignores any existing
* properties.)
*
+ * If @a no_autoprops is TRUE, don't set any autoprops on imported files. If
+ * @a no_autoprops is FALSE then all imported files have autprops set as per
+ * the auto-props list in @a ctx->config and the value of any
+ * @c SVN_PROP_INHERITABLE_AUTO_PROPS properties inherited by and explicitly set
+ * on @a url if @a url is already under versioned control, or the nearest parents
+ * of @a path which are already under version control if not.
+ *
* If @a ignore_unknown_node_types is @c FALSE, ignore files of which the
* node type is unknown, such as device files and pipes.
*
@@ -1897,6 +1929,7 @@ svn_client_import5(const char *path,
const char *url,
svn_depth_t depth,
svn_boolean_t no_ignore,
+ svn_boolean_t no_autoprops,
svn_boolean_t ignore_unknown_node_types,
const apr_hash_t *revprop_table,
svn_client_import_filter_func_t filter_callback,
@@ -1908,7 +1941,7 @@ svn_client_import5(const char *path,
/**
* Similar to svn_client_import5(), but without support for an optional
- * @a filter_callback.
+ * @a filter_callback and @a no_autoprops always set to FALSE.
*
* @since New in 1.7.
* @deprecated Provided for backward compatibility with the 1.7 API.
@@ -2867,8 +2900,8 @@ svn_client_blame(const char *path_or_url
* errstream. @a path_or_url1 and @a path_or_url2 can be either
* working-copy paths or URLs.
*
- * If @a relative_to_dir is not @c NULL, the @a original_path and
- * @a modified_path will have the @a relative_to_dir stripped from the
+ * If @a relative_to_dir is not @c NULL, the original path and
+ * modified path will have the @a relative_to_dir stripped from the
* front of the respective paths. If @a relative_to_dir is @c NULL,
* paths will not be modified. If @a relative_to_dir is not
* @c NULL but @a relative_to_dir is not a parent path of the target,
@@ -3376,19 +3409,42 @@ svn_client_diff_summarize_peg(const char
* @{
*/
-/* Details of an automatic merge. */
+/** Details of an automatic merge.
+ *
+ * The information includes the locations of the youngest common ancestor,
+ * merge base, and such like. The details are private to the implementation
+ * but some of the information can be retrieved through the public APIs
+ * svn_client_automatic_merge_is_reintegrate_like() and
+ * svn_client_automatic_merge_get_locations().
+ *
+ * @since New in 1.8.
+ */
typedef struct svn_client_automatic_merge_t svn_client_automatic_merge_t;
-/* Find the information needed to merge all unmerged changes from a source
- * branch into a target branch. The information is the locations of the
- * youngest common ancestor, merge base, and such like.
+/** Find the information needed to merge all unmerged changes from a source
+ * branch into a target branch.
*
- * Set *MERGE to the information needed to merge all unmerged changes
- * (up to SOURCE_REVISION) from the source branch SOURCE_PATH_OR_URL @
- * SOURCE_REVISION into the target WC at TARGET_WCPATH.
+ * Set @a *merge_p to the information needed to merge all unmerged changes
+ * (up to @a source_revision) from the source branch @a source_path_or_url
+ * at @a source_revision into the target WC at @a target_wcpath.
+ *
+ * The flags @a allow_mixed_rev, @a allow_local_mods and
+ * @a allow_switched_subtrees enable merging into a WC that is in any or all
+ * of the states described by their names, but only if this function decides
+ * that the merge will be in the same direction as the last automatic merge.
+ * If, on the other hand, the merge turns out to be in the opposite
+ * direction (that is, if svn_client_automatic_merge_is_reintegrate_like()
+ * would return true), then such states of the WC are not allowed regardless
+ * of these flags. This function merely records these flags in the
+ * @a *merge_p structure; svn_client_do_automatic_merge() checks the WC
+ * state for compliance.
+ *
+ * Allocate the @a *merge_p structure in @a result_pool.
+ *
+ * @since New in 1.8.
*/
svn_error_t *
-svn_client_find_automatic_merge(svn_client_automatic_merge_t **merge,
+svn_client_find_automatic_merge(svn_client_automatic_merge_t **merge_p,
const char *source_path_or_url,
const svn_opt_revision_t *source_revision,
const char *target_wcpath,
@@ -3399,18 +3455,22 @@ svn_client_find_automatic_merge(svn_clie
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/* Find out what kind of automatic merge would be needed, when the target
+/** Find out what kind of automatic merge would be needed, when the target
* is only known as a repository location rather than a WC.
*
- * Like svn_client_find_automatic_merge() except that SOURCE_PATH_OR_URL @
- * SOURCE_REVISION should refer to a repository location and not a WC.
+ * Like svn_client_find_automatic_merge() except that @a source_path_or_url
+ * at @a source_revision should refer to a repository location and not a WC.
+ *
+ * @note The result, @a *merge_p, is not intended for passing to
+ * svn_client_do_automatic_merge().
+ * ### We should do something about this. Perhaps ensure
+ * svn_client_do_automatic_merge() will work iff given a WC that
+ * matches the stored repo-location of the target branch and is an
+ * unmodified single-rev WC.
*
- * ### The result, *MERGE_P, may not be suitable for passing to
- * svn_client_do_automatic_merge(). The target WC state would not be
- * checked (as in the ALLOW_* flags). We should resolve this problem:
- * perhaps add the allow_* params here, or provide another way of setting
- * them; and perhaps ensure __do_...() will accept the result iff given a
- * WC that matches the stored target location.
+ * Allocate the @a *merge_p structure in @a result_pool.
+ *
+ * @since New in 1.8.
*/
svn_error_t *
svn_client_find_automatic_merge_no_wc(
@@ -3423,19 +3483,15 @@ svn_client_find_automatic_merge_no_wc(
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/* Perform an automatic merge.
+/** Perform an automatic merge.
*
- * Merge according to MERGE into the WC at TARGET_WCPATH.
+ * Perform a merge, according to the information stored in @a merge, into
+ * the WC at @a target_wcpath. The @a merge structure would typically come
+ * from calling svn_client_find_automatic_merge().
*
* The other parameters are as in svn_client_merge4().
*
- * ### TODO: There's little point in this function being the only way the
- * caller can use the result of svn_client_find_automatic_merge(). The
- * contents of MERGE should be more public, or there should be other ways
- * the caller can use it, or these two functions should be combined into
- * one. I want to make it more public, and also possibly have more ways
- * to use it in future (for example, do_automatic_merge_with_step_by_-
- * step_confirmation).
+ * @since New in 1.8.
*/
svn_error_t *
svn_client_do_automatic_merge(const svn_client_automatic_merge_t *merge,
@@ -3448,17 +3504,49 @@ svn_client_do_automatic_merge(const svn_
svn_client_ctx_t *ctx,
apr_pool_t *scratch_pool);
-/* Return TRUE iff the automatic merge represented by MERGE is going to be
- * a reintegrate-like merge: that is, merging in the opposite direction
- * from the last full merge.
+/** Return TRUE iff the automatic merge represented by @a merge is going to
+ * be a reintegrate-like merge: that is, merging in the opposite direction
+ * from the last automatic merge.
*
- * This function exists because the merge is NOT really automatic and the
+ * This function exists because the automatic merge is not symmetric and the
* client can be more friendly if it knows something about the differences.
+ *
+ * @since New in 1.8.
*/
svn_boolean_t
svn_client_automatic_merge_is_reintegrate_like(
const svn_client_automatic_merge_t *merge);
+/** Retrieve the repository coordinates involved in an automatic merge.
+ *
+ * Set @a *yca_url, @a *yca_rev, @a *base_url, @a *base_rev, @a *right_url,
+ * @a *right_rev, @a *target_url, @a *target_rev to the repository locations
+ * of, respectively: the youngest common ancestor of the branches, the base
+ * chosen for 3-way merge, the right-hand side of the source diff, and the
+ * target WC.
+ *
+ * Set @a repos_root_url to the URL of the repository root. The four
+ * locations are necessarily in the same repository.
+ *
+ * Allocate the results in @a result_pool. Any of the output pointers may
+ * be NULL if not wanted.
+ *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_client_automatic_merge_get_locations(
+ const char **yca_url,
+ svn_revnum_t *yca_rev,
+ const char **base_url,
+ svn_revnum_t *base_rev,
+ const char **right_url,
+ svn_revnum_t *right_rev,
+ const char **target_url,
+ svn_revnum_t *target_rev,
+ const char **repos_root_url,
+ const svn_client_automatic_merge_t *merge,
+ apr_pool_t *result_pool);
+
/** Merge changes from @a source1/@a revision1 to @a source2/@a revision2 into
* the working-copy path @a target_wcpath.
@@ -5280,7 +5368,7 @@ svn_client_export(svn_revnum_t *result_r
* @{
*/
-/** The type of function invoked by svn_client_list2() to report the details
+/** The type of function invoked by svn_client_list3() to report the details
* of each directory entry being listed.
*
* @a baton is the baton that was passed to the caller. @a path is the
@@ -5290,11 +5378,45 @@ svn_client_export(svn_revnum_t *result_r
* the entry's lock, if it is locked and if lock information is being
* reported by the caller; otherwise @a lock is NULL. @a abs_path is the
* repository path of the top node of the list operation; it is relative to
- * the repository root and begins with "/". @a pool may be used for
- * temporary allocations.
+ * the repository root and begins with "/".
*
- * @since New in 1.4.
+ * If svn_client_list3() was called with @a include_externals set to TRUE,
+ * @a external_parent_url and @a external_target will be set.
+ * @a external_parent_url is url of the directory which has the
+ * externals definitions. @a external_target is the target subdirectory of
+ * externals definitions which is relative to the parent directory that holds
+ * the external item.
+ *
+ * If external_parent_url and external_target are defined, the item being
+ * listed is part of the external described by external_parent_url and
+ * external_target. Else, the item is not part of any external.
+ * Moreover, we will never mix items which are part of separate
+ * externals, and will always finish listing an external before listing
+ * the next one.
+
+ * @a scratch_pool may be used for temporary allocations.
+ *
+ * @since New in 1.8.
*/
+typedef svn_error_t *(*svn_client_list_func2_t)(
+ void *baton,
+ const char *path,
+ const svn_dirent_t *dirent,
+ const svn_lock_t *lock,
+ const char *abs_path,
+ const char *external_parent_url,
+ const char *external_target,
+ apr_pool_t *scratch_pool);
+
+/**
+ * Similar to #svn_client_list_func2_t, but without any information about
+ * externals definitions.
+ *
+ * @deprecated Provided for backward compatibility with the 1.7 API.
+ *
+ * @since New in 1.4
+ *
+ * */
typedef svn_error_t *(*svn_client_list_func_t)(void *baton,
const char *path,
const svn_dirent_t *dirent,
@@ -5318,6 +5440,10 @@ typedef svn_error_t *(*svn_client_list_f
*
* If @a fetch_locks is TRUE, include locks when reporting directory entries.
*
+ * If @a include_externals is TRUE, also list all external items
+ * reached by recursion. @a depth value passed to the original list target
+ * applies for the externals also.
+ *
* Use @a pool for temporary allocations.
*
* Use authentication baton cached in @a ctx to authenticate against the
@@ -5334,8 +5460,30 @@ typedef svn_error_t *(*svn_client_list_f
* otherwise simply bitwise OR together the combination of @c SVN_DIRENT_
* fields you care about.
*
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_client_list3(const char *path_or_url,
+ const svn_opt_revision_t *peg_revision,
+ const svn_opt_revision_t *revision,
+ svn_depth_t depth,
+ apr_uint32_t dirent_fields,
+ svn_boolean_t fetch_locks,
+ svn_boolean_t include_externals,
+ svn_client_list_func2_t list_func,
+ void *baton,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool);
+
+
+/** Similar to svn_client_list3(), but with @a include_externals set to FALSE,
+ * and using a #svn_client_list_func2_t as callback.
+ *
+ * @deprecated Provided for backwards compatibility with the 1.7 API.
+ *
* @since New in 1.5.
*/
+SVN_DEPRECATED
svn_error_t *
svn_client_list2(const char *path_or_url,
const svn_opt_revision_t *peg_revision,
Modified: subversion/branches/wc-collate-path/subversion/include/svn_delta.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/include/svn_delta.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/include/svn_delta.h (original)
+++ subversion/branches/wc-collate-path/subversion/include/svn_delta.h Tue Dec 4 15:35:13 2012
@@ -1290,7 +1290,8 @@ svn_delta_depth_filter_editor(const svn_
/** Callback function type for svn_delta_path_driver().
*
* The handler of this callback is given the callback baton @a
- * callback_baton, @a path, and the @a parent_baton which represents
+ * callback_baton, @a path which is a relpath relative to the
+ * root of the edit, and the @a parent_baton which represents
* path's parent directory as created by the editor passed to
* svn_delta_path_driver().
*
@@ -1321,7 +1322,8 @@ typedef svn_error_t *(*svn_delta_path_dr
* @a callback_func and @a callback_baton to allow the caller to handle
* the portion of the editor drive related to that path.
*
- * Each path in @a paths is a const char *. The editor drive will be
+ * Each path in @a paths is a (const char *) relpath, relative
+ * to the root path of the @a edit. The editor drive will be
* performed in the same order as @a paths. The paths should be sorted
* using something like svn_sort_compare_paths to ensure that a depth-first
* pattern is observed for directory/file baton creation. If @a sort_paths
Modified: subversion/branches/wc-collate-path/subversion/include/svn_diff.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/include/svn_diff.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/include/svn_diff.h (original)
+++ subversion/branches/wc-collate-path/subversion/include/svn_diff.h Tue Dec 4 15:35:13 2012
@@ -279,6 +279,9 @@ svn_diff_contains_diffs(svn_diff_t *diff
* Differences, similarities, and conflicts are described by lining up
* "ranges" of data.
*
+ * Any of the function pointers in this vtable may be NULL to ignore the
+ * corresponding kinds of output.
+ *
* @note These callbacks describe data ranges in units of "tokens".
* A "token" is whatever you've defined it to be in your datasource
* @c svn_diff_fns_t vtable.
@@ -745,17 +748,21 @@ svn_diff_mem_string_diff4(svn_diff_t **d
/** Outputs the @a diff object generated by svn_diff_mem_string_diff()
* in unified diff format on @a output_stream, using @a original
* and @a modified for the text in the output.
- * A diff header is only written to the output if @a with_diff_header
- * is TRUE.
+ *
+ * If @a with_diff_header is TRUE, write a diff header ("---" and "+++"
+ * lines), using @a original_header and @a modified_header to fill the field
+ * after the "---" and "+++" markers; otherwise @a original_header and
+ * @a modified_header are ignored and may be NULL.
*
* Outputs the header and hunk delimiters in @a header_encoding.
* A @a hunk_delimiter can optionally be specified.
* If @a hunk_delimiter is NULL, use the default hunk delimiter "@@".
*
- * @a original_header and @a modified header are
- * used to fill the field after the "---" and "+++" header markers.
+ * As a special case, if the hunk delimiter is "##", then for an incomplete
+ * final line use the text "\ No newline at end of property" instead of
+ * "\ No newline at end of file".
*
- * @since New in 1.7.
+ * @since New in 1.7. Hunk delimiter "##" has the special meaning since 1.8.
*/
svn_error_t *
svn_diff_mem_string_output_unified2(svn_stream_t *output_stream,
@@ -840,7 +847,6 @@ svn_diff_mem_string_output_merge(svn_str
apr_pool_t *pool);
-
/* Diff parsing. If you want to apply a patch to a working copy
* rather than parse it, see svn_client_patch(). */
Modified: subversion/branches/wc-collate-path/subversion/include/svn_dirent_uri.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/include/svn_dirent_uri.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/include/svn_dirent_uri.h (original)
+++ subversion/branches/wc-collate-path/subversion/include/svn_dirent_uri.h Tue Dec 4 15:35:13 2012
@@ -32,7 +32,7 @@
* But not:
* "http://server"
*
- * - a uri, for our purposes, is a percent-encoded, absolute path
+ * - a uri, for our purposes, is a percent-encoded, absolute path
* (URI) that starts with a schema definition. In practice, these
* tend to look like URLs, but never carry query strings.
* Examples:
Modified: subversion/branches/wc-collate-path/subversion/include/svn_editor.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/include/svn_editor.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/include/svn_editor.h (original)
+++ subversion/branches/wc-collate-path/subversion/include/svn_editor.h Tue Dec 4 15:35:13 2012
@@ -79,8 +79,8 @@ extern "C" {
* coupling between those subsystems.
*
* The set of changes, and the data necessary to describe it entirely, is
- * completely unbounded. An addition of one simple 20Gb file would be well
- * past the available memory of any machine processing these operations.
+ * completely unbounded. An addition of one simple 20 GB file might be well
+ * past the available memory of a machine processing these operations.
* As a result, the API to describe the changes is designed to be applied
* in a sequential (and relatively random-access) model. The operations
* can be streamed from the driver to the receiver, resulting in the
@@ -927,8 +927,8 @@ svn_editor_alter_directory(svn_editor_t
* The properties and/or the contents must be changed. It is an error to
* pass NULL for @a props, @a checksum, and @a contents.
*
- * For a description of @a checksum, and @a contents see
- * svn_editor_add_file(). This functions allows @a props to be NULL, but
+ * For a description of @a checksum and @a contents see
+ * svn_editor_add_file(). This function allows @a props to be NULL, but
* the parameter is otherwise described by svn_editor_add_file().
*
* For all restrictions on driving the editor, see #svn_editor_t.
@@ -955,7 +955,7 @@ svn_editor_alter_file(svn_editor_t *edit
* The properties and/or the target must be changed. It is an error to
* pass NULL for @a props and @a target.
*
- * This functions allows @a props to be NULL, but the parameter is
+ * This function allows @a props to be NULL, but the parameter is
* otherwise described by svn_editor_add_file().
*
* For all restrictions on driving the editor, see #svn_editor_t.
@@ -1032,7 +1032,7 @@ svn_editor_move(svn_editor_t *editor,
* For example, the node at index 0 of @a relpaths and @a revisions will
* be moved to the relpath specified at index 1 of @a relpaths. The node
* at index 1 will be moved to the location at index 2. The node at index
- * N-1 will be moved to the relpath specifed at index 0.
+ * N-1 will be moved to the relpath specified at index 0.
*
* The simplest form of this operation is to swap nodes A and B. One may
* think to move A to a temporary location T, then move B to A, then move