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

svn_client_merge_reintegrate() - API concerns

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Tue, 26 Feb 2008 15:19:04 +0000

Three concerns on the present svn_client_merge_reintegrate() API (on trunk_at_29422).

1. There is no "record-only" argument. I would expect it to have this option.
Can someone explain why it doesn't?

2. The "peg_revision" argument wasn't documented; see my suggested trivial
patch below.

3. The "force" argument:

It's time to stop using the vague name "force" for an argument which does
something specific and non-obvious. It's important for both us and the API
users to be clear about what it does. We should never perpetuate this name in
new APIs.

The explanation if we follow the cross-reference to svn_client_merge3() is:

> * If @a force is not set and the merge involves deleting locally modified or
> * unversioned items the operation will fail. If @a force is set such items
> * will be deleted.

A "reintegrate" merge will never try to delete "locally modified" items because
it requires an unmodified target tree. It will never try to delete
"unversioned" items because it requires the source tree to be already caught up
with the latest versioned state of the target tree.

So is the "force" argument appropriate for this API? It seems to me that it is
redundant, and certainly it shouldn't be there if that's true.

- Julian

Here's the API I'm discussing, for reference.
> /**
> * Perform a reintegration merge of @a source at @a peg_revision
> * into @target_wc_path.
> * @a target_wc_path must be a single-revision, @c svn_depth_infinity,
> * pristine, unswitched working copy -- in other words, it must
> * reflect a single revision tree, the "target". The mergeinfo on @a
> * source must reflect that all of the target has been merged into it.
> * Then this behaves like a merge with svn_client_merge3() from the
> * target's URL to the source.
> *
> * All other options are handled identically to svn_client_merge3().
> * The depth of the merge is always @c svn_depth_infinity.
> *
> * @since New in 1.5.
> */
> svn_error_t *
> svn_client_merge_reintegrate(const char *source,
> const svn_opt_revision_t *peg_revision,
> const char *target_wcpath,
> svn_boolean_t force,
> svn_boolean_t dry_run,
> const apr_array_header_t *merge_options,
> svn_client_ctx_t *ctx,
> apr_pool_t *pool);

Index: subversion/include/svn_client.h
===================================================================
--- subversion/include/svn_client.h (revision 29422)
+++ subversion/include/svn_client.h (working copy)
@@ -2517,7 +2517,8 @@

  /**
- * Perform a reintegration merge of @a source into @target_wc_path.
+ * Perform a reintegration merge of @a source at @a peg_revision
+ * into @target_wc_path.
   * @a target_wc_path must be a single-revision, @c svn_depth_infinity,
   * pristine, unswitched working copy -- in other words, it must
   * reflect a single revision tree, the "target". The mergeinfo on @a

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-02-26 16:19:21 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.