<commit_before>/*
 * info.c:  return system-generated metadata about paths or URLs.
 *
 * ====================================================================
 * Copyright (c) 2000-2004 CollabNet.  All rights reserved.
 *
 * This software is licensed as described in the file COPYING, which
 * you should have received as part of this distribution.  The terms
 * are also available at http://subversion.tigris.org/license-1.html.
 * If newer versions of this license are posted there, you may use a
 * newer version instead, at your option.
 *
 * This software consists of voluntary contributions made by many
 * individuals.  For exact contribution history, see the revision
 * history and logs, available at http://subversion.tigris.org/.
 * ====================================================================
 */

/* ==================================================================== */



#include "client.h"
#include "svn_client.h"
#include "svn_wc.h"
#include "svn_pools.h"
#include "svn_path.h"

#include "svn_private_config.h"


/* Helper: build an svn_info_t *INFO struct from svn_dirent_t DIRENT,
   allocated in POOL.  Pointer fields are copied by reference, not dup'd. */
static svn_error_t *
build_info_from_dirent (svn_info_t **info,
                        const svn_dirent_t *dirent,
                        const char *URL,
                        svn_revnum_t revision,
                        const char *repos_UUID,
                        const char *repos_root,
                        apr_pool_t *pool)
{
  svn_info_t *i = apr_pcalloc (pool, sizeof(*i));

  i->URL                  = URL;
  i->rev                  = revision;
  i->kind                 = dirent->kind;
  i->repos_UUID           = repos_UUID;
  i->repos_root_URL       = repos_root;
  i->last_changed_rev     = dirent->created_rev;
  i->last_changed_date    = dirent->time;
  i->last_changed_author  = dirent->last_author;;
  
  *info = i;
  return SVN_NO_ERROR;
}


/* Helper: build an svn_info_t *INFO struct from svn_wc_entry_t ENTRY,
   allocated in POOL.  Pointer fields are copied by reference, not dup'd. */
static svn_error_t *
build_info_from_entry (svn_info_t **info,
                       const svn_wc_entry_t *entry,
                       apr_pool_t *pool)
{
  svn_info_t *i = apr_pcalloc (pool, sizeof(*i));

  i->URL                  = entry->url;
  i->rev                  = entry->revision;
  i->kind                 = entry->kind;
  i->repos_UUID           = entry->uuid;
  i->last_changed_rev     = entry->cmt_rev;
  i->last_changed_date    = entry->cmt_date;
  i->last_changed_author  = entry->cmt_author;
  
  /* entry-specific stuff */
  i->has_wc_info          = TRUE;
  i->schedule             = entry->schedule;
  i->copyfrom_url         = entry->copyfrom_url;
  i->copyfrom_rev         = entry->copyfrom_rev;
  i->text_time            = entry->text_time;
  i->prop_time            = entry->prop_time;
  i->checksum             = entry->checksum;
  i->conflict_old         = entry->conflict_old;
  i->conflict_new         = entry->conflict_new;
  i->conflict_wrk         = entry->conflict_wrk;
  i->prejfile             = entry->prejfile;

  *info = i;
  return SVN_NO_ERROR;
}


/* Helper func for recursively fetching svn_dirent_t's from a remote
   directory and pushing them at an info-receiver callback. */
static svn_error_t *<commit_msg>All those i's were making my eyes water...<commit_after>/*
 * info.c:  return system-generated metadata about paths or URLs.
 *
 * ====================================================================
 * Copyright (c) 2000-2004 CollabNet.  All rights reserved.
 *
 * This software is licensed as described in the file COPYING, which
 * you should have received as part of this distribution.  The terms
 * are also available at http://subversion.tigris.org/license-1.html.
 * If newer versions of this license are posted there, you may use a
 * newer version instead, at your option.
 *
 * This software consists of voluntary contributions made by many
 * individuals.  For exact contribution history, see the revision
 * history and logs, available at http://subversion.tigris.org/.
 * ====================================================================
 */

/* ==================================================================== */



#include "client.h"
#include "svn_client.h"
#include "svn_wc.h"
#include "svn_pools.h"
#include "svn_path.h"

#include "svn_private_config.h"


/* Helper: build an svn_info_t *INFO struct from svn_dirent_t DIRENT,
   allocated in POOL.  Pointer fields are copied by reference, not dup'd. */
static svn_error_t *
build_info_from_dirent (svn_info_t **info,
                        const svn_dirent_t *dirent,
                        const char *URL,
                        svn_revnum_t revision,
                        const char *repos_UUID,
                        const char *repos_root,
                        apr_pool_t *pool)
{
  svn_info_t *tmpinfo = apr_pcalloc (pool, sizeof(*tmpinfo));

  tmpinfo->URL                  = URL;
  tmpinfo->rev                  = revision;
  tmpinfo->kind                 = dirent->kind;
  tmpinfo->repos_UUID           = repos_UUID;
  tmpinfo->repos_root_URL       = repos_root;
  tmpinfo->last_changed_rev     = dirent->created_rev;
  tmpinfo->last_changed_date    = dirent->time;
  tmpinfo->last_changed_author  = dirent->last_author;;

  *info = tmpinfo;
  return SVN_NO_ERROR;
}


/* Helper: build an svn_info_t *INFO struct from svn_wc_entry_t ENTRY,
   allocated in POOL.  Pointer fields are copied by reference, not dup'd. */
static svn_error_t *
build_info_from_entry (svn_info_t **info,
                       const svn_wc_entry_t *entry,
                       apr_pool_t *pool)
{
  svn_info_t *tmpinfo = apr_pcalloc (pool, sizeof(*tmpinfo));

  tmpinfo->URL                  = entry->url;
  tmpinfo->rev                  = entry->revision;
  tmpinfo->kind                 = entry->kind;
  tmpinfo->repos_UUID           = entry->uuid;
  tmpinfo->last_changed_rev     = entry->cmt_rev;
  tmpinfo->last_changed_date    = entry->cmt_date;
  tmpinfo->last_changed_author  = entry->cmt_author;

  /* entry-specific stuff */
  tmpinfo->has_wc_info          = TRUE;
  tmpinfo->schedule             = entry->schedule;
  tmpinfo->copyfrom_url         = entry->copyfrom_url;
  tmpinfo->copyfrom_rev         = entry->copyfrom_rev;
  tmpinfo->text_time            = entry->text_time;
  tmpinfo->prop_time            = entry->prop_time;
  tmpinfo->checksum             = entry->checksum;
  tmpinfo->conflict_old         = entry->conflict_old;
  tmpinfo->conflict_new         = entry->conflict_new;
  tmpinfo->conflict_wrk         = entry->conflict_wrk;
  tmpinfo->prejfile             = entry->prejfile;

  *info = tmpinfo;
  return SVN_NO_ERROR;
}


/* Helper func for recursively fetching svn_dirent_t's from a remote
   directory and pushing them at an info-receiver callback. */
static svn_error_t *
{'fraction_non_alphanumeric': 0.15156317533496613, 'fraction_numerical': 0.002593286269989915, 'mean_word_length': 2.547266223811957, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 97, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1984785', 'n_tokens_mistral': 2179, 'n_tokens_neox': 2091, 'n_words': 525}