FreeBSD/contrib/subversion/subversion/libsvn_repos/dump.c
/* Return an error when PATH in REVISION does not exist or is of a
   different kind than EXPECTED_KIND.  If the latter is svn_node_unknown,
   skip that check.  Use EB for context information.  If REVISION is the
   current revision, use EB's path tracker to follow renames, deletions,
   etc.

   Use SCRATCH_POOL for temporary allocations.
   No-op if EB's path tracker has not been initialized.
 */
Return an error when PATH in REVISION does not exist or is of a
different kind than EXPECTED_KIND.  If the latter is svn_node_unknown,
skip that check.  Use EB for context information.  If REVISION is the
current revision, use EB's path tracker to follow renames, deletions,
etc.

Use SCRATCH_POOL for temporary allocations.
No-op if EB's path tracker has not been initialized.
Return an error when PATH in REVISION does not exist or is of a different kind than EXPECTED_KIND . If the latter is svn_node_unknown skip that check . Use EB for context information . If REVISION is the current revision use EB ' s path tracker to follow renames deletions etc . Use SCRATCH_POOL for temporary allocations . No - op if EB ' s path tracker has not been initialized .
static svn_error_t *
node_must_exist(struct edit_baton *eb,
                const char *path,
                svn_revnum_t revision,
                svn_node_kind_t expected_kind,
                apr_pool_t *scratch_pool)
{
  svn_node_kind_t kind = svn_node_none;
  if (eb->path_tracker == NULL)
    return SVN_NO_ERROR;
  if (revision == eb->path_tracker->revision)
    tracker_lookup(&path, &revision, eb->path_tracker, path, scratch_pool);
  if (path)
    SVN_ERR(fetch_kind_func(&kind, eb, path, revision, scratch_pool));
  if (kind == svn_node_none)
    return svn_error_createf(SVN_ERR_FS_NOT_FOUND, NULL,
                             _("Path '%s' not found in r%ld."),
                             path, revision);
  if (expected_kind != kind && expected_kind != svn_node_unknown)
    return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
                             _("Unexpected node kind %d for '%s' at r%ld. "
                               "Expected kind was %d."),
                             kind, path, revision, expected_kind);
  return SVN_NO_ERROR;
}
static svn_error_t * node_must_exist ( struct edit_baton * eb , const char * path , svn_revnum_t revision , svn_node_kind_t expected_kind , apr_pool_t * scratch_pool ) { svn_node_kind_t kind = svn_node_none ; if ( eb -> path_tracker == NULL ) return SVN_NO_ERROR ; if ( revision == eb -> path_tracker -> revision ) tracker_lookup ( & path , & revision , eb -> path_tracker , path , scratch_pool ) ; if ( path ) SVN_ERR ( fetch_kind_func ( & kind , eb , path , revision , scratch_pool ) ) ; if ( kind == svn_node_none ) return svn_error_createf ( SVN_ERR_FS_NOT_FOUND , NULL , _ ( " " ) , path , revision ) ; if ( expected_kind != kind && expected_kind != svn_node_unknown ) return svn_error_createf ( SVN_ERR_NODE_UNEXPECTED_KIND , NULL , _ ( " " " " ) , kind , path , revision , expected_kind ) ; return SVN_NO_ERROR ; }
Return an error when PATH in REVISION does not exist or is of a
different kind than EXPECTED_KIND.
Return an error when PATH in REVISION does not exist or is of a different kind than EXPECTED_KIND .
/* in case the caller is trying something stupid ... */ /* paths pertaining to the revision currently being processed must
     be translated / checked using our path tracker. */ /* determine the node type (default: no such node) */ /* check results */