Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/libsvn_wc/adm_crawler.c view on Meta::CPAN
{
const char *child = svn__apr_hash_index_key(hi);
const char *this_report_relpath;
const char *this_abspath;
svn_boolean_t this_switched = FALSE;
struct svn_wc__db_base_info_t *ths = svn__apr_hash_index_val(hi);
if (cancel_func)
SVN_ERR(cancel_func(cancel_baton));
/* Clear the iteration subpool here because the loop has a bunch
of 'continue' jump statements. */
svn_pool_clear(iterpool);
/* Compute the paths and URLs we need. */
this_report_relpath = svn_relpath_join(report_relpath, child, iterpool);
this_abspath = svn_dirent_join(dir_abspath, child, iterpool);
/*** File Externals **/
if (ths->update_root)
{
/* File externals are ... special. We ignore them. */;
continue;
}
/* First check for exclusion */
if (ths->status == svn_wc__db_status_excluded)
{
if (honor_depth_exclude)
{
/* Report the excluded path, no matter whether report_everything
flag is set. Because the report_everything flag indicates
that the server will treat the wc as empty and thus push
full content of the files/subdirs. But we want to prevent the
server from pushing the full content of this_path at us. */
/* The server does not support link_path report on excluded
path. We explicitly prohibit this situation in
svn_wc_crop_tree(). */
SVN_ERR(reporter->set_path(report_baton,
this_report_relpath,
dir_rev,
svn_depth_exclude,
FALSE,
NULL,
iterpool));
}
else
{
/* We want to pull in the excluded target. So, report it as
deleted, and server will respond properly. */
if (! report_everything)
SVN_ERR(reporter->delete_path(report_baton,
this_report_relpath, iterpool));
}
continue;
}
/*** The Big Tests: ***/
if (ths->status == svn_wc__db_status_server_excluded
|| ths->status == svn_wc__db_status_not_present)
{
/* If the entry is 'absent' or 'not-present', make sure the server
knows it's gone...
...unless we're reporting everything, in which case we're
going to report it missing later anyway.
This instructs the server to send it back to us, if it is
now available (an addition after a not-present state), or if
it is now authorized (change in authz for the absent item). */
if (! report_everything)
SVN_ERR(reporter->delete_path(report_baton, this_report_relpath,
iterpool));
continue;
}
/* Is the entry NOT on the disk? We may be able to restore it. */
if (restore_files
&& svn_hash_gets(dirents, child) == NULL)
{
svn_wc__db_status_t wrk_status;
svn_node_kind_t wrk_kind;
const svn_checksum_t *checksum;
SVN_ERR(svn_wc__db_read_info(&wrk_status, &wrk_kind, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
&checksum, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL,
db, this_abspath, iterpool, iterpool));
if ((wrk_status == svn_wc__db_status_normal
|| wrk_status == svn_wc__db_status_added
|| wrk_status == svn_wc__db_status_incomplete)
&& (wrk_kind == svn_node_dir || checksum))
{
svn_node_kind_t dirent_kind;
/* It is possible on a case insensitive system that the
entry is not really missing, but just cased incorrectly.
In this case we can't overwrite it with the pristine
version */
SVN_ERR(svn_io_check_path(this_abspath, &dirent_kind, iterpool));
if (dirent_kind == svn_node_none)
{
SVN_ERR(restore_node(db, this_abspath, wrk_kind,
use_commit_times, notify_func,
notify_baton, iterpool));
}
}
}
/* And finally prepare for reporting */
if (!ths->repos_relpath)
{
ths->repos_relpath = svn_relpath_join(dir_repos_relpath, child,
iterpool);
}
else
{
src/subversion/subversion/libsvn_wc/adm_crawler.c view on Meta::CPAN
return svn_error_trace(err);
svn_error_clear(err);
/* We don't know about this node, so all we have to do is tell
the reporter that we don't know this node.
But first we have to start the report by sending some basic
information for the root. */
if (depth == svn_depth_unknown)
depth = svn_depth_infinity;
SVN_ERR(reporter->set_path(report_baton, "", 0, depth, FALSE,
NULL, scratch_pool));
SVN_ERR(reporter->delete_path(report_baton, "", scratch_pool));
/* Finish the report, which causes the update editor to be
driven. */
SVN_ERR(reporter->finish_report(report_baton, scratch_pool));
return SVN_NO_ERROR;
}
if (target_depth == svn_depth_unknown)
target_depth = svn_depth_infinity;
start_empty = (status == svn_wc__db_status_incomplete);
if (depth_compatibility_trick
&& target_depth <= svn_depth_immediates
&& depth > target_depth)
{
start_empty = TRUE;
}
if (restore_files)
SVN_ERR(svn_io_check_path(local_abspath, &disk_kind, scratch_pool));
else
disk_kind = svn_node_unknown;
/* Determine if there is a missing node that should be restored */
if (restore_files
&& disk_kind == svn_node_none)
{
svn_wc__db_status_t wrk_status;
svn_node_kind_t wrk_kind;
const svn_checksum_t *checksum;
err = svn_wc__db_read_info(&wrk_status, &wrk_kind, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, &checksum, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL,
db, local_abspath,
scratch_pool, scratch_pool);
if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
{
svn_error_clear(err);
wrk_status = svn_wc__db_status_not_present;
wrk_kind = svn_node_file;
}
else
SVN_ERR(err);
if ((wrk_status == svn_wc__db_status_normal
|| wrk_status == svn_wc__db_status_added
|| wrk_status == svn_wc__db_status_incomplete)
&& (wrk_kind == svn_node_dir || checksum))
{
SVN_ERR(restore_node(wc_ctx->db, local_abspath,
wrk_kind, use_commit_times,
notify_func, notify_baton,
scratch_pool));
}
}
{
report_depth = target_depth;
if (honor_depth_exclude
&& depth != svn_depth_unknown
&& depth < target_depth)
report_depth = depth;
/* The first call to the reporter merely informs it that the
top-level directory being updated is at BASE_REV. Its PATH
argument is ignored. */
SVN_ERR(reporter->set_path(report_baton, "", target_rev, report_depth,
start_empty, NULL, scratch_pool));
}
if (target_kind == svn_node_dir)
{
if (depth != svn_depth_empty)
{
/* Recursively crawl ROOT_DIRECTORY and report differing
revisions. */
err = report_revisions_and_depths(wc_ctx->db,
local_abspath,
"",
target_rev,
repos_relpath,
repos_root_url,
report_depth,
reporter, report_baton,
restore_files, depth,
honor_depth_exclude,
depth_compatibility_trick,
start_empty,
use_commit_times,
cancel_func, cancel_baton,
notify_func, notify_baton,
scratch_pool);
if (err)
goto abort_report;
}
}
else if (target_kind == svn_node_file || target_kind == svn_node_symlink)
{
( run in 1.021 second using v1.01-cache-2.11-cpan-524268b4103 )