Alien-SVN

 view release on metacpan or  search on metacpan

src/subversion/subversion/libsvn_client/list.c  view on Meta::CPAN


              /* Get the relevant entry. */
              dirent = svn_hash_gets(parent_ents, base_name);

              if (dirent)
                *dirent_p = svn_dirent_dup(dirent, pool);
              else
                *dirent_p = NULL;

              svn_pool_destroy(subpool); /* Close RA session */
            }
          else
            {
              /* We can't get the directory entry for the repository root,
                 but we can still get the information we want.
                 The created-rev of the repository root must, by definition,
                 be rev. */
              dirent = apr_palloc(pool, sizeof(*dirent));
              dirent->kind = kind;
              dirent->size = SVN_INVALID_FILESIZE;
              if (dirent_fields & SVN_DIRENT_HAS_PROPS)
                {
                  apr_hash_t *props;
                  SVN_ERR(svn_ra_get_dir2(ra_session, NULL, NULL, &props,
                                          "", rev, 0 /* no dirent fields */,
                                          pool));
                  dirent->has_props = (apr_hash_count(props) != 0);
                }
              dirent->created_rev = rev;
              if (dirent_fields & (SVN_DIRENT_TIME | SVN_DIRENT_LAST_AUTHOR))
                {
                  apr_hash_t *props;
                  svn_string_t *val;

                  SVN_ERR(svn_ra_rev_proplist(ra_session, rev, &props,
                                              pool));
                  val = svn_hash_gets(props, SVN_PROP_REVISION_DATE);
                  if (val)
                    SVN_ERR(svn_time_from_cstring(&dirent->time, val->data,
                                                  pool));
                  else
                    dirent->time = 0;

                  val = svn_hash_gets(props, SVN_PROP_REVISION_AUTHOR);
                  dirent->last_author = val ? val->data : NULL;
                }

              *dirent_p = dirent;
            }
        }
      else
        *dirent_p = NULL;
    }
  else
    SVN_ERR(err);

  return SVN_NO_ERROR;
}

/* List the file/directory entries for PATH_OR_URL at REVISION.
   The actual node revision selected is determined by the path as
   it exists in PEG_REVISION.

   If DEPTH is svn_depth_infinity, then list all file and directory entries
   recursively.  Else if DEPTH is svn_depth_files, list all files under
   PATH_OR_URL (if any), but not subdirectories.  Else if DEPTH is
   svn_depth_immediates, list all files and include immediate
   subdirectories (at svn_depth_empty).  Else if DEPTH is
   svn_depth_empty, just list PATH_OR_URL with none of its entries.

   DIRENT_FIELDS controls which fields in the svn_dirent_t's are
   filled in.  To have them totally filled in use SVN_DIRENT_ALL,
   otherwise simply bitwise OR together the combination of SVN_DIRENT_*
   fields you care about.

   If FETCH_LOCKS is TRUE, include locks when reporting directory entries.

   If INCLUDE_EXTERNALS is TRUE, also list all external items
   reached by recursion.  DEPTH value passed to the original list target
   applies for the externals also.  EXTERNAL_PARENT_URL is url of the
   directory which has the externals definitions.  EXTERNAL_TARGET is the
   target subdirectory of externals definitions.

   Report directory entries by invoking LIST_FUNC/BATON.
   Pass EXTERNAL_PARENT_URL and EXTERNAL_TARGET to LIST_FUNC when external
   items are listed, otherwise both are set to NULL.

   Use authentication baton cached in CTX to authenticate against the
   repository.

   Use POOL for all allocations.
*/
static svn_error_t *
list_internal(const char *path_or_url,
              const svn_opt_revision_t *peg_revision,
              const svn_opt_revision_t *revision,
              svn_depth_t depth,
              apr_uint32_t dirent_fields,
              svn_boolean_t fetch_locks,
              svn_boolean_t include_externals,
              const char *external_parent_url,
              const char *external_target,
              svn_client_list_func2_t list_func,
              void *baton,
              svn_client_ctx_t *ctx,
              apr_pool_t *pool)
{
  svn_ra_session_t *ra_session;
  svn_client__pathrev_t *loc;
  svn_dirent_t *dirent;
  const char *fs_path;
  svn_error_t *err;
  apr_hash_t *locks;
  apr_hash_t *externals;

  if (include_externals)
    externals = apr_hash_make(pool);
  else
    externals = NULL;

  /* We use the kind field to determine if we should recurse, so we



( run in 0.438 second using v1.01-cache-2.11-cpan-d0baa829c65 )