Author: julianfoad
Date: Wed Oct 19 10:08:23 2011
New Revision: 1186066
URL: http://svn.apache.org/viewvc?rev=1186066&view=rev
Log:
Don't force callers of svn_client__ra_session_from_path() to receive
unwanted outputs: make the 'rev_p' and 'url_p' parameters optional.
* subversion/libsvn_client/client.h
(svn_client__ra_session_from_path): Document 'rev_p' and 'url_p' as
optional.
* subversion/libsvn_client/blame.c
(svn_client_blame5): Don't receive an unwanted URL.
* subversion/libsvn_client/log.c
(svn_client_log5): Don't receive an unwanted revnum.
* subversion/libsvn_client/mergeinfo.c
(svn_client_mergeinfo_log): Don't receive an unwanted URL.
* subversion/libsvn_client/ra.c
(resolve_rev_and_url, svn_client__ra_session_from_path): Make 'rev_p' and
'url_p' optional.
(svn_client__get_youngest_common_ancestor): Don't receive unwanted outputs.
Modified:
subversion/trunk/subversion/libsvn_client/blame.c
subversion/trunk/subversion/libsvn_client/client.h
subversion/trunk/subversion/libsvn_client/log.c
subversion/trunk/subversion/libsvn_client/mergeinfo.c
subversion/trunk/subversion/libsvn_client/ra.c
Modified: subversion/trunk/subversion/libsvn_client/blame.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/blame.c?rev=1186066&r1=1186065&r2=1186066&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/blame.c (original)
+++ subversion/trunk/subversion/libsvn_client/blame.c Wed Oct 19 10:08:23 2011
@@ -592,7 +592,6 @@ svn_client_blame5(const char *target,
{
struct file_rev_baton frb;
svn_ra_session_t *ra_session;
- const char *url;
svn_revnum_t start_revnum, end_revnum;
struct blame *walk, *walk_merged = NULL;
apr_pool_t *iterpool;
@@ -611,9 +610,8 @@ svn_client_blame5(const char *target,
SVN_ERR(svn_dirent_get_absolute(&target_abspath_or_url, target, pool));
/* Get an RA plugin for this filesystem object. */
- SVN_ERR(svn_client__ra_session_from_path(&ra_session, &end_revnum,
- &url, target, NULL,
- peg_revision, end,
+ SVN_ERR(svn_client__ra_session_from_path(&ra_session, &end_revnum, NULL,
+ target, NULL, peg_revision, end,
ctx, pool));
SVN_ERR(svn_client__get_revision_number(&start_revnum, NULL, ctx->wc_ctx,
Modified: subversion/trunk/subversion/libsvn_client/client.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/client.h?rev=1186066&r1=1186065&r2=1186066&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/client.h (original)
+++ subversion/trunk/subversion/libsvn_client/client.h Wed Oct 19 10:08:23 2011
@@ -202,7 +202,7 @@ svn_client__get_youngest_common_ancestor
Store the resulting ra_session in *RA_SESSION_P. Store the actual
revision number of the object in *REV_P, and the final resulting
- URL in *URL_P.
+ URL in *URL_P. REV_P and/or URL_P may be NULL if not wanted.
Use authentication baton cached in CTX to authenticate against the
repository.
Modified: subversion/trunk/subversion/libsvn_client/log.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/log.c?rev=1186066&r1=1186065&r2=1186066&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/log.c (original)
+++ subversion/trunk/subversion/libsvn_client/log.c Wed Oct 19 10:08:23 2011
@@ -283,7 +283,6 @@ svn_client_log5(const apr_array_header_t
svn_boolean_t has_log_revprops;
const char *actual_url;
apr_array_header_t *condensed_targets;
- svn_revnum_t ignored_revnum;
svn_opt_revision_t session_opt_rev;
const char *ra_target;
pre_15_receiver_baton_t rb = {0};
@@ -485,8 +484,8 @@ svn_client_log5(const apr_array_header_t
else
ra_target = url_or_path;
- SVN_ERR(svn_client__ra_session_from_path(&ra_session, &ignored_revnum,
- &actual_url, ra_target, NULL,
+ SVN_ERR(svn_client__ra_session_from_path(&ra_session, NULL, &actual_url,
+ ra_target, NULL,
&peg_rev, &session_opt_rev,
ctx, pool));
Modified: subversion/trunk/subversion/libsvn_client/mergeinfo.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/mergeinfo.c?rev=1186066&r1=1186065&r2=1186066&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_client/mergeinfo.c Wed Oct 19 10:08:23
2011
@@ -1803,19 +1803,18 @@ svn_client_mergeinfo_log(svn_boolean_t f
/* Open RA sessions to the repository for the source and target.
* ### TODO: As the source and target must be in the same repository, we
* should share a single session, tracking the two URLs separately. */
-
+
if (!finding_merged)
{
svn_revnum_t target_peg_revnum;
- const char *url;
SVN_ERR(svn_client__ra_session_from_path(&target_session,
- &target_peg_revnum, &url,
+ &target_peg_revnum, NULL,
target_path_or_url, NULL,
target_peg_revision,
target_peg_revision,
ctx, scratch_pool));
-
+
SVN_ERR(svn_client__get_history_as_mergeinfo(&target_history, NULL,
target_peg_revnum,
SVN_INVALID_REVNUM,
@@ -1826,10 +1825,9 @@ svn_client_mergeinfo_log(svn_boolean_t f
{
svn_revnum_t source_peg_revnum;
- const char *url;
SVN_ERR(svn_client__ra_session_from_path(&source_session,
- &source_peg_revnum, &url,
+ &source_peg_revnum, NULL,
source_path_or_url, NULL,
source_peg_revision,
source_peg_revision,
Modified: subversion/trunk/subversion/libsvn_client/ra.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/ra.c?rev=1186066&r1=1186065&r2=1186066&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/ra.c (original)
+++ subversion/trunk/subversion/libsvn_client/ra.c Wed Oct 19 10:08:23 2011
@@ -447,7 +447,8 @@ path_or_url_local_style(const char *path
as "head" for a URL or "working" for a working-copy path.
Store the actual revision number of the object in *REV_P, and the
- final resulting URL in *URL_P.
+ final resulting URL in *URL_P. REV_P and/or URL_P may be NULL if not
+ wanted.
Use authentication baton cached in CTX to authenticate against the
repository.
@@ -485,8 +486,10 @@ resolve_rev_and_url(svn_revnum_t *rev_p,
good_rev->kind = svn_opt_revision_head;
SVN_ERR(svn_client__get_revision_number(&rev, NULL, ctx->wc_ctx, url,
ra_session, good_rev, pool));
- *rev_p = rev;
- *url_p = url;
+ if (rev_p)
+ *rev_p = rev;
+ if (url_p)
+ *url_p = url;
return SVN_NO_ERROR;
}
@@ -505,6 +508,7 @@ svn_client__ra_session_from_path(svn_ra_
svn_ra_session_t *ra_session;
const char *initial_url;
const char *corrected_url;
+ const char *resolved_url;
SVN_ERR(svn_client_url_from_path2(&initial_url, path_or_url, ctx, pool,
pool));
@@ -523,14 +527,16 @@ svn_client__ra_session_from_path(svn_ra_
if (corrected_url && svn_path_is_url(path_or_url))
path_or_url = corrected_url;
- SVN_ERR(resolve_rev_and_url(rev_p, url_p, ra_session,
+ SVN_ERR(resolve_rev_and_url(rev_p, &resolved_url, ra_session,
path_or_url, peg_revision, revision,
ctx, pool));
/* Make the session point to the real URL. */
- SVN_ERR(svn_ra_reparent(ra_session, *url_p, pool));
+ SVN_ERR(svn_ra_reparent(ra_session, resolved_url, pool));
*ra_session_p = ra_session;
+ if (url_p)
+ *url_p = resolved_url;
return SVN_NO_ERROR;
}
@@ -823,14 +829,11 @@ svn_client__get_youngest_common_ancestor
* ### TODO: As they are assumed to be in the same repository, we
* should share a single session, tracking the two URLs separately. */
{
- svn_revnum_t peg;
- const char *url;
-
- SVN_ERR(svn_client__ra_session_from_path(&session1, &peg, &url,
+ SVN_ERR(svn_client__ra_session_from_path(&session1, NULL, NULL,
path_or_url1, NULL,
&revision1, &revision1,
ctx, pool));
- SVN_ERR(svn_client__ra_session_from_path(&session2, &peg, &url,
+ SVN_ERR(svn_client__ra_session_from_path(&session2, NULL, NULL,
path_or_url2, NULL,
&revision2, &revision2,
ctx, pool));