FreeBSD/contrib/subversion/subversion/libsvn_client/diff.c
/* Calculate the repository relative path of DIFF_RELPATH, using
 * SESSION_RELPATH and WC_CTX, and return the result in *REPOS_RELPATH.
 * ORIG_TARGET is the related original target passed to the diff command,
 * and may be used to derive leading path components missing from PATH.
 * ANCHOR is the local path where the diff editor is anchored.
 * Do all allocations in POOL. */
Calculate the repository relative path of DIFF_RELPATH, using
SESSION_RELPATH and WC_CTX, and return the result in *REPOS_RELPATH.
ORIG_TARGET is the related original target passed to the diff command,
and may be used to derive leading path components missing from PATH.
ANCHOR is the local path where the diff editor is anchored.
Do all allocations in POOL.
Calculate the repository relative path of DIFF_RELPATH using SESSION_RELPATH and WC_CTX and return the result in * REPOS_RELPATH . ORIG_TARGET is the related original target passed to the diff command and may be used to derive leading path components missing from PATH . ANCHOR is the local path where the diff editor is anchored . Do all allocations in POOL .
static svn_error_t *
make_repos_relpath(const char **repos_relpath,
                   const char *diff_relpath,
                   const char *orig_target,
                   const char *session_relpath,
                   svn_wc_context_t *wc_ctx,
                   const char *anchor,
                   apr_pool_t *result_pool,
                   apr_pool_t *scratch_pool)
{
  const char *local_abspath;
  if (! session_relpath
      || (anchor && !svn_path_is_url(orig_target)))
    {
      svn_error_t *err;
      SVN_ERR(svn_dirent_get_absolute(&local_abspath,
                                      svn_dirent_join(anchor, diff_relpath,
                                                      scratch_pool),
                                      scratch_pool));
      err = svn_wc__node_get_repos_info(NULL, repos_relpath, NULL, NULL,
                                        wc_ctx, local_abspath,
                                        result_pool, scratch_pool);
      if (!session_relpath
          || ! err
          || (err && err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND))
        {
           return svn_error_trace(err);
        }
      svn_error_clear(err);
    }
  *repos_relpath = svn_relpath_join(session_relpath, diff_relpath,
                                    result_pool);
  return SVN_NO_ERROR;
}
static svn_error_t * make_repos_relpath ( const char * * repos_relpath , const char * diff_relpath , const char * orig_target , const char * session_relpath , svn_wc_context_t * wc_ctx , const char * anchor , apr_pool_t * result_pool , apr_pool_t * scratch_pool ) { const char * local_abspath ; if ( ! session_relpath || ( anchor && ! svn_path_is_url ( orig_target ) ) ) { svn_error_t * err ; SVN_ERR ( svn_dirent_get_absolute ( & local_abspath , svn_dirent_join ( anchor , diff_relpath , scratch_pool ) , scratch_pool ) ) ; err = svn_wc__node_get_repos_info ( NULL , repos_relpath , NULL , NULL , wc_ctx , local_abspath , result_pool , scratch_pool ) ; if ( ! session_relpath || ! err || ( err && err -> apr_err != SVN_ERR_WC_PATH_NOT_FOUND ) ) { return svn_error_trace ( err ) ; } svn_error_clear ( err ) ; } * repos_relpath = svn_relpath_join ( session_relpath , diff_relpath , result_pool ) ; return SVN_NO_ERROR ; }
Calculate the repository relative path of DIFF_RELPATH, using
 SESSION_RELPATH and WC_CTX, and return the result in *REPOS_RELPATH.
Calculate the repository relative path of DIFF_RELPATH using SESSION_RELPATH and WC_CTX and return the result in * REPOS_RELPATH .
/* We're doing a WC-WC diff, so we can retrieve all information we
       * need from the working copy. */ /* The path represents a local working copy path, but does not
         exist. Fall through to calculate an in-repository location
         based on the ra session */ /* ### Maybe we should use the nearest existing ancestor instead? */