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

Re: reintegrate and renames

From: David Glasser <glasser_at_davidglasser.net>
Date: Sat, 5 Apr 2008 12:33:06 -0700

Here's a half-assed stab at the first part of what I'm talking about.
Didn't actually update the docs yet. Unfortunately I don't think I
will be able to work on this myself in the next few days but maybe
someone else can pick up from here. This just moves the actual
merging out of the reintegrate API (which perhaps should be renamed
too). Next step would be to add a returned data structure from
calculate_left_hand_side/svn_client_merge_reintegrate listing the
inconsistent mergeinfo (instead of throwing an error); then the CLI
client can decide not to go forward, leaving us the option in 1.5.1
(or whatever) to add an interactive prompt or a force option or
whatever.

Index: subversion/include/svn_client.h
===================================================================
--- subversion/include/svn_client.h (revision 30348)
+++ subversion/include/svn_client.h (working copy)
@@ -2532,7 +2532,11 @@
  * @since New in 1.5.
  */
 svn_error_t *
-svn_client_merge_reintegrate(const char *source,
+svn_client_merge_reintegrate(const char **url1,
+ svn_revnum_t *rev1,
+ const char **url2,
+ svn_revnum_t *rev2,
+ const char *source,
                              const svn_opt_revision_t *peg_revision,
                              const char *target_wcpath,
                              svn_boolean_t dry_run,
Index: subversion/libsvn_client/merge.c
===================================================================
--- subversion/libsvn_client/merge.c (revision 30348)
+++ subversion/libsvn_client/merge.c (working copy)
@@ -5490,7 +5490,11 @@

 svn_error_t *
-svn_client_merge_reintegrate(const char *source,
+svn_client_merge_reintegrate(const char **url1_p,
+ svn_revnum_t *rev1_p,
+ const char **url2_p,
+ svn_revnum_t *rev2_p,
+ const char *source,
                              const svn_opt_revision_t *peg_revision,
                              const char *target_wcpath,
                              svn_boolean_t dry_run,
@@ -5621,16 +5625,20 @@
      ### of the other (what's erroneously referred to as "ancestrally
      ### related" in this source file). We can merge to trunk without
      ### implementing this. */
- SVN_ERR(merge_cousins_and_supplement_mergeinfo(target_wcpath, entry,
- adm_access, ra_session,
- url1, rev1, url2, rev2,
- yc_ancestor_rev,
- source_repos_root,
- wc_repos_root,
- svn_depth_infinity,
- FALSE,
- FALSE, FALSE, dry_run,
- merge_options, ctx, pool));
+ *url1_p = url1;
+ *rev1_p = rev1;
+ *url2_p = url2;
+ *rev2_p = rev2;
+/* SVN_ERR(merge_cousins_and_supplement_mergeinfo(target_wcpath, entry, */
+/* adm_access, ra_session, */
+/* url1, rev1, url2, rev2, */
+/* yc_ancestor_rev, */
+/* source_repos_root, */
+/* wc_repos_root, */
+/* svn_depth_infinity, */
+/* FALSE, */
+/* FALSE, FALSE, dry_run, */
+/* merge_options,
ctx, pool)); */

   /* Shutdown the administrative session. */
   SVN_ERR(svn_wc_adm_close(adm_access));
Index: subversion/svn/merge-cmd.c
===================================================================
--- subversion/svn/merge-cmd.c (revision 30348)
+++ subversion/svn/merge-cmd.c (working copy)
@@ -45,7 +45,7 @@
   apr_array_header_t *targets;
   const char *sourcepath1 = NULL, *sourcepath2 = NULL, *targetpath = "";
   svn_boolean_t two_sources_specified = TRUE;
- svn_error_t *err;
+ svn_error_t *err = SVN_NO_ERROR;
   svn_opt_revision_t first_range_start, first_range_end, peg_revision1,
     peg_revision2;
   apr_array_header_t *options, *ranges_to_merge = opt_state->revision_ranges;
@@ -287,16 +287,32 @@

       if (opt_state->reintegrate)
         {
+ const char *url1, *url2;
+ svn_revnum_t rev1, rev2;
+ svn_opt_revision_t opt_rev1, opt_rev2;
           if (opt_state->force)
             return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
                                     _("--force cannot be used with "
                                       "--reintegrate"));

- err = svn_client_merge_reintegrate(sourcepath1,
- &peg_revision1,
- targetpath,
- opt_state->dry_run,
- options, ctx, pool);
+ SVN_ERR(svn_client_merge_reintegrate(&url1,
+ &rev1,
+ &url2,
+ &rev2,
+ sourcepath1,
+ &peg_revision1,
+ targetpath,
+ opt_state->dry_run,
+ options, ctx, pool));
+
+ opt_rev1.kind = opt_rev2.kind = svn_opt_revision_number;
+ opt_rev1.value.number = rev1;
+ opt_rev2.value.number = rev2;
+
+ SVN_ERR(svn_client_merge3(url1, &opt_rev1, url2, &opt_rev2,
+ targetpath, svn_depth_infinity,
+ FALSE, FALSE, FALSE, opt_state->dry_run,
+ options, ctx, pool));
         }
       else
         err = svn_client_merge_peg3(sourcepath1,

On Sat, Apr 5, 2008 at 11:34 AM, Mark Phippard <markphip_at_gmail.com> wrote:
> On Sat, Apr 5, 2008 at 2:13 PM, David Glasser <glasser_at_davidglasser.net> wrote:
> > On Sat, Apr 5, 2008 at 8:33 AM, Mark Phippard <markphip_at_gmail.com> wrote:
> > > On Fri, Apr 4, 2008 at 11:01 PM, David Glasser <glasser_at_davidglasser.net> wrote:
>
> > > I guess I am just proposing we wait until we know the entirety of the
> > > problem in real situations. The user has a relatively easy "out" in
> > > the current code (namely they can run the 2-URL merge and get the
> > > identical results. We can optimize this for 1.6 if we see the need,
> > > or we can even do it before RC2 if after you look at the problem
> > > deeper you become more convinced it is the right thing to do now.
> >
> > Well, take a peek at one of the XFailing reintegrate tests and see how
> > unreasonable it is...
>
> I am not doubting how easy it is to create the scenario. I still have
> two thoughts:
>
> 1) Maybe we should be trying to attack the problem at the point where
> we create it. In other words, be smarter about when we create the
> mergeinfo that causes the problem.
>
> 2) Merges with renames basically do not work anyway. So maybe people
> just avoid renames? I doubt that is the case. But this issue is just
> a minor part of the larger problem.
>
>
>
> --
> Thanks
>
> Mark Phippard
> http://markphip.blogspot.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: dev-help_at_subversion.tigris.org
>
>

-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-04-05 21:33:19 CEST

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.