Alien-SVN

 view release on metacpan or  search on metacpan

src/subversion/subversion/libsvn_ra_serf/property.c  view on Meta::CPAN

  SVN_ERR(svn_ra_serf__deliver_props(&handler, *results, sess, conn, url,
                                     rev, depth, props, NULL, result_pool));
  SVN_ERR(svn_ra_serf__wait_for_props(handler, scratch_pool));

  return SVN_NO_ERROR;
}


svn_error_t *
svn_ra_serf__fetch_node_props(apr_hash_t **results,
                              svn_ra_serf__connection_t *conn,
                              const char *url,
                              svn_revnum_t revision,
                              const svn_ra_serf__dav_props_t *which_props,
                              apr_pool_t *result_pool,
                              apr_pool_t *scratch_pool)
{
  apr_hash_t *multiprops;
  apr_hash_t *ver_props;

  /* Note: a couple extra hash tables and whatnot get into RESULT_POOL.
     Not a big deal at this point. Theoretically, we could fetch all
     props into SCRATCH_POOL, then copy just the REVISION/URL props
     into RESULT_POOL. Too much work for too little gain...  */
  SVN_ERR(svn_ra_serf__retrieve_props(&multiprops, conn->session, conn,
                                      url, revision, "0", which_props,
                                      result_pool, scratch_pool));

  ver_props = apr_hash_get(multiprops, &revision, sizeof(revision));
  if (ver_props != NULL)
    {
      *results = svn_hash_gets(ver_props, url);
      if (*results != NULL)
        return SVN_NO_ERROR;
    }

  return svn_error_create(SVN_ERR_RA_DAV_PROPS_NOT_FOUND, NULL,
                          _("The PROPFIND response did not include "
                            "the requested properties"));
}


svn_error_t *
svn_ra_serf__walk_node_props(apr_hash_t *props,
                             svn_ra_serf__walker_visitor_t walker,
                             void *baton,
                             apr_pool_t *scratch_pool)
{
  apr_pool_t *iterpool;
  apr_hash_index_t *ns_hi;

  iterpool = svn_pool_create(scratch_pool);
  for (ns_hi = apr_hash_first(scratch_pool, props); ns_hi;
       ns_hi = apr_hash_next(ns_hi))
    {
      void *ns_val;
      const void *ns_name;
      apr_hash_index_t *name_hi;

      /* NOTE: We do not clear ITERPOOL in this loop. Generally, there are
           very few namespaces, so this loop will not have many iterations.
           Instead, ITERPOOL is used for the inner loop.  */

      apr_hash_this(ns_hi, &ns_name, NULL, &ns_val);

      for (name_hi = apr_hash_first(scratch_pool, ns_val); name_hi;
           name_hi = apr_hash_next(name_hi))
        {
          void *prop_val;
          const void *prop_name;

          /* See note above, regarding clearing of this pool.  */
          svn_pool_clear(iterpool);

          apr_hash_this(name_hi, &prop_name, NULL, &prop_val);

          SVN_ERR(walker(baton, ns_name, prop_name, prop_val, iterpool));
        }
    }
  svn_pool_destroy(iterpool);

  return SVN_NO_ERROR;
}


svn_error_t *
svn_ra_serf__walk_all_props(apr_hash_t *props,
                            const char *name,
                            svn_revnum_t rev,
                            svn_ra_serf__walker_visitor_t walker,
                            void *baton,
                            apr_pool_t *scratch_pool)
{
  apr_hash_t *ver_props;
  apr_hash_t *path_props;

  ver_props = apr_hash_get(props, &rev, sizeof(rev));
  if (!ver_props)
    return SVN_NO_ERROR;

  path_props = svn_hash_gets(ver_props, name);
  if (!path_props)
    return SVN_NO_ERROR;

  return svn_error_trace(svn_ra_serf__walk_node_props(path_props,
                                                      walker, baton,
                                                      scratch_pool));
}


svn_error_t *
svn_ra_serf__walk_all_paths(apr_hash_t *props,
                            svn_revnum_t rev,
                            svn_ra_serf__path_rev_walker_t walker,
                            void *baton,
                            apr_pool_t *pool)
{
  apr_hash_index_t *path_hi;
  apr_hash_t *ver_props;

  ver_props = apr_hash_get(props, &rev, sizeof(rev));



( run in 0.981 second using v1.01-cache-2.11-cpan-71847e10f99 )