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 2013/06/20 02:19:30 UTC
svn commit: r1494817 [2/4] - in /subversion/branches/javahl-1.7-extensions:
./ subversion/bindings/javahl/ subversion/bindings/javahl/native/
subversion/bindings/javahl/src/org/apache/subversion/javahl/
subversion/bindings/javahl/src/org/apache/subvers...
Modified: subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/Prompter.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/Prompter.cpp?rev=1494817&r1=1494816&r2=1494817&view=diff
==============================================================================
--- subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/Prompter.cpp (original)
+++ subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/Prompter.cpp Thu Jun 20 00:19:28 2013
@@ -40,9 +40,9 @@
* @param jprompter a global reference to the Java callback object
*/
Prompter::Prompter(jobject jprompter)
-{
- m_prompter = jprompter;
-}
+ : m_prompter(jprompter),
+ m_maySave(false)
+{}
Prompter::~Prompter()
{
@@ -427,9 +427,9 @@ svn_error_t *Prompter::simple_prompt(svn
svn_boolean_t may_save,
apr_pool_t *pool)
{
- Prompter *that = (Prompter*)baton;
+ Prompter *that = static_cast<Prompter *>(baton);
svn_auth_cred_simple_t *ret =
- (svn_auth_cred_simple_t*)apr_pcalloc(pool, sizeof(*ret));
+ reinterpret_cast<svn_auth_cred_simple_t*>(apr_pcalloc(pool, sizeof(*ret)));
if (!that->prompt(realm, username, may_save ? true : false))
return svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
_("User canceled dialog"));
@@ -460,9 +460,9 @@ svn_error_t *Prompter::username_prompt(s
svn_boolean_t may_save,
apr_pool_t *pool)
{
- Prompter *that = (Prompter*)baton;
+ Prompter *that = static_cast<Prompter *>(baton);
svn_auth_cred_username_t *ret =
- (svn_auth_cred_username_t*)apr_pcalloc(pool, sizeof(*ret));
+ reinterpret_cast<svn_auth_cred_username_t*>(apr_pcalloc(pool, sizeof(*ret)));
const char *user = that->askQuestion(realm, _("Username: "), true,
may_save ? true : false);
if (user == NULL)
@@ -484,9 +484,9 @@ Prompter::ssl_server_trust_prompt(svn_au
svn_boolean_t may_save,
apr_pool_t *pool)
{
- Prompter *that = (Prompter*)baton;
+ Prompter *that = static_cast<Prompter *>(baton);
svn_auth_cred_ssl_server_trust_t *ret =
- (svn_auth_cred_ssl_server_trust_t*)apr_pcalloc(pool, sizeof(*ret));
+ reinterpret_cast<svn_auth_cred_ssl_server_trust_t*>(apr_pcalloc(pool, sizeof(*ret)));
std::string question = _("Error validating server certificate for ");
question += realm;
@@ -550,9 +550,9 @@ Prompter::ssl_client_cert_prompt(svn_aut
svn_boolean_t may_save,
apr_pool_t *pool)
{
- Prompter *that = (Prompter*)baton;
+ Prompter *that = static_cast<Prompter *>(baton);
svn_auth_cred_ssl_client_cert_t *ret =
- (svn_auth_cred_ssl_client_cert_t*)apr_pcalloc(pool, sizeof(*ret));
+ reinterpret_cast<svn_auth_cred_ssl_client_cert_t*>(apr_pcalloc(pool, sizeof(*ret)));
const char *cert_file =
that->askQuestion(realm, _("client certificate filename: "), true,
may_save ? true : false);
@@ -572,9 +572,9 @@ Prompter::ssl_client_cert_pw_prompt(svn_
svn_boolean_t may_save,
apr_pool_t *pool)
{
- Prompter *that = (Prompter*)baton;
+ Prompter *that = static_cast<Prompter *>(baton);
svn_auth_cred_ssl_client_cert_pw_t *ret =
- (svn_auth_cred_ssl_client_cert_pw_t*)apr_pcalloc(pool, sizeof(*ret));
+ reinterpret_cast<svn_auth_cred_ssl_client_cert_pw_t*>(apr_pcalloc(pool, sizeof(*ret)));
const char *info = that->askQuestion(realm,
_("client certificate passphrase: "),
false, may_save ? true : false);
@@ -593,7 +593,7 @@ Prompter::plaintext_prompt(svn_boolean_t
void *baton,
apr_pool_t *pool)
{
- Prompter *that = (Prompter *) baton;
+ Prompter *that = static_cast<Prompter *>(baton);
bool result = that->askYesNo(realmstring,
_("Store password unencrypted?"),
@@ -610,7 +610,7 @@ Prompter::plaintext_passphrase_prompt(sv
void *baton,
apr_pool_t *pool)
{
- Prompter *that = (Prompter *) baton;
+ Prompter *that = static_cast<Prompter *>(baton);
bool result = that->askYesNo(realmstring,
_("Store passphrase unencrypted?"),
Modified: subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/ProplistCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/ProplistCallback.cpp?rev=1494817&r1=1494816&r2=1494817&view=diff
==============================================================================
--- subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/ProplistCallback.cpp (original)
+++ subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/ProplistCallback.cpp Thu Jun 20 00:19:28 2013
@@ -33,10 +33,10 @@
* Create a ProplistCallback object
* @param jcallback the Java callback object.
*/
-ProplistCallback::ProplistCallback(jobject jcallback)
-{
- m_callback = jcallback;
-}
+ProplistCallback::ProplistCallback(jobject jcallback, bool inherited)
+ : m_callback(jcallback),
+ m_inherited(inherited)
+{}
/**
* Destroy a ProplistCallback object
@@ -54,7 +54,10 @@ ProplistCallback::callback(void *baton,
apr_pool_t *pool)
{
if (baton)
- return ((ProplistCallback *)baton)->singlePath(path, prop_hash, pool);
+ {
+ ProplistCallback *cb = static_cast<ProplistCallback *>(baton);
+ return cb->singlePath(path, prop_hash, pool);
+ }
return SVN_NO_ERROR;
}
@@ -78,7 +81,7 @@ svn_error_t *ProplistCallback::singlePat
// The method id will not change during the time this library is
// loaded, so it can be cached.
- static jmethodID mid = 0;
+ static volatile jmethodID mid = 0;
if (mid == 0)
{
jclass clazz = env->FindClass(JAVA_PACKAGE"/callback/ProplistCallback");
@@ -108,3 +111,58 @@ svn_error_t *ProplistCallback::singlePat
return SVN_NO_ERROR;
}
+
+
+
+/**
+ * Callback called for a single path
+ * @param path the path name
+ * @param prop_hash the hash of properties on this path
+ * @param inherited_props list of inherited props
+ * @param pool memory pool for the use of this function
+ */
+svn_error_t *ProplistCallback::singlePath(
+ const char *path,
+ apr_hash_t *prop_hash,
+ apr_array_header_t *inherited_props,
+ apr_pool_t *pool)
+{
+ JNIEnv *env = JNIUtil::getEnv();
+
+ // Create a local frame for our references
+ env->PushLocalFrame(LOCAL_FRAME_SIZE);
+ if (JNIUtil::isJavaExceptionThrown())
+ return NULL;
+
+ // The method id will not change during the time this library is
+ // loaded, so it can be cached.
+ static jmethodID mid = 0;
+ if (mid == 0)
+ {
+ jclass clazz = env->FindClass(JAVA_PACKAGE"/callback/InheritedProplistCallback");
+ if (JNIUtil::isJavaExceptionThrown())
+ return SVN_NO_ERROR;
+
+ mid = env->GetMethodID(clazz, "singlePath",
+ "(Ljava/lang/String;Ljava/util/Map;Ljava/util/Collection;)V");
+ if (JNIUtil::isJavaExceptionThrown() || mid == 0)
+ POP_AND_RETURN(SVN_NO_ERROR);
+ }
+
+ // convert the parameters to their Java relatives
+ jstring jpath = JNIUtil::makeJString(path);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN(SVN_NO_ERROR);
+
+ jobject jmap = CreateJ::PropertyMap(prop_hash);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN(SVN_NO_ERROR);
+
+ // call the Java method
+ env->CallVoidMethod(m_callback, mid, jpath, jmap, NULL);
+ // We return whether an exception was thrown or not.
+
+ env->PopLocalFrame(NULL);
+
+ return SVN_NO_ERROR;
+}
Modified: subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/ProplistCallback.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/ProplistCallback.h?rev=1494817&r1=1494816&r2=1494817&view=diff
==============================================================================
--- subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/ProplistCallback.h (original)
+++ subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/ProplistCallback.h Thu Jun 20 00:19:28 2013
@@ -37,7 +37,7 @@
class ProplistCallback
{
public:
- ProplistCallback(jobject jcallback);
+ ProplistCallback(jobject jcallback, bool inherited);
~ProplistCallback();
static svn_error_t *callback(void *baton,
@@ -45,16 +45,24 @@ class ProplistCallback
apr_hash_t *prop_hash,
apr_pool_t *pool);
+ bool inherited() const { return m_inherited; }
+
protected:
svn_error_t *singlePath(const char *path,
apr_hash_t *prop_hash,
apr_pool_t *pool);
+ svn_error_t *singlePath(const char *path,
+ apr_hash_t *prop_hash,
+ apr_array_header_t *inherited_props,
+ apr_pool_t *pool);
private:
/**
* This a local reference to the Java object.
*/
jobject m_callback;
+ bool m_inherited;
};
+
#endif // PROPLISTCALLBACK_H
Modified: subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/ReposNotifyCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/ReposNotifyCallback.cpp?rev=1494817&r1=1494816&r2=1494817&view=diff
==============================================================================
--- subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/ReposNotifyCallback.cpp (original)
+++ subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/ReposNotifyCallback.cpp Thu Jun 20 00:19:28 2013
@@ -49,7 +49,7 @@ ReposNotifyCallback::notify(void *baton,
apr_pool_t *pool)
{
if (baton)
- ((ReposNotifyCallback *)baton)->onNotify(notify, pool);
+ static_cast<ReposNotifyCallback *>(baton)->onNotify(notify, pool);
}
/**
Modified: subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/Revision.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/Revision.cpp?rev=1494817&r1=1494816&r2=1494817&view=diff
==============================================================================
--- subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/Revision.cpp (original)
+++ subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/Revision.cpp Thu Jun 20 00:19:28 2013
@@ -31,7 +31,7 @@
const svn_opt_revision_kind Revision::START = svn_opt_revision_unspecified;
const svn_opt_revision_kind Revision::HEAD = svn_opt_revision_head;
-Revision::Revision (const svn_opt_revision_kind kind)
+Revision::Revision(const svn_opt_revision_kind kind)
{
m_revision.kind = kind;
m_revision.value.number = 0;
@@ -149,7 +149,7 @@ Revision::~Revision()
{
}
-const svn_opt_revision_t *Revision::revision () const
+const svn_opt_revision_t *Revision::revision() const
{
return &m_revision;
}
Modified: subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/RevisionRange.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/RevisionRange.cpp?rev=1494817&r1=1494816&r2=1494817&view=diff
==============================================================================
--- subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/RevisionRange.cpp (original)
+++ subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/RevisionRange.cpp Thu Jun 20 00:19:28 2013
@@ -20,7 +20,7 @@
* ====================================================================
* @endcopyright
*
- * @file RevisionRanges.cpp
+ * @file RevisionRange.cpp
* @brief Implementation of the class RevisionRange.
*/
@@ -87,7 +87,8 @@ const svn_opt_revision_range_t *Revision
return NULL;
svn_opt_revision_range_t *range =
- (svn_opt_revision_range_t *) apr_palloc(pool.getPool(), sizeof(*range));
+ reinterpret_cast<svn_opt_revision_range_t *>
+ (apr_palloc(pool.getPool(), sizeof(*range)));
range->start = *startRevision.revision();
if (JNIUtil::isExceptionThrown())
Modified: subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/RevpropTable.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/RevpropTable.cpp?rev=1494817&r1=1494816&r2=1494817&view=diff
==============================================================================
--- subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/RevpropTable.cpp (original)
+++ subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/RevpropTable.cpp Thu Jun 20 00:19:28 2013
@@ -41,9 +41,9 @@ RevpropTable::~RevpropTable()
JNIUtil::getEnv()->DeleteLocalRef(m_revpropTable);
}
-const apr_hash_t *RevpropTable::hash(const SVN::Pool &pool)
+apr_hash_t *RevpropTable::hash(const SVN::Pool &pool, bool nullIfEmpty)
{
- if (m_revprops.size() == 0)
+ if (m_revprops.size() == 0 && nullIfEmpty)
return NULL;
apr_hash_t *revprop_table = apr_hash_make(pool.getPool());
@@ -77,7 +77,7 @@ RevpropTable::RevpropTable(jobject jrevp
if (jrevpropTable != NULL)
{
- static jmethodID keySet = 0, toArray = 0, get = 0;
+ static jmethodID keySet = 0, get = 0;
JNIEnv *env = JNIUtil::getEnv();
jclass mapClazz = env->FindClass("java/util/Map");
@@ -120,8 +120,8 @@ RevpropTable::RevpropTable(jobject jrevp
if (JNIUtil::isExceptionThrown())
return;
- m_revprops[std::string((const char *)propname)]
- = std::string((const char *)propval);
+ m_revprops[std::string(static_cast<const char *>(propname))]
+ = std::string(static_cast<const char *>(propval));
JNIUtil::getEnv()->DeleteLocalRef(jpropval);
}
Modified: subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/RevpropTable.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/RevpropTable.h?rev=1494817&r1=1494816&r2=1494817&view=diff
==============================================================================
--- subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/RevpropTable.h (original)
+++ subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/RevpropTable.h Thu Jun 20 00:19:28 2013
@@ -44,7 +44,7 @@ class RevpropTable
public:
RevpropTable(jobject jrevpropTable);
~RevpropTable();
- const apr_hash_t *hash(const SVN::Pool &pool);
+ apr_hash_t *hash(const SVN::Pool &pool, bool nullIfEmpty = true);
};
#endif // REVPROPTABLE_H
Modified: subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNBase.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNBase.cpp?rev=1494817&r1=1494816&r2=1494817&view=diff
==============================================================================
--- subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNBase.cpp (original)
+++ subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNBase.cpp Thu Jun 20 00:19:28 2013
@@ -30,7 +30,6 @@
SVNBase::SVNBase()
: pool(JNIUtil::getPool())
{
- jthis = NULL;
}
SVNBase::~SVNBase()
@@ -58,17 +57,6 @@ jlong SVNBase::findCppAddrForJObject(job
if (JNIUtil::isJavaExceptionThrown())
return 0;
- if (cppAddr)
- {
- /* jthis is not guaranteed to be the same between JNI invocations, so
- we do a little dance here and store the updated version in our
- object for this invocation.
-
- findCppAddrForJObject() is, by necessity, called before any other
- methods on the C++ object, so by doing this we can guarantee a
- valid jthis pointer for subsequent uses. */
- (reinterpret_cast<SVNBase *> (cppAddr))->jthis = jthis;
- }
return cppAddr;
}
}
@@ -82,17 +70,15 @@ void SVNBase::finalize()
JNIUtil::enqueueForDeletion(this);
}
-void SVNBase::dispose(jfieldID *fid, const char *className)
+void SVNBase::dispose(jobject jthis, jfieldID *fid, const char *className)
{
- jobject my_jthis = this->jthis;
-
delete this;
JNIEnv *env = JNIUtil::getEnv();
SVNBase::findCppAddrFieldID(fid, className, env);
if (*fid == 0)
return;
- env->SetLongField(my_jthis, *fid, 0);
+ env->SetLongField(jthis, *fid, 0);
if (JNIUtil::isJavaExceptionThrown())
return;
}
@@ -111,3 +97,29 @@ inline void SVNBase::findCppAddrFieldID(
}
}
}
+
+jobject SVNBase::createCppBoundObject(const char *clazzName)
+{
+ JNIEnv *env = JNIUtil::getEnv();
+
+ // Create java session object
+ jclass clazz = env->FindClass(clazzName);
+ if (JNIUtil::isJavaExceptionThrown())
+ return NULL;
+
+ static jmethodID ctor = 0;
+ if (ctor == 0)
+ {
+ ctor = env->GetMethodID(clazz, "<init>", "(J)V");
+ if (JNIUtil::isJavaExceptionThrown())
+ return NULL;
+ }
+
+ jlong cppAddr = this->getCppAddr();
+
+ jobject jself = env->NewObject(clazz, ctor, cppAddr);
+ if (JNIUtil::isJavaExceptionThrown())
+ return NULL;
+
+ return jself;
+}
Modified: subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNBase.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNBase.h?rev=1494817&r1=1494816&r2=1494817&view=diff
==============================================================================
--- subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNBase.h (original)
+++ subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNBase.h Thu Jun 20 00:19:28 2013
@@ -49,7 +49,7 @@ class SVNBase
*
* @since 1.4.0
*/
- virtual void dispose() = 0;
+ virtual void dispose(jobject jthis) = 0;
/**
* This method should never be called, as @c dispose() should be
@@ -80,13 +80,12 @@ class SVNBase
*
* @since 1.4.0
*/
- void dispose(jfieldID *fid, const char *className);
+ void dispose(jobject jthis, jfieldID *fid, const char *className);
/**
- * A pointer to the parent java object. This is not valid across JNI
- * method invocations, and so should be set in each one.
+ * Instantiates java object attached to this base object
*/
- jobject jthis;
+ jobject createCppBoundObject(const char *clazzName);
private:
/**
Modified: subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNClient.cpp?rev=1494817&r1=1494816&r2=1494817&view=diff
==============================================================================
--- subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNClient.cpp Thu Jun 20 00:19:28 2013
@@ -30,6 +30,7 @@
#include "DiffSummaryReceiver.h"
#include "ClientContext.h"
#include "Prompter.h"
+#include "RemoteSession.h"
#include "Pool.h"
#include "Targets.h"
#include "Revision.h"
@@ -67,10 +68,11 @@
#include <vector>
#include <iostream>
#include <sstream>
+#include <string>
SVNClient::SVNClient(jobject jthis_in)
- : context(jthis_in, pool), m_lastPath("", pool)
+ : m_lastPath("", pool), context(jthis_in, pool)
{
}
@@ -86,10 +88,10 @@ SVNClient *SVNClient::getCppObject(jobje
return (cppAddr == 0 ? NULL : reinterpret_cast<SVNClient *>(cppAddr));
}
-void SVNClient::dispose()
+void SVNClient::dispose(jobject jthis)
{
static jfieldID fid = 0;
- SVNBase::dispose(&fid, JAVA_PACKAGE"/SVNClient");
+ SVNBase::dispose(jthis, &fid, JAVA_PACKAGE"/SVNClient");
}
jstring SVNClient::getAdminDirectoryName()
@@ -130,7 +132,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(),
@@ -161,7 +163,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;
@@ -175,30 +177,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(), 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
@@ -206,8 +196,8 @@ void SVNClient::logMessages(const char *
== svn_opt_revision_unspecified)
{
svn_opt_revision_range_t *range =
- (svn_opt_revision_range_t *)apr_pcalloc(subPool.getPool(),
- sizeof(*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;
@@ -219,8 +209,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,
@@ -242,8 +257,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);
@@ -274,7 +289,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),
@@ -295,14 +310,15 @@ 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()), );
}
void SVNClient::add(const char *path,
- svn_depth_t depth, bool force, bool no_ignore,
+ svn_depth_t depth, bool force,
+ bool no_ignore, bool no_autoprops,
bool add_parents)
{
SVN::Pool subPool(pool);
@@ -310,7 +326,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;
@@ -333,7 +349,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,
@@ -369,13 +385,14 @@ 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;
SVN_JNI_ERR(svn_client_commit5(targets2, depth,
- noUnlock, keepChangelist, TRUE,
+ noUnlock, keepChangelist,
+ TRUE,
changelists.array(subPool),
revprops.hash(subPool),
CommitCallback::callback, callback,
@@ -399,7 +416,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)
@@ -414,16 +431,16 @@ void SVNClient::copy(CopySources ©So
void SVNClient::move(Targets &srcPaths, const char *destPath,
CommitMessage *message, bool force, bool moveAsChild,
- bool makeParents, RevpropTable &revprops,
- CommitCallback *callback)
+ bool makeParents, bool metadataOnly, bool allowMixRev,
+ RevpropTable &revprops, CommitCallback *callback)
{
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)
@@ -446,7 +463,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),
@@ -459,7 +476,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)
@@ -474,7 +491,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;
@@ -492,9 +509,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)
@@ -525,9 +542,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);
@@ -552,16 +569,19 @@ jlong SVNClient::doSwitch(const char *pa
void SVNClient::doImport(const char *path, const char *url,
CommitMessage *message, svn_depth_t depth,
- bool noIgnore, bool ignoreUnknownNodeTypes,
- RevpropTable &revprops, CommitCallback *callback)
+ bool noIgnore, bool noAutoProps,
+ bool ignoreUnknownNodeTypes,
+ RevpropTable &revprops,
+ ImportFilterCallback *ifCallback,
+ CommitCallback *commitCallback)
{
SVN::Pool subPool(pool);
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)
@@ -570,7 +590,7 @@ void SVNClient::doImport(const char *pat
SVN_JNI_ERR(svn_client_import4(intPath.c_str(), intUrl.c_str(), depth,
noIgnore, ignoreUnknownNodeTypes,
revprops.hash(subPool),
- CommitCallback::callback, callback,
+ CommitCallback::callback, commitCallback,
ctx, subPool.getPool()), );
}
@@ -593,21 +613,22 @@ SVNClient::suggestMergeSources(const cha
void SVNClient::merge(const char *path1, Revision &revision1,
const char *path2, Revision &revision2,
- const char *localPath, bool force, svn_depth_t depth,
- bool ignoreAncestry, bool dryRun, bool recordOnly)
+ const char *localPath, bool forceDelete,
+ svn_depth_t depth, bool ignoreAncestry,
+ bool dryRun, bool recordOnly)
{
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, 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)
@@ -616,64 +637,42 @@ void SVNClient::merge(const char *path1,
SVN_JNI_ERR(svn_client_merge4(srcPath1.c_str(), revision1.revision(),
srcPath2.c_str(), revision2.revision(),
intLocalPath.c_str(),
- depth,
- ignoreAncestry, force, recordOnly, dryRun,
+ depth, ignoreAncestry,
+ forceDelete, recordOnly, dryRun,
TRUE, NULL, ctx, subPool.getPool()), );
}
void SVNClient::merge(const char *path, Revision &pegRevision,
- std::vector<RevisionRange> &rangesToMerge,
- const char *localPath, bool force, svn_depth_t depth,
- bool ignoreAncestry, bool dryRun, bool recordOnly)
+ std::vector<RevisionRange> *rangesToMerge,
+ const char *localPath, bool forceDelete,
+ svn_depth_t depth, bool ignoreAncestry,
+ bool dryRun, bool recordOnly)
{
SVN::Pool subPool(pool);
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(), 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 =
- (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;
- }
+ (!rangesToMerge ? NULL
+ : rev_range_vector_to_apr_array(*rangesToMerge, subPool));
+ if (JNIUtil::isExceptionThrown())
+ return;
SVN_JNI_ERR(svn_client_merge_peg4(srcPath.c_str(),
ranges,
pegRevision.revision(),
intLocalPath.c_str(),
- depth,
- ignoreAncestry, force, recordOnly,
+ depth, ignoreAncestry,
+ forceDelete, recordOnly,
dryRun, TRUE, NULL, ctx,
subPool.getPool()), );
}
@@ -685,10 +684,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)
@@ -713,7 +712,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,
@@ -758,13 +757,13 @@ SVNClient::getMergeinfo(const char *targ
void *val;
apr_hash_this(hi, &path, NULL, &val);
- jstring jpath = JNIUtil::makeJString((const char *) path);
+ jstring jpath =
+ JNIUtil::makeJString(reinterpret_cast<const char *>(path));
jobject jranges =
CreateJ::RevisionRangeList((apr_array_header_t *) val);
env->CallVoidMethod(jmergeinfo, addRevisions, jpath, jranges);
- env->DeleteLocalRef(jranges);
env->DeleteLocalRef(jpath);
}
@@ -790,11 +789,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(),
@@ -816,23 +815,24 @@ void SVNClient::getMergeinfoLog(int type
* Get a property.
*/
jbyteArray SVNClient::propertyGet(const char *path, const char *name,
- Revision &revision, Revision &pegRevision)
+ Revision &revision, Revision &pegRevision,
+ StringArray &changelists)
{
SVN::Pool subPool(pool);
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)
return NULL;
apr_hash_t *props;
- SVN_JNI_ERR(svn_client_propget3(&props, name,
+ SVN_JNI_ERR(svn_client_propget4(&props, name,
intPath.c_str(), pegRevision.revision(),
revision.revision(), NULL, svn_depth_empty,
- NULL, ctx, subPool.getPool()),
+ NULL, ctx, subPool.getPool(), subPool.getPool()),
NULL);
apr_hash_index_t *hi;
@@ -842,23 +842,23 @@ jbyteArray SVNClient::propertyGet(const
return NULL; // no property with this name
svn_string_t *propval;
- apr_hash_this(hi, NULL, NULL, (void**)&propval);
+ apr_hash_this(hi, NULL, NULL, reinterpret_cast<void**>(&propval));
if (propval == NULL)
return NULL;
- return JNIUtil::makeJByteArray((const signed char *)propval->data,
- propval->len);
+ return JNIUtil::makeJByteArray(propval);
}
void SVNClient::properties(const char *path, Revision &revision,
Revision &pegRevision, svn_depth_t depth,
- StringArray &changelists, ProplistCallback *callback)
+ StringArray &changelists,
+ ProplistCallback *callback)
{
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)
@@ -869,8 +869,6 @@ void SVNClient::properties(const char *p
changelists.array(subPool),
ProplistCallback::callback, callback,
ctx, subPool.getPool()), );
-
- return;
}
void SVNClient::propertySetLocal(Targets &targets, const char *name,
@@ -884,8 +882,10 @@ void SVNClient::propertySetLocal(Targets
if (value.isNull())
val = NULL;
else
- val = svn_string_ncreate((const char *)value.getBytes(), value.getLength(),
- subPool.getPool());
+ val = svn_string_ncreate
+ (reinterpret_cast<const char *>(value.getBytes()),
+ value.getLength(),
+ subPool.getPool());
svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
if (ctx == NULL)
@@ -912,11 +912,13 @@ void SVNClient::propertySetRemote(const
if (value.isNull())
val = NULL;
else
- val = svn_string_ncreate((const char *)value.getBytes(), value.getLength(),
- subPool.getPool());
+ val = svn_string_ncreate
+ (reinterpret_cast<const char *>(value.getBytes()),
+ value.getLength(),
+ 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)
@@ -942,6 +944,7 @@ void SVNClient::diff(const char *target1
const char *c_relToDir = relativeToDir ?
svn_dirent_canonicalize(relativeToDir, subPool.getPool()) :
relativeToDir;
+ bool noDiffAdded = false; /* ### Promote to argument */
SVN_JNI_NULL_PTR_EX(target1, "target", );
// target2 is ignored when pegRevision is provided.
@@ -954,7 +957,7 @@ void SVNClient::diff(const char *target1
return;
Path path1(target1, subPool);
- SVN_JNI_ERR(path1.error_occured(), );
+ SVN_JNI_ERR(path1.error_occurred(), );
apr_file_t *outfile = NULL;
apr_status_t rv =
@@ -998,7 +1001,7 @@ void SVNClient::diff(const char *target1
{
// "Regular" diff (without a peg revision).
Path path2(target2, subPool);
- err = path2.error_occured();
+ err = path2.error_occurred();
if (err)
{
if (outfile)
@@ -1081,9 +1084,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(),
@@ -1110,7 +1113,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(),
@@ -1131,7 +1134,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)
@@ -1150,7 +1153,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)
@@ -1178,8 +1181,7 @@ jbyteArray SVNClient::revProperty(const
if (propval == NULL)
return NULL;
- return JNIUtil::makeJByteArray((const signed char *)propval->data,
- propval->len);
+ return JNIUtil::makeJByteArray(propval);
}
void SVNClient::relocate(const char *from, const char *to, const char *path,
bool ignoreExternals)
@@ -1189,13 +1191,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)
@@ -1213,21 +1215,19 @@ void SVNClient::blame(const char *path,
{
SVN::Pool subPool(pool);
SVN_JNI_NULL_PTR_EX(path, "path", );
- apr_pool_t *pool = 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(NULL, subPool);
if (ctx == NULL)
return;
- SVN_JNI_ERR(svn_client_blame5(intPath.c_str(), pegRevision.revision(),
- revisionStart.revision(),
- revisionEnd.revision(),
- svn_diff_file_options_create(pool),
- ignoreMimeType, includeMergedRevisions,
- BlameCallback::callback, callback, ctx,
- pool),
+ SVN_JNI_ERR(svn_client_blame5(
+ intPath.c_str(), pegRevision.revision(), revisionStart.revision(),
+ revisionEnd.revision(),
+ svn_diff_file_options_create(subPool.getPool()), ignoreMimeType,
+ includeMergedRevisions, BlameCallback::callback, callback, ctx,
+ subPool.getPool()),
);
}
@@ -1238,7 +1238,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),
@@ -1252,7 +1252,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),
@@ -1278,7 +1278,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,
@@ -1290,10 +1290,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((apr_array_header_t*)targetsApr, force,
- ctx, subPool.getPool()), );
+ SVN_JNI_ERR(svn_client_unlock(
+ targetsApr, force, ctx, subPool.getPool()), );
}
void SVNClient::setRevProperty(const char *path,
const char *name, Revision &rev,
@@ -1304,7 +1304,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)
@@ -1342,7 +1342,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);
@@ -1409,7 +1409,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()), );
}
@@ -1420,7 +1420,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;
@@ -1459,7 +1459,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(),
@@ -1484,9 +1484,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(),
@@ -1497,6 +1497,77 @@ SVNClient::patch(const char *patchPath,
ctx, subPool.getPool()), );
}
+jobject
+SVNClient::openRemoteSession(const char* path, int retryAttempts)
+{
+ static const svn_opt_revision_t HEAD = { svn_opt_revision_head, {0}};
+ static const svn_opt_revision_t NONE = { svn_opt_revision_unspecified, {0}};
+
+ SVN_JNI_NULL_PTR_EX(path, "path", NULL);
+
+ SVN::Pool subPool(pool);
+ svn_client_ctx_t *ctx = context.getContext(NULL, subPool);
+ if (ctx == NULL)
+ return NULL;
+
+ Path checkedPath(path, subPool);
+ SVN_JNI_ERR(checkedPath.error_occurred(), NULL);
+
+ struct PathInfo
+ {
+ std::string url;
+ std::string uuid;
+ static svn_error_t *callback(void *baton,
+ const char *,
+ const svn_client_info2_t *info,
+ apr_pool_t *)
+ {
+ PathInfo* const pi = static_cast<PathInfo*>(baton);
+ pi->url = info->URL;
+ pi->uuid = info->repos_UUID;
+ return SVN_NO_ERROR;
+ }
+ } path_info;
+
+ SVN_JNI_ERR(svn_client_info3(
+ checkedPath.c_str(), &NONE,
+ (svn_path_is_url(checkedPath.c_str()) ? &HEAD : &NONE),
+ svn_depth_empty, FALSE, TRUE, NULL,
+ PathInfo::callback, &path_info,
+ ctx, subPool.getPool()),
+ NULL);
+
+ jobject jctx = context.getSelf();
+ if (JNIUtil::isJavaExceptionThrown())
+ return NULL;
+
+ /* Decouple the RemoteSession's context from SVNClient's context
+ by creating a copy of the prompter here. */
+ Prompter* prompter = new Prompter(context.getPrompter());
+ if (!prompter)
+ {
+ /* context.getSelf() created a new global reference. */
+ JNIUtil::getEnv()->DeleteGlobalRef(jctx);
+ JNIUtil::throwNullPointerException("allocating Prompter");
+ return NULL;
+ }
+
+ jobject jremoteSession = RemoteSession::open(
+ retryAttempts, path_info.url.c_str(), path_info.uuid.c_str(),
+ context.getConfigDirectory(),
+ context.getUsername(), context.getPassword(),
+ prompter, jctx);
+ if (JNIUtil::isJavaExceptionThrown())
+ {
+ /* context.getSelf() created a new global reference. */
+ JNIUtil::getEnv()->DeleteGlobalRef(jctx);
+ jremoteSession = NULL;
+ delete prompter;
+ }
+
+ return jremoteSession;
+}
+
ClientContext &
SVNClient::getClientContext()
{
Modified: subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNClient.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNClient.h?rev=1494817&r1=1494816&r2=1494817&view=diff
==============================================================================
--- subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNClient.h (original)
+++ subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNClient.h Thu Jun 20 00:19:28 2013
@@ -46,6 +46,7 @@ class LogMessageCallback;
class InfoCallback;
class CommitCallback;
class ListCallback;
+class ImportFilterCallback;
class StatusCallback;
class OutputStream;
class PatchCallback;
@@ -53,6 +54,7 @@ class ChangelistCallback;
class CommitMessage;
class StringArray;
class RevpropTable;
+class DiffOptions;
#include "svn_types.h"
#include "svn_client.h"
#include "SVNBase.h"
@@ -60,6 +62,7 @@ class RevpropTable;
class SVNClient :public SVNBase
{
public:
+ jobject openRemoteSession(const char* path, int);
void patch(const char *patchPath, const char *targetPath, bool dryRun,
int stripCount, bool reverse, bool ignoreWhitespace,
bool removeTempfiles, PatchCallback *callback);
@@ -91,23 +94,28 @@ class SVNClient :public SVNBase
jobject getMergeinfo(const char *target, Revision &pegRevision);
void getMergeinfoLog(int type, const char *pathOrURL,
Revision &pegRevision, const char *mergeSourceURL,
- Revision &srcPegRevision, bool discoverChangedPaths,
+ Revision &srcPegRevision,
+ bool discoverChangedPaths,
svn_depth_t depth, StringArray &revProps,
LogMessageCallback *callback);
jobject suggestMergeSources(const char *path, Revision &pegRevision);
- void merge(const char *path1, Revision &revision1, const char *path2,
- Revision &revision2, const char *localPath, bool force,
- svn_depth_t depth, bool ignoreAncestry, bool dryRun,
- bool recordOnly);
+ void merge(const char *path1, Revision &revision1,
+ const char *path2, Revision &revision2,
+ const char *localPath, bool forceDelete, svn_depth_t depth,
+ bool ignoreAncestry,
+ bool dryRun, bool recordOnly);
void merge(const char *path, Revision &pegRevision,
- std::vector<RevisionRange> &rangesToMerge,
- const char *localPath, bool force, svn_depth_t depth,
- bool ignoreAncestry, bool dryRun, bool recordOnly);
+ std::vector<RevisionRange> *rangesToMerge,
+ const char *localPath, bool forceDelete, svn_depth_t depth,
+ bool ignoreAncestry,
+ bool dryRun, bool recordOnly);
void mergeReintegrate(const char *path, Revision &pegRevision,
const char *localPath, bool dryRun);
void doImport(const char *path, const char *url, CommitMessage *message,
- svn_depth_t depth, bool noIgnore, bool ignoreUnknownNodeTypes,
- RevpropTable &revprops, CommitCallback *callback);
+ svn_depth_t depth, bool noIgnore, bool noAutoProps,
+ bool ignoreUnknownNodeTypes,
+ RevpropTable &revprops, ImportFilterCallback *ifCallback,
+ CommitCallback *commitCallback);
jlong doSwitch(const char *path, const char *url, Revision &revision,
Revision &pegRevision, svn_depth_t depth,
bool depthIsSticky, bool ignoreExternals,
@@ -123,7 +131,8 @@ class SVNClient :public SVNBase
RevpropTable &revprops, CommitCallback *callback);
void move(Targets &srcPaths, const char *destPath,
CommitMessage *message, bool force, bool moveAsChild,
- bool makeParents, RevpropTable &revprops, CommitCallback *callback);
+ bool makeParents, bool metadataOnly, bool allowMixRev,
+ RevpropTable &revprops, CommitCallback *callback);
void copy(CopySources ©Sources, const char *destPath,
CommitMessage *message, bool copyAsChild, bool makeParents,
bool ignoreExternals, RevpropTable &revprops,
@@ -135,8 +144,8 @@ class SVNClient :public SVNBase
jlongArray update(Targets &targets, Revision &revision, svn_depth_t depth,
bool depthIsSticky, bool makeParents, bool ignoreExternals,
bool allowUnverObstructions);
- void add(const char *path, svn_depth_t depth, bool force, bool no_ignore,
- bool add_parents);
+ void add(const char *path, svn_depth_t depth, bool force,
+ bool no_ignore, bool no_autoprops, bool add_parents);
void revert(const char *path, svn_depth_t depth, StringArray &changelists);
void remove(Targets &targets, CommitMessage *message, bool force,
bool keep_local, RevpropTable &revprops,
@@ -149,6 +158,7 @@ class SVNClient :public SVNBase
bool discoverPaths, bool includeMergedRevisions,
StringArray &revProps,
long limit, LogMessageCallback *callback);
+ jobject getVersionExtended(bool verbose);
jstring getAdminDirectoryName();
jboolean isAdminDirectory(const char *name);
void addToChangelist(Targets &srcPaths, const char *changelist,
@@ -171,7 +181,8 @@ class SVNClient :public SVNBase
bool lastChanged);
void upgrade(const char *path);
jbyteArray propertyGet(const char *path, const char *name,
- Revision &revision, Revision &pegRevision);
+ Revision &revision, Revision &pegRevision,
+ StringArray &changelists);
void diff(const char *target1, Revision &revision1,
const char *target2, Revision &revision2,
const char *relativeToDir, const char *outfileName,
@@ -196,7 +207,7 @@ class SVNClient :public SVNBase
ClientContext &getClientContext();
const char *getLastPath();
- void dispose();
+ void dispose(jobject jthis);
static SVNClient *getCppObject(jobject jthis);
SVNClient(jobject jthis_in);
virtual ~SVNClient();
Modified: subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNRepos.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNRepos.cpp?rev=1494817&r1=1494816&r2=1494817&view=diff
==============================================================================
--- subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNRepos.cpp (original)
+++ subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNRepos.cpp Thu Jun 20 00:19:28 2013
@@ -54,10 +54,10 @@ SVNRepos *SVNRepos::getCppObject(jobject
return (cppAddr == 0 ? NULL : reinterpret_cast<SVNRepos *>(cppAddr));
}
-void SVNRepos::dispose()
+void SVNRepos::dispose(jobject jthis)
{
static jfieldID fid = 0;
- SVNBase::dispose(&fid, JAVA_PACKAGE"/SVNRepos");
+ SVNBase::dispose(jthis, &fid, JAVA_PACKAGE"/SVNRepos");
}
void SVNRepos::cancelOperation()
@@ -68,7 +68,7 @@ void SVNRepos::cancelOperation()
svn_error_t *
SVNRepos::checkCancel(void *cancelBaton)
{
- SVNRepos *that = (SVNRepos *)cancelBaton;
+ SVNRepos *that = static_cast<SVNRepos *>(cancelBaton);
if (that->m_cancelOperation)
return svn_error_create(SVN_ERR_CANCELLED, NULL,
_("Operation cancelled"));
@@ -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.getPool()),
+ SVN_JNI_ERR(svn_fs_deltify_revision(fs, revision, revisionPool.getPool()),
);
}
@@ -177,7 +177,7 @@ void SVNRepos::deltify(File &path, Revis
}
void SVNRepos::dump(File &path, OutputStream &dataOut,
- Revision &revsionStart, Revision &revisionEnd,
+ Revision &revisionStart, Revision &revisionEnd,
bool incremental, bool useDeltas,
ReposNotifyCallback *notifyCallback)
{
@@ -199,9 +199,9 @@ void SVNRepos::dump(File &path, OutputSt
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)
- lower = revsionStart.revision()->value.number;
- else if (revsionStart.revision()->kind == svn_opt_revision_head)
+ if (revisionStart.revision()->kind == svn_opt_revision_number)
+ lower = revisionStart.revision()->value.number;
+ else if (revisionStart.revision()->kind == svn_opt_revision_head)
lower = youngest;
else
lower = SVN_INVALID_REVNUM;
@@ -248,7 +248,7 @@ void SVNRepos::dump(File &path, OutputSt
}
void SVNRepos::hotcopy(File &path, File &targetPath,
- bool cleanLogs)
+ bool cleanLogs, bool incremental)
{
SVN::Pool requestPool;
@@ -270,7 +270,7 @@ void SVNRepos::hotcopy(File &path, File
}
static void
-list_dblogs (File &path, MessageReceiver &receiver, bool only_unused)
+list_dblogs(File &path, MessageReceiver &receiver, bool only_unused)
{
SVN::Pool requestPool;
apr_array_header_t *logfiles;
@@ -294,7 +294,7 @@ list_dblogs (File &path, MessageReceiver
log_utf8 = svn_dirent_join(path.getInternalStyle(requestPool),
APR_ARRAY_IDX(logfiles, i, const char *),
requestPool.getPool());
- log_utf8 = svn_dirent_local_style (log_utf8, requestPool.getPool());
+ log_utf8 = svn_dirent_local_style(log_utf8, requestPool.getPool());
receiver.receiveMessage(log_utf8);
}
}
@@ -312,6 +312,8 @@ void SVNRepos::listUnusedDBLogs(File &pa
void SVNRepos::load(File &path,
InputStream &dataIn,
+ Revision &revisionStart,
+ Revision &revisionEnd,
bool ignoreUUID,
bool forceUUID,
bool usePreCommitHook,
@@ -321,6 +323,7 @@ void SVNRepos::load(File &path,
{
SVN::Pool requestPool;
svn_repos_t *repos;
+ svn_revnum_t lower = SVN_INVALID_REVNUM, upper = SVN_INVALID_REVNUM;
enum svn_repos_load_uuid uuid_action = svn_repos_load_uuid_default;
if (ignoreUUID)
uuid_action = svn_repos_load_uuid_ignore;
@@ -333,6 +336,20 @@ void SVNRepos::load(File &path,
return;
}
+ /* ### We only handle revision numbers right now, not dates. */
+ if (revisionStart.revision()->kind == svn_opt_revision_number)
+ lower = revisionStart.revision()->value.number;
+ if (revisionEnd.revision()->kind == svn_opt_revision_number)
+ upper = revisionEnd.revision()->value.number;
+ if (upper < lower
+ && lower != SVN_INVALID_REVNUM
+ && upper != SVN_INVALID_REVNUM)
+ {
+ SVN_JNI_ERR(svn_error_create
+ (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("First revision cannot be higher than second")), );
+ }
+
SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
NULL, requestPool.getPool()), );
@@ -362,13 +379,13 @@ void SVNRepos::lstxns(File &path, Messag
SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
NULL, requestPool.getPool()), );
- fs = svn_repos_fs (repos);
+ fs = svn_repos_fs(repos);
SVN_JNI_ERR(svn_fs_list_transactions(&txns, fs, requestPool.getPool()), );
/* Loop, printing revisions. */
for (int i = 0; i < txns->nelts; ++i)
{
- messageReceiver.receiveMessage(APR_ARRAY_IDX (txns, i, const char *));
+ messageReceiver.receiveMessage(APR_ARRAY_IDX(txns, i, const char *));
}
@@ -399,7 +416,7 @@ jlong SVNRepos::recover(File &path, Repo
* recovery actually worked. */
SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
NULL, requestPool.getPool()), -1);
- SVN_JNI_ERR(svn_fs_youngest_rev(&youngest_rev, svn_repos_fs (repos),
+ SVN_JNI_ERR(svn_fs_youngest_rev(&youngest_rev, svn_repos_fs(repos),
requestPool.getPool()),
-1);
return youngest_rev;
@@ -423,13 +440,13 @@ void SVNRepos::rmtxns(File &path, String
SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
NULL, requestPool.getPool()), );
- fs = svn_repos_fs (repos);
+ fs = svn_repos_fs(repos);
args = transactions.array(requestPool);
/* All the rest of the arguments are transaction names. */
for (i = 0; i < args->nelts; ++i)
{
- const char *txn_name = APR_ARRAY_IDX (args, i, const char *);
+ const char *txn_name = APR_ARRAY_IDX(args, i, const char *);
svn_error_t *err;
/* Try to open the txn. If that succeeds, try to abort it. */
@@ -443,7 +460,7 @@ void SVNRepos::rmtxns(File &path, String
* all. */
if (err && (err->apr_err == SVN_ERR_FS_TRANSACTION_DEAD))
{
- svn_error_clear (err);
+ svn_error_clear(err);
err = svn_fs_purge_txn(fs, txn_name, transactionPool.getPool());
}
@@ -497,7 +514,7 @@ void SVNRepos::setRevProp(File &path, Re
}
else
{
- svn_fs_t *fs = svn_repos_fs (repos);
+ svn_fs_t *fs = svn_repos_fs(repos);
err = svn_fs_change_rev_prop2(fs, revision.revision()->value.number,
propName, NULL, propValStr,
requestPool.getPool());
@@ -554,7 +571,7 @@ SVNRepos::verify(File &path, Revision &r
* with no interest in the output. */
SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
NULL, requestPool.getPool()), );
- SVN_JNI_ERR(svn_fs_youngest_rev(&youngest, svn_repos_fs (repos),
+ SVN_JNI_ERR(svn_fs_youngest_rev(&youngest, svn_repos_fs(repos),
requestPool.getPool()), );
/* Find the revision numbers at which to start and end. */
@@ -658,13 +675,13 @@ jobject SVNRepos::lslocks(File &path, sv
std::vector<jobject> jlocks;
- for (hi = apr_hash_first (requestPool.getPool(), locks);
+ for (hi = apr_hash_first(requestPool.getPool(), locks);
hi;
- hi = apr_hash_next (hi))
+ hi = apr_hash_next(hi))
{
void *val;
- apr_hash_this (hi, NULL, NULL, &val);
- svn_lock_t *lock = (svn_lock_t *)val;
+ apr_hash_this(hi, NULL, NULL, &val);
+ svn_lock_t *lock = reinterpret_cast<svn_lock_t *>(val);
jobject jLock = CreateJ::Lock(lock);
jlocks.push_back(jLock);
@@ -691,8 +708,8 @@ void SVNRepos::rmlocks(File &path, Strin
SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
NULL, requestPool.getPool()), );
- fs = svn_repos_fs (repos);
- const char *username;
+ fs = svn_repos_fs(repos);
+ const char *username = NULL;
/* svn_fs_unlock() demands that some username be associated with the
* filesystem, so just use the UID of the person running 'svnadmin'.*/
@@ -704,7 +721,7 @@ void SVNRepos::rmlocks(File &path, Strin
apr_uid_name_get (&un, uid, pool) == APR_SUCCESS)
{
svn_error_t *err = svn_utf_cstring_to_utf8(&username, un, pool);
- svn_error_clear (err);
+ svn_error_clear(err);
if (err)
username = "administrator";
}
@@ -720,7 +737,7 @@ void SVNRepos::rmlocks(File &path, Strin
const apr_array_header_t *args = locks.array(requestPool);
for (int i = 0; i < args->nelts; ++i)
{
- const char *lock_path = APR_ARRAY_IDX (args, i, const char *);
+ const char *lock_path = APR_ARRAY_IDX(args, i, const char *);
svn_lock_t *lock;
/* Fetch the path's svn_lock_t. */
@@ -731,13 +748,13 @@ void SVNRepos::rmlocks(File &path, Strin
continue;
/* Now forcibly destroy the lock. */
- err = svn_fs_unlock (fs, lock_path,
- lock->token, 1 /* force */, subpool.getPool());
+ err = svn_fs_unlock(fs, lock_path,
+ lock->token, 1 /* force */, subpool.getPool());
if (err)
goto move_on;
move_on:
- svn_error_clear (err);
+ svn_error_clear(err);
subpool.clear();
}
Modified: subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNRepos.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNRepos.h?rev=1494817&r1=1494816&r2=1494817&view=diff
==============================================================================
--- subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNRepos.h (original)
+++ subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/SVNRepos.h Thu Jun 20 00:19:28 2013
@@ -52,13 +52,15 @@ class SVNRepos : public SVNBase
void rmtxns(File &path, StringArray &transactions);
jlong recover(File &path, ReposNotifyCallback *notifyCallback);
void lstxns(File &path, MessageReceiver &messageReceiver);
- void load(File &path, InputStream &dataIn, bool ignoreUUID, bool forceUUID,
+ void load(File &path, InputStream &dataIn,
+ Revision &revsionStart, Revision &revisionEnd,
+ bool ignoreUUID, bool forceUUID,
bool usePreCommitHook, bool usePostCommitHook,
const char *relativePath, ReposNotifyCallback *notifyCallback);
void listUnusedDBLogs(File &path,
MessageReceiver &messageReceiver);
void listDBLogs(File &path, MessageReceiver &messageReceiver);
- void hotcopy(File &path, File &targetPath, bool cleanLogs);
+ void hotcopy(File &path, File &targetPath, bool cleanLogs, bool incremental);
void dump(File &path, OutputStream &dataOut, Revision &revsionStart,
Revision &RevisionEnd, bool incremental, bool useDeltas,
ReposNotifyCallback *notifyCallback);
@@ -69,7 +71,7 @@ class SVNRepos : public SVNBase
void pack(File &path, ReposNotifyCallback *callback);
SVNRepos();
virtual ~SVNRepos();
- void dispose();
+ void dispose(jobject jthis);
static SVNRepos *getCppObject(jobject jthis);
static svn_error_t *checkCancel(void *cancelBaton);
Modified: subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/StatusCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/StatusCallback.cpp?rev=1494817&r1=1494816&r2=1494817&view=diff
==============================================================================
--- subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/StatusCallback.cpp (original)
+++ subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/StatusCallback.cpp Thu Jun 20 00:19:28 2013
@@ -55,7 +55,8 @@ StatusCallback::callback(void *baton,
apr_pool_t *pool)
{
if (baton)
- return ((StatusCallback *)baton)->doStatus(local_abspath, status, pool);
+ return static_cast<StatusCallback *>(baton)->doStatus(
+ local_abspath, status, pool);
return SVN_NO_ERROR;
}
@@ -93,7 +94,7 @@ StatusCallback::doStatus(const char *loc
jstring jPath = JNIUtil::makeJString(local_abspath);
if (JNIUtil::isJavaExceptionThrown())
- POP_AND_RETURN_NULL;
+ POP_AND_RETURN(SVN_NO_ERROR);
jobject jStatus = CreateJ::Status(wc_ctx, status, pool);
if (JNIUtil::isJavaExceptionThrown())
Modified: subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/StringArray.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/StringArray.cpp?rev=1494817&r1=1494816&r2=1494817&view=diff
==============================================================================
--- subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/StringArray.cpp (original)
+++ subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/StringArray.cpp Thu Jun 20 00:19:28 2013
@@ -39,7 +39,8 @@ StringArray::~StringArray()
const apr_array_header_t *StringArray::array(const SVN::Pool &pool)
{
apr_array_header_t *strings
- = apr_array_make(pool.getPool(), m_strings.size(), sizeof(char *));
+ = apr_array_make(pool.getPool(), static_cast<int>(m_strings.size()),
+ sizeof(char *));
std::vector<std::string>::const_iterator it;
for (it = m_strings.begin(); it < m_strings.end(); ++it)
@@ -69,7 +70,7 @@ StringArray::init(void)
if (JNIUtil::isExceptionThrown())
return;
- m_strings.push_back(std::string((const char *)str));
+ m_strings.push_back(std::string(static_cast<const char *>(str)));
}
}
Modified: subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/Targets.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/Targets.cpp?rev=1494817&r1=1494816&r2=1494817&view=diff
==============================================================================
--- subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/Targets.cpp (original)
+++ subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/Targets.cpp Thu Jun 20 00:19:28 2013
@@ -40,13 +40,13 @@ Targets::Targets(const char *path, SVN::
: m_subpool(in_pool)
{
m_strArray = NULL;
- m_targets.push_back (apr_pstrdup(m_subpool.getPool(), path));
- m_error_occured = NULL;
+ m_targets.push_back(apr_pstrdup(m_subpool.getPool(), path));
+ m_error_occurred = NULL;
}
void Targets::add(const char *path)
{
- m_targets.push_back (path);
+ m_targets.push_back(path);
}
const apr_array_header_t *Targets::array(const SVN::Pool &pool)
@@ -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);
@@ -72,9 +72,9 @@ const apr_array_header_t *Targets::array
std::vector<const char*>::const_iterator it;
apr_pool_t *apr_pool = pool.getPool();
- apr_array_header_t *apr_targets = apr_array_make (apr_pool,
- m_targets.size(),
- sizeof(const char *));
+ apr_array_header_t *apr_targets
+ = apr_array_make(apr_pool, static_cast<int>(m_targets.size()),
+ sizeof(const char *));
for (it = m_targets.begin(); it != m_targets.end(); ++it)
{
@@ -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/javahl-1.7-extensions/subversion/bindings/javahl/native/Targets.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/Targets.h?rev=1494817&r1=1494816&r2=1494817&view=diff
==============================================================================
--- subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/Targets.h (original)
+++ subversion/branches/javahl-1.7-extensions/subversion/bindings/javahl/native/Targets.h Thu Jun 20 00:19:28 2013
@@ -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