Author: julianfoad
Date: Fri Apr 13 11:33:07 2012
New Revision: 1325719
URL: http://svn.apache.org/viewvc?rev=1325719&view=rev
Log:
Simplify the semantics of svn_client__wc_node_get_origin(). Only one of
its callers cared about getting the repository root URL when the node itself
has no origin in the repository, so that is now done outside the function.
* subversion/include/private/svn_client_private.h,
subversion/libsvn_client/util.c
(svn_client__wc_node_get_origin): If the node has no origin, return NULL
for the pathrev instead of a pathrev with a NULL URL inside it.
* subversion/libsvn_client/copy.c
(calculate_target_mergeinfo): Adjust the check for null.
* subversion/libsvn_client/merge.c
(get_full_mergeinfo): Adjust the check for null.
(open_target_wc): If the path-rev is null, fetch the repository root
information separately.
* subversion/libsvn_client/mergeinfo.c
(get_mergeinfo): Adjust the check for null.
Modified:
subversion/trunk/subversion/include/private/svn_client_private.h
subversion/trunk/subversion/libsvn_client/copy.c
subversion/trunk/subversion/libsvn_client/merge.c
subversion/trunk/subversion/libsvn_client/mergeinfo.c
subversion/trunk/subversion/libsvn_client/util.c
Modified: subversion/trunk/subversion/include/private/svn_client_private.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_client_private.h?rev=1325719&r1=1325718&r2=1325719&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_client_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_client_private.h Fri Apr 13
11:33:07 2012
@@ -146,10 +146,7 @@ svn_client__youngest_common_ancestor(con
/* Set *ORIGIN_P to the origin of the WC node at WC_ABSPATH. If the node
* is a local copy, give the copy-from location. If the node is locally
- * added or deleted, set the REV and URL fields to SVN_INVALID_REVNUM and
- * NULL respectively, but still give the correct repository root URL and
- * UUID.
- */
+ * added or deleted, set *ORIGIN_P to NULL. */
svn_error_t *
svn_client__wc_node_get_origin(svn_client__pathrev_t **origin_p,
const char *wc_abspath,
Modified: subversion/trunk/subversion/libsvn_client/copy.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/copy.c?rev=1325719&r1=1325718&r2=1325719&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/copy.c (original)
+++ subversion/trunk/subversion/libsvn_client/copy.c Fri Apr 13 11:33:07 2012
@@ -100,10 +100,12 @@ calculate_target_mergeinfo(svn_ra_sessio
SVN_ERR(svn_client__wc_node_get_origin(&origin,
local_abspath, ctx,
pool, pool));
- src_revnum = origin->rev;
- src_url = origin->url;
-
- if (! src_url)
+ if (origin)
+ {
+ src_revnum = origin->rev;
+ src_url = origin->url;
+ }
+ else
locally_added = TRUE;
}
Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1325719&r1=1325718&r2=1325719&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Fri Apr 13 11:33:07 2012
@@ -3529,7 +3529,7 @@ get_full_mergeinfo(svn_mergeinfo_t *reco
SVN_ERR(svn_client__wc_node_get_origin(&target, target_abspath, ctx,
scratch_pool, scratch_pool));
- if (! target->url)
+ if (! target)
{
/* We've been asked to operate on a locally added target, so its
* implicit mergeinfo is empty. */
@@ -9292,7 +9292,25 @@ open_target_wc(merge_target_t **target_p
scratch_pool));
SVN_ERR(svn_client__wc_node_get_origin(&origin, wc_abspath, ctx,
result_pool, scratch_pool));
- target->loc = *origin;
+ if (origin)
+ {
+ target->loc = *origin;
+ }
+ else
+ {
+ /* The node has no location in the repository. It's unversioned or
+ * locally added or locally deleted.
+ *
+ * If it's locally added or deleted, find the repository root
+ * URL and UUID anyway, and leave the node URL and revision as NULL
+ * and INVALID. If it's unversioned, this will throw an error. */
+ SVN_ERR(svn_wc__node_get_repos_info(&target->loc.repos_root_url,
+ &target->loc.repos_uuid,
+ ctx->wc_ctx, wc_abspath,
+ result_pool, scratch_pool));
+ target->loc.rev = SVN_INVALID_REVNUM;
+ target->loc.url = NULL;
+ }
SVN_ERR(ensure_wc_is_suitable_merge_target(
wc_abspath, ctx,
Modified: subversion/trunk/subversion/libsvn_client/mergeinfo.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/mergeinfo.c?rev=1325719&r1=1325718&r2=1325719&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_client/mergeinfo.c Fri Apr 13 11:33:07
2012
@@ -1070,8 +1070,8 @@ get_mergeinfo(svn_mergeinfo_catalog_t *m
SVN_ERR(svn_client__wc_node_get_origin(&origin, local_abspath, ctx,
scratch_pool, scratch_pool));
- rev = origin->rev;
- if (!origin->url
+ rev = origin ? origin->rev : SVN_INVALID_REVNUM;
+ if (!origin
|| strcmp(origin->url, url) != 0
|| peg_rev != rev)
{
Modified: subversion/trunk/subversion/libsvn_client/util.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/util.c?rev=1325719&r1=1325718&r2=1325719&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/util.c (original)
+++ subversion/trunk/subversion/libsvn_client/util.c Fri Apr 13 11:33:07 2012
@@ -257,22 +257,8 @@ svn_client__wc_node_get_origin(svn_clien
}
else
{
- /* The node has no location in the repository. It's unversioned or
- * locally added or locally deleted.
- *
- * If it's locally added or deleted, find the repository root
- * URL and UUID anyway, and leave the node URL and revision as NULL
- * and INVALID. If it's unversioned, this will throw an error. */
- SVN_ERR(svn_wc__node_get_repos_info(&(*origin_p)->repos_root_url,
- &(*origin_p)->repos_uuid,
- ctx->wc_ctx, wc_abspath,
- result_pool, scratch_pool));
- (*origin_p)->rev = SVN_INVALID_REVNUM;
- (*origin_p)->url = NULL;
+ *origin_p = NULL;
}
-
- SVN_ERR_ASSERT((*origin_p)->repos_root_url);
- SVN_ERR_ASSERT((*origin_p)->repos_uuid);
return SVN_NO_ERROR;
}