Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/bindings/javahl/native/SVNRepos.cpp view on Meta::CPAN
if ((lower > youngest) || (upper > youngest))
{
SVN_JNI_ERR(svn_error_createf
(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("Revisions must not be greater than the youngest revision"
" (%ld)"), youngest), );
}
SVN_JNI_ERR(svn_repos_dump_fs3(repos, dataOut.getStream(requestPool),
lower, upper, incremental, useDeltas,
notifyCallback != NULL
? ReposNotifyCallback::notify
: NULL,
notifyCallback,
checkCancel, this, requestPool.getPool()), );
}
void SVNRepos::hotcopy(File &path, File &targetPath,
bool cleanLogs, bool incremental)
{
SVN::Pool requestPool;
if (path.isNull())
{
JNIUtil::throwNullPointerException("path");
return;
}
if (targetPath.isNull())
{
JNIUtil::throwNullPointerException("targetPath");
return;
}
SVN_JNI_ERR(svn_repos_hotcopy2(path.getInternalStyle(requestPool),
targetPath.getInternalStyle(requestPool),
cleanLogs, incremental,
checkCancel, this /* cancel callback/baton */,
requestPool.getPool()),
);
}
static void
list_dblogs(File &path, MessageReceiver &receiver, bool only_unused)
{
SVN::Pool requestPool;
apr_array_header_t *logfiles;
if (path.isNull())
{
JNIUtil::throwNullPointerException("path");
return;
}
SVN_JNI_ERR(svn_repos_db_logfiles(&logfiles,
path.getInternalStyle(requestPool),
only_unused, requestPool.getPool()), );
/* Loop, printing log files. We append the log paths to the
* repository path, making sure to return everything to the native
* style and encoding before printing. */
for (int i = 0; i < logfiles->nelts; ++i)
{
const char *log_utf8;
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());
receiver.receiveMessage(log_utf8);
}
}
void SVNRepos::listDBLogs(File &path, MessageReceiver &messageReceiver)
{
list_dblogs(path, messageReceiver, false);
}
void SVNRepos::listUnusedDBLogs(File &path,
MessageReceiver &messageReceiver)
{
list_dblogs(path, messageReceiver, true);
}
void SVNRepos::load(File &path,
InputStream &dataIn,
Revision &revisionStart,
Revision &revisionEnd,
bool ignoreUUID,
bool forceUUID,
bool usePreCommitHook,
bool usePostCommitHook,
const char *relativePath,
ReposNotifyCallback *notifyCallback)
{
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;
else if (forceUUID)
uuid_action = svn_repos_load_uuid_force;
if (path.isNull())
{
JNIUtil::throwNullPointerException("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()), );
SVN_JNI_ERR(svn_repos_load_fs4(repos, dataIn.getStream(requestPool),
lower, upper, uuid_action, relativePath,
( run in 0.513 second using v1.01-cache-2.11-cpan-39bf76dae61 )