FreeBSD/contrib/subversion/subversion/libsvn_fs_x/revprops.c
/* Set the revision property list of revision REV in filesystem FS to
   PROPLIST.  Use SCRATCH_POOL for temporary allocations. */
Set the revision property list of revision REV in filesystem FS to
PROPLIST.  Use SCRATCH_POOL for temporary allocations.
Set the revision property list of revision REV in filesystem FS to PROPLIST . Use SCRATCH_POOL for temporary allocations .
svn_error_t *
svn_fs_x__set_revision_proplist(svn_fs_t *fs,
                                svn_revnum_t rev,
                                apr_hash_t *proplist,
                                apr_pool_t *scratch_pool)
{
  svn_boolean_t is_packed;
  svn_boolean_t bump_generation = FALSE;
  const char *final_path;
  const char *tmp_path;
  const char *perms_reference;
  apr_array_header_t *files_to_delete = NULL;
  SVN_ERR(svn_fs_x__ensure_revision_exists(rev, fs, scratch_pool));
  is_packed = svn_fs_x__is_packed_revprop(fs, rev);
  if (is_packed)
    {
      bump_generation = TRUE;
    }
  else
    {
      svn_node_kind_t kind;
      SVN_ERR(svn_io_check_path(svn_fs_x__path_revprops(fs, rev,
                                                        scratch_pool),
                                &kind, scratch_pool));
      bump_generation = kind != svn_node_none;
    }
  if (is_packed)
    SVN_ERR(write_packed_revprop(&final_path, &tmp_path, &files_to_delete,
                                 fs, rev, proplist, scratch_pool,
                                 scratch_pool));
  else
    SVN_ERR(write_non_packed_revprop(&final_path, &tmp_path,
                                     fs, rev, proplist, scratch_pool,
                                     scratch_pool));
  perms_reference = svn_fs_x__path_rev_absolute(fs, rev, scratch_pool);
  SVN_ERR(switch_to_new_revprop(fs, final_path, tmp_path, perms_reference,
                                files_to_delete, bump_generation,
                                scratch_pool));
  return SVN_NO_ERROR;
}
svn_error_t * svn_fs_x__set_revision_proplist ( svn_fs_t * fs , svn_revnum_t rev , apr_hash_t * proplist , apr_pool_t * scratch_pool ) { svn_boolean_t is_packed ; svn_boolean_t bump_generation = FALSE ; const char * final_path ; const char * tmp_path ; const char * perms_reference ; apr_array_header_t * files_to_delete = NULL ; SVN_ERR ( svn_fs_x__ensure_revision_exists ( rev , fs , scratch_pool ) ) ; is_packed = svn_fs_x__is_packed_revprop ( fs , rev ) ; if ( is_packed ) { bump_generation = TRUE ; } else { svn_node_kind_t kind ; SVN_ERR ( svn_io_check_path ( svn_fs_x__path_revprops ( fs , rev , scratch_pool ) , & kind , scratch_pool ) ) ; bump_generation = kind != svn_node_none ; } if ( is_packed ) SVN_ERR ( write_packed_revprop ( & final_path , & tmp_path , & files_to_delete , fs , rev , proplist , scratch_pool , scratch_pool ) ) ; else SVN_ERR ( write_non_packed_revprop ( & final_path , & tmp_path , fs , rev , proplist , scratch_pool , scratch_pool ) ) ; perms_reference = svn_fs_x__path_rev_absolute ( fs , rev , scratch_pool ) ; SVN_ERR ( switch_to_new_revprop ( fs , final_path , tmp_path , perms_reference , files_to_delete , bump_generation , scratch_pool ) ) ; return SVN_NO_ERROR ; }
Set the revision property list of revision REV in filesystem FS to
PROPLIST.
Set the revision property list of revision REV in filesystem FS to PROPLIST .
/* this info will not change while we hold the global FS write lock */ /* Test whether revprops already exist for this revision.
   * Only then will we need to bump the revprop generation.
   * The fact that they did not yet exist is never cached. */ /* Serialize the new revprop data */ /* We use the rev file of this revision as the perms reference,
   * because when setting revprops for the first time, the revprop
   * file won't exist and therefore can't serve as its own reference.
   * (Whereas the rev file should already exist at this point.)
   */ /* Now, switch to the new revprop data. */