Alien-SVN

 view release on metacpan or  search on metacpan

src/subversion/subversion/libsvn_wc/entries.c  view on Meta::CPAN

                                                          scratch_pool);
              if (relpath == NULL || *relpath == '\0')
                base_node->repos_relpath = entry->name;
              else
                base_node->repos_relpath =
                  svn_dirent_join(relpath, entry->name, result_pool);
            }
        }

      /* TODO: These values should always be present, if they are missing
         during an upgrade, set a flag, and then ask the user to talk to the
         server.

         Note: cmt_rev is the distinguishing value. The others may be 0 or
         NULL if the corresponding revprop has been deleted.  */
      base_node->changed_rev = entry->cmt_rev;
      base_node->changed_date = entry->cmt_date;
      base_node->changed_author = entry->cmt_author;

      if (entry->file_external_path)
        base_node->file_external = TRUE;

      /* Switched nodes get an empty iprops cache. */
      if (parent_node
          && is_switched(parent_node->base, base_node, scratch_pool))
        base_node->inherited_props
          = apr_array_make(scratch_pool, 0, sizeof(svn_prop_inherited_item_t*));

      SVN_ERR(insert_node(sdb, base_node, scratch_pool));

      /* We have to insert the lock after the base node, because the node
         must exist to lookup various bits of repos related information for
         the abs path. */
      if (entry->lock_token && create_locks)
        {
          svn_wc__db_lock_t lock;

          lock.token = entry->lock_token;
          lock.owner = entry->lock_owner;
          lock.comment = entry->lock_comment;
          lock.date = entry->lock_creation_date;

          SVN_ERR(svn_wc__db_lock_add(db, tmp_entry_abspath, &lock,
                                      scratch_pool));
        }
    }

  if (below_working_node)
    {
      db_node_t *work
        = parent_node->below_work ? parent_node->below_work : parent_node->work;

      below_working_node->wc_id = wc_id;
      below_working_node->local_relpath = local_relpath;
      below_working_node->op_depth = work->op_depth;
      below_working_node->parent_relpath = parent_relpath;
      below_working_node->presence = svn_wc__db_status_normal;
      below_working_node->kind = entry->kind;
      below_working_node->repos_id = work->repos_id;

      /* This is just guessing. If the node below would have been switched
         or if it was updated to a different version, the guess would
         fail. But we don't have better information pre wc-ng :( */
      if (work->repos_relpath)
        below_working_node->repos_relpath
          = svn_relpath_join(work->repos_relpath, entry->name,
                             result_pool);
      else
        below_working_node->repos_relpath = NULL;
      below_working_node->revision = parent_node->work->revision;

      /* The revert_base checksum isn't available in the entry structure,
         so the caller provides it. */

      /* text_base_info is NULL for files scheduled to be added. */
      below_working_node->checksum = NULL;
      if (text_base_info)
        {
          if (entry->schedule == svn_wc_schedule_delete)
            below_working_node->checksum =
              text_base_info->normal_base.sha1_checksum;
          else
            below_working_node->checksum =
              text_base_info->revert_base.sha1_checksum;
        }
      below_working_node->recorded_size = 0;
      below_working_node->changed_rev = SVN_INVALID_REVNUM;
      below_working_node->changed_date = 0;
      below_working_node->changed_author = NULL;
      below_working_node->depth = svn_depth_infinity;
      below_working_node->recorded_time = 0;
      below_working_node->properties = NULL;

      if (working_node
          && entry->schedule == svn_wc_schedule_delete
          && working_node->repos_relpath)
        {
          /* We are lucky, our guesses above are not necessary. The known
             correct information is in working. But our op_depth design
             expects more information here */
          below_working_node->repos_relpath = working_node->repos_relpath;
          below_working_node->repos_id = working_node->repos_id;
          below_working_node->revision = working_node->revision;

          /* Nice for 'svn status' */
          below_working_node->changed_rev = entry->cmt_rev;
          below_working_node->changed_date = entry->cmt_date;
          below_working_node->changed_author = entry->cmt_author;

          /* And now remove it from WORKING, because in wc-ng code
             should read it from the lower layer */
          working_node->repos_relpath = NULL;
          working_node->repos_id = 0;
          working_node->revision = SVN_INVALID_REVNUM;
        }

      SVN_ERR(insert_node(sdb, below_working_node, scratch_pool));
    }

  /* Insert the working node. */
  if (working_node)
    {
      working_node->wc_id = wc_id;
      working_node->local_relpath = local_relpath;
      working_node->parent_relpath = parent_relpath;
      working_node->changed_rev = SVN_INVALID_REVNUM;
      working_node->recorded_time = entry->text_time;
      working_node->recorded_size = entry->working_size;

      if (entry->depth != svn_depth_exclude)
        working_node->depth = entry->depth;
      else
        {
          working_node->presence = svn_wc__db_status_excluded;
          working_node->depth = svn_depth_infinity;
        }

      if (entry->kind == svn_node_dir)
        working_node->checksum = NULL;
      else
        {
          working_node->checksum = NULL;
          /* text_base_info is NULL for files scheduled to be added. */
          if (text_base_info)
            working_node->checksum = text_base_info->normal_base.sha1_checksum;


          /* If an MD5 checksum is present in the entry, we can verify that
           * it matches the MD5 of the base file we found earlier. */
#ifdef SVN_DEBUG
          if (entry->checksum && text_base_info)
          {
            svn_checksum_t *md5_checksum;
            SVN_ERR(svn_checksum_parse_hex(&md5_checksum, svn_checksum_md5,
                                           entry->checksum, result_pool));
            SVN_ERR_ASSERT(
              md5_checksum && text_base_info->normal_base.md5_checksum);
            SVN_ERR_ASSERT(svn_checksum_match(



( run in 1.431 second using v1.01-cache-2.11-cpan-63c85eba8c4 )