cmpilato_at_tigris.org writes:
> Log:
> Add a missing docstring for a helper function.
>
> * subversion/libsvn_client/mergeinfo.c
> (location_from_path_and_rev): Add docstring.
>
> Suggested by: kfogel
Thank you!
But, there's a lot more to this diff than just the new doc string. Did
you commit some other work prematurely?
-K
> Modified:
> trunk/subversion/libsvn_client/merge.c
> trunk/subversion/libsvn_client/mergeinfo.c
>
> Modified: trunk/subversion/libsvn_client/merge.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_client/merge.c?pathrev=31929&r1=31928&r2=31929
> ==============================================================================
> --- trunk/subversion/libsvn_client/merge.c Mon Jun 30 09:18:20 2008 (r31928)
> +++ trunk/subversion/libsvn_client/merge.c Mon Jun 30 09:50:12 2008 (r31929)
> @@ -3920,6 +3920,7 @@ remove_noop_merge_ranges(apr_array_heade
> int i;
> svn_revnum_t oldest_rev = SVN_INVALID_REVNUM;
> svn_revnum_t youngest_rev = SVN_INVALID_REVNUM;
> + svn_revnum_t oldest_changed_rev, youngest_changed_rev;
> apr_array_header_t *changed_revs =
> apr_array_make(pool, ranges->nelts, sizeof(svn_revnum_t *));
> apr_array_header_t *operative_ranges =
> @@ -3948,20 +3949,36 @@ remove_noop_merge_ranges(apr_array_heade
> apr_array_make(pool, 0, sizeof(const char *)),
> log_changed_revs, changed_revs, pool));
>
> + /* Our list of changed revisions should be in youngest-to-oldest order. */
> + youngest_changed_rev = *(APR_ARRAY_IDX(changed_revs,
> + 0, svn_revnum_t *));
> + oldest_changed_rev = *(APR_ARRAY_IDX(changed_revs,
> + changed_revs->nelts - 1,
> + svn_revnum_t *));
> +
> /* Now, copy from RANGES to *OPERATIVE_RANGES, filtering out ranges
> that aren't operative (by virtue of not having any revisions
> represented in the CHANGED_REVS array). */
> for (i = 0; i < ranges->nelts; i++)
> {
> svn_merge_range_t *range = APR_ARRAY_IDX(ranges, i, svn_merge_range_t *);
> + svn_revnum_t range_min = MIN(range->start, range->end) + 1;
> + svn_revnum_t range_max = MAX(range->start, range->end);
> int j;
>
> + /* If the merge range is entirely outside the range of changed
> + revisions, we've no use for it. */
> + if ((range_min > youngest_changed_rev)
> + || (range_max < oldest_changed_rev))
> + continue;
> +
> + /* Walk through the changed_revs to see if any of them fall
> + inside our current range. */
> for (j = 0; j < changed_revs->nelts; j++)
> {
> svn_revnum_t *changed_rev =
> APR_ARRAY_IDX(changed_revs, j, svn_revnum_t *);
> - if ((*changed_rev > MIN(range->start, range->end))
> - && (*changed_rev <= MAX(range->start, range->end)))
> + if ((*changed_rev >= range_min) && (*changed_rev <= range_max))
> {
> APR_ARRAY_PUSH(operative_ranges, svn_merge_range_t *) = range;
> break;
>
> Modified: trunk/subversion/libsvn_client/mergeinfo.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_client/mergeinfo.c?pathrev=31929&r1=31928&r2=31929
> ==============================================================================
> --- trunk/subversion/libsvn_client/mergeinfo.c Mon Jun 30 09:18:20 2008 (r31928)
> +++ trunk/subversion/libsvn_client/mergeinfo.c Mon Jun 30 09:50:12 2008 (r31929)
> @@ -1118,6 +1118,24 @@ logs_for_mergeinfo_rangelist(const char
> return SVN_NO_ERROR;
> }
>
> +
> +/* Set URL and REVISION to the url and revision (of kind
> + svn_opt_revision_number) which is associated with PATH_OR_URL at
> + PEG_REVISION. Use POOL for allocations.
> +
> + Implementation Note: sometimes this information can be found
> + locally via the information in the 'entries' files, such as when
> + PATH_OR_URL is a working copy path and PEG_REVISION is of kind
> + svn_opt_revision_base. At other times, this function needs to
> + contact the repository, resolving revision keywords into real
> + revision numbers and tracing node history to find the correct
> + location.
> +
> + ### Can this be used elsewhere? I was *sure* I'd find this same
> + ### functionality elsewhere before writing this helper, but I
> + ### didn't. Seems like an operation that we'd be likely to do
> + ### often, though. -- cmpilato
> +*/
> static svn_error_t *
> location_from_path_and_rev(const char **url,
> svn_opt_revision_t **revision,
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: svn-help_at_subversion.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-06-30 22:25:53 CEST