FreeBSD/contrib/subversion/subversion/libsvn_fs_fs/hotcopy.c
/* Like svn_io_dir_file_copy(), but doesn't copy files that exist at
 * the destination and do not differ in terms of kind, size, and mtime.
 * Set *SKIPPED_P to FALSE only if the file was copied, do not change
 * the value in *SKIPPED_P otherwise. SKIPPED_P may be NULL if not
 * required. */
Like svn_io_dir_file_copy(), but doesn't copy files that exist at
the destination and do not differ in terms of kind, size, and mtime.
Set *SKIPPED_P to FALSE only if the file was copied, do not change
the value in *SKIPPED_P otherwise. SKIPPED_P may be NULL if not
required.
Like svn_io_dir_file_copy () but doesn ' t copy files that exist at the destination and do not differ in terms of kind size and mtime . Set * SKIPPED_P to FALSE only if the file was copied do not change the value in * SKIPPED_P otherwise . SKIPPED_P may be NULL if not required .
static svn_error_t *
hotcopy_io_dir_file_copy(svn_boolean_t *skipped_p,
                         const char *src_path,
                         const char *dst_path,
                         const char *file,
                         apr_pool_t *scratch_pool)
{
  const svn_io_dirent2_t *src_dirent;
  const svn_io_dirent2_t *dst_dirent;
  const char *src_target;
  const char *dst_target;
  dst_target = svn_dirent_join(dst_path, file, scratch_pool);
  SVN_ERR(svn_io_stat_dirent2(&dst_dirent, dst_target, FALSE, TRUE,
                              scratch_pool, scratch_pool));
  if (dst_dirent->kind != svn_node_none)
    {
      src_target = svn_dirent_join(src_path, file, scratch_pool);
      SVN_ERR(svn_io_stat_dirent2(&src_dirent, src_target, FALSE, FALSE,
                                  scratch_pool, scratch_pool));
      if (src_dirent->kind == dst_dirent->kind &&
          src_dirent->special == dst_dirent->special &&
          src_dirent->filesize == dst_dirent->filesize &&
          src_dirent->mtime <= dst_dirent->mtime)
        return SVN_NO_ERROR;
    }
  if (skipped_p)
    *skipped_p = FALSE;
  return svn_error_trace(svn_io_dir_file_copy(src_path, dst_path, file,
                                              scratch_pool));
}
static svn_error_t * hotcopy_io_dir_file_copy ( svn_boolean_t * skipped_p , const char * src_path , const char * dst_path , const char * file , apr_pool_t * scratch_pool ) { const svn_io_dirent2_t * src_dirent ; const svn_io_dirent2_t * dst_dirent ; const char * src_target ; const char * dst_target ; dst_target = svn_dirent_join ( dst_path , file , scratch_pool ) ; SVN_ERR ( svn_io_stat_dirent2 ( & dst_dirent , dst_target , FALSE , TRUE , scratch_pool , scratch_pool ) ) ; if ( dst_dirent -> kind != svn_node_none ) { src_target = svn_dirent_join ( src_path , file , scratch_pool ) ; SVN_ERR ( svn_io_stat_dirent2 ( & src_dirent , src_target , FALSE , FALSE , scratch_pool , scratch_pool ) ) ; if ( src_dirent -> kind == dst_dirent -> kind && src_dirent -> special == dst_dirent -> special && src_dirent -> filesize == dst_dirent -> filesize && src_dirent -> mtime <= dst_dirent -> mtime ) return SVN_NO_ERROR ; } if ( skipped_p ) * skipped_p = FALSE ; return svn_error_trace ( svn_io_dir_file_copy ( src_path , dst_path , file , scratch_pool ) ) ; }
Like svn_io_dir_file_copy(), but doesn't copy files that exist at
 the destination and do not differ in terms of kind, size, and mtime.
Like svn_io_dir_file_copy () but doesn ' t copy files that exist at the destination and do not differ in terms of kind size and mtime .
/* Does the destination already exist? If not, we must copy it. */ /* If the destination's stat information indicates that the file
       * is equal to the source, don't bother copying the file again. */