/* An svn_wc_entry_callbacks2_t callback function. */ static svn_error_t * info_found_entry_callback(const char *path, const svn_wc_entry_t *entry, void *walk_baton, apr_pool_t *pool) { struct found_entry_baton *fe_baton = walk_baton; /* We're going to receive dirents twice; we want to ignore the first one (where it's a child of a parent dir), and only print the second one (where we're looking at THIS_DIR.) */ if ((entry->kind == svn_node_dir) && (strcmp(entry->name, SVN_WC_ENTRY_THIS_DIR))) return SVN_NO_ERROR; if (SVN_WC__CL_MATCH(fe_baton->changelist_hash, entry)) { svn_info_t *info; svn_wc_adm_access_t *adm_access; SVN_ERR(build_info_from_entry(&info, entry, path, pool)); SVN_ERR(svn_wc_adm_probe_try3(&adm_access, fe_baton->adm_access, path, FALSE /* read-only */, 0 /* levels */, NULL, NULL, pool)); SVN_ERR(svn_wc__get_tree_conflict(&info->tree_conflict, path, adm_access, pool)); SVN_ERR(fe_baton->receiver(fe_baton->receiver_baton, path, info, pool)); } return SVN_NO_ERROR; }
/* Helper function: push the svn_wc_entry_t for WCPATH at RECEIVER/BATON, and possibly recurse over more entries. */ static svn_error_t * crawl_entries(const char *wcpath, svn_info_receiver_t receiver, void *receiver_baton, svn_depth_t depth, apr_hash_t *changelist_hash, svn_client_ctx_t *ctx, apr_pool_t *pool) { svn_wc_adm_access_t *adm_access; const svn_wc_entry_t *entry; int adm_lock_level = SVN_WC__LEVELS_TO_LOCK_FROM_DEPTH(depth); SVN_ERR(svn_wc_adm_probe_open3(&adm_access, NULL, wcpath, FALSE, adm_lock_level, ctx->cancel_func, ctx->cancel_baton, pool)); SVN_ERR(svn_wc__entry_versioned(&entry, wcpath, adm_access, FALSE, pool)); if (entry->kind == svn_node_file) { if (SVN_WC__CL_MATCH(changelist_hash, entry)) { svn_info_t *info; SVN_ERR(build_info_from_entry(&info, entry, pool)); return receiver(receiver_baton, wcpath, info, pool); } } else if (entry->kind == svn_node_dir) { struct found_entry_baton fe_baton; fe_baton.changelist_hash = changelist_hash; fe_baton.receiver = receiver; fe_baton.receiver_baton = receiver_baton; SVN_ERR(svn_wc_walk_entries3(wcpath, adm_access, &entry_walk_callbacks, &fe_baton, depth, FALSE, ctx->cancel_func, ctx->cancel_baton, pool)); } return SVN_NO_ERROR; }
static svn_error_t * info_found_entry_callback(const char *path, const svn_wc_entry_t *entry, void *walk_baton, apr_pool_t *pool) { struct found_entry_baton *fe_baton = walk_baton; /* We're going to receive dirents twice; we want to ignore the first one (where it's a child of a parent dir), and only print the second one (where we're looking at THIS_DIR.) */ if ((entry->kind == svn_node_dir) && (strcmp(entry->name, SVN_WC_ENTRY_THIS_DIR))) return SVN_NO_ERROR; if (SVN_WC__CL_MATCH(fe_baton->changelist_hash, entry)) { svn_info_t *info; SVN_ERR(build_info_from_entry(&info, entry, pool)); SVN_ERR(fe_baton->receiver(fe_baton->receiver_baton, path, info, pool)); } return SVN_NO_ERROR; }