FreeBSD/contrib/subversion/subversion/libsvn_wc/adm_ops.c
/* Schedule the single node at LOCAL_ABSPATH, of kind KIND, for addition in
 * its parent directory in the WC.  It will have the regular properties
 * provided in PROPS, or none if that is NULL.
 *
 * If the node is a file, set its on-disk executable and read-only bits to
 * match its properties and lock state,
 * ### only if it has an svn:executable or svn:needs-lock property.
 * ### This is to match the previous behaviour of setting its props
 *     afterwards by calling svn_wc_prop_set4(), but is not very clean.
 *
 * Sync the on-disk executable and read-only bits accordingly.
 */
Schedule the single node at LOCAL_ABSPATH, of kind KIND, for addition in
its parent directory in the WC.  It will have the regular properties
provided in PROPS, or none if that is NULL.

If the node is a file, set its on-disk executable and read-only bits to
match its properties and lock state,
only if it has an svn:executable or svn:needs-lock property.
This is to match the previous behaviour of setting its props
afterwards by calling svn_wc_prop_set4(), but is not very clean.

Sync the on-disk executable and read-only bits accordingly.
Schedule the single node at LOCAL_ABSPATH of kind KIND for addition in its parent directory in the WC . It will have the regular properties provided in PROPS or none if that is NULL . If the node is a file set its on - disk executable and read - only bits to match its properties and lock state only if it has an svn : executable or svn : needs - lock property . This is to match the previous behaviour of setting its props afterwards by calling svn_wc_prop_set4 () but is not very clean . Sync the on - disk executable and read - only bits accordingly .
static svn_error_t *
add_from_disk(svn_wc__db_t *db,
              const char *local_abspath,
              svn_node_kind_t kind,
              const apr_hash_t *props,
              apr_pool_t *scratch_pool)
{
  if (kind == svn_node_file)
    {
      svn_skel_t *work_item = NULL;
      if (props && (svn_prop_get_value(props, SVN_PROP_EXECUTABLE)
                    || svn_prop_get_value(props, SVN_PROP_NEEDS_LOCK)))
        SVN_ERR(svn_wc__wq_build_sync_file_flags(&work_item, db, local_abspath,
                                                 scratch_pool, scratch_pool));
      SVN_ERR(svn_wc__db_op_add_file(db, local_abspath, props, work_item,
                                     scratch_pool));
      if (work_item)
        SVN_ERR(svn_wc__wq_run(db, local_abspath, NULL, NULL, scratch_pool));
    }
  else
    {
      SVN_ERR(svn_wc__db_op_add_directory(db, local_abspath, props, NULL,
                                          scratch_pool));
    }
  return SVN_NO_ERROR;
}
static svn_error_t * add_from_disk ( svn_wc__db_t * db , const char * local_abspath , svn_node_kind_t kind , const apr_hash_t * props , apr_pool_t * scratch_pool ) { if ( kind == svn_node_file ) { svn_skel_t * work_item = NULL ; if ( props && ( svn_prop_get_value ( props , SVN_PROP_EXECUTABLE ) || svn_prop_get_value ( props , SVN_PROP_NEEDS_LOCK ) ) ) SVN_ERR ( svn_wc__wq_build_sync_file_flags ( & work_item , db , local_abspath , scratch_pool , scratch_pool ) ) ; SVN_ERR ( svn_wc__db_op_add_file ( db , local_abspath , props , work_item , scratch_pool ) ) ; if ( work_item ) SVN_ERR ( svn_wc__wq_run ( db , local_abspath , NULL , NULL , scratch_pool ) ) ; } else { SVN_ERR ( svn_wc__db_op_add_directory ( db , local_abspath , props , NULL , scratch_pool ) ) ; } return SVN_NO_ERROR ; }
Schedule the single node at LOCAL_ABSPATH, of kind KIND, for addition in
 its parent directory in the WC.
Schedule the single node at LOCAL_ABSPATH of kind KIND for addition in its parent directory in the WC .