예제 #1
0
/* 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;
}
예제 #2
0
파일: info.c 프로젝트: vocho/openqnx
/* 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;
}
예제 #3
0
파일: info.c 프로젝트: vocho/openqnx
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;
}
예제 #4
0
파일: status.c 프로젝트: aosm/subversion
/* A status callback function which wraps the *real* status
   function/baton.   This sucker takes care of any status tweaks we
   need to make (such as noting that the target of the status is
   missing from HEAD in the repository).

   This implements the 'svn_wc_status_func3_t' function type. */
static svn_error_t *
tweak_status(void *baton,
             const char *path,
             svn_wc_status2_t *status,
             apr_pool_t *pool)
{
  struct status_baton *sb = baton;

  /* If we know that the target was deleted in HEAD of the repository,
     we need to note that fact in all the status structures that come
     through here. */
  if (sb->deleted_in_repos)
    status->repos_text_status = svn_wc_status_deleted;

  /* If the status item has an entry, but doesn't belong to one of the
     changelists our caller is interested in, we filter our this status
     transmission.  */
  if (! SVN_WC__CL_MATCH(sb->changelist_hash, status->entry))
    return SVN_NO_ERROR;

  /* Call the real status function/baton. */
  return sb->real_status_func(sb->real_status_baton, path, status, pool);
}