31
31
#include "JNIByteArray.h"
32
32
#include "CommitMessage.h"
33
33
#include "EnumMapper.h"
34
#include <svn_client.h>
35
#include <svn_sorts.h>
37
#include <svn_config.h>
34
#include "svn_client.h"
35
#include "svn_sorts.h"
37
#include "svn_config.h"
40
40
#include "svn_private_config.h"
41
41
#include "../include/org_tigris_subversion_javahl_Revision.h"
42
42
#include "../include/org_tigris_subversion_javahl_NodeKind.h"
72
jlong SVNClient::getCppAddr()
74
return reinterpret_cast<jlong>(this);
77
72
SVNClient * SVNClient::getCppObject(jobject jthis)
79
74
static jfieldID fid = 0;
80
JNIEnv *env = JNIUtil::getEnv();
83
jclass clazz = env->FindClass(JAVA_PACKAGE"/SVNClient");
84
if(JNIUtil::isJavaExceptionThrown())
88
fid = env->GetFieldID(clazz, "cppAddr", "J");
89
if(JNIUtil::isJavaExceptionThrown())
95
jlong cppAddr = env->GetLongField(jthis, fid);
96
if(JNIUtil::isJavaExceptionThrown())
100
return reinterpret_cast<SVNClient*>(cppAddr);
75
jlong cppAddr = SVNBase::findCppAddrForJObject(jthis, &fid,
76
JAVA_PACKAGE"/SVNClient");
77
return (cppAddr == 0 ? NULL : reinterpret_cast<SVNClient *>(cppAddr));
104
80
void SVNClient::dispose(jobject jthis)
107
82
static jfieldID fid = 0;
108
JNIEnv *env = JNIUtil::getEnv();
111
jclass clazz = env->FindClass(JAVA_PACKAGE"/SVNClient");
112
if(JNIUtil::isJavaExceptionThrown())
116
fid = env->GetFieldID(clazz, "cppAddr", "J");
117
if(JNIUtil::isJavaExceptionThrown())
123
env->SetLongField(jthis, fid, 0);
124
if(JNIUtil::isJavaExceptionThrown())
130
void SVNClient::finalize()
132
JNIUtil::putFinalizedClient(this);
83
SVNBase::dispose(jthis, &fid, JAVA_PACKAGE"/SVNClient");
135
86
jstring SVNClient::getAdminDirectoryName()
431
382
void SVNClient::username(const char *pi_username)
433
m_userName = pi_username;
384
m_userName = (pi_username == NULL ? "" : pi_username);
436
387
void SVNClient::password(const char *pi_password)
438
m_passWord = pi_password;
389
m_passWord = (pi_password == NULL ? "" : pi_password);
441
392
void SVNClient::setPrompt(Prompter *prompter)
678
Err = svn_client_add2 (intPath.c_str (), recurse, force,
629
Err = svn_client_add3 (intPath.c_str (), recurse, force, FALSE,
682
633
JNIUtil::handleSVNError(Err);
2084
2034
if(date != NULL && *date != '\0')
2086
2036
apr_time_t timeTemp;
2087
svn_time_from_cstring (&timeTemp, date, pool);
2038
svn_error_t * err = svn_time_from_cstring (&timeTemp, date, pool);
2039
if(err != SVN_NO_ERROR)
2089
2042
jdate = JNIUtil::createDate(timeTemp);
2090
2043
if(JNIUtil::isJavaExceptionThrown())
2758
2711
const char *line,
2759
2712
apr_pool_t *pool)
2761
((BlameCallback *)baton)->callback(revision, author, date, line, pool);
2714
return ((BlameCallback *)baton)->callback(revision, author, date, line, pool);
2764
2716
void SVNClient::blame(const char *path, Revision &pegRevision,
2765
2717
Revision &revisionStart,
2798
2750
void SVNClient::setConfigDirectory(const char *configDir)
2800
m_configDir = configDir;
2752
// A change to the config directory may necessitate creation of
2753
// the config templates.
2755
svn_error_t *err = svn_config_ensure(configDir, requestPool.pool());
2758
JNIUtil::handleSVNError(err);
2762
m_configDir = (configDir == NULL ? "" : configDir);
2803
2766
const char * SVNClient::getConfigDirectory()