Author: rhuijben
Date: Thu Nov 29 14:00:05 2012
New Revision: 1415167
URL: http://svn.apache.org/viewvc?rev=1415167&view=rev
Log:
Update convention of arguments of an internal helper to avoid path
calculations.
* subversion/libsvn_client/mergeinfo.c
(svn_client__elide_mergeinfo): Assume arguments are abspaths.
* subversion/libsvn_client/mergeinfo.h
(svn_client__elide_mergeinfo): Document arguments are abspaths.
Modified:
subversion/trunk/subversion/libsvn_client/mergeinfo.c
subversion/trunk/subversion/libsvn_client/mergeinfo.h
Modified: subversion/trunk/subversion/libsvn_client/mergeinfo.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/mergeinfo.c?rev=1415167&r1=1415166&r2=1415167&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_client/mergeinfo.c Thu Nov 29 14:00:05
2012
@@ -911,18 +911,15 @@ elide_mergeinfo(svn_mergeinfo_t parent_m
svn_error_t *
-svn_client__elide_mergeinfo(const char *target_wcpath,
- const char *wc_elision_limit_path,
+svn_client__elide_mergeinfo(const char *target_abspath,
+ const char *wc_elision_limit_abspath,
svn_client_ctx_t *ctx,
apr_pool_t *pool)
{
- const char *target_abspath;
- const char *limit_abspath = NULL;
+ const char *limit_abspath = wc_elision_limit_abspath;
- SVN_ERR(svn_dirent_get_absolute(&target_abspath, target_wcpath, pool));
- if (wc_elision_limit_path)
- SVN_ERR(svn_dirent_get_absolute(&limit_abspath, wc_elision_limit_path,
- pool));
+ SVN_ERR_ASSERT(svn_dirent_is_absolute(target_abspath));
+ SVN_ERR_ASSERT(!wc_elision_limit_abspath ||
svn_dirent_is_absolute(wc_elision_limit_abspath));
/* Check for first easy out: We are already at the limit path. */
if (!limit_abspath
@@ -985,12 +982,12 @@ svn_client__elide_mergeinfo(const char *
/* If TARGET_WCPATH inherited no mergeinfo from the WC and we are
not limiting our search to the working copy then check if it
inherits any from the repos. */
- if (!mergeinfo && !wc_elision_limit_path)
+ if (!mergeinfo && !wc_elision_limit_abspath)
{
err = svn_client__get_wc_or_repos_mergeinfo(
&mergeinfo, NULL, NULL, TRUE,
svn_mergeinfo_nearest_ancestor,
- NULL, target_wcpath, ctx, pool);
+ NULL, target_abspath, ctx, pool);
if (err)
{
if (err->apr_err == SVN_ERR_MERGEINFO_PARSE_ERROR)
@@ -1009,7 +1006,7 @@ svn_client__elide_mergeinfo(const char *
/* If there is nowhere to elide TARGET_WCPATH's mergeinfo to and
the elision is limited, then we are done.*/
- if (!mergeinfo && wc_elision_limit_path)
+ if (!mergeinfo && wc_elision_limit_abspath)
return SVN_NO_ERROR;
SVN_ERR(elide_mergeinfo(mergeinfo, target_mergeinfo, target_abspath,
Modified: subversion/trunk/subversion/libsvn_client/mergeinfo.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/mergeinfo.h?rev=1415167&r1=1415166&r2=1415167&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/mergeinfo.h (original)
+++ subversion/trunk/subversion/libsvn_client/mergeinfo.h Thu Nov 29 14:00:05
2012
@@ -345,42 +345,42 @@ svn_client__record_wc_mergeinfo_catalog(
svn_client_ctx_t *ctx,
apr_pool_t *scratch_pool);
-/* Elide any svn:mergeinfo set on TARGET_WCPATH to its nearest working
+/* Elide any svn:mergeinfo set on TARGET_ABSPATH to its nearest working
copy (or possibly repository) ancestor with equivalent mergeinfo.
- If WC_ELISION_LIMIT_PATH is NULL check up to the root of the
+ If WC_ELISION_LIMIT_ABSPATH is NULL check up to the root of the
working copy or the nearest switched parent for an elision
destination, if none is found check the repository, otherwise check
- as far as WC_ELISION_LIMIT_PATH within the working copy.
- TARGET_WCPATH and WC_ELISION_LIMIT_PATH, if it exists, must both be
+ as far as WC_ELISION_LIMIT_ABSPATH within the working copy.
+ TARGET_WCPATH and WC_ELISION_LIMIT_ABSPATH, if it exists, must both be
absolute or relative to the working directory.
Elision occurs if:
- A) TARGET_WCPATH has empty mergeinfo and no parent path with
+ A) TARGET_ABSPATH has empty mergeinfo and no parent path with
explicit mergeinfo can be found in either the WC or the
repository (WC_ELISION_LIMIT_PATH must be NULL for this to
occur).
- B) TARGET_WCPATH has empty mergeinfo and its nearest parent also
+ B) TARGET_ABSPATH has empty mergeinfo and its nearest parent also
has empty mergeinfo.
- C) TARGET_WCPATH has the same mergeinfo as its nearest parent
+ C) TARGET_ABSPATH has the same mergeinfo as its nearest parent
when that parent's mergeinfo is adjusted for the path
difference between the two, e.g.:
- TARGET_WCPATH = A_COPY/D/H
- TARGET_WCPATH's mergeinfo = '/A/D/H:3'
- TARGET_WCPATH nearest parent = A_COPY
- Parent's mergeinfo = '/A:3'
- Path differece = 'D/H'
- Parent's adjusted mergeinfo = '/A/D/H:3'
+ TARGET_ABSPATH = A_COPY/D/H
+ TARGET_ABSPATH's mergeinfo = '/A/D/H:3'
+ TARGET_ABSPATH nearest parent = A_COPY
+ Parent's mergeinfo = '/A:3'
+ Path difference = 'D/H'
+ Parent's adjusted mergeinfo = '/A/D/H:3'
If Elision occurs remove the svn:mergeinfo property from
- TARGET_WCPATH. */
+ TARGET_ABSPATH. */
svn_error_t *
-svn_client__elide_mergeinfo(const char *target_wcpath,
- const char *wc_elision_limit_path,
+svn_client__elide_mergeinfo(const char *target_abspath,
+ const char *wc_elision_limit_abspath,
svn_client_ctx_t *ctx,
apr_pool_t *pool);