FreeBSD/contrib/subversion/subversion/libsvn_ra_serf/update.c
/* Close the file, handling loose ends and cleanup */
Close the file, handling loose ends and cleanup
Close the file handling loose ends and cleanup
static svn_error_t *
close_file(file_baton_t *file,
           apr_pool_t *scratch_pool)
{
  dir_baton_t *parent_dir = file->parent_dir;
  report_context_t *ctx = parent_dir->ctx;
  SVN_ERR(ensure_file_opened(file, scratch_pool));
  if (file->remove_props)
    {
      apr_hash_index_t *hi;
      for (hi = apr_hash_first(scratch_pool, file->remove_props);
           hi;
           hi = apr_hash_next(hi))
        {
          SVN_ERR(ctx->editor->change_file_prop(file->file_baton,
                                                apr_hash_this_key(hi),
                                                NULL ,
                                                scratch_pool));
        }
    }
  if (!ctx->add_props_included
      && file->lock_token && !file->found_lock_prop
      && SVN_IS_VALID_REVNUM(file->base_rev) )
    {
      SVN_ERR(ctx->editor->change_file_prop(file->file_baton,
                                            SVN_PROP_ENTRY_LOCK_TOKEN,
                                            NULL,
                                            scratch_pool));
    }
  if (file->url)
    {
      SVN_ERR(ctx->editor->change_file_prop(file->file_baton,
                                            SVN_RA_SERF__WC_CHECKED_IN_URL,
                                            svn_string_create(file->url,
                                                              scratch_pool),
                                            scratch_pool));
    }
  SVN_ERR(ctx->editor->close_file(file->file_baton,
                                  svn_checksum_to_cstring(
                                        file->final_md5_checksum,
                                        scratch_pool),
                                  scratch_pool));
  svn_pool_destroy(file->pool);
  SVN_ERR(maybe_close_dir(parent_dir)); 
  return SVN_NO_ERROR;
}
static svn_error_t * close_file ( file_baton_t * file , apr_pool_t * scratch_pool ) { dir_baton_t * parent_dir = file -> parent_dir ; report_context_t * ctx = parent_dir -> ctx ; SVN_ERR ( ensure_file_opened ( file , scratch_pool ) ) ; if ( file -> remove_props ) { apr_hash_index_t * hi ; for ( hi = apr_hash_first ( scratch_pool , file -> remove_props ) ; hi ; hi = apr_hash_next ( hi ) ) { SVN_ERR ( ctx -> editor -> change_file_prop ( file -> file_baton , apr_hash_this_key ( hi ) , NULL , scratch_pool ) ) ; } } if ( ! ctx -> add_props_included && file -> lock_token && ! file -> found_lock_prop && SVN_IS_VALID_REVNUM ( file -> base_rev ) ) { SVN_ERR ( ctx -> editor -> change_file_prop ( file -> file_baton , SVN_PROP_ENTRY_LOCK_TOKEN , NULL , scratch_pool ) ) ; } if ( file -> url ) { SVN_ERR ( ctx -> editor -> change_file_prop ( file -> file_baton , SVN_RA_SERF__WC_CHECKED_IN_URL , svn_string_create ( file -> url , scratch_pool ) , scratch_pool ) ) ; } SVN_ERR ( ctx -> editor -> close_file ( file -> file_baton , svn_checksum_to_cstring ( file -> final_md5_checksum , scratch_pool ) , scratch_pool ) ) ; svn_pool_destroy ( file -> pool ) ; SVN_ERR ( maybe_close_dir ( parent_dir ) ) ; return SVN_NO_ERROR ; }
Close the file, handling loose ends and cleanup
Close the file handling loose ends and cleanup
/* Set all of the properties we received */ /* value */ /* Check for lock information. */ /* This works around a bug in some older versions of mod_dav_svn in that it
   * will not send remove-prop in the update report when a lock property
   * disappears when send-all is false.

   ### Given that we only fetch props on additions, is this really necessary?
       Or is it covering up old local copy bugs where we copied locks to other
       paths? */ /* file_is_added */ /* Close the file via the editor. */ /* Remove reference */