[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Turning off mergeinfo calculations against a pre-1.5 repos

From: Daniel Rall <dlr_at_collab.net>
Date: 2007-11-27 01:25:18 CET

Mike, was this along the lines of what you were thinking? On IRC, you
mentioned adjusting the ignore_ancestry flag directly, which we could
do instead of adding another field (unsure whether doing so preserve
the semantics).

- Dan

On Mon, 26 Nov 2007, dlr@tigris.org wrote:
...
> * subversion/libsvn_client/merge.c
> Include svn_ra.h.
> (merge_cmd_baton_t): Add new mergeinfo_capable field, indicating
> whether the merge source repository is capable of Merge Tracking.
> (mergeinfo_behavior): Add APR_INLINE to declaration. Test
> *MERGE_B->mergeinfo_capable when setting both *HONOR_MERGEINFO and
> *RECORD_MERGEINFO.
> (do_merge): Set *merge_cmd_baton.mergeinfo_capable using the new
> svn_ra_has_capability() API.
...
> --- trunk/subversion/libsvn_client/merge.c (original)
> +++ trunk/subversion/libsvn_client/merge.c Mon Nov 26 16:17:12 2007
> @@ -43,6 +43,7 @@
> #include "svn_props.h"
> #include "svn_time.h"
> #include "svn_sorts.h"
> +#include "svn_ra.h"
> #include "client.h"
> #include "mergeinfo.h"
> #include <assert.h>
> @@ -170,6 +171,8 @@
> is the same repository as the
> target. Defaults to FALSE if DRY_RUN
> is TRUE.*/
> + svn_boolean_t *mergeinfo_capable; /* Whether the merge source repository
> + is capable of Merge Tracking. */
> svn_boolean_t ignore_ancestry; /* Are we ignoring ancestry (and by
> extension, mergeinfo)? FALSE if
> SOURCES_RELATED is FALSE. */
> @@ -2149,17 +2152,20 @@
>
> /* Set *HONOR_MERGEINFO and *RECORD_MERGEINFO (if non-NULL)
> appropriately for MERGE_B. */
> -static void
> +static APR_INLINE void
> mergeinfo_behavior(svn_boolean_t *honor_mergeinfo,
> svn_boolean_t *record_mergeinfo,
> merge_cmd_baton_t *merge_b)
> {
> if (honor_mergeinfo)
> - *honor_mergeinfo = (merge_b->sources_related
> + *honor_mergeinfo = (*merge_b->mergeinfo_capable
> + && merge_b->sources_related
> && merge_b->same_repos
> && (! merge_b->ignore_ancestry));
> +
> if (record_mergeinfo)
> - *record_mergeinfo = (merge_b->sources_related
> + *record_mergeinfo = (*merge_b->mergeinfo_capable
> + && merge_b->sources_related
> && merge_b->same_repos
> && (! merge_b->dry_run));
> }
> @@ -4299,6 +4305,7 @@
> svn_config_t *cfg;
> const char *diff3_cmd;
> int i;
> + svn_boolean_t mergeinfo_capable = FALSE;
>
> /* If this is a dry-run record-only merge, there's nothing to do. */
> if (record_only && dry_run)
> @@ -4330,6 +4337,7 @@
> merge_cmd_baton.record_only = record_only;
> merge_cmd_baton.ignore_ancestry = ignore_ancestry;
> merge_cmd_baton.same_repos = same_repos;
> + merge_cmd_baton.mergeinfo_capable = NULL;
> merge_cmd_baton.sources_related = sources_related;
> merge_cmd_baton.ctx = ctx;
> merge_cmd_baton.target_missing_child = FALSE;
> @@ -4394,6 +4402,15 @@
> merge_cmd_baton.ra_session1 = ra_session1;
> merge_cmd_baton.ra_session2 = ra_session2;
>
> + /* Populate the portions of the merge context baton that require
> + an RA session to set, but shouldn't be reset for each iteration. */
> + if (merge_cmd_baton.mergeinfo_capable == NULL)
> + {
> + merge_cmd_baton.mergeinfo_capable = &mergeinfo_capable;
> + SVN_ERR(svn_ra_has_capability(ra_session1, &mergeinfo_capable,
> + SVN_RA_CAPABILITY_MERGEINFO, pool));
> + }
> +
> /* If this is a record-only merge and our sources are from the
> same repository as our target, just do the record and move on. */
> if (same_repos && record_only)

  • application/pgp-signature attachment: stored
Received on Tue Nov 27 01:25:28 2007

This is an archived mail posted to the Subversion Dev mailing list.