Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/libsvn_wc/status.c view on Meta::CPAN
const struct svn_wc__db_info_t *dir_info,
const svn_io_dirent2_t *dirent,
const apr_array_header_t *ignore_patterns,
svn_depth_t depth,
svn_boolean_t get_all,
svn_boolean_t no_ignore,
svn_wc_status_func4_t status_func,
void *status_baton,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool)
{
const char *dir_repos_root_url;
const char *dir_repos_relpath;
const char *dir_repos_uuid;
apr_hash_t *dirents, *nodes, *conflicts, *all_children;
apr_array_header_t *sorted_children;
apr_array_header_t *collected_ignore_patterns = NULL;
apr_pool_t *iterpool;
svn_error_t *err;
int i;
if (cancel_func)
SVN_ERR(cancel_func(cancel_baton));
if (depth == svn_depth_unknown)
depth = svn_depth_infinity;
iterpool = svn_pool_create(scratch_pool);
err = svn_io_get_dirents3(&dirents, local_abspath, FALSE, scratch_pool,
iterpool);
if (err
&& (APR_STATUS_IS_ENOENT(err->apr_err)
|| SVN__APR_STATUS_IS_ENOTDIR(err->apr_err)))
{
svn_error_clear(err);
dirents = apr_hash_make(scratch_pool);
}
else
SVN_ERR(err);
if (!dir_info)
SVN_ERR(svn_wc__db_read_single_info(&dir_info, wb->db, local_abspath,
scratch_pool, iterpool));
SVN_ERR(get_repos_root_url_relpath(&dir_repos_relpath, &dir_repos_root_url,
&dir_repos_uuid, dir_info,
parent_repos_relpath,
parent_repos_root_url, parent_repos_uuid,
wb->db, local_abspath,
scratch_pool, iterpool));
/* Create a hash containing all children. The source hashes
don't all map the same types, but only the keys of the result
hash are subsequently used. */
SVN_ERR(svn_wc__db_read_children_info(&nodes, &conflicts,
wb->db, local_abspath,
scratch_pool, iterpool));
all_children = apr_hash_overlay(scratch_pool, nodes, dirents);
if (apr_hash_count(conflicts) > 0)
all_children = apr_hash_overlay(scratch_pool, conflicts, all_children);
/* Handle "this-dir" first. */
if (! skip_this_dir)
{
/* This code is not conditional on HAVE_SYMLINK as some systems that do
not allow creating symlinks (!HAVE_SYMLINK) can still encounter
symlinks (or in case of Windows also 'Junctions') created by other
methods.
Without this block a working copy in the root of a junction is
reported as an obstruction, because the junction itself is reported as
special.
Systems that have no symlink support at all, would always see
dirent->special as FALSE, so even there enabling this code shouldn't
produce problems.
*/
if (dirent->special)
{
svn_io_dirent2_t *this_dirent = svn_io_dirent2_dup(dirent, iterpool);
/* We're being pointed to "this-dir" via a symlink.
* Get the real node kind and pretend the path is not a symlink.
* This prevents send_status_structure() from treating this-dir
* as a directory obstructed by a file. */
SVN_ERR(svn_io_check_resolved_path(local_abspath,
&this_dirent->kind, iterpool));
this_dirent->special = FALSE;
SVN_ERR(send_status_structure(wb, local_abspath,
parent_repos_root_url,
parent_repos_relpath,
parent_repos_uuid,
dir_info, this_dirent, get_all,
status_func, status_baton,
iterpool));
}
else
SVN_ERR(send_status_structure(wb, local_abspath,
parent_repos_root_url,
parent_repos_relpath,
parent_repos_uuid,
dir_info, dirent, get_all,
status_func, status_baton,
iterpool));
}
/* If the requested depth is empty, we only need status on this-dir. */
if (depth == svn_depth_empty)
return SVN_NO_ERROR;
/* Walk all the children of this directory. */
sorted_children = svn_sort__hash(all_children,
svn_sort_compare_items_lexically,
scratch_pool);
for (i = 0; i < sorted_children->nelts; i++)
{
const void *key;
apr_ssize_t klen;
svn_sort__item_t item;
const char *child_abspath;
( run in 0.882 second using v1.01-cache-2.11-cpan-39bf76dae61 )